Versions in this module Expand all Collapse all v0 v0.2.3 Sep 13, 2024 Changes in this version type OpCode + const PREVRANDAO + const TLOAD + const TSTORE type StateDB + GetTransientState func(addr common.Address, key common.Hash) common.Hash + SetTransientState func(addr common.Address, key, value common.Hash) v0.2.2 Jun 30, 2023 Changes in this version + var ErrExecutionReverted = errors.New("execution reverted") + var ErrGasUintOverflow = errors.New("gas uint64 overflow") + var ErrInvalidCode = errors.New("invalid code: must not begin with 0xef") + var ErrInvalidJump = errors.New("invalid jump destination") + var ErrMaxCodeSizeExceeded = errors.New("max code size exceeded") + var ErrNonceUintOverflow = errors.New("nonce uint64 overflow") + var ErrReturnDataOutOfBounds = errors.New("return data out of bounds") + var ErrWriteProtection = errors.New("write protection") + var PrecompiledAddressesBerlin []common.Address + var PrecompiledAddressesByzantium []common.Address + var PrecompiledAddressesHomestead []common.Address + var PrecompiledAddressesIstanbul []common.Address + var PrecompiledContractsBLS = map[common.Address]PrecompiledContract + var PrecompiledContractsBerlin = map[common.Address]PrecompiledContract + func ActivateableEips() []string + func ActivePrecompiles(rules params.Rules) []common.Address + func ValidEip(eipNum int) bool type Config + NoBaseFee bool type Context + BaseFee *big.Int + Random *common.Hash type EVM + Config Config + func (evm *EVM) Reset(txContext TxContext, statedb StateDB) + type EVMLogger interface + CaptureEnd func(output []byte, gasUsed uint64, t time.Duration, 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 OpCode + const BASEFEE + const INVALID + const KECCAK256 + const PUSH0 + const RANDOM + type ScopeContext struct + Contract *Contract + Memory *Memory + Stack *Stack type StateDB + AddAddressToAccessList func(addr common.Address) + AddSlotToAccessList func(addr common.Address, slot common.Hash) + AddressInAccessList func(addr common.Address) bool + PrepareAccessList func(sender common.Address, dest *common.Address, precompiles []common.Address, ...) + SlotInAccessList func(addr common.Address, slot common.Hash) (addressOk bool, slotOk bool) + type TxContext struct + GasPrice *big.Int + Origin common.Address v0.2.1 Mar 31, 2023 v0.2.0 Dec 23, 2021 Changes in this version + var ErrWithdawrefundCallFailed = errors.New("refund withdraw tx call failed") + func GetCredentialOwner(CredentialSubject interface{}) string + func GetDIDAndUri(idURI string) (string, string) + func HaveCtrl(docCtrl interface{}, controller string) bool + func IsControllerInvalid(controller interface{}, evm *EVM) error + func IsDocProofCtrUnique_Bk(proof interface{}, evm *EVM) error + func IsLetterOrNumber(s string) bool + func IsTicketProofCtrInvalid(proof interface{}, evm *EVM, ID string) error + func ReceivedCustomToLower(receivedCustomIDs map[string]common.Uint168) map[string]common.Uint168 + func ReserveCustomToLower(reservedCustomIDs map[string]struct{}) map[string]struct + type PayloadGenerator struct + func (s *PayloadGenerator) TestFromHexStrPrivateToBase58PriJianBin(privatekeyhexstr string) string + func (s *PayloadGenerator) TestFromHexStrPublicToBase58PublicJianBin(publickeyhexstr string) string type StateDB + GetCredentialExpiresHeight func(credentIDKey []byte) (uint32, error) + GetDIDExpiresHeight func(idKey []byte) (uint32, error) + GetRevokeCredentialCtrls func(credentIDKey []byte) ([]string, error) + IsIDDeactivated func(id string) bool v0.1.3 Oct 29, 2021 v0.1.2 Jul 26, 2021 v0.1.1 Jul 5, 2021 v0.1.0 Jun 21, 2021 Changes in this version + const AuthPublicKey + const AuthorPublicKey + const DefaultPublicKey + const GasExtStep + const GasFastStep + const GasFastestStep + const GasMidStep + const GasQuickStep + const GasSlowStep + const PrefixCRDID + var ErrCastCaller = errors.New("cast caller error") + 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 ErrLeveldbNotFound = errors.New("leveldb: not found") + var ErrNoCompatibleInterpreter = errors.New("no compatible interpreter") + var ErrNotFound = errors.New("not found") + var ErrOutOfGas = errors.New("out of gas") + var ErrTraceLimitReached = errors.New("the number of logs reached the specified limit") + var PrecompileContractsDID = map[common.Address]PrecompiledContractDID + var PrecompiledContractsByzantium = map[common.Address]PrecompiledContract + var PrecompiledContractsHomestead = map[common.Address]PrecompiledContract + var PrecompiledContractsIstanbul = map[common.Address]PrecompiledContract + func EnableEIP(eipNum int, jt *JumpTable) error + func GetDIDAndCompactSymbolFromUri(idURI string) (string, string) + func GetIDLastDoc(evm *EVM, id string) (*did.DIDDoc, error) + func GetLastDIDTxData(evm *EVM, issuerDID string) (*did.DIDTransactionData, error) + func GetMultisignMN(mulstiSign string) (int, int, error) + func GetVerifiableCredentialID(cridential *did.VerifiableCredentialDoc) string + func InitDIDParams(params did.DIDParams) + func IsVerifMethCustIDAuthKey(evm *EVM, VerificationMethod, ID string, publicKey []did.DIDPublicKeyInfo, ...) bool + func IsVerifMethCustIDControllerKey(evm *EVM, VerificationMethod, ID string, Controller interface{}, ...) bool + func IsVerifMethCustIDDefKey(evm *EVM, VerificationMethod, ID string, publicKey []did.DIDPublicKeyInfo, ...) bool + func RunPrecompiledContract(p PrecompiledContract, input []byte, contract *Contract) (ret []byte, err error) + func RunPrecompiledContractDID(evm *EVM, p PrecompiledContractDID, input []byte, contract *Contract) (ret []byte, err error) + func Unmarshal(src, target interface{}) 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 + EVMInterpreter string + EWASMInterpreter string + EnablePreimageRecording bool + ExtraEips []int + 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 + 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) GetByte(n uint64) byte + 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 + 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) 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, salt *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 EVMInterpreter struct + func NewEVMInterpreter(evm *EVM, cfg Config) *EVMInterpreter + func (in *EVMInterpreter) CanRun(code []byte) bool + func (in *EVMInterpreter) Run(contract *Contract, input []byte, readOnly bool) (ret []byte, err error) + type GetHashFunc func(uint64) common.Hash + type Interpreter interface + CanRun func([]byte) bool + Run func(contract *Contract, input []byte, static bool) ([]byte, error) + type JSONLogger struct + func NewJSONLogger(cfg *LogConfig, writer io.Writer) *JSONLogger + func (l *JSONLogger) CaptureEnd(output []byte, gasUsed uint64, t time.Duration, err error) error + func (l *JSONLogger) CaptureFault(env *EVM, pc uint64, op OpCode, gas, cost uint64, memory *Memory, stack *Stack, ...) error + func (l *JSONLogger) CaptureStart(from common.Address, to common.Address, create bool, input []byte, gas uint64, ...) error + func (l *JSONLogger) CaptureState(env *EVM, pc uint64, op OpCode, gas, cost uint64, memory *Memory, stack *Stack, ...) error + type JumpTable [256]operation + type LogConfig struct + Debug bool + DisableMemory bool + DisableStack bool + DisableStorage bool + Limit int + type Memory struct + func NewMemory() *Memory + 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) Print() + func (m *Memory) Resize(size uint64) + func (m *Memory) Set(offset, size uint64, value []byte) + func (m *Memory) Set32(offset uint64, val *big.Int) + 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 CHAINID + const CODECOPY + const CODESIZE + const COINBASE + const CREATE + const CREATE2 + const DELEGATECALL + 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 EXTCODEHASH + 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 RETURN + const RETURNDATACOPY + const RETURNDATASIZE + const REVERT + const SAR + const SDIV + const SELFBALANCE + const SELFDESTRUCT + const SGT + const SHA3 + const SHL + const SHR + const SIGNEXTEND + const SLOAD + const SLT + const SMOD + const SSTORE + const STATICCALL + const STOP + 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 (op OpCode) IsPush() bool + func (op OpCode) IsStaticJump() bool + func (op OpCode) String() string + type PrecompiledContract interface + RequiredGas func(input []byte) uint64 + Run func(input []byte) ([]byte, error) + type PrecompiledContractDID interface + RequiredGas func(evm *EVM, input []byte) (uint64, error) + Run func(evm *EVM, input []byte, gas uint64) ([]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 + AddBalance func(common.Address, *big.Int) + AddDIDLog func(did string, operation string, doc []byte) + AddLog func(*types.Log) + AddPreimage func(common.Hash, []byte) + AddRefund func(uint64) + CreateAccount func(common.Address) + Empty func(common.Address) bool + Exist func(common.Address) bool + ForEachStorage func(common.Address, func(common.Hash, common.Hash) bool) error + GetAllDIDTxData func(idKey []byte, config *params.ChainConfig) ([]did.DIDTransactionData, error) + GetBalance func(common.Address) *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 + GetDeactivatedTxData func(idKey []byte, config *params.ChainConfig) (*did.DIDTransactionData, error) + GetLastCustomizedDIDTxData func(idKey []byte) (*did.DIDTransactionData, error) + GetLastCustomizedDIDTxHash func(idKey []byte) (elacom.Uint256, error) + GetLastDIDTxData func(idKey []byte, config *params.ChainConfig) (*did.DIDTransactionData, error) + GetLastVerifiableCredentialTxData func(idKey []byte, config *params.ChainConfig) (*did.DIDTransactionData, error) + GetNonce func(common.Address) uint64 + GetRefund func() uint64 + GetState func(common.Address, common.Hash) common.Hash + HasSuicided func(common.Address) bool + IsDID func(did string) (bool, error) + IsDIDDeactivated func(did string) bool + ReadBlock func(hash common.Hash, number uint64) *types.Block + ReadTransaction func(txID common.Hash) (*types.Transaction, common.Hash, uint64, uint64) + RevertToSnapshot func(int) + SetCode func(common.Address, []byte) + SetNonce func(common.Address, uint64) + SetState func(common.Address, common.Hash, common.Hash) + Snapshot func() int + SubBalance func(common.Address, *big.Int) + SubRefund func(uint64) + Suicide func(common.Address) bool + type Storage map[common.Hash]common.Hash + func (s Storage) Copy() Storage + type StructLog struct + Depth int + Err error + Gas uint64 + GasCost uint64 + Memory []byte + MemorySize int + Op OpCode + Pc uint64 + RefundCounter 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)