Versions in this module Expand all Collapse all v0 v0.13.7 Jul 13, 2024 Changes in this version + const BALANCEMC + const CALLEX + 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 GasExtStep + const GasFastStep + const GasFastestStep + const GasMidStep + const GasQuickStep + const GasSlowStep + 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 + var BuiltinAddr = common.Address + var NativeAssetBalanceAddr = common.HexToAddress("0x0100000000000000000000000000000000000001") + var NativeAssetCallAddr = common.HexToAddress("0x0100000000000000000000000000000000000002") + var PrecompileAllNativeAddresses map[common.Address]struct + var PrecompiledAddressesApricotPhase2 []common.Address + var PrecompiledAddressesApricotPhase6 []common.Address + var PrecompiledAddressesApricotPhasePre6 []common.Address + var PrecompiledAddressesBLS []common.Address + var PrecompiledAddressesBanff []common.Address + var PrecompiledAddressesByzantium []common.Address + var PrecompiledAddressesCancun []common.Address + var PrecompiledAddressesHomestead []common.Address + var PrecompiledAddressesIstanbul []common.Address + var PrecompiledContractsApricotPhase2 = map[common.Address]contract.StatefulPrecompiledContract + var PrecompiledContractsApricotPhase6 = map[common.Address]contract.StatefulPrecompiledContract + var PrecompiledContractsApricotPhasePre6 = map[common.Address]contract.StatefulPrecompiledContract + var PrecompiledContractsBLS = map[common.Address]contract.StatefulPrecompiledContract + var PrecompiledContractsBanff = map[common.Address]contract.StatefulPrecompiledContract + var PrecompiledContractsByzantium = map[common.Address]contract.StatefulPrecompiledContract + var PrecompiledContractsCancun = map[common.Address]contract.StatefulPrecompiledContract + var PrecompiledContractsHomestead = map[common.Address]contract.StatefulPrecompiledContract + var PrecompiledContractsIstanbul = map[common.Address]contract.StatefulPrecompiledContract + func ActivateableEips() []string + func ActivePrecompiles(rules params.Rules) []common.Address + func EnableEIP(eipNum int, jt *JumpTable) error + func IsProhibited(addr common.Address) bool + func PackNativeAssetBalanceInput(address common.Address, assetID common.Hash) []byte + func PackNativeAssetCallInput(address common.Address, assetID common.Hash, assetAmount *big.Int, ...) []byte + func RunPrecompiledContract(p PrecompiledContract, input []byte, suppliedGas uint64) (ret []byte, remainingGas uint64, err error) + func RunStatefulPrecompiledContract(precompile contract.StatefulPrecompiledContract, ...) (ret []byte, remainingGas uint64, err error) + func UnpackNativeAssetBalanceInput(input []byte) (common.Address, common.Hash, error) + func UnpackNativeAssetCallInput(input []byte) (common.Address, common.Hash, *big.Int, []byte, error) + func ValidEip(eipNum int) bool + type AccountRef common.Address + func (ar AccountRef) Address() common.Address + type BlockContext struct + BaseFee *big.Int + BlobBaseFee *big.Int + BlockNumber *big.Int + CanTransfer CanTransferFunc + CanTransferMC CanTransferMCFunc + Coinbase common.Address + Difficulty *big.Int + GasLimit uint64 + GetHash GetHashFunc + PredicateResults *predicate.Results + Time uint64 + Transfer TransferFunc + TransferMultiCoin TransferMCFunc + func (b *BlockContext) GetPredicateResults(txHash common.Hash, address common.Address) []byte + func (b *BlockContext) Number() *big.Int + func (b *BlockContext) Timestamp() uint64 + 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 CanTransferMCFunc func(StateDB, common.Address, common.Address, common.Hash, *big.Int) bool + type Config struct + EnablePreimageRecording bool + ExtraEips []int + NoBaseFee bool + Tracer EVMLogger + type Contract struct + CallerAddress common.Address + Code []byte + CodeAddr *common.Address + CodeHash common.Hash + 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) GetOp(n uint64) OpCode + func (c *Contract) SetCallCode(addr *common.Address, hash common.Hash, code []byte) + func (c *Contract) SetCodeOptionalHash(addr *common.Address, codeAndHash *codeAndHash) + func (c *Contract) UseGas(gas uint64) (ok bool) + func (c *Contract) Value() *big.Int + type ContractRef interface + Address func() common.Address + type EVM struct + Config Config + Context BlockContext + StateDB StateDB + func NewEVM(blockCtx BlockContext, txCtx TxContext, statedb StateDB, ...) *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) CallExpert(caller ContractRef, addr common.Address, input []byte, gas uint64, ...) (ret []byte, leftOverGas uint64, err error) + func (evm *EVM) Cancel() + func (evm *EVM) Cancelled() bool + 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) Create2(caller ContractRef, code []byte, gas uint64, endowment *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) GetBlockContext() contract.BlockContext + func (evm *EVM) GetChainConfig() precompileconfig.ChainConfig + func (evm *EVM) GetSnowContext() *snow.Context + func (evm *EVM) GetStateDB() contract.StateDB + func (evm *EVM) Interpreter() *EVMInterpreter + func (evm *EVM) NativeAssetCall(caller common.Address, input []byte, suppliedGas uint64, gasCost uint64, ...) (ret []byte, remainingGas uint64, err error) + func (evm *EVM) Reset(txCtx TxContext, statedb StateDB) + func (evm *EVM) StaticCall(caller ContractRef, addr common.Address, input []byte, gas uint64) (ret []byte, leftOverGas uint64, err error) + type EVMInterpreter struct + func NewEVMInterpreter(evm *EVM) *EVMInterpreter + func (in *EVMInterpreter) Run(contract *Contract, input []byte, readOnly bool) (ret []byte, err error) + type EVMLogger interface + CaptureEnd func(output []byte, gasUsed uint64, err error) + CaptureEnter func(typ OpCode, from common.Address, to common.Address, input []byte, gas uint64, ...) + CaptureExit func(output []byte, gasUsed uint64, err error) + CaptureFault func(pc uint64, op OpCode, gas, cost uint64, scope *ScopeContext, depth int, ...) + CaptureStart func(env *EVM, from common.Address, to common.Address, create bool, input []byte, ...) + CaptureState func(pc uint64, op OpCode, gas, cost uint64, scope *ScopeContext, rData []byte, ...) + CaptureTxEnd func(restGas uint64) + CaptureTxStart func(gasLimit uint64) + type ErrInvalidOpCode struct + func (e *ErrInvalidOpCode) Error() string + type ErrStackOverflow struct + func (e *ErrStackOverflow) Error() string + type ErrStackUnderflow struct + func (e *ErrStackUnderflow) Error() string + type GetHashFunc func(uint64) common.Hash + type JumpTable [256]*operation + func LookupInstructionSet(rules params.Rules) (JumpTable, error) + type Memory struct + func NewMemory() *Memory + func (m *Memory) Copy(dst, src, len uint64) + func (m *Memory) Data() []byte + func (m *Memory) GetCopy(offset, size int64) (cpy []byte) + func (m *Memory) GetPtr(offset, size int64) []byte + func (m *Memory) Len() int + func (m *Memory) Resize(size uint64) + func (m *Memory) Set(offset, size uint64, value []byte) + func (m *Memory) Set32(offset uint64, val *uint256.Int) + type OpCode byte + const ADD + const ADDMOD + const ADDRESS + const AND + const BALANCE + const BASEFEE + const BLOBBASEFEE + const BLOBHASH + const BLOCKHASH + const BYTE + const CALL + const CALLCODE + const CALLDATACOPY + const CALLDATALOAD + const CALLDATASIZE + const CALLER + const CALLVALUE + const CHAINID + const CODECOPY + const CODESIZE + const COINBASE + const CREATE + const CREATE2 + const DELEGATECALL + const DIFFICULTY + const DIV + const EQ + const EXP + const EXTCODECOPY + const EXTCODEHASH + const EXTCODESIZE + const GAS + const GASLIMIT + const GASPRICE + const GT + const INVALID + const ISZERO + const JUMP + const JUMPDEST + const JUMPI + const KECCAK256 + const LOG0 + const LOG1 + const LOG2 + const LOG3 + const LOG4 + const LT + const MCOPY + 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 PUSH0 + 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 RETURNDATACOPY + const RETURNDATASIZE + const REVERT + const SAR + const SDIV + const SELFBALANCE + const SELFDESTRUCT + const SGT + const SHL + const SHR + const SIGNEXTEND + const SLOAD + const SLT + const SMOD + const SSTORE + const STATICCALL + const STOP + const SUB + const TIMESTAMP + const TLOAD + const TSTORE + const XOR + func StringToOp(str string) OpCode + func (op OpCode) IsPush() bool + func (op OpCode) String() string + type PrecompiledContract interface + RequiredGas func(input []byte) uint64 + Run func(input []byte) ([]byte, error) + type ScopeContext struct + Contract *Contract + Memory *Memory + Stack *Stack + type Stack struct + func (st *Stack) Back(n int) *uint256.Int + func (st *Stack) Data() []uint256.Int + type StateDB interface + AddAddressToAccessList func(addr common.Address) + AddBalance func(common.Address, *big.Int) + AddBalanceMultiCoin func(common.Address, common.Hash, *big.Int) + AddLog func(addr common.Address, topics []common.Hash, data []byte, blockNumber uint64) + AddPreimage func(common.Hash, []byte) + AddRefund func(uint64) + AddSlotToAccessList func(addr common.Address, slot common.Hash) + AddressInAccessList func(addr common.Address) bool + CreateAccount func(common.Address) + Empty func(common.Address) bool + Exist func(common.Address) bool + GetBalance func(common.Address) *big.Int + GetBalanceMultiCoin func(common.Address, common.Hash) *big.Int + GetCode func(common.Address) []byte + GetCodeHash func(common.Address) common.Hash + GetCodeSize func(common.Address) int + GetCommittedState func(common.Address, common.Hash) common.Hash + GetCommittedStateAP1 func(common.Address, common.Hash) common.Hash + GetLogData func() (topics [][]common.Hash, data [][]byte) + GetNonce func(common.Address) uint64 + GetPredicateStorageSlots func(address common.Address, index int) ([]byte, bool) + GetRefund func() uint64 + GetState func(common.Address, common.Hash) common.Hash + GetTransientState func(addr common.Address, key common.Hash) common.Hash + GetTxHash func() common.Hash + HasSelfDestructed func(common.Address) bool + Prepare func(rules params.Rules, sender, coinbase common.Address, dest *common.Address, ...) + RevertToSnapshot func(int) + SelfDestruct func(common.Address) + Selfdestruct6780 func(common.Address) + SetCode func(common.Address, []byte) + SetNonce func(common.Address, uint64) + SetPredicateStorageSlots func(address common.Address, predicates [][]byte) + SetState func(common.Address, common.Hash, common.Hash) + SetTransientState func(addr common.Address, key, value common.Hash) + SlotInAccessList func(addr common.Address, slot common.Hash) (addressOk bool, slotOk bool) + Snapshot func() int + SubBalance func(common.Address, *big.Int) + SubBalanceMultiCoin func(common.Address, common.Hash, *big.Int) + SubRefund func(uint64) + type TransferFunc func(StateDB, common.Address, common.Address, *big.Int) + type TransferMCFunc func(StateDB, common.Address, common.Address, common.Hash, *big.Int) + type TxContext struct + BlobFeeCap *big.Int + BlobHashes []common.Hash + GasPrice *big.Int + Origin common.Address