contracts

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: GPL-3.0, GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrSmartContractNotDeployed is returned when the RegisteredAddresses mapping does not contain the specified contract
	ErrSmartContractNotDeployed    = errors.New("Contract not in Registry")
	ErrRegistryContractNotDeployed = errors.New("Registry not deployed")
	ErrExchangeRateZero            = errors.New("Exchange rate returned from the network is zero")
)

Functions

func GetRegisteredAddress

func GetRegisteredAddress(vmRunner vm.EVMRunner, registryId common.Hash) (common.Address, error)

GetRegisteredAddress returns the address on the registry for a given id

Types

type BoundMethod

type BoundMethod struct {
	Method
	// contains filtered or unexported fields
}

BoundMethod represents a Method that is bounded to an address In particular, instead of address we use an address resolver to cope the fact that addresses need to be obtained from the Registry before making a call

func NewBoundMethod

func NewBoundMethod(contractAddress common.Address, abi *abi.ABI, methodName string, maxGas uint64) *BoundMethod

NewBoundMethod constructs a new bound method instance bound to the given address.

func NewRegisteredContractMethod

func NewRegisteredContractMethod(registryId common.Hash, abi *abi.ABI, methodName string, maxGas uint64) *BoundMethod

func (*BoundMethod) Execute

func (bm *BoundMethod) Execute(vmRunner vm.EVMRunner, result interface{}, value *big.Int, args ...interface{}) error

Execute executes the method with the given EVMRunner and unpacks the return value into result. If the method does not return a value then result should be nil.

func (*BoundMethod) Query

func (bm *BoundMethod) Query(vmRunner vm.EVMRunner, result interface{}, args ...interface{}) error

Query executes the method with the given EVMRunner as a read only action, the returned value is unpacked into result.

type Method

type Method struct {
	// contains filtered or unexported fields
}

Method represents a contract's method

func NewMethod

func NewMethod(abi *abi.ABI, method string, maxGas uint64) Method

NewMethod creates a new Method

func (Method) Bind

func (am Method) Bind(contractAddress common.Address) *BoundMethod

Bind returns a BoundMethod instance which can be used to call the contract method represented by am and residing at contracAddress.

Directories

Path Synopsis
You should have received a copy of the GNU General Public License along with MAP Protocol.
You should have received a copy of the GNU General Public License along with MAP Protocol.
You should have received a copy of the GNU General Public License along with MAP Protocol.
You should have received a copy of the GNU General Public License along with MAP Protocol.
You should have received a copy of the GNU General Public License along with MAP Protocol.
You should have received a copy of the GNU General Public License along with MAP Protocol.

Jump to

Keyboard shortcuts

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