Skip to main content

FoundryTransactionBuilder

Trait FoundryTransactionBuilder 

Source
pub trait FoundryTransactionBuilder<N: Network>:
    TransactionBuilder<N>
    + Default
    + Sized
    + Send
    + Sync
    + 'static {
Show 22 methods // Provided methods fn max_fee_per_blob_gas(&self) -> Option<u128> { ... } fn set_max_fee_per_blob_gas(&mut self, _max_fee_per_blob_gas: u128) { ... } fn with_max_fee_per_blob_gas(self, max_fee_per_blob_gas: u128) -> Self { ... } fn blob_versioned_hashes(&self) -> Option<&[B256]> { ... } fn set_blob_versioned_hashes(&mut self, _hashes: Vec<B256>) { ... } fn with_blob_versioned_hashes(self, hashes: Vec<B256>) -> Self { ... } fn blob_sidecar(&self) -> Option<&BlobTransactionSidecarVariant> { ... } fn set_blob_sidecar(&mut self, _sidecar: BlobTransactionSidecarVariant) { ... } fn with_blob_sidecar(self, sidecar: BlobTransactionSidecarVariant) -> Self { ... } fn blob_sidecar_4844(&self) -> Option<&BlobTransactionSidecar> { ... } fn set_blob_sidecar_4844(&mut self, sidecar: BlobTransactionSidecar) { ... } fn with_blob_sidecar_4844(self, sidecar: BlobTransactionSidecar) -> Self { ... } fn blob_sidecar_7594(&self) -> Option<&BlobTransactionSidecarEip7594> { ... } fn set_blob_sidecar_7594(&mut self, sidecar: BlobTransactionSidecarEip7594) { ... } fn with_blob_sidecar_7594( self, sidecar: BlobTransactionSidecarEip7594, ) -> Self { ... } fn authorization_list(&self) -> Option<&Vec<SignedAuthorization>> { ... } fn set_authorization_list( &mut self, _authorization_list: Vec<SignedAuthorization>, ) { ... } fn with_authorization_list( self, authorization_list: Vec<SignedAuthorization>, ) -> Self { ... } fn set_fee_token(&mut self, _fee_token: Address) { ... } fn with_fee_token(self, fee_token: Address) -> Self { ... } fn set_nonce_key(&mut self, _nonce_key: U256) { ... } fn with_nonce_key(self, nonce_key: U256) -> Self { ... }
}
Expand description

Composite transaction builder trait for Foundry transactions.

This extends the base TransactionBuilder trait with the same methods as [alloy_network::TransactionBuilder4844] for handling blob transaction sidecars, and [alloy_network::TransactionBuilder7702] for handling EIP-7702 authorization lists.

By default, all methods have no-op implementations, so this can be implemented for any Network.

If the Network supports Eip4844 blob transactions implement these methods:

If the Network supports EIP-7702 authorization lists, implement these methods:

If the Network supports Tempo transactions, implement these methods:

Provided Methods§

Source

fn max_fee_per_blob_gas(&self) -> Option<u128>

Get the max fee per blob gas for the transaction.

Source

fn set_max_fee_per_blob_gas(&mut self, _max_fee_per_blob_gas: u128)

Set the max fee per blob gas for the transaction.

Source

fn with_max_fee_per_blob_gas(self, max_fee_per_blob_gas: u128) -> Self

Builder-pattern method for setting max fee per blob gas.

Source

fn blob_versioned_hashes(&self) -> Option<&[B256]>

Gets the EIP-4844 blob versioned hashes of the transaction.

These may be set independently of the sidecar, e.g. when the sidecar has been pruned but the hashes are still needed for eth_call.

Source

fn set_blob_versioned_hashes(&mut self, _hashes: Vec<B256>)

Sets the EIP-4844 blob versioned hashes of the transaction.

Source

fn with_blob_versioned_hashes(self, hashes: Vec<B256>) -> Self

Builder-pattern method for setting the EIP-4844 blob versioned hashes.

Source

