Versions in this module Expand all Collapse all v0 v0.0.2 Dec 21, 2022 v0.0.1 Dec 21, 2022 Changes in this version + var ErrCodeEmpty = errors.New("contract code empty") + 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 ErrExecutionReverted = errors.New("execution was reverted") + var ErrInsufficientBalance = errors.New("insufficient balance for transfer") + var ErrMaxCodeSizeExceeded = errors.New("evm: max code size exceeded") + var ErrNotEnoughFunds = errors.New("not enough funds") + var ErrOutOfGas = errors.New("out of gas") + var ErrStackOverflow = errors.New("stack overflow") + var ErrStackUnderflow = errors.New("stack underflow") + func IsCallType(typ CallType) bool + func IsCreateType(typ CallType) bool + type CallType int + const Call + const CallCode + const Create + const Create2 + const DelegateCall + const StaticCall + type Contract struct + Address types.Address + Caller types.Address + Code []byte + CodeAddress types.Address + Depth int + Gas uint64 + Input []byte + Origin types.Address + Static bool + Type CallType + Value *big.Int + func NewContract(depth int, origin types.Address, from types.Address, to types.Address, ...) *Contract + func NewContractCall(depth int, origin types.Address, from types.Address, to types.Address, ...) *Contract + func NewContractCreation(depth int, origin types.Address, from types.Address, to types.Address, ...) *Contract + type DummyLogger struct + func (d *DummyLogger) CaptureEnd(output []byte, gasUsed uint64, t time.Duration, err error) + func (d *DummyLogger) CaptureEnter(opCode int, from, to types.Address, input []byte, gas uint64, value *big.Int) + func (d *DummyLogger) CaptureExit(output []byte, gasUsed uint64, err error) + func (d *DummyLogger) CaptureFault(ctx *ScopeContext, pc uint64, opCode int, gas, cost uint64, depth int, ...) + func (d *DummyLogger) CaptureStart(txn Txn, from, to types.Address, create bool, input []byte, gas uint64, ...) + func (d *DummyLogger) CaptureState(ctx *ScopeContext, pc uint64, opCode int, gas, cost uint64, rData []byte, ...) + type EVMLogger interface + CaptureEnd func(output []byte, gasUsed uint64, t time.Duration, err error) + CaptureEnter func(opCode int, from, to types.Address, input []byte, gas uint64, value *big.Int) + CaptureExit func(output []byte, gasUsed uint64, err error) + CaptureFault func(ctx *ScopeContext, pc uint64, opCode int, gas, cost uint64, depth int, ...) + CaptureStart func(txn Txn, from, to types.Address, create bool, input []byte, gas uint64, ...) + CaptureState func(ctx *ScopeContext, pc uint64, opCode int, gas, cost uint64, rData []byte, ...) + func NewDummyLogger() EVMLogger + type ExecutionResult struct + Err error + GasLeft uint64 + GasUsed uint64 + ReturnValue []byte + func (r *ExecutionResult) Failed() bool + func (r *ExecutionResult) Return() []byte + func (r *ExecutionResult) Revert() []byte + func (r *ExecutionResult) Reverted() bool + func (r *ExecutionResult) Succeeded() bool + func (r *ExecutionResult) UpdateGasUsed(gasLimit uint64, refund uint64) + type Host interface + AccountExists func(addr types.Address) bool + Callx func(*Contract, Host) *ExecutionResult + EmitLog func(addr types.Address, topics []types.Hash, data []byte) + Empty func(addr types.Address) bool + GetBalance func(addr types.Address) *big.Int + GetBlockHash func(number int64) types.Hash + GetCode func(addr types.Address) []byte + GetCodeHash func(addr types.Address) types.Hash + GetCodeSize func(addr types.Address) int + GetEVMLogger func() EVMLogger + GetNonce func(addr types.Address) uint64 + GetStorage func(addr types.Address, key types.Hash) types.Hash + GetTxContext func() TxContext + Selfdestruct func(addr types.Address, beneficiary types.Address) + SetStorage func(addr types.Address, key types.Hash, value types.Hash, ...) StorageStatus + type Runtime interface + CanRun func(c *Contract, host Host, config *chain.ForksInTime) bool + Name func() string + Run func(c *Contract, host Host, config *chain.ForksInTime) *ExecutionResult + type ScopeContext struct + ContractAddress types.Address + Memory []byte + Stack []*big.Int + type StorageStatus int + const StorageAdded + const StorageDeleted + const StorageModified + const StorageModifiedAgain + const StorageUnchanged + func (s StorageStatus) String() string + type TxContext struct + ChainID int64 + Coinbase types.Address + Difficulty types.Hash + GasLimit int64 + GasPrice types.Hash + Number int64 + Origin types.Address + Timestamp int64 + type Txn interface + GetRefund func() uint64 + GetState func(addr types.Address, key types.Hash) types.Hash