Versions in this module Expand all Collapse all v1 v1.0.1 Aug 5, 2015 v1.0.0 Jul 29, 2015 v0 v0.9.39 Jul 25, 2015 Changes in this version + const JitVmTy + const LogTyDiff + const LogTyPretty + const MaxVmTy + const StdVmTy + var Debug bool + var DepthError = fmt.Errorf("Max call depth exceeded (%d)", params.CallCreateDepth) + var GasContractByte = big.NewInt(200) + var GasExtStep = big.NewInt(20) + var GasFastStep = big.NewInt(5) + var GasFastestStep = big.NewInt(3) + var GasMidStep = big.NewInt(8) + var GasQuickStep = big.NewInt(2) + var GasReturn = big.NewInt(0) + var GasSlowStep = big.NewInt(10) + var GasStop = big.NewInt(0) + var One = common.Big1 + var OutOfGasError = errors.New("Out of gas") + var Pow256 = common.BigPow(2, 256) + var Precompiled = PrecompiledContracts() + var S256 = common.S256 + var U256 = common.U256 + var Zero = common.Big0 + func Disasm(code []byte) []string + func Disassemble(script []byte) (asm []string) + func IsStackErr(err error) bool + func PrecompiledContracts() map[string]*PrecompiledAccount + func StdErrFormat(logs []StructLog) + func Transfer(from, to Account, amount *big.Int) error + func UseGas(gas, amount *big.Int) bool + type Account interface + AddBalance func(amount *big.Int) + Address func() common.Address + Balance func() *big.Int + SubBalance func(amount *big.Int) + type Address interface + Call func(in []byte) []byte + type Context struct + Args []byte + Code []byte + CodeAddr *common.Address + Gas *big.Int + Price *big.Int + UsedGas *big.Int + func NewContext(caller ContextRef, object ContextRef, value, gas, price *big.Int) *Context + func (c *Context) Address() common.Address + func (c *Context) GetByte(n uint64) byte + func (c *Context) GetOp(n uint64) OpCode + func (c *Context) Return(ret []byte) []byte + func (c *Context) ReturnGas(gas, price *big.Int) + func (c *Context) UseGas(gas *big.Int) (ok bool) + func (self *Context) SetCallCode(addr *common.Address, code []byte) + func (self *Context) SetCode(code []byte) + type ContextRef interface + Address func() common.Address + ReturnGas func(*big.Int, *big.Int) + SetCode func([]byte) + type Environment interface + AddLog func(*state.Log) + AddStructLog func(StructLog) + BlockNumber func() *big.Int + Call func(me ContextRef, addr common.Address, data []byte, gas, price, value *big.Int) ([]byte, error) + CallCode func(me ContextRef, addr common.Address, data []byte, gas, price, value *big.Int) ([]byte, error) + Coinbase func() common.Address + Create func(me ContextRef, data []byte, gas, price, value *big.Int) ([]byte, error, ContextRef) + Depth func() int + Difficulty func() *big.Int + GasLimit func() *big.Int + GetHash func(n uint64) common.Hash + Origin func() common.Address + SetDepth func(i int) + State func() *state.StateDB + StructLogs func() []StructLog + Time func() uint64 + Transfer func(from, to Account, amount *big.Int) error + VmType func() Type + type Memory struct + func NewMemory() *Memory + func (m *Memory) Data() []byte + func (m *Memory) Len() int + func (m *Memory) Print() + func (m *Memory) Resize(size uint64) + func (m *Memory) Set(offset, size uint64, value []byte) + func (self *Memory) Get(offset, size int64) (cpy []byte) + func (self *Memory) GetPtr(offset, size int64) []byte + type OpCode byte + const ADD + const ADDMOD + const ADDRESS + const AND + const BALANCE + const BLOCKHASH + const BYTE + const CALL + const CALLCODE + const CALLDATACOPY + const CALLDATALOAD + const CALLDATASIZE + const CALLER + const CALLVALUE + const CODECOPY + const CODESIZE + const COINBASE + const CREATE + const DIFFICULTY + const DIV + const DUP1 + const DUP10 + const DUP11 + const DUP12 + const DUP13 + const DUP14 + const DUP15 + const DUP16 + const DUP2 + const DUP3 + const DUP4 + const DUP5 + const DUP6 + const DUP7 + const DUP8 + const DUP9 + const EQ + const EXP + const EXTCODECOPY + const EXTCODESIZE + const GAS + const GASLIMIT + const GASPRICE + const GT + const ISZERO + const JUMP + const JUMPDEST + const JUMPI + const LOG0 + const LOG1 + const LOG2 + const LOG3 + const LOG4 + const LT + const MLOAD + const MOD + const MSIZE + const MSTORE + const MSTORE8 + const MUL + const MULMOD + const NOT + const NUMBER + const OR + const ORIGIN + const PC + const POP + const PUSH1 + const PUSH10 + const PUSH11 + const PUSH12 + const PUSH13 + const PUSH14 + const PUSH15 + const PUSH16 + const PUSH17 + const PUSH18 + const PUSH19 + const PUSH2 + const PUSH20 + const PUSH21 + const PUSH22 + const PUSH23 + const PUSH24 + const PUSH25 + const PUSH26 + const PUSH27 + const PUSH28 + const PUSH29 + const PUSH3 + const PUSH30 + const PUSH31 + const PUSH32 + const PUSH4 + const PUSH5 + const PUSH6 + const PUSH7 + const PUSH8 + const PUSH9 + const RETURN + const SDIV + const SGT + const SHA3 + const SIGNEXTEND + const SLOAD + const SLT + const SMOD + const SSTORE + const STOP + const SUB + const SUICIDE + const SWAP1 + const SWAP10 + const SWAP11 + const SWAP12 + const SWAP13 + const SWAP14 + const SWAP15 + const SWAP16 + const SWAP2 + const SWAP3 + const SWAP4 + const SWAP5 + const SWAP6 + const SWAP7 + const SWAP8 + const SWAP9 + const TIMESTAMP + const XOR + func StringToOp(str string) OpCode + func (o OpCode) String() string + type PrecompiledAccount struct + Gas func(l int) *big.Int + func (self PrecompiledAccount) Call(in []byte) []byte + type StackError struct + func StackErr(req, has int) StackError + func (self StackError) Error() string + type StructLog struct + Err error + Gas *big.Int + GasCost *big.Int + Memory []byte + Op OpCode + Pc uint64 + Stack []*big.Int + Storage map[common.Hash][]byte + type Type byte + type VirtualMachine interface + Env func() Environment + Run func(context *Context, data []byte) ([]byte, error) + func NewJitVm(env Environment) VirtualMachine + func NewVm(env Environment) VirtualMachine + type Vm struct + After func(*Context, error) + BreakPoints []int64 + Fn string + Recoverable bool + Stepping bool + func New(env Environment) *Vm + func (self *Vm) Env() Environment + func (self *Vm) Run(context *Context, input []byte) (ret []byte, err error) + func (self *Vm) RunPrecompiled(p *PrecompiledAccount, input []byte, context *Context) (ret []byte, err error)