pub trait FoundryTransactionBuilder<N: Network>: TransactionBuilder<N> {
Show 38 methods
// Required method
fn reset_gas_limit(&mut self);
// 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 fee_token(&self) -> Option<Address> { ... }
fn set_fee_token(&mut self, _fee_token: Address) { ... }
fn with_fee_token(self, fee_token: Address) -> Self { ... }
fn nonce_key(&self) -> Option<U256> { ... }
fn set_nonce_key(&mut self, _nonce_key: U256) { ... }
fn with_nonce_key(self, nonce_key: U256) -> Self { ... }
fn key_id(&self) -> Option<Address> { ... }
fn set_key_id(&mut self, _key_id: Address) { ... }
fn with_key_id(self, key_id: Address) -> Self { ... }
fn valid_before(&self) -> Option<u64> { ... }
fn set_valid_before(&mut self, _valid_before: u64) { ... }
fn with_valid_before(self, valid_before: u64) -> Self { ... }
fn valid_after(&self) -> Option<u64> { ... }
fn set_valid_after(&mut self, _valid_after: u64) { ... }
fn with_valid_after(self, valid_after: u64) -> Self { ... }
fn fee_payer_signature(&self) -> Option<Signature> { ... }
fn set_fee_payer_signature(&mut self, _signature: Signature) { ... }
fn with_fee_payer_signature(self, signature: Signature) -> Self { ... }
fn compute_sponsor_hash(&self, _from: Address) -> Option<B256> { ... }
}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:
FoundryTransactionBuilder::max_fee_per_blob_gasFoundryTransactionBuilder::set_max_fee_per_blob_gasFoundryTransactionBuilder::blob_versioned_hashesFoundryTransactionBuilder::set_blob_versioned_hashesFoundryTransactionBuilder::blob_sidecarFoundryTransactionBuilder::set_blob_sidecar
If the Network supports EIP-7702 authorization lists, implement these methods:
If the Network supports Tempo transactions, implement these methods:
Required Methods§
Sourcefn reset_gas_limit(&mut self)
fn reset_gas_limit(&mut self)
Reset gas limit
Provided Methods§
Sourcefn max_fee_per_blob_gas(&self) -> Option<u128>
fn max_fee_per_blob_gas(&self) -> Option<u128>
Get the max fee per blob gas for the transaction.
Sourcefn set_max_fee_per_blob_gas(&mut self, _max_fee_per_blob_gas: u128)
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.
Sourcefn with_max_fee_per_blob_gas(self, max_fee_per_blob_gas: u128) -> Self
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.
Sourcefn blob_versioned_hashes(&self) -> Option<&[B256]>
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.
Sourcefn set_blob_versioned_hashes(&mut self, _hashes: Vec<B256>)
fn set_blob_versioned_hashes(&mut self, _hashes: Vec<B256>)
Sets the EIP-4844 blob versioned hashes of the transaction.
Sourcefn with_blob_versioned_hashes(self, hashes: Vec<B256>) -> Self
fn with_blob_versioned_hashes(self, hashes: Vec<B256>) -> Self
Builder-pattern method for setting the EIP-4844 blob versioned hashes.
Sourcefn blob_sidecar(&self) -> Option<&BlobTransactionSidecarVariant>
fn blob_sidecar(&self) -> Option<&BlobTransactionSidecarVariant>
Gets the blob sidecar (either EIP-4844 or EIP-7594 variant) of the transaction.
Sourcefn set_blob_sidecar(&mut self, _sidecar: BlobTransactionSidecarVariant)
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]
Sourcefn with_blob_sidecar(self, sidecar: BlobTransactionSidecarVariant) -> Self
fn with_blob_sidecar(self, sidecar: BlobTransactionSidecarVariant) -> Self
Builder-pattern method for setting the blob sidecar of the transaction.
Sourcefn blob_sidecar_4844(&self) -> Option<&BlobTransactionSidecar>
fn blob_sidecar_4844(&self) -> Option<&BlobTransactionSidecar>
Gets the EIP-4844 blob sidecar if the current sidecar is of that variant.
Sourcefn set_blob_sidecar_4844(&mut self, sidecar: BlobTransactionSidecar)
fn set_blob_sidecar_4844(&mut self, sidecar: BlobTransactionSidecar)
Sets the EIP-4844 blob sidecar of the transaction.
Sourcefn with_blob_sidecar_4844(self, sidecar: BlobTransactionSidecar) -> Self
fn with_blob_sidecar_4844(self, sidecar: BlobTransactionSidecar) -> Self
Builder-pattern method for setting the EIP-4844 blob sidecar of the transaction.
Sourcefn blob_sidecar_7594(&self) -> Option<&BlobTransactionSidecarEip7594>
fn blob_sidecar_7594(&self) -> Option<&BlobTransactionSidecarEip7594>
Gets the EIP-7594 blob sidecar if the current sidecar is of that variant.
Sourcefn set_blob_sidecar_7594(&mut self, sidecar: BlobTransactionSidecarEip7594)
fn set_blob_sidecar_7594(&mut self, sidecar: BlobTransactionSidecarEip7594)
Sets the EIP-7594 blob sidecar of the transaction.
Sourcefn with_blob_sidecar_7594(self, sidecar: BlobTransactionSidecarEip7594) -> Self
fn with_blob_sidecar_7594(self, sidecar: BlobTransactionSidecarEip7594) -> Self
Builder-pattern method for setting the EIP-7594 blob sidecar of the transaction.
Get the EIP-7702 authorization list for the transaction.
Sets the EIP-7702 authorization list.
Builder-pattern method for setting the authorization list.
Sourcefn set_fee_token(&mut self, _fee_token: Address)
fn set_fee_token(&mut self, _fee_token: Address)
Set the fee token for a Tempo transaction.
Sourcefn with_fee_token(self, fee_token: Address) -> Self
fn with_fee_token(self, fee_token: Address) -> Self
Builder-pattern method for setting the Tempo fee token.
Sourcefn set_nonce_key(&mut self, _nonce_key: U256)
fn set_nonce_key(&mut self, _nonce_key: U256)
Set the 2D nonce key for the Tempo transaction.
Sourcefn with_nonce_key(self, nonce_key: U256) -> Self
fn with_nonce_key(self, nonce_key: U256) -> Self
Builder-pattern method for setting a 2D nonce key for a Tempo transaction.
Sourcefn set_key_id(&mut self, _key_id: Address)
fn set_key_id(&mut self, _key_id: Address)
Set the access key ID for a Tempo transaction.
Used during gas estimation to override the key_id that would normally be recovered from the signature.
Sourcefn with_key_id(self, key_id: Address) -> Self
fn with_key_id(self, key_id: Address) -> Self
Builder-pattern method for setting the Tempo access key ID.
Sourcefn valid_before(&self) -> Option<u64>
fn valid_before(&self) -> Option<u64>
Get the valid_before timestamp for a Tempo expiring nonce transaction.
Sourcefn set_valid_before(&mut self, _valid_before: u64)
fn set_valid_before(&mut self, _valid_before: u64)
Set the valid_before timestamp for a Tempo expiring nonce transaction.
Sourcefn with_valid_before(self, valid_before: u64) -> Self
fn with_valid_before(self, valid_before: u64) -> Self
Builder-pattern method for setting the valid_before timestamp.
Sourcefn valid_after(&self) -> Option<u64>
fn valid_after(&self) -> Option<u64>
Get the valid_after timestamp for a Tempo expiring nonce transaction.
Sourcefn set_valid_after(&mut self, _valid_after: u64)
fn set_valid_after(&mut self, _valid_after: u64)
Set the valid_after timestamp for a Tempo expiring nonce transaction.
Sourcefn with_valid_after(self, valid_after: u64) -> Self
fn with_valid_after(self, valid_after: u64) -> Self
Builder-pattern method for setting the valid_after timestamp.
Sourcefn fee_payer_signature(&self) -> Option<Signature>
fn fee_payer_signature(&self) -> Option<Signature>
Get the fee payer (sponsor) signature for a Tempo sponsored transaction.
Sourcefn set_fee_payer_signature(&mut self, _signature: Signature)
fn set_fee_payer_signature(&mut self, _signature: Signature)
Set the fee payer (sponsor) signature for a Tempo sponsored transaction.
Sourcefn with_fee_payer_signature(self, signature: Signature) -> Self
fn with_fee_payer_signature(self, signature: Signature) -> Self
Builder-pattern method for setting the fee payer signature.
Sourcefn compute_sponsor_hash(&self, _from: Address) -> Option<B256>
fn compute_sponsor_hash(&self, _from: Address) -> Option<B256>
Computes the sponsor (fee payer) signature hash for this transaction.
This builds an unsigned consensus-level transaction from the request and computes
the hash that a sponsor needs to sign. Returns None for networks that don’t
support sponsored transactions.
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.