contract

package
v1.8.3 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

README

To generate gen_abis.go run

Using the monorepo_commit file:

go run ./mycelo/internal/scripts/generate -buildpath ./compiled-system-contracts

For a custom one:

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

Documentation

Overview

Code generated by go generate; DO NOT EDIT. 2023-07-05 07:15:33.1771 -0300 -03 m=+0.311256855

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(subpath, name string) ([]byte, error)
	ReadDeployedBytecodeFor(subpath, name string) ([]byte, error)
	MustReadBytecodeFor(subpath, name string) []byte
	MustReadDeployedBytecodeFor(subpath, 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