Documentation ¶
Overview ¶
Package contracts provide a way to interact with a smart contract
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Contract ¶
type Contract struct { Abi gethABI.ABI // ABI of the contract Function map[string]ContractFunction From string // sender of the transaction // contains filtered or unexported fields }
Contract structure represent a contract with different useful attribute
func InitalizeContract ¶
func InitalizeContract(ep *rpc.Endpoint, contractAddr string, sendingAddr string, abiDefinition io.Reader) (*Contract, error)
Use to Initialize a new contract Multiple parameters are needed: 1) the endpoint structure 2) the contract address 3) the sendingAddr: the address used to send transaction to this contract 4) the ABI definition of the contract
type ContractFunction ¶
type ContractFunction struct { Name string // contains filtered or unexported fields }
ContractFunction Structure is used to represent the function a contract might have.
func (ContractFunction) Call ¶
func (cf ContractFunction) Call(arguments ...interface{}) ([]interface{}, error)
Call can only be used on a ContractFunction struct. It will simply called the ContractFunction cf with the undefined number of argument the user will give to it.
Click to show internal directories.
Click to hide internal directories.