contracts

package
v0.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 24, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL