contracts

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2026 License: AGPL-3.0 Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Contract

type Contract struct {

	// PropertyTestMethods are the methods that are property tests.
	PropertyTestMethods []abi.Method

	// OptimizationTestMethods are the methods that are optimization tests.
	OptimizationTestMethods []abi.Method

	// AssertionTestMethods are ALL other methods that are not property or optimization tests by default.
	// If configured, the methods will be targeted or excluded based on the targetFunctionSignatures
	// and excludedFunctionSignatures, respectively.
	AssertionTestMethods []abi.Method
	// 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.

func (*Contract) WithExcludedAssertionMethods added in v0.1.4

func (c *Contract) WithExcludedAssertionMethods(excludedMethods []string) *Contract

WithExcludedAssertionMethods filters the assertion test methods to all methods not in excluded list.

func (*Contract) WithTargetedAssertionMethods added in v0.1.4

func (c *Contract) WithTargetedAssertionMethods(target []string) *Contract

WithTargetedAssertionMethods filters the assertion test methods to those in the target list.

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