pub trait FoundryEvmFactory:
EvmFactory<Precompiles = PrecompilesMap>
+ Clone
+ Debug
+ Default
+ 'staticwhere
Self::Spec: Into<SpecId> + ExecutionSpec + Default + Copy + Unpin + Send + 'static,
Self::BlockEnv: FoundryBlock + ForkBlockEnv + Default + Unpin,
Self::Tx: Clone + Debug + FoundryTransaction + FromAnyRpcTransaction + Default + Send + Sync,
Self::HaltReason: IntoInstructionResult,{
type Chain: FoundryChain<Self::Tx>;
type FoundryContext<'db>: FoundryContextExt<Block = Self::BlockEnv, Tx = Self::Tx, Spec = Self::Spec, Chain = Self::Chain>
where <Self::FoundryContext<'db> as ContextTr>::Journal: FoundryJournal,
<Self::FoundryContext<'db> as ContextTr>::Db: DatabaseExt<Self>,
Self: 'db;
type FoundryEvm<'db, I: FoundryInspectorExt<Self::FoundryContext<'db>>>: Evm<DB = &'db mut dyn DatabaseExt<Self, Error = DatabaseError>, Tx = Self::Tx, BlockEnv = Self::BlockEnv, Spec = Self::Spec, HaltReason = Self::HaltReason, Precompiles = PrecompilesMap> + DerefMut<Target = Self::FoundryContext<'db>>
where Self: 'db;
// Required methods
fn create_foundry_evm_with_inspector<'db, I>(
&self,
db: &'db mut dyn DatabaseExt<Self, Error = DatabaseError>,
evm_env: EvmEnv<Self::Spec, Self::BlockEnv>,
inspector: I,
) -> Self::FoundryEvm<'db, I>
where I: FoundryInspectorExt<Self::FoundryContext<'db>>;
fn create_nested_evm_with_inspector<'db, I>(
&self,
db: &'db mut dyn DatabaseExt<Self, Error = DatabaseError>,
evm_env: EvmEnv<Self::Spec, Self::BlockEnv>,
inspector: I,
) -> Box<dyn NestedEvm<Block = Self::BlockEnv, Spec = Self::Spec, Tx = Self::Tx, Journal = <Self::FoundryContext<'db> as ContextTr>::Journal, Chain = Self::Chain> + 'db>
where I: FoundryInspectorExt<Self::FoundryContext<'db>> + 'db;
// Provided methods
fn create_nested_evm<'db>(
&self,
db: &'db mut dyn DatabaseExt<Self, Error = DatabaseError>,
evm_env: EvmEnv<Self::Spec, Self::BlockEnv>,
) -> Box<dyn NestedEvm<Block = Self::BlockEnv, Spec = Self::Spec, Tx = Self::Tx, Journal = <Self::FoundryContext<'db> as ContextTr>::Journal, Chain = Self::Chain> + 'db> { ... }
fn set_execution_spec(
context: &mut Self::FoundryContext<'_>,
spec: Self::Spec,
) { ... }
}Required Associated Types§
Sourcetype Chain: FoundryChain<Self::Tx>
type Chain: FoundryChain<Self::Tx>
Chain type for EVM’s context created by this factory.
Sourcetype FoundryContext<'db>: FoundryContextExt<Block = Self::BlockEnv, Tx = Self::Tx, Spec = Self::Spec, Chain = Self::Chain>
where
<Self::FoundryContext<'db> as ContextTr>::Journal: FoundryJournal,
<Self::FoundryContext<'db> as ContextTr>::Db: DatabaseExt<Self>,
Self: 'db
type FoundryContext<'db>: FoundryContextExt<Block = Self::BlockEnv, Tx = Self::Tx, Spec = Self::Spec, Chain = Self::Chain> where <Self::FoundryContext<'db> as ContextTr>::Journal: FoundryJournal, <Self::FoundryContext<'db> as ContextTr>::Db: DatabaseExt<Self>, Self: 'db
Foundry Context abstraction
Sourcetype FoundryEvm<'db, I: FoundryInspectorExt<Self::FoundryContext<'db>>>: Evm<DB = &'db mut dyn DatabaseExt<Self, Error = DatabaseError>, Tx = Self::Tx, BlockEnv = Self::BlockEnv, Spec = Self::Spec, HaltReason = Self::HaltReason, Precompiles = PrecompilesMap> + DerefMut<Target = Self::FoundryContext<'db>>
where
Self: 'db
type FoundryEvm<'db, I: FoundryInspectorExt<Self::FoundryContext<'db>>>: Evm<DB = &'db mut dyn DatabaseExt<Self, Error = DatabaseError>, Tx = Self::Tx, BlockEnv = Self::BlockEnv, Spec = Self::Spec, HaltReason = Self::HaltReason, Precompiles = PrecompilesMap> + DerefMut<Target = Self::FoundryContext<'db>> where Self: 'db
The Foundry-wrapped EVM type produced by this factory.
Required Methods§
Sourcefn create_foundry_evm_with_inspector<'db, I>(
&self,
db: &'db mut dyn DatabaseExt<Self, Error = DatabaseError>,
evm_env: EvmEnv<Self::Spec, Self::BlockEnv>,
inspector: I,
) -> Self::FoundryEvm<'db, I>where
I: FoundryInspectorExt<Self::FoundryContext<'db>>,
fn create_foundry_evm_with_inspector<'db, I>(
&self,
db: &'db mut dyn DatabaseExt<Self, Error = DatabaseError>,
evm_env: EvmEnv<Self::Spec, Self::BlockEnv>,
inspector: I,
) -> Self::FoundryEvm<'db, I>where
I: FoundryInspectorExt<Self::FoundryContext<'db>>,
Creates a Foundry-wrapped EVM with the given inspector.
Callers carrying execution context must install it through the returned context’s
chain_mut before executing. This also preserves OP’s block-derived L1 fee information.
Sourcefn create_nested_evm_with_inspector<'db, I>(
&self,
db: &'db mut dyn DatabaseExt<Self, Error = DatabaseError>,
evm_env: EvmEnv<Self::Spec, Self::BlockEnv>,
inspector: I,
) -> Box<dyn NestedEvm<Block = Self::BlockEnv, Spec = Self::Spec, Tx = Self::Tx, Journal = <Self::FoundryContext<'db> as ContextTr>::Journal, Chain = Self::Chain> + 'db>where
I: FoundryInspectorExt<Self::FoundryContext<'db>> + 'db,
fn create_nested_evm_with_inspector<'db, I>(
&self,
db: &'db mut dyn DatabaseExt<Self, Error = DatabaseError>,
evm_env: EvmEnv<Self::Spec, Self::BlockEnv>,
inspector: I,
) -> Box<dyn NestedEvm<Block = Self::BlockEnv, Spec = Self::Spec, Tx = Self::Tx, Journal = <Self::FoundryContext<'db> as ContextTr>::Journal, Chain = Self::Chain> + 'db>where
I: FoundryInspectorExt<Self::FoundryContext<'db>> + 'db,
Creates a Foundry-wrapped nested EVM with the given inspector.
Install inherited chain state with NestedEvm::chain_mut before executing or restoring
journal-derived state.
Provided Methods§
Sourcefn create_nested_evm<'db>(
&self,
db: &'db mut dyn DatabaseExt<Self, Error = DatabaseError>,
evm_env: EvmEnv<Self::Spec, Self::BlockEnv>,
) -> Box<dyn NestedEvm<Block = Self::BlockEnv, Spec = Self::Spec, Tx = Self::Tx, Journal = <Self::FoundryContext<'db> as ContextTr>::Journal, Chain = Self::Chain> + 'db>
fn create_nested_evm<'db>( &self, db: &'db mut dyn DatabaseExt<Self, Error = DatabaseError>, evm_env: EvmEnv<Self::Spec, Self::BlockEnv>, ) -> Box<dyn NestedEvm<Block = Self::BlockEnv, Spec = Self::Spec, Tx = Self::Tx, Journal = <Self::FoundryContext<'db> as ContextTr>::Journal, Chain = Self::Chain> + 'db>
Creates a Foundry-wrapped nested EVM without an inspector.
Sourcefn set_execution_spec(context: &mut Self::FoundryContext<'_>, spec: Self::Spec)
fn set_execution_spec(context: &mut Self::FoundryContext<'_>, spec: Self::Spec)
Updates the execution spec and gas parameters using this family’s configuration. This does not reconstruct the instruction table or precompile registry.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".