Documentation ¶
Overview ¶
Package contract defines the Contract API. All chains that have "smart contracts" should implement this API. UTXO-based chains that support scripting must not attempt to implementing scripting using this API.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CallData ¶
CallData is used to specify a function and its parameters when invoking business logic on a contract.
func (CallData) Marshal ¶
Marshal the address to binary. You should not call this function directly, unless you are implementing marshalling for a container type.
type Caller ¶
type Caller interface { // CallContract at the specified address, using the specified calldata as // input (this encodes the function and its parameters). The function output // is returned as raw uninterpreted bytes. It is up to the application to // interpret these bytes in a meaningful way. If the call cannot be // completed before the context is done, or the call is invalid, then an // error should be returned. CallContract(context.Context, address.Address, CallData) (pack.Bytes, error) }
The Caller interface defines the functionality required to call readonly functions on a contract. Calling functions that mutate contract state should be done using the Account API.