evm

package
v0.0.0-...-85922c0 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseCallResultToBig

func ParseCallResultToBig(result string) *big.Int

parse token decimal or totalSupply by call result.

func ParseCallResultToString

func ParseCallResultToString(result string) string

parse token name or symbol by call result.

Types

type Evm

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

Evm struct

func NewEvm

func NewEvm(sdb *state.StateDB, chainId int64, gasLimit, gasPrice uint64) *Evm

func (*Evm) AddBalance

func (e *Evm) AddBalance(addr common.Address, amount *big.Int)

Add Balance

func (*Evm) AddLog

func (e *Evm) AddLog(lg *types.Log)

Add log

func (*Evm) Call

func (e *Evm) Call(contAddr common.Address, origin common.Address, inputCode []byte) ([]byte, uint64, error)

Call contract

func (*Evm) Create

func (e *Evm) Create(code []byte, origin common.Address) ([]byte, common.Address, uint64, error)

Create a contract

func (*Evm) GetBalance

func (e *Evm) GetBalance(addr common.Address) *big.Int

Get Balance

func (*Evm) GetCode

func (e *Evm) GetCode(contAddr common.Address) []byte

Get contract bytecode

func (*Evm) GetConfig

func (e *Evm) GetConfig() *runtime.Config

Get evm Config

func (*Evm) GetLogs

func (e *Evm) GetLogs(txHash, blockH common.Hash) []*types.Log

Get logs

func (*Evm) GetNonce

func (e *Evm) GetNonce(addr common.Address) uint64

Get Nonce

func (*Evm) GetSnapshot

func (e *Evm) GetSnapshot() int

Get Snapshot

func (*Evm) GetStorageAt

func (e *Evm) GetStorageAt(addr common.Address, hash common.Hash) common.Hash

Get Storage At address

func (*Evm) Logs

func (e *Evm) Logs() []*types.Log

Get logs

func (*Evm) Prepare

func (e *Evm) Prepare(txhash, blhash common.Hash, txindex int)

Prepare hash into evm

func (*Evm) RawDump

func (e *Evm) RawDump() state.Dump

Get evm dump

func (*Evm) RevertToSnapshot

func (e *Evm) RevertToSnapshot(sp int)

Revert Snapshot to a position

func (*Evm) SetBalance

func (e *Evm) SetBalance(addr common.Address, amount *big.Int)

Set Balance

func (*Evm) SetBlockInfo

func (e *Evm) SetBlockInfo(num, tm uint64, miner common.Address, difficulty *big.Int)

SetBlockInfo set block info into evm

func (*Evm) SetCode

func (e *Evm) SetCode(contAddr common.Address, code []byte)

func (*Evm) SetConfig

func (e *Evm) SetConfig(val, price *big.Int, limit uint64, origin common.Address)

Set evm cfg

func (*Evm) SetNonce

func (e *Evm) SetNonce(addr common.Address, nonce uint64)

Set Nonce

func (*Evm) SubBalance

func (e *Evm) SubBalance(addr common.Address, amount *big.Int)

Sub Balance

Jump to

Keyboard shortcuts

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