Struct ethcontract::contract::Instance[][src]

pub struct Instance<T: Transport> {
    pub defaults: MethodDefaults,
    // some fields omitted
}
Expand description

Represents a contract instance at an address. Provides methods for contract interaction.

Fields

defaults: MethodDefaults

Default method parameters to use when sending method transactions or querying method calls.

Implementations

Creates a new contract instance with the specified web3 provider with the given Abi at the given Address.

Note that this does not verify that a contract with a matching Abi is actually deployed at the given address.

Creates a new contract instance with the specified web3 provider with the given Abi at the given Address and an optional transaction hash. This hash is used to retrieve contract related information such as the creation block (which is useful for fetching all historic events).

Note that this does not verify that a contract with a matching Abi is actually deployed at the given address nor that the transaction hash, when provided, is actually for this contract deployment.

Locates a deployed contract based on the current network ID reported by the web3 provider from the given Contract’s ABI and networks.

Note that this does not verify that a contract with a matching Abi is actually deployed at the given address.

Creates a contract builder with the specified web3 provider and the given Contract byte code. This allows the contract deployment transaction to be configured before deploying the contract.

Deploys a contract with the specified web3 provider with the given Contract byte code and linking libraries.

Retrieve the underlying web3 provider used by this contract instance.

Retrieves the contract ABI for this instance.

Returns the contract address being used by this instance.

Returns the hash for the transaction that deployed the contract if it is known, None otherwise.

Returns a method builder to setup a call or transaction on a smart contract method. Note that calls just get evaluated on a node but do not actually commit anything to the block chain.

Returns a view method builder to setup a call to a smart contract. View method builders can’t actually send transactions and only query contract state.

Returns a method builder to setup a call to a smart contract’s fallback function.

This method will error if the ABI does not contain an entry for a fallback function.

Returns a event builder to setup an event stream for a smart contract that emits events for the specified Solidity event by name.

Returns a log stream that emits a log for every new event emitted after the stream was created for this contract instance.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

The type of the contract instance being created.

Gets a reference the contract ABI.

Gets a reference to the contract bytecode.

Create a contract instance from the specified deployment.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.