Versions in this module Expand all Collapse all v1 v1.0.2 Jul 14, 2024 v1.0.1 Jul 14, 2024 Changes in this version + var ErrFetch = errors.New("fetching failed") + var ErrMissingFunc = errors.New("missing function") + var ErrRevert = errors.New("execution reverted") + func RandA() (addr common.Address) + func Slot(pos, key common.Hash) common.Hash + func Slot2(pos, key, key2 common.Hash) common.Hash + func WETHAllowanceSlot(owner, spender common.Address) common.Hash + func WETHBalanceSlot(addr common.Address) common.Hash + type AccessList struct + Data hexutil.Bytes + From common.Address + Gas hexutil.Uint64 + GasPrice *hexutil.Big + To common.Address + Value *hexutil.Big + type CallFuncFactory struct + func (cff *CallFuncFactory) Returns(returns ...any) error + type Fetcher interface + Account func(common.Address) (*types.StateAccount, error) + Code func(common.Hash) ([]byte, error) + HeaderHash func(uint64) (common.Hash, error) + StorageAt func(common.Address, common.Hash) (common.Hash, error) + func NewRPCFetcher(client *w3.Client, blockNumber *big.Int) Fetcher + func NewTestingRPCFetcher(tb testing.TB, chainID uint64, client *w3.Client, blockNumber *big.Int) Fetcher + type Option func(*VM) + func WithBlockContext(ctx *vm.BlockContext) Option + func WithChainConfig(cfg *params.ChainConfig) Option + func WithFetcher(fetcher Fetcher) Option + func WithFork(client *w3.Client, blockNumber *big.Int) Option + func WithHeader(header *types.Header) Option + func WithNoBaseFee() Option + func WithState(state w3types.State) Option + func WithTB(tb testing.TB) Option + type Receipt struct + ContractAddress *common.Address + Err error + GasLimit uint64 + GasRefund uint64 + GasUsed uint64 + Logs []*types.Log + Output []byte + func (r Receipt) DecodeReturns(returns ...any) error + type VM struct + func New(opts ...Option) (*VM, error) + func (vm *VM) Apply(msg *w3types.Message, hooks ...*tracing.Hooks) (*Receipt, error) + func (vm *VM) ApplyTx(tx *types.Transaction, hooks ...*tracing.Hooks) (*Receipt, error) + func (vm *VM) Balance(addr common.Address) (*big.Int, error) + func (vm *VM) Call(msg *w3types.Message, hooks ...*tracing.Hooks) (*Receipt, error) + func (vm *VM) CallFunc(contract common.Address, f w3types.Func, args ...any) *CallFuncFactory + func (vm *VM) Code(addr common.Address) ([]byte, error) + func (vm *VM) CreateAccessList(contract common.Address, data []byte) (*types.AccessList, error) + func (vm *VM) CreateAccessListRPC(msg *w3types.Message, blockNumber *big.Int) (*types.AccessList, error) + func (vm *VM) Nonce(addr common.Address) (uint64, error) + func (vm *VM) Rollback(snapshot *state.StateDB) + func (vm *VM) Snapshot() *state.StateDB + func (vm *VM) StorageAt(addr common.Address, slot common.Hash) (common.Hash, error)