contracts

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Contract

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

Contract describes a compiled smart contract.

func NewContract

func NewContract(name string, sourcePath string, compiledContract *types.CompiledContract, compilation *types.Compilation) *Contract

NewContract returns a new Contract instance with the provided information.

func (*Contract) Compilation added in v0.1.1

func (c *Contract) Compilation() *types.Compilation

Compilation returns the compilation which contains the CompiledContract.

func (*Contract) CompiledContract

func (c *Contract) CompiledContract() *types.CompiledContract

CompiledContract returns the compiled contract information including source mappings, byte code, and ABI.

func (*Contract) Name

func (c *Contract) Name() string

Name returns the name of the contract.

func (*Contract) SourcePath

func (c *Contract) SourcePath() string

SourcePath returns the path of the source file containing the contract.

type ContractMethodID

type ContractMethodID string

ContractMethodID is a string-based identifier which is meant to be unique for any contract-method definition pair, such that it can be used to index a specific contract method.

func GetContractMethodID

func GetContractMethodID(contract *Contract, method *abi.Method) ContractMethodID

GetContractMethodID returns a unique string for the contract and method definition provided. This is used to identify a contract and method definition and generate keys for mappings for a given method. It is unique between multiple compilations of the same origin contract.

type Contracts

type Contracts []*Contract

Contracts describes an array of contracts

func (Contracts) MatchBytecode

func (c Contracts) MatchBytecode(initBytecode []byte, runtimeBytecode []byte) *Contract

MatchBytecode takes init and/or runtime bytecode and attempts to match it to a contract definition in the current list of contracts. It returns the contract definition if found. Otherwise, it returns nil.

type DeployedContractMethod

type DeployedContractMethod struct {
	// Address represents the Ethereum address where the deployed contract containing the method exists.
	Address common.Address

	// Contract describes the contract which was deployed and contains the target method.
	Contract *Contract

	// Method describes the method which is available through the deployed contract.
	Method abi.Method
}

DeployedContractMethod describes a method which is accessible through a contract actively deployed on-chain.

Jump to

Keyboard shortcuts

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