fn blob_sidecar(&self) -> Option<&BlobTransactionSidecarVariant>

Gets the blob sidecar (either EIP-4844 or EIP-7594 variant) of the transaction.

Source

fn set_blob_sidecar(&mut self, _sidecar: BlobTransactionSidecarVariant)

Sets the blob sidecar (either EIP-4844 or EIP-7594 variant) of the transaction.

Note: This will also set the versioned blob hashes accordingly: [BlobTransactionSidecarVariant::versioned_hashes]

Source

fn with_blob_sidecar(self, sidecar: BlobTransactionSidecarVariant) -> Self

Builder-pattern method for setting the blob sidecar of the transaction.

Source

fn blob_sidecar_4844(&self) -> Option<&BlobTransactionSidecar>

Gets the EIP-4844 blob sidecar if the current sidecar is of that variant.

Source

fn set_blob_sidecar_4844(&mut self, sidecar: BlobTransactionSidecar)

Sets the EIP-4844 blob sidecar of the transaction.

Source

fn with_blob_sidecar_4844(self, sidecar: BlobTransactionSidecar) -> Self

Builder-pattern method for setting the EIP-4844 blob sidecar of the transaction.

Source

fn blob_sidecar_7594(&self) -> Option<&BlobTransactionSidecarEip7594>

Gets the EIP-7594 blob sidecar if the current sidecar is of that variant.

Source

fn set_blob_sidecar_7594(&mut self, sidecar: BlobTransactionSidecarEip7594)

Sets the EIP-7594 blob sidecar of the transaction.

Source

fn with_blob_sidecar_7594(self, sidecar: BlobTransactionSidecarEip7594) -> Self

Builder-pattern method for setting the EIP-7594 blob sidecar of the transaction.

Source

fn authorization_list(&self) -> Option<&Vec<SignedAuthorization>>

Get the EIP-7702 authorization list for the transaction.

Source

fn set_authorization_list( &mut self, _authorization_list: Vec<SignedAuthorization>, )

Sets the EIP-7702 authorization list.

Source

fn with_authorization_list( self, authorization_list: Vec<SignedAuthorization>, ) -> Self

Builder-pattern method for setting the authorization list.

Source

fn set_fee_token(&mut self, _fee_token: Address)

Set the fee token for a Tempo transaction.

Source

fn with_fee_token(self, fee_token: Address) -> Self

Builder-pattern method for setting the Tempo fee token.

Source

fn set_nonce_key(&mut self, _nonce_key: U256)

Set the 2D nonce key for the Tempo transaction.

Source

fn with_nonce_key(self, nonce_key: U256) -> Self

Builder-pattern method for setting a 2D nonce key for a Tempo transaction.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl FoundryTransactionBuilder<AnyNetwork> for <AnyNetwork as Network>::TransactionRequest

Source§

fn max_fee_per_blob_gas(&self) -> Option<u128>

Source§

fn set_max_fee_per_blob_gas(&mut self, max_fee_per_blob_gas: u128)

Source§

fn blob_versioned_hashes(&self) -> Option<&[B256]>

Source§

fn set_blob_versioned_hashes(&mut self, hashes: Vec<B256>)

Source§

fn blob_sidecar(&self) -> Option<&BlobTransactionSidecarVariant>

Source§

fn set_blob_sidecar(&mut self, sidecar: BlobTransactionSidecarVariant)

Source§

fn authorization_list(&self) -> Option<&Vec<SignedAuthorization>>

Source§

fn set_authorization_list( &mut self, authorization_list: Vec<SignedAuthorization>, )

Source§

impl FoundryTransactionBuilder<TempoNetwork> for <TempoNetwork as Network>::TransactionRequest

Source§

fn authorization_list(&self) -> Option<&Vec<SignedAuthorization>>

Source§

fn set_authorization_list( &mut self, authorization_list: Vec<SignedAuthorization>, )

Source§

fn set_fee_token(&mut self, fee_token: Address)

Source§

fn set_nonce_key(&mut self, nonce_key: U256)

Implementors§