SeismicFoundry
Development network type for Sanvil (Seismic Anvil) local testing
SeismicFoundry is the network type for connecting to Sanvil (Seismic Anvil), the local development node. Use it when running integration tests or developing locally.
Overview
SeismicFoundry implements both Alloy's Network trait and the SeismicNetwork trait, just like SeismicReth. The key difference is that it uses Foundry-compatible transaction types that match Sanvil's expected formats.
Sanvil is Seismic's modified version of Foundry's Anvil. It supports the same Seismic transaction type (0x4A) but uses slightly different envelope and request types that are compatible with the Foundry toolchain.
Definition
#[derive(Clone, Copy, Debug)]
pub struct SeismicFoundry {
_private: (),
}Like SeismicReth, SeismicFoundry is a zero-sized type used purely as a type parameter.
Associated Types
TxType
SeismicFoundryTxType
Transaction type enum (Foundry-compatible)
TxEnvelope
SeismicFoundryTxEnvelope
Signed transaction container (Foundry-compatible)
UnsignedTx
SeismicFoundryTypedTransaction
Unsigned transaction before signing
ReceiptEnvelope
SeismicFoundryReceiptEnvelope
Transaction receipt container
Header
alloy_consensus::Header
Standard block header
TransactionRequest
SeismicFoundryTransactionRequest
Builder for transaction parameters
TransactionResponse
Transaction<SeismicFoundryTxEnvelope>
RPC response for transaction queries
ReceiptResponse
SeismicFoundryTransactionReceipt
RPC response for receipt queries
HeaderResponse
Header
RPC response for header queries
BlockResponse
Block<TransactionResponse, HeaderResponse>
RPC response for block queries
Differences from SeismicReth
Target node
reth-based Seismic node
Sanvil (Foundry-based)
Envelope type
SeismicTxEnvelope
SeismicFoundryTxEnvelope
Request type
SeismicTransactionRequest
SeismicFoundryTransactionRequest
Receipt type
SeismicReceiptEnvelope
SeismicFoundryReceiptEnvelope
Use case
Production, testnet, devnet
Local development, testing
Chain ID
Varies (e.g., 5124 for testnet)
Typically 31337
Usage
With SeismicProviderBuilder (Signed)
Unsigned Provider (Read-Only)
SeismicProviderBuilder with Foundry
To use SeismicFoundry, call .foundry() on the builder to switch from the default SeismicReth network:
.foundry()
Switch to SeismicFoundry network type
.wallet(wallet)
Set the wallet for signing transactions
.connect_http(url)
Connect to an HTTP RPC endpoint and build the provider
Signed Provider
.foundry()
Yes
Selects SeismicFoundry network
.wallet(wallet)
Yes
Wallet containing signers
.connect_http(url)
Yes
RPC endpoint URL (typically http://127.0.0.1:8545)
Returns: A fully configured signed provider for Sanvil.
Unsigned Provider
.foundry()
Yes
Selects SeismicFoundry network
.connect_http(url)
Yes
RPC endpoint URL
Returns: A read-only unsigned provider for Sanvil.
Transaction Building
With #[sol(rpc)], you can build Seismic transactions directly from contract instances. Functions with shielded parameters auto-encrypt; for others, use .seismic():
When to Use SeismicFoundry
Local testing with Sanvil
Yes
Integration tests in CI
Yes (if using Sanvil)
Connecting to Seismic testnet
No — use SeismicReth
Connecting to Seismic mainnet
No — use SeismicReth
Notes
SeismicFoundryis a zero-sized type and adds no runtime overheadIt is
Clone,Copy, andDebugSanvil defaults to chain ID
31337, matching Foundry Anvil conventionsThe Foundry-specific types handle serialization differences between Sanvil and production reth nodes
Both
SeismicRethandSeismicFoundrysupport the sameSeismicNetworktrait methods
See Also
SeismicNetwork Trait - The trait that
SeismicFoundryimplementsSeismicReth - Production network type
Sanvil - Local development chain configuration
SeismicSignedProvider - Full-featured provider
SeismicUnsignedProvider - Read-only provider
Last updated

