libevm

package
v1.13.14-0.2.0.release Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2025 License: GPL-3.0 Imports: 2 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
	Caller common.Address // equivalent to vm.CALLER op code
	Self   common.Address // equivalent to vm.ADDRESS op code
}

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

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

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) common.Hash
	GetState(common.Address, common.Hash) 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
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 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