evm_old

package
v0.0.0-...-8526a12 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultEthChainCfg = &params.ChainConfig{
	ChainID:             big.NewInt(1),
	HomesteadBlock:      onFork,
	DAOForkBlock:        onFork,
	DAOForkSupport:      true,
	EIP150Block:         onFork,
	EIP150Hash:          gcommon.Hash{},
	EIP155Block:         onFork,
	EIP158Block:         onFork,
	ByzantiumBlock:      onFork,
	ConstantinopleBlock: onFork,
	PetersburgBlock:     onFork,
	IstanbulBlock:       onFork,
	MuirGlacierBlock:    onFork,
	BerlinBlock:         onFork,
	LondonBlock:         onFork,
	CatalystBlock:       onFork,
	Ethash:              nil,
	Clique:              nil,
}

Functions

func ApplyTxn

func ApplyTxn(
	block *Block,
	chain IBlockChain,
	statedb *gstate.StateDB,
	to common.Address,
	code []byte,
	value, gasFeeCap, gasTipCap uint64,
) error

func CanTransfer

func CanTransfer(db vm.StateDB, addr gcommon.Address, amount *big.Int) bool

CanTransfer checks whether there are enough funds in the address' account to make a transfer. This does not take the necessary gas in to account to make the transfer valid.

func GetHashFn

func GetHashFn(ref *gtypes.Header, chain IBlockChain) func(n uint64) gcommon.Hash

GetHashFn returns a GetHashFunc which retrieves header hashes by number

func HeaderToGeth

func HeaderToGeth(header *types.Header) *gtypes.Header

func NewDefaultEVM

func NewDefaultEVM(header *Header, chain IBlockChain, statedb vm.StateDB) *vm.EVM

func NewEVM

func NewEVM(
	header *Header,
	chain IBlockChain,
	statedb vm.StateDB,
	chainCfg *params.ChainConfig,
	txCtx vm.TxContext,
	cfg vm.Config,
	author common.Address,
) *vm.EVM

func NewEVMBlockContext

func NewEVMBlockContext(yheader *Header, chain IBlockChain, author *gcommon.Address) vm.BlockContext

NewEVMBlockContext creates a new context for use in the EVM.

func Transfer

func Transfer(db vm.StateDB, sender, recipient gcommon.Address, amount *big.Int)

Transfer subtracts amount from sender and adds amount to recipient using the given Db

Types

This section is empty.

Jump to

Keyboard shortcuts

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