Documentation ¶
Overview ¶
Package levm is a higher level wrapper for the EVM and the related StateDB. levm.go contains methods for creating the LEVM and deploying/calling contracts. db.go contains methods for interacting with the stateDB i.e. getting accounts and balances
Index ¶
- type Account
- type LEVM
- func (lvm *LEVM) CallContract(callerAddr, contractAddr common.Address, value *big.Int, inputs []byte) ([]byte, error)
- func (lvm *LEVM) CallContractABI(callerAddr, contractAddr common.Address, value *big.Int, abiObject abi.ABI, ...) ([]byte, error)
- func (lvm *LEVM) DB() *state.StateDB
- func (lvm *LEVM) DeployContract(fromAddr common.Address, contractData []byte) ([]byte, common.Address, uint64, error)
- func (lvm *LEVM) GetAccount(addr common.Address) Account
- func (lvm *LEVM) NewAccount(addr common.Address, balance *big.Int)
- func (lvm *LEVM) NewEVM(blockNumber *big.Int, origin common.Address)
- func (lvm *LEVM) SetAccount(addr common.Address, acc Account)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
Account is a simple representation of an account in the stateDB, for further controls call DB() to retrieve the db reference itself. Almost as a snapshot
type LEVM ¶
type LEVM struct {
// contains filtered or unexported fields
}
LEVM is a container for the go-ethereum EVM with methods to create and call contracts.
LEVM contains the two most important objects for interacting with the EVM: stateDB and vm.EVM. The LEVM should be created with the LEVM.New() method, unless you know what you doing.
func (*LEVM) CallContract ¶
func (lvm *LEVM) CallContract(callerAddr, contractAddr common.Address, value *big.Int, inputs []byte) ([]byte, error)
CallContract - make a call to a Contract Method using prepacked Inputs. To use ABI directly try lvm.CallContractABI()
func (*LEVM) CallContractABI ¶
func (lvm *LEVM) CallContractABI(callerAddr, contractAddr common.Address, value *big.Int, abiObject abi.ABI, funcName string, args ...interface{}) ([]byte, error)
CallContractABI - make a call to a Contract Method using the ABI.
func (*LEVM) DeployContract ¶
func (lvm *LEVM) DeployContract(fromAddr common.Address, contractData []byte) ([]byte, common.Address, uint64, error)
DeployContract will create and deploy a new contract from the contract data.
func (*LEVM) GetAccount ¶
GetAccount returns a copy of stateDB
func (*LEVM) NewAccount ¶
NewAccount Create a new Account and Set its balance