contract

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2022 License: GPL-3.0 Imports: 12 Imported by: 0

README

To generate gen_abis.go run

go run ./mycelo/internal/scripts/generate -buildpath $CELO_MONOREPO/packages/protocol/build/contracts

Documentation

Overview

Code generated by go generate; DO NOT EDIT. 2021-02-23 16:02:29.096161 -0600 CST m=+0.252353841

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AbiFor

func AbiFor(name string) *abi.ABI

AbiFor returns the ABI for one of the core contracts

Types

type CallOpts

type CallOpts struct {
	Origin common.Address
	Value  *big.Int
}

type EVMBackend

type EVMBackend struct {
	Address common.Address
	// contains filtered or unexported fields
}

EVMBackend represents a contract interface that talks directly to an EVM

func CoreContract

func CoreContract(cfg *runtime.Config, contractName string, address common.Address) *EVMBackend

CoreContract returns a contractBackend for a core contract

func DeployCoreContract

func DeployCoreContract(cfg *runtime.Config, contractName string, code []byte, params ...interface{}) (*EVMBackend, error)

DeployCoreContract deploys one of celo's core contracts

func DeployEVMBackend

func DeployEVMBackend(abi *abi.ABI, runtimeConfig *runtime.Config, code []byte, params ...interface{}) (*EVMBackend, error)

func NewEVMBackend

func NewEVMBackend(abi *abi.ABI, runtimeConfig *runtime.Config, receiver common.Address) *EVMBackend

NewEVMBackend creates a new EVM based contract

func ProxyContract

func ProxyContract(cfg *runtime.Config, contractName string, address common.Address) *EVMBackend

ProxyContract returns a contractBackend for a core contract's proxy

func (*EVMBackend) Call

func (ecb *EVMBackend) Call(opts CallOpts, method string, args ...interface{}) (uint64, error)

Call makes an evm call and returns error and gasLeft

func (*EVMBackend) Query

func (ecb *EVMBackend) Query(returnValue interface{}, method string, args ...interface{}) (uint64, error)

Query makes an evm call, populates the result into returnValue and returns error and gasLeft

func (*EVMBackend) SimpleCall

func (ecb *EVMBackend) SimpleCall(method string, args ...interface{}) error

SimpleCall makes an evm call and just returns the error status

func (*EVMBackend) SimpleCallFrom

func (ecb *EVMBackend) SimpleCallFrom(origin common.Address, method string, args ...interface{}) error

SimpleCallFrom makes an evm call with given sender address and just returns the error status

type TruffleReader

type TruffleReader interface {
	ReadBytecodeFor(name string) ([]byte, error)
	ReadDeployedBytecodeFor(name string) ([]byte, error)
	MustReadBytecodeFor(name string) []byte
	MustReadDeployedBytecodeFor(name string) []byte
}

func NewTruffleReader

func NewTruffleReader(buildPath string) TruffleReader

Jump to

Keyboard shortcuts

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