Documentation ¶
Index ¶
- type WASMContract
- func (c *WASMContract) Address() common.Address
- func (c *WASMContract) AsDelegate() inter.Contract
- func (c *WASMContract) Caller() common.Address
- func (c *WASMContract) GetByte(n uint64) byte
- func (c *WASMContract) SetCallCode(addr *common.Address, hash common.Hash, code []byte)
- func (c *WASMContract) SetCode(hash common.Hash, code []byte)
- func (c *WASMContract) UseGas(gas uint64) (ok bool)
- func (c *WASMContract) Value() *big.Int
- type WASMContractRef
- type WasmCode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type WASMContract ¶
type WASMContract struct { // CallerAddress is the result of the caller which initialised this // contract. However when the "call method" is delegated this value // needs to be initialised to that of the caller's caller. CallerAddress common.Address Code []byte CodeHash common.Hash CodeAddr *common.Address Input []byte GasLimit uint64 Gas uint64 Args []byte DelegateCall bool // contains filtered or unexported fields }
Contract represents an VNTChain contract in the state database. It contains the the contract code, calling arguments. Contract implements ContractRef
func NewWASMContract ¶
func NewWASMContract(caller WASMContractRef, object WASMContractRef, value *big.Int, gas uint64) *WASMContract
NewWASMContract returns a new contract environment for the execution of WAVM.
func (*WASMContract) Address ¶
func (c *WASMContract) Address() common.Address
Address returns the contracts address
func (*WASMContract) AsDelegate ¶
func (c *WASMContract) AsDelegate() inter.Contract
AsDelegate sets the contract to be a delegate call and returns the current contract (for chaining calls)
func (*WASMContract) Caller ¶
func (c *WASMContract) Caller() common.Address
Caller returns the caller of the contract.
Caller will recursively call caller when the contract is a delegate call, including that of caller's caller.
func (*WASMContract) GetByte ¶
func (c *WASMContract) GetByte(n uint64) byte
GetByte returns the n'th byte in the contract's byte array
func (*WASMContract) SetCallCode ¶
SetCallCode sets the code of the contract and address of the backing data object
func (*WASMContract) SetCode ¶
func (c *WASMContract) SetCode(hash common.Hash, code []byte)
SetCode sets the code to the contract
func (*WASMContract) UseGas ¶
func (c *WASMContract) UseGas(gas uint64) (ok bool)
UseGas attempts the use gas and subtracts it and returns true on success
func (*WASMContract) Value ¶
func (c *WASMContract) Value() *big.Int
Value returns the contracts value (sent to it from it's caller)