contract

package
v0.0.0-...-d9f2ef2 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2020 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Overview

Copyright (c) 2018 Clearmatics Technologies Ltd

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallContract

func CallContract(
	ctx context.Context,
	client bind.ContractCaller,
	contract *compiler.Contract,
	from, to common.Address,
	methodName string,
	out interface{},
	args ...interface{},
) (res interface{}, err error)

CallContract without changing the state

func CompileContract

func CompileContract(contract string) (compiledContract *compiler.Contract, err error)

func CompileContractAt

func CompileContractAt(contractPath string) (compiledContract *compiler.Contract, err error)

func CompileContractWithLibraries

func CompileContractWithLibraries(contractPath string, libraries map[string]common.Address) (compiledContract *compiler.Contract, err error)

func CompilePayload

func CompilePayload(
	binStr string,
	abiStr string,
	constructorArgs ...interface{},
) []byte

func DeployContract

func DeployContract(
	ctx context.Context,
	backend bind.ContractBackend,
	userKey *ecdsa.PrivateKey,
	payload []byte,
	amount *big.Int,
	gasLimit uint64,
) (*types.Transaction, error)

func GetContractBytecodeAndABI

func GetContractBytecodeAndABI(c *compiler.Contract) (string, string)

func TransactionContract

func TransactionContract(
	ctx context.Context,
	backend bind.ContractBackend,
	userKey *ecdsa.PrivateKey,
	contract *compiler.Contract,
	to common.Address,
	amount *big.Int,
	gasLimit uint64,
	methodName string,
	args ...interface{},
) (*types.Transaction, error)

TransactionContract execute function in contract

Types

type ContractInstance

type ContractInstance struct {
	Contract *compiler.Contract
	Abi      *abi.ABI
	Path     string
}

ContractInstance is just an util type to output contract and address

Jump to

Keyboard shortcuts

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