geth

package
v1.16.21 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2025 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddressContext

type AddressContext struct {
	Origin common.Address
	Self   common.Address
}

AddressContext contains address information for contract creation

type PrecompileEnvironment

type PrecompileEnvironment interface {
	BlockHeader() (*vm.BlockHeader, error)
	BlockNumber() *big.Int
	BlockTime() uint64
	Addresses() *vm.Addresses
	ReadOnly() bool
	ReadOnlyState() StateReader
	StateDB() StateReader
	ChainConfig() *vm.ChainConfig
}

PrecompileEnvironment provides the execution environment for precompiled contracts

type PrecompiledContract

type PrecompiledContract interface {
	Run(input []byte) ([]byte, error)
	RequiredGas(input []byte) uint64
}

PrecompiledContract represents a precompiled contract

type RulesHooks

type RulesHooks interface {
	CanCreateContract(ac *AddressContext, gas uint64, state StateReader) (uint64, error)
	CanExecuteTransaction(from common.Address, to *common.Address, state StateReader) error
	ActivePrecompiles(existing []common.Address) []common.Address
	MinimumGasConsumption(x uint64) uint64
	PrecompileOverride(addr common.Address) (PrecompiledContract, bool)
}

RulesHooks interface for chain rules extensions

type StateReader

type StateReader interface {
	GetState(common.Address, common.Hash) common.Hash
	GetBalance(common.Address) *big.Int
	GetNonce(common.Address) uint64
	GetCode(common.Address) []byte
	GetCodeHash(common.Address) common.Hash
	GetCodeSize(common.Address) int
	Exist(common.Address) bool
	Empty(common.Address) bool
}

StateReader interface for reading state

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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