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) SourcePath ¶
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 ¶
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.