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 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
pub async fn send(
&'_ self
) -> Result<PendingTransaction<'_, <M as Middleware>::Provider>, ContractError<M>>
pub async fn send(
&'_ self
) -> Result<PendingTransaction<'_, <M as Middleware>::Provider>, ContractError<M>>
Signs and broadcasts the provided transaction
Trait Implementations
Auto Trait Implementations
impl<M, D> RefUnwindSafe for ContractCall<M, D> where
D: RefUnwindSafe,
M: RefUnwindSafe,
impl<M, D> Send for ContractCall<M, D> where
D: Send,
M: Send + Sync,
impl<M, D> Sync for ContractCall<M, D> where
D: Sync,
M: Send + Sync,
impl<M, D> Unpin for ContractCall<M, D> where
D: Unpin,
impl<M, D> UnwindSafe for ContractCall<M, D> where
D: UnwindSafe,
M: RefUnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
pub fn vzip(self) -> V
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