libevm

package
v1.13.14-0.3.0.rc.7 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 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 // equivalent to vm.ORIGIN op code
	// EVMSemantic addresses are those defined by the rules of the EVM, based on
	// the type of call made to a contract; i.e. the addresses pushed to the
	// stack by the vm.CALLER and vm.SELF op codes, respectively.
	EVMSemantic CallerAndSelf
	// Raw addresses are those that would be available to a contract under a
	// standard CALL; i.e. not interpreted according EVM rules. They are the
	// "intuitive" addresses such that the `Caller` is the account that called
	// `Self` even if it did so via DELEGATECALL or CALLCODE (in which cases
	// `Raw` and `EVMSemantic` would differ).
	//
	// Raw MUST NOT be nil when returned to a precompile implementation but MAY
	// be nil in other situations (e.g. hooks), which MUST document behaviour on
	// a case-by-case basis.
	Raw *CallerAndSelf
}

AddressContext carries addresses available to contexts such as calls and contract creation.

With respect to contract creation, the EVMSemantic.Self address MAY be the predicted address of the contract about to be deployed, which might not exist yet.

type CallerAndSelf

type CallerAndSelf struct {
	Caller common.Address
	Self   common.Address
}

CallerAndSelf carries said addresses for use in an AddressContext, where the definitions of `Caller` and `Self` are defined based on context.

type PrecompiledContract

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

PrecompiledContract is an exact copy of vm.PrecompiledContract, mirrored here for instances where importing that package would result in a circular dependency.

type StateReader

type StateReader interface {
	GetBalance(common.Address) *uint256.Int
	GetNonce(common.Address) uint64

	GetCodeHash(common.Address) common.Hash
	GetCode(common.Address) []byte
	GetCodeSize(common.Address) int

	GetRefund() uint64

	GetCommittedState(common.Address, common.Hash, ...stateconf.StateDBStateOption) common.Hash
	GetState(common.Address, common.Hash, ...stateconf.StateDBStateOption) common.Hash

	GetTransientState(addr common.Address, key common.Hash) common.Hash

	HasSelfDestructed(common.Address) bool

	Exist(common.Address) bool
	Empty(common.Address) bool

	AddressInAccessList(addr common.Address) bool
	SlotInAccessList(addr common.Address, slot common.Hash) (addressOk bool, slotOk bool)
}

StateReader is a subset of vm.StateDB, exposing only methods that read from but do not modify state. See method comments in vm.StateDB, which aren't copied here as they risk becoming outdated.

Directories

Path Synopsis
cmd
internalise command
The internalise command modifies Go files in place, making exported methods internal.
The internalise command modifies Go files in place, making exported methods internal.
Package ethapi exposes the internal ethapi package.
Package ethapi exposes the internal ethapi package.
Package ethtest provides utility functions for use in testing Ethereum-related functionality.
Package ethtest provides utility functions for use in testing Ethereum-related functionality.
Package hookstest provides test doubles and convenience wrappers for testing libevm hooks.
Package hookstest provides test doubles and convenience wrappers for testing libevm hooks.
Package legacy provides converters between legacy types and their refactored equivalents.
Package legacy provides converters between legacy types and their refactored equivalents.
Package options provides a generic mechanism for defining configuration of arbitrary types.
Package options provides a generic mechanism for defining configuration of arbitrary types.
Package pseudo provides a bridge between generic and non-generic code via pseudo-types and pseudo-values.
Package pseudo provides a bridge between generic and non-generic code via pseudo-types and pseudo-values.
Package register provides functionality for optional registration of types.
Package register provides functionality for optional registration of types.
Package set provides a generic implementation of a set.
Package set provides a generic implementation of a set.
Package stateconf configures state management.
Package stateconf configures state management.
Package sync extends the standard library's sync package.
Package sync extends the standard library's sync package.
Package testonly enforces functionality that MUST be limited to tests.
Package testonly enforces functionality that MUST be limited to tests.

Jump to

Keyboard shortcuts

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