Versions in this module Expand all Collapse all v1 v1.0.3 Apr 3, 2019 Changes in this version + const CALL + const CALLCODE + const CREATE + const DELEGATECALL + const GasContractByte + const GasExtStep + const GasFastStep + const GasFastestStep + const GasMidStep + const GasQuickStep + const GasReturn + const GasSlowStep + const GasStop + const RETURN + const REVERT + const SELFDESTRUCT + const STATICCALL + var ErrCodeStoreOutOfGas = errors.New("contract creation code storage out of gas") + var ErrContractAddressCollision = errors.New("contract address collision") + var ErrDepth = errors.New("max call depth exceeded") + var ErrInsufficientBalance = errors.New("insufficient balance for transfer") + var ErrOutOfGas = errors.New("out of gas") + var ErrTraceLimitReached = errors.New("the number of logs reached the specified limit") + var PrecompiledContractsByzantium = map[common.Address]PrecompiledContract + var PrecompiledContractsHomestead = map[common.Address]PrecompiledContract + func CarriedOutPromissoryNotes(evm *EVM, s types.SpecialTxInput, caller common.Address) error + func CheckAccountBindingTx(caller common.Address, s types.SpecialTxInput, state StateDB) error + func CheckAccountCancelBindingTx(caller common.Address, s types.SpecialTxInput, state StateDB) (t int, err error) + func CheckAddAccountInForbidBackStakeListTx(caller common.Address, s types.SpecialTxInput, state StateDB, ...) error + func CheckAddCoinpool(caller common.Address, s types.SpecialTxInput, state StateDB) error + func CheckApplyBucketTx(s types.SpecialTxInput, state StateDB, genaroConfig *params.GenaroConfig) error + func CheckBackStakeTx(caller common.Address, state StateDB) error + func CheckBucketSupplement(s types.SpecialTxInput, state StateDB, genaroConfig *params.GenaroConfig) error + func CheckBuyPromissoryNotes(caller common.Address, s types.SpecialTxInput, state StateDB, ...) error + func CheckCarriedOutPromissoryNotes(caller common.Address, s types.SpecialTxInput, state StateDB, ...) error + func CheckDelAccountInForbidBackStakeListTx(caller common.Address, s types.SpecialTxInput, state StateDB, ...) error + func CheckPriceRegulation(caller common.Address, s types.SpecialTxInput) error + func CheckPromissoryNoteRevoke(caller common.Address, s types.SpecialTxInput, state StateDB, ...) error + func CheckPublishOption(caller common.Address, s types.SpecialTxInput, state StateDB, ...) error + func CheckPunishmentTx(caller common.Address, s types.SpecialTxInput, state StateDB, ...) error + func CheckSetGlobalVar(caller common.Address, s types.SpecialTxInput, ...) error + func CheckSetNameTxStatus(caller common.Address, s types.SpecialTxInput, state StateDB) error + func CheckSetOptionTxStatus(caller common.Address, s types.SpecialTxInput, state StateDB, ...) error + func CheckSpecialTxTypeSyncSidechainStatusParameter(s types.SpecialTxInput, caller common.Address, state StateDB, ...) error + func CheckStakeTx(s types.SpecialTxInput, state StateDB, genaroConfig *params.GenaroConfig) error + func CheckSynStateTx(caller common.Address, state StateDB) error + func CheckSyncFileSharePublicKeyTx(s types.SpecialTxInput, state StateDB, genaroConfig *params.GenaroConfig) error + func CheckSyncHeftTx(caller common.Address, s types.SpecialTxInput, state StateDB, ...) error + func CheckSyncNodeTx(caller common.Address, s types.SpecialTxInput, db StateDB) error + func CheckSynchronizeShareKeyParameter(s types.SpecialTxInput, state StateDB, genaroConfig *params.GenaroConfig) error + func CheckTrafficTx(s types.SpecialTxInput, state StateDB, genaroConfig *params.GenaroConfig) error + func CheckTransferNameTxStatus(caller common.Address, s types.SpecialTxInput, state StateDB) error + func CheckTurnBuyPromissoryNotes(caller common.Address, s types.SpecialTxInput, state StateDB, ...) error + func CheckUnbindNodeTx(caller common.Address, s types.SpecialTxInput, existNodes []string) error + func CheckUnlockSharedKeyParameter(s types.SpecialTxInput, state StateDB, caller common.Address) error + func CheckUnsubscribeNameTxStatus(caller common.Address, s types.SpecialTxInput, state StateDB) error + func CheckspecialTxTypeMortgageInitParameter(s types.SpecialTxInput, caller common.Address) error + func NewByzantiumInstructionSet() [256]operation + func NewConstantinopleInstructionSet() [256]operation + func NewFrontierInstructionSet() [256]operation + func NewHomesteadInstructionSet() [256]operation + func NoopCanTransfer(db StateDB, from common.Address, balance *big.Int) bool + func NoopTransfer(db StateDB, from, to common.Address, amount *big.Int) + func PromissoryNotesWithdrawCash(evm *EVM, caller common.Address) error + func RunPrecompiledContract(p PrecompiledContract, input []byte, contract *Contract) (ret []byte, err error) + func SpecialTxTypeSyncSidechainStatus(evm *EVM, s types.SpecialTxInput, caller common.Address) error + func SynState(evm *EVM, s types.SpecialTxInput, caller common.Address) error + func SynchronizeShareKey(evm *EVM, s types.SpecialTxInput, caller common.Address) error + func UnlockSharedKey(evm *EVM, s types.SpecialTxInput, caller common.Address) error + func WithdrawCash(caller common.Address, state StateDB, blockNum *big.Int) error + func WriteLogs(writer io.Writer, logs []*types.Log) + func WriteTrace(writer io.Writer, logs []StructLog) + type AccountRef common.Address + func (ar AccountRef) Address() common.Address + type CallContext interface + Call func(env *EVM, me ContractRef, addr common.Address, data []byte, ...) ([]byte, error) + CallCode func(env *EVM, me ContractRef, addr common.Address, data []byte, ...) ([]byte, error) + Create func(env *EVM, me ContractRef, data []byte, gas, value *big.Int) ([]byte, common.Address, error) + DelegateCall func(env *EVM, me ContractRef, addr common.Address, data []byte, gas *big.Int) ([]byte, error) + type CanTransferFunc func(StateDB, common.Address, *big.Int) bool + type Config struct + Debug bool + EnablePreimageRecording bool + JumpTable [256]operation + NoRecursion bool + Tracer Tracer + type Context struct + BlockNumber *big.Int + CanTransfer CanTransferFunc + Coinbase common.Address + Difficulty *big.Int + GasLimit uint64 + GasPrice *big.Int + GetHash GetHashFunc + Origin common.Address + Time *big.Int + Transfer TransferFunc + type Contract struct + Args []byte + CallerAddress common.Address + Code []byte + CodeAddr *common.Address + CodeHash common.Hash + DelegateCall bool + Gas uint64 + Input []byte + func NewContract(caller ContractRef, object ContractRef, value *big.Int, gas uint64) *Contract + func (c *Contract) Address() common.Address + func (c *Contract) AsDelegate() *Contract + func (c *Contract) Caller() common.Address + func (c *Contract) GetByte(n uint64) byte + func (c *Contract) GetOp(n uint64) OpCode + func (c *Contract) UseGas(gas uint64) (ok bool) + func (c *Contract) Value() *big.Int + func (self *Contract) SetCallCode(addr *common.Address, hash common.Hash, code []byte) + func (self *Contract) SetCode(hash common.Hash, code []byte) + type ContractRef interface + Address func() common.Address + type EVM struct + StateDB StateDB + func NewEVM(ctx Context, statedb StateDB, chainConfig *params.ChainConfig, vmConfig Config) *EVM + func (evm *EVM) Call(caller ContractRef, addr common.Address, input []byte, gas uint64, ...) (ret []byte, leftOverGas uint64, err error) + func (evm *EVM) CallCode(caller ContractRef, addr common.Address, input []byte, gas uint64, ...) (ret []byte, leftOverGas uint64, err error) + func (evm *EVM) Cancel() + func (evm *EVM) ChainConfig() *params.ChainConfig + func (evm *EVM) Create(caller ContractRef, code []byte, gas uint64, value *big.Int) (ret []byte, contractAddr common.Address, leftOverGas uint64, err error) + func (evm *EVM) DelegateCall(caller ContractRef, addr common.Address, input []byte, gas uint64) (ret []byte, leftOverGas uint64, err error) + func (evm *EVM) Interpreter() *Interpreter + func (evm *EVM) StaticCall(caller ContractRef, addr common.Address, input []byte, gas uint64) (ret []byte, leftOverGas uint64, err error) + type GetHashFunc func(uint64) common.Hash + type GetSentinelFunc func(uint64) uint64 + type Interpreter struct + func NewInterpreter(evm *EVM, cfg Config) *Interpreter + func (in *Interpreter) Run(contract *Contract, input []byte) (ret []byte, err error) + type LogConfig struct + DisableMemory bool + DisableStack bool + DisableStorage bool + Limit int + 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 NoopEVMCallContext struct + func (NoopEVMCallContext) Call(caller ContractRef, addr common.Address, data []byte, gas, value *big.Int) ([]byte, error) + func (NoopEVMCallContext) CallCode(caller ContractRef, addr common.Address, data []byte, gas, value *big.Int) ([]byte, error) + func (NoopEVMCallContext) Create(caller ContractRef, data []byte, gas, value *big.Int) ([]byte, common.Address, error) + func (NoopEVMCallContext) DelegateCall(me ContractRef, addr common.Address, data []byte, gas *big.Int) ([]byte, error) + type NoopStateDB struct + func (NoopStateDB) AddBalance(common.Address, *big.Int) + func (NoopStateDB) AddLog(*types.Log) + func (NoopStateDB) AddPreimage(common.Hash, []byte) + func (NoopStateDB) AddRefund(uint64) + func (NoopStateDB) CreateAccount(common.Address) + func (NoopStateDB) Empty(common.Address) bool + func (NoopStateDB) Exist(common.Address) bool + func (NoopStateDB) ForEachStorage(common.Address, func(common.Hash, common.Hash) bool) + func (NoopStateDB) GetBalance(common.Address) *big.Int + func (NoopStateDB) GetCode(common.Address) []byte + func (NoopStateDB) GetCodeHash(common.Address) common.Hash + func (NoopStateDB) GetCodeSize(common.Address) int + func (NoopStateDB) GetNonce(common.Address) uint64 + func (NoopStateDB) GetRefund() uint64 + func (NoopStateDB) GetState(common.Address, common.Hash) common.Hash + func (NoopStateDB) HasSuicided(common.Address) bool + func (NoopStateDB) RevertToSnapshot(int) + func (NoopStateDB) SetCode(common.Address, []byte) + func (NoopStateDB) SetNonce(common.Address, uint64) + func (NoopStateDB) SetState(common.Address, common.Hash, common.Hash) + func (NoopStateDB) Snapshot() int + func (NoopStateDB) SubBalance(common.Address, *big.Int) + func (NoopStateDB) Suicide(common.Address) bool + type OpCode byte + const ADD + const ADDMOD + const ADDRESS + const AND + const BALANCE + const BLOCKHASH + const BYTE + const CALLDATACOPY + const CALLDATALOAD + const CALLDATASIZE + const CALLER + const CALLVALUE + const CODECOPY + const CODESIZE + const COINBASE + const DATA_VERSION_READ + const DATA_VERSION_UPDATE + const DIFFICULTY + const DIV + const DUP + 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 PUSH + 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 RETURNDATACOPY + const RETURNDATASIZE + const SAR + const SDIV + const SENTINEL_HEFT + const SGT + const SHA3 + const SHL + const SHR + const SIGNEXTEND + const SLOAD + const SLT + const SMOD + const SSIZE + const SSTORE + const STOP + const STORAGE_GAS + const STORAGE_GAS_PRICE + const STORAGE_GAS_USED + const SUB + const SWAP + 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 + func (op OpCode) IsPush() bool + func (op OpCode) IsStaticJump() bool + type PrecompiledContract interface + RequiredGas func(input []byte) uint64 + Run func(input []byte) ([]byte, error) + type Stack struct + func (st *Stack) Back(n int) *big.Int + func (st *Stack) Data() []*big.Int + func (st *Stack) Print() + type StateDB interface + AddAccountInForbidBackStakeList func(address common.Address) bool + AddAlreadyBackStack func(backStack common.AlreadyBackStake) bool + AddBalance func(common.Address, *big.Int) + AddCandidate func(common.Address) bool + AddLastRootState func(statehash common.Hash, blockNumber uint64) bool + AddLog func(*types.Log) + AddPreimage func(common.Hash, []byte) + AddPromissoryNote func(address common.Address, promissoryNote types.PromissoryNote) bool + AddRefund func(uint64) + AddTxInOptionTxTable func(common.Hash, types.PromissoryNotesOptionTx, uint64) bool + BuyPromissoryNotes func(common.Hash, common.Address, uint64) types.PromissoryNotesOptionTx + CarriedOutPromissoryNotes func(common.Hash, common.Address, uint64) types.PromissoryNotesOptionTx + CreateAccount func(common.Address) + DelAccountInForbidBackStakeList func(address common.Address) bool + DelCandidate func(candidate common.Address) bool + DelMainAccountBinding func(mainAccount common.Address) []common.Address + DelPromissoryNote func(address common.Address, promissoryNote types.PromissoryNote) bool + DelSubAccountBinding func(subAccount common.Address) bool + DelTxInOptionTxTable func(common.Hash, uint64) bool + DeleteStake func(common.Address, uint64, uint64) (bool, uint64) + Empty func(common.Address) bool + Exist func(common.Address) bool + ForEachStorage func(common.Address, func(common.Hash, common.Hash) bool) + GetAddressByNode func(string) string + GetAlreadyBackStakeList func() (bool, common.BackStakeList) + GetBalance func(common.Address) *big.Int + GetBeforPromissoryNotesNum func(common.Address, uint64) uint64 + GetBucketApplyPrice func() *big.Int + GetBuckets func(common.Address) (map[string]interface{}, error) + GetCandidates func() state.Candidates + GetCandidatesInfoInRange func(uint64, uint64) []state.CandidateInfo + GetCode func(common.Address) []byte + GetCodeHash func(common.Address) common.Hash + GetCodeSize func(common.Address) int + GetForbidBackStakeList func() types.ForbidBackStakeList + GetGenaroPrice func() *types.GenaroPrice + GetHeft func(common.Address) (uint64, error) + GetHeftLog func(common.Address) types.NumLogs + GetHeftRangeDiff func(common.Address, uint64, uint64) uint64 + GetLastSynState func() *types.LastSynState + GetMainAccount func(subAccount common.Address) *common.Address + GetMainAccounts func() map[common.Address][]common.Address + GetNameAccount func(name string) (addr common.Address, err error) + GetNonce func(common.Address) uint64 + GetOneDayGesCost func() *big.Int + GetOneDaySyncLogGsaCost func() *big.Int + GetOptionTxTable func(common.Hash, uint64) *types.OptionTxTable + GetOptionTxTableByAddress func(common.Address) *types.OptionTxTable + GetPromissoryNotes func(address common.Address) types.PromissoryNotes + GetRefund func() uint64 + GetRewardsValues func() *types.RewardsValues + GetSharedFile func(common.Address, string) types.SynchronizeShareKey + GetStake func(common.Address) (uint64, error) + GetStakeLog func(common.Address) types.NumLogs + GetStakePerNodePrice func() *big.Int + GetStakeRangeDiff func(common.Address, uint64, uint64) uint64 + GetState func(common.Address, common.Hash) common.Hash + GetStorageGas func(common.Address, [32]byte) (uint64, error) + GetStorageGasPrice func(common.Address, [32]byte) (uint64, error) + GetStorageGasUsed func(common.Address, [32]byte) (uint64, error) + GetStorageNodes func(addr common.Address) []string + GetStorageSize func(common.Address, [32]byte) (uint64, error) + GetSubAccountsCount func(mainAccount common.Address) int + GetTraffic func(common.Address) uint64 + GetTrafficApplyPrice func() *big.Int + HasName func(common.Address, string) bool + HasSuicided func(common.Address) bool + IsAccountExistInForbidBackStakeList func(address common.Address) bool + IsAlreadyBackStake func(addr common.Address) bool + IsBindingAccount func(account common.Address) bool + IsBindingMainAccount func(account common.Address) bool + IsBindingSubAccount func(account common.Address) bool + IsCandidateExist func(candidate common.Address) bool + IsContract func(addr common.Address) bool + IsNameAccountExist func(name string) (bool, error) + PromissoryNotesWithdrawCash func(common.Address, uint64) uint64 + RevertToSnapshot func(int) + SetAlreadyBackStakeList func(common.BackStakeList) bool + SetCode func(common.Address, []byte) + SetGenaroPrice func(genaroPrice types.GenaroPrice) bool + SetLastSynBlock func(blockNumber uint64, blockHash common.Hash) bool + SetNameAccount func(name string, addr common.Address) (err error) + SetNonce func(common.Address, uint64) + SetRewardsValues func(rewardsValues types.RewardsValues) bool + SetState func(common.Address, common.Hash, common.Hash) + SetTxStatusInOptionTxTable func(common.Hash, bool, uint64) bool + Snapshot func() int + SpecialTxTypeMortgageInit func(common.Address, types.SpecialTxTypeMortgageInit) bool + SpecialTxTypeSyncSidechainStatus func(common.Address, types.SpecialTxTypeMortgageInit) (map[common.Address]*big.Int, bool) + SubBalance func(common.Address, *big.Int) + Suicide func(common.Address) bool + SyncNode2Address func(common.Address, string, string) error + SyncStakeNode func(common.Address, string) error + SynchronizeShareKey func(common.Address, types.SynchronizeShareKey) bool + TurnBuyPromissoryNotes func(common.Hash, *hexutil.Big, common.Address, uint64) bool + TxLogByDataVersionRead func(common.Address, [32]byte, string) (map[common.Address]*hexutil.Big, error) + TxLogBydataVersionUpdate func(common.Address, [32]byte, common.Address) bool + UbindNode2Address func(common.Address, string) error + UnbindNode func(common.Address, string) error + UnlockSharedKey func(common.Address, string) bool + UpdateAccountBinding func(mainAccount common.Address, subAccount common.Address) bool + UpdateBucket func(common.Address, types.BucketPropertie) bool + UpdateBucketApplyPrice func(common.Address, *hexutil.Big) bool + UpdateBucketProperties func(common.Address, string, uint64, uint64, uint64, uint64) bool + UpdateFileSharePublicKey func(common.Address, string) bool + UpdateHeft func(common.Address, uint64, uint64) bool + UpdateOneDayGesCost func(common.Address, *hexutil.Big) bool + UpdateOneDaySyncLogGsaCost func(common.Address, *hexutil.Big) bool + UpdateStake func(common.Address, uint64, uint64) bool + UpdateStakePerNodePrice func(common.Address, *hexutil.Big) bool + UpdateTraffic func(common.Address, uint64) bool + UpdateTrafficApplyPrice func(common.Address, *hexutil.Big) bool + type Storage map[common.Hash]common.Hash + func (self Storage) Copy() Storage + type StructLog struct + Depth int + Err error + Gas uint64 + GasCost uint64 + Memory []byte + MemorySize int + Op OpCode + Pc uint64 + Stack []*big.Int + Storage map[common.Hash]common.Hash + func (s *StructLog) ErrorString() string + func (s *StructLog) OpName() string + func (s *StructLog) UnmarshalJSON(input []byte) error + func (s StructLog) MarshalJSON() ([]byte, error) + type StructLogger struct + func NewStructLogger(cfg *LogConfig) *StructLogger + func (l *StructLogger) CaptureEnd(output []byte, gasUsed uint64, t time.Duration, err error) error + func (l *StructLogger) CaptureFault(env *EVM, pc uint64, op OpCode, gas, cost uint64, memory *Memory, stack *Stack, ...) error + func (l *StructLogger) CaptureStart(from common.Address, to common.Address, create bool, input []byte, gas uint64, ...) error + func (l *StructLogger) CaptureState(env *EVM, pc uint64, op OpCode, gas, cost uint64, memory *Memory, stack *Stack, ...) error + func (l *StructLogger) Error() error + func (l *StructLogger) Output() []byte + func (l *StructLogger) StructLogs() []StructLog + type Tracer interface + CaptureEnd func(output []byte, gasUsed uint64, t time.Duration, err error) error + CaptureFault func(env *EVM, pc uint64, op OpCode, gas, cost uint64, memory *Memory, stack *Stack, ...) error + CaptureStart func(from common.Address, to common.Address, call bool, input []byte, gas uint64, ...) error + CaptureState func(env *EVM, pc uint64, op OpCode, gas, cost uint64, memory *Memory, stack *Stack, ...) error + type TransferFunc func(StateDB, common.Address, common.Address, *big.Int)