Struct ethers::contract::builders::ContractCall[][src]

pub struct ContractCall<M, D> {
    pub tx: TypedTransaction,
    pub function: Function,
    pub block: Option<BlockId>,
    // some fields omitted
}
Expand description

Helper for managing a transaction before submitting it to a node

Fields

tx: TypedTransaction

The raw transaction object

function: Function

The ABI of the function being called

block: Option<BlockId>

Optional block number to be used when calculating the transaction’s gas and nonce

Implementations

Sets the from field in the transaction to the provided value

Uses a Legacy transaction instead of an EIP-1559 one to execute the call

Sets the gas field in the transaction to the provided value

Sets the gas_price field in the transaction to the provided value If the internal transaction is an EIP-1559 one, then it sets both max_fee_per_gas and max_priority_fee_per_gas to the same value

Sets the value field in the transaction to the provided value

Sets the block field for sending the tx to the chain

Returns the underlying transaction’s ABI encoded data

Returns the estimated gas cost for the underlying transaction to be executed

Queries the blockchain via an eth_call for the provided transaction.

If executed on a non-state mutating smart contract function (i.e. view, pure) then it will return the raw data from the chain.

If executed on a mutating smart contract function, it will do a “dry run” of the call and return the return type of the transaction without mutating the state

Note: this function does not send a transaction from your account

Signs and broadcasts the provided transaction

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

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

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)

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.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more