extstate

package
v0.8.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 7, 2025 License: GPL-3.0, LGPL-3.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PrecompileStateDBAdapter added in v0.8.6

type PrecompileStateDBAdapter struct {
	*StateDB
}

PrecompileStateDBAdapter adapts the new geth StateDB interface (with BalanceChangeReason) to the legacy precompile contract.StateDB interface that doesn't use BalanceChangeReason.

func NewPrecompileAdapter added in v0.8.6

func NewPrecompileAdapter(stateDB *StateDB) *PrecompileStateDBAdapter

NewPrecompileAdapter creates a new adapter for precompile compatibility

func (*PrecompileStateDBAdapter) AddBalance added in v0.8.6

func (a *PrecompileStateDBAdapter) AddBalance(addr common.Address, amount *uint256.Int)

AddBalance implements the legacy AddBalance without BalanceChangeReason

func (*PrecompileStateDBAdapter) SetNonce added in v0.8.6

func (a *PrecompileStateDBAdapter) SetNonce(addr common.Address, nonce uint64)

SetNonce implements the legacy SetNonce without NonceChangeReason

func (*PrecompileStateDBAdapter) SetState added in v0.8.6

func (a *PrecompileStateDBAdapter) SetState(addr common.Address, key, value common.Hash)

SetState implements the contract.StateDB interface (no return value)

type StateDB

type StateDB struct {
	// contains filtered or unexported fields
}

func New

func New(vm VmStateDB) *StateDB

New creates a new *StateDB with the given VmStateDB, effectively wrapping it with additional functionality.

func (*StateDB) GetPredicateStorageSlots

func (s *StateDB) GetPredicateStorageSlots(address common.Address, index int) ([]byte, bool)

GetPredicateStorageSlots returns the storage slots associated with the address, index pair. A list of access tuples can be included within transaction types post EIP-2930. The address is declared directly on the access tuple and the index is the i'th occurrence of an access tuple with the specified address.

Ex. AccessList[[AddrA, Predicate1], [AddrB, Predicate2], [AddrA, Predicate3]] In this case, the caller could retrieve predicates 1-3 with the following calls: GetPredicateStorageSlots(AddrA, 0) -> Predicate1 GetPredicateStorageSlots(AddrB, 0) -> Predicate2 GetPredicateStorageSlots(AddrA, 1) -> Predicate3

func (*StateDB) Prepare

func (s *StateDB) Prepare(rules params.Rules, sender, coinbase common.Address, dst *common.Address, precompiles []common.Address, list types.AccessList)

func (*StateDB) PrepareWithExtrasRules added in v0.8.6

func (s *StateDB) PrepareWithExtrasRules(rules params.Rules, extrasRules predicate.PredicaterExistChecker, sender, coinbase common.Address, dst *common.Address, precompiles []common.Address, list types.AccessList)

PrepareWithExtrasRules prepares the state with extras.Rules for predicate support

type VmStateDB

type VmStateDB interface {
	vm.StateDB
	Logs() []*types.Log
	GetTxHash() common.Hash
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL