Versions in this module Expand all Collapse all v0 v0.6.3 Nov 22, 2024 Changes in this version + const LogDataGas + const LogGas + const LogTopicGas + const ReadGasCostPerSlot + const SelectorLen + const WriteGasCostPerSlot + func CalculateFunctionSelector(functionSignature string) []byte + func DeductGas(suppliedGas uint64, requiredGas uint64) (uint64, error) + func IsDurangoActivated(evm AccessibleState) bool + func PackOrderedHashes(dst []byte, hashes []common.Hash) error + func PackOrderedHashesWithSelector(dst []byte, functionSelector []byte, hashes []common.Hash) error + func PackedHash(packed []byte, index int) []byte + func ParseABI(rawABI string) abi.ABI + type AccessibleState interface + GetBlockContext func() BlockContext + GetChainConfig func() precompileconfig.ChainConfig + GetSnowContext func() *snow.Context + GetStateDB func() StateDB + type ActivationFunc func(AccessibleState) bool + type BlockContext interface + GetPredicateResults func(txHash common.Hash, precompileAddress common.Address) []byte + type ConfigurationBlockContext interface + Number func() *big.Int + Timestamp func() uint64 + type Configurator interface + Configure func(chainConfig precompileconfig.ChainConfig, ...) error + MakeConfig func() precompileconfig.Config + type MockAccessibleState struct + func NewMockAccessibleState(ctrl *gomock.Controller) *MockAccessibleState + func (m *MockAccessibleState) EXPECT() *MockAccessibleStateMockRecorder + func (m *MockAccessibleState) GetBlockContext() BlockContext + func (m *MockAccessibleState) GetChainConfig() precompileconfig.ChainConfig + func (m *MockAccessibleState) GetSnowContext() *snow.Context + func (m *MockAccessibleState) GetStateDB() StateDB + type MockAccessibleStateMockRecorder struct + func (mr *MockAccessibleStateMockRecorder) GetBlockContext() *gomock.Call + func (mr *MockAccessibleStateMockRecorder) GetChainConfig() *gomock.Call + func (mr *MockAccessibleStateMockRecorder) GetSnowContext() *gomock.Call + func (mr *MockAccessibleStateMockRecorder) GetStateDB() *gomock.Call + type MockBlockContext struct + func NewMockBlockContext(ctrl *gomock.Controller) *MockBlockContext + func (m *MockBlockContext) EXPECT() *MockBlockContextMockRecorder + func (m *MockBlockContext) GetPredicateResults(arg0 common.Hash, arg1 common.Address) []byte + func (m *MockBlockContext) Number() *big.Int + func (m *MockBlockContext) Timestamp() uint64 + type MockBlockContextMockRecorder struct + func (mr *MockBlockContextMockRecorder) GetPredicateResults(arg0, arg1 any) *gomock.Call + func (mr *MockBlockContextMockRecorder) Number() *gomock.Call + func (mr *MockBlockContextMockRecorder) Timestamp() *gomock.Call + type MockStateDB struct + func NewMockStateDB(ctrl *gomock.Controller) *MockStateDB + func (m *MockStateDB) AddBalance(arg0 common.Address, arg1 *big.Int) + func (m *MockStateDB) AddLog(arg0 common.Address, arg1 []common.Hash, arg2 []byte, arg3 uint64) + func (m *MockStateDB) CreateAccount(arg0 common.Address) + func (m *MockStateDB) EXPECT() *MockStateDBMockRecorder + func (m *MockStateDB) Exist(arg0 common.Address) bool + func (m *MockStateDB) GetBalance(arg0 common.Address) *big.Int + func (m *MockStateDB) GetLogData() ([][]common.Hash, [][]byte) + func (m *MockStateDB) GetNonce(arg0 common.Address) uint64 + func (m *MockStateDB) GetPredicateStorageSlots(arg0 common.Address, arg1 int) ([]byte, bool) + func (m *MockStateDB) GetState(arg0 common.Address, arg1 common.Hash) common.Hash + func (m *MockStateDB) GetTxHash() common.Hash + func (m *MockStateDB) RevertToSnapshot(arg0 int) + func (m *MockStateDB) SetNonce(arg0 common.Address, arg1 uint64) + func (m *MockStateDB) SetPredicateStorageSlots(arg0 common.Address, arg1 [][]byte) + func (m *MockStateDB) SetState(arg0 common.Address, arg1, arg2 common.Hash) + func (m *MockStateDB) Snapshot() int + type MockStateDBMockRecorder struct + func (mr *MockStateDBMockRecorder) AddBalance(arg0, arg1 any) *gomock.Call + func (mr *MockStateDBMockRecorder) AddLog(arg0, arg1, arg2, arg3 any) *gomock.Call + func (mr *MockStateDBMockRecorder) CreateAccount(arg0 any) *gomock.Call + func (mr *MockStateDBMockRecorder) Exist(arg0 any) *gomock.Call + func (mr *MockStateDBMockRecorder) GetBalance(arg0 any) *gomock.Call + func (mr *MockStateDBMockRecorder) GetLogData() *gomock.Call + func (mr *MockStateDBMockRecorder) GetNonce(arg0 any) *gomock.Call + func (mr *MockStateDBMockRecorder) GetPredicateStorageSlots(arg0, arg1 any) *gomock.Call + func (mr *MockStateDBMockRecorder) GetState(arg0, arg1 any) *gomock.Call + func (mr *MockStateDBMockRecorder) GetTxHash() *gomock.Call + func (mr *MockStateDBMockRecorder) RevertToSnapshot(arg0 any) *gomock.Call + func (mr *MockStateDBMockRecorder) SetNonce(arg0, arg1 any) *gomock.Call + func (mr *MockStateDBMockRecorder) SetPredicateStorageSlots(arg0, arg1 any) *gomock.Call + func (mr *MockStateDBMockRecorder) SetState(arg0, arg1, arg2 any) *gomock.Call + func (mr *MockStateDBMockRecorder) Snapshot() *gomock.Call + type RunStatefulPrecompileFunc func(accessibleState AccessibleState, caller common.Address, addr common.Address, ...) (ret []byte, remainingGas uint64, err error) + type StateDB interface + AddBalance func(common.Address, *big.Int) + AddLog func(addr common.Address, topics []common.Hash, data []byte, blockNumber uint64) + CreateAccount func(common.Address) + Exist func(common.Address) bool + GetBalance func(common.Address) *big.Int + GetLogData func() (topics [][]common.Hash, data [][]byte) + GetNonce func(common.Address) uint64 + GetPredicateStorageSlots func(address common.Address, index int) ([]byte, bool) + GetState func(common.Address, common.Hash) common.Hash + GetTxHash func() common.Hash + RevertToSnapshot func(int) + SetNonce func(common.Address, uint64) + SetPredicateStorageSlots func(address common.Address, predicates [][]byte) + SetState func(common.Address, common.Hash, common.Hash) + Snapshot func() int + type StatefulPrecompileFunction struct + func NewStatefulPrecompileFunction(selector []byte, execute RunStatefulPrecompileFunc) *StatefulPrecompileFunction + func NewStatefulPrecompileFunctionWithActivator(selector []byte, execute RunStatefulPrecompileFunc, activation ActivationFunc) *StatefulPrecompileFunction + func (f *StatefulPrecompileFunction) IsActivated(accessibleState AccessibleState) bool + type StatefulPrecompiledContract interface + Run func(accessibleState AccessibleState, caller common.Address, addr common.Address, ...) (ret []byte, remainingGas uint64, err error) + func NewStatefulPrecompileContract(fallback RunStatefulPrecompileFunc, functions []*StatefulPrecompileFunction) (StatefulPrecompiledContract, error)