levm

package
v0.0.0-...-fb320be Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2021 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EVMConfig

type EVMConfig struct {
	ChainConfig *params.ChainConfig
	Difficulty  *big.Int
	Origin      common.Address
	Coinbase    common.Address
	BlockNumber *big.Int
	Time        *big.Int
	GasLimit    uint64
	GasPrice    *big.Int
	Value       *big.Int
	Debug       bool
	EVMConfig   vm.Config
	BaseFee     *big.Int

	State     *state.StateDB
	GetHashFn func(n uint64) common.Hash
}

func (*EVMConfig) SetDefaults

func (cfg *EVMConfig) SetDefaults()

sets defaults on the config

type LEVM

type LEVM struct {
	EVMConfig EVMConfig
	Evm       *vm.EVM
}

Lonely EVM,封装了调用evm的方法。

func (*LEVM) Call

func (levm *LEVM) Call(from string, contractAddress string, data string, gas uint64, value *big.Int) ([]byte, uint64, error)

调用合约

func (*LEVM) CreateEVM

func (levm *LEVM) CreateEVM()

func (*LEVM) Deploy

func (levm *LEVM) Deploy(from string, data string, gas uint64, value *big.Int) (string, uint64, error)

部署合约 @from 部署发起者 @data hex格式的智能合约代码

func (*LEVM) Init

func (levm *LEVM) Init()

Jump to

Keyboard shortcuts

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