extstate

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2026 License: GPL-3.0, LGPL-3.0, LGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPrecompileAdapter

func NewPrecompileAdapter(extState *ExtState) contract.StateDB

NewPrecompileAdapter creates a new PrecompileAdapter

Types

type ExtState

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

ExtState wraps a StateDB for extended state operations

func New

func New(stateDB *state.StateDB) *ExtState

New creates a new ExtState instance

type PrecompileAdapter

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

PrecompileAdapter adapts ExtState for precompile usage

func (*PrecompileAdapter) AddBalance

func (p *PrecompileAdapter) AddBalance(addr common.Address, amount *uint256.Int)

AddBalance adds balance to an account

func (*PrecompileAdapter) AddLog

func (p *PrecompileAdapter) AddLog(log *types.Log)

AddLog adds a log entry

func (*PrecompileAdapter) CreateAccount

func (p *PrecompileAdapter) CreateAccount(addr common.Address)

CreateAccount creates a new account

func (*PrecompileAdapter) Exist

func (p *PrecompileAdapter) Exist(addr common.Address) bool

Exist returns whether an account exists

func (*PrecompileAdapter) GetBalance

func (p *PrecompileAdapter) GetBalance(addr common.Address) *uint256.Int

GetBalance gets account balance

func (*PrecompileAdapter) GetNonce

func (p *PrecompileAdapter) GetNonce(addr common.Address) uint64

GetNonce gets account nonce

func (*PrecompileAdapter) GetPredicateStorageSlots

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

GetPredicateStorageSlots gets predicate storage slots

func (*PrecompileAdapter) GetState

func (p *PrecompileAdapter) GetState(addr common.Address, key common.Hash) common.Hash

GetState gets state value

func (*PrecompileAdapter) GetTxHash

func (p *PrecompileAdapter) GetTxHash() common.Hash

GetTxHash gets the current transaction hash

func (*PrecompileAdapter) RevertToSnapshot

func (p *PrecompileAdapter) RevertToSnapshot(snapshot int)

RevertToSnapshot reverts to a previous snapshot

func (*PrecompileAdapter) SetNonce

func (p *PrecompileAdapter) SetNonce(addr common.Address, nonce uint64)

SetNonce sets account nonce

func (*PrecompileAdapter) SetState

func (p *PrecompileAdapter) SetState(addr common.Address, key common.Hash, value common.Hash)

SetState sets state value

func (*PrecompileAdapter) Snapshot

func (p *PrecompileAdapter) Snapshot() int

Snapshot returns the current revision number

Jump to

Keyboard shortcuts

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