Documentation
¶
Index ¶
- Constants
- type Address
- type CallKind
- type Capability
- type Error
- type Hash
- type HostContext
- type Revision
- type StorageStatus
- type TxContext
- type VM
- func (vm *VM) Destroy()
- func (vm *VM) Execute(ctx HostContext, rev Revision, kind CallKind, static bool, depth int, ...) (output []byte, gasLeft int64, err error)
- func (vm *VM) HasCapability(capability Capability) bool
- func (vm *VM) Name() string
- func (vm *VM) SetOption(name string, value string) (err error)
- func (vm *VM) Version() string
Constants ¶
View Source
const ( Failure = Error(C.EVMC_FAILURE) Revert = Error(C.EVMC_REVERT) )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Address ¶
type Address [addressLength]byte
Address represents the 20 byte address of an Ethereum account.
type CallKind ¶
type CallKind int
const ( Call CallKind = C.EVMC_CALL DelegateCall CallKind = C.EVMC_DELEGATECALL CallCode CallKind = C.EVMC_CALLCODE Create CallKind = C.EVMC_CREATE Create2 CallKind = C.EVMC_CREATE2 )
type Capability ¶
type Capability uint32
const ( CapabilityEVM1 Capability = C.EVMC_CAPABILITY_EVM1 CapabilityEWASM Capability = C.EVMC_CAPABILITY_EWASM )
type Hash ¶
type Hash [hashLength]byte
Hash represents the 32 byte Keccak256 hash of arbitrary data.
type HostContext ¶
type HostContext interface { AccountExists(addr Address) bool GetStorage(addr Address, key Hash) Hash SetStorage(addr Address, key Hash, value Hash) StorageStatus GetBalance(addr Address) Hash GetCodeSize(addr Address) int GetCodeHash(addr Address) Hash GetCode(addr Address) []byte Selfdestruct(addr Address, beneficiary Address) GetTxContext() TxContext GetBlockHash(number int64) Hash EmitLog(addr Address, topics []Hash, data []byte) Call(kind CallKind, destination Address, sender Address, value *big.Int, input []byte, gas int64, depth int, static bool, salt *big.Int) (output []byte, gasLeft int64, createAddr Address, err error) }
type Revision ¶
type Revision int32
const ( Frontier Revision = C.EVMC_FRONTIER Homestead Revision = C.EVMC_HOMESTEAD TangerineWhistle Revision = C.EVMC_TANGERINE_WHISTLE SpuriousDragon Revision = C.EVMC_SPURIOUS_DRAGON Byzantium Revision = C.EVMC_BYZANTIUM Constantinople Revision = C.EVMC_CONSTANTINOPLE Petersburg Revision = C.EVMC_PETERSBURG Istanbul Revision = C.EVMC_ISTANBUL )
type StorageStatus ¶
type StorageStatus int
const ( StorageUnchanged StorageStatus = C.EVMC_STORAGE_UNCHANGED StorageModified StorageStatus = C.EVMC_STORAGE_MODIFIED StorageModifiedAgain StorageStatus = C.EVMC_STORAGE_MODIFIED_AGAIN StorageAdded StorageStatus = C.EVMC_STORAGE_ADDED StorageDeleted StorageStatus = C.EVMC_STORAGE_DELETED )
type TxContext ¶
type TxContext struct { GasPrice Hash Origin Address Coinbase Address Number int64 Timestamp int64 GasLimit int64 Difficulty Hash ChainID Hash }
TxContext contains information about current transaction and block.
type VM ¶
type VM struct {
// contains filtered or unexported fields
}
func LoadAndConfigure ¶
func (*VM) HasCapability ¶
func (vm *VM) HasCapability(capability Capability) bool
Click to show internal directories.
Click to hide internal directories.