Trait NestedEvm
pub trait NestedEvm {
type Spec;
type Block;
type Tx: FoundryTransaction;
type Chain: FoundryChain<Self::Tx>;
type Journal: FoundryJournal;
// Required methods
fn journal_inner_mut(&mut self) -> &mut JournalInner<JournalEntry>;
fn tx_mut(&mut self) -> &mut Self::Tx;
fn chain_mut(&mut self) -> &mut Self::Chain;
fn precompiles_mut(&mut self) -> &mut PrecompilesMap;
fn journal_mut(&mut self) -> &mut Self::Journal;
fn run_execution(
&mut self,
frame: FrameInput,
) -> Result<FrameResult, EVMError<DatabaseError>>;
fn transact_raw(
&mut self,
tx: Self::Tx,
) -> Result<ExecResultAndState<ExecutionResult>, Report>;
fn to_evm_env(&self) -> EvmEnv<Self::Spec, Self::Block>;
// Provided method
fn transact_replay(
&mut self,
tx: Self::Tx,
is_system: bool,
) -> Result<Option<ExecResultAndState<ExecutionResult>>, Report> { ... }
}Expand description
Object-safe EVM operations used by nested execution and fork replay.
This abstracts over the concrete EVM type (FoundryEvm, future TempoEvm, etc.)
so that cheatcode impls can build and run nested EVMs without knowing the concrete type.
Required Associated Types§
type Spec
type Spec
The spec type.
type Block
type Block
The block environment type.
type Tx: FoundryTransaction
type Tx: FoundryTransaction
The transaction environment type.
type Chain: FoundryChain<Self::Tx>
type Chain: FoundryChain<Self::Tx>
Chain context identifying the active transaction position.
type Journal: FoundryJournal
type Journal: FoundryJournal
The Journal type, which may own Monad’s reserve-balance-tracker state.
Required Methods§
fn journal_inner_mut(&mut self) -> &mut JournalInner<JournalEntry>
fn journal_inner_mut(&mut self) -> &mut JournalInner<JournalEntry>
Returns a mutable reference to the journal inner state (JournaledState).
fn chain_mut(&mut self) -> &mut Self::Chain
fn chain_mut(&mut self) -> &mut Self::Chain
Returns a mutable reference to the chain-position context.
fn precompiles_mut(&mut self) -> &mut PrecompilesMap
fn precompiles_mut(&mut self) -> &mut PrecompilesMap
Returns the precompile map.
fn journal_mut(&mut self) -> &mut Self::Journal
fn journal_mut(&mut self) -> &mut Self::Journal
Returns a mutable reference to the Journal.
fn run_execution(
&mut self,
frame: FrameInput,
) -> Result<FrameResult, EVMError<DatabaseError>>
fn run_execution( &mut self, frame: FrameInput, ) -> Result<FrameResult, EVMError<DatabaseError>>
Runs a single execution frame (create or call) through the EVM handler loop.
fn transact_raw(
&mut self,
tx: Self::Tx,
) -> Result<ExecResultAndState<ExecutionResult>, Report>
fn transact_raw( &mut self, tx: Self::Tx, ) -> Result<ExecResultAndState<ExecutionResult>, Report>
Executes a full transaction with the given tx env.
fn to_evm_env(&self) -> EvmEnv<Self::Spec, Self::Block>
Provided Methods§
fn transact_replay(
&mut self,
tx: Self::Tx,
is_system: bool,
) -> Result<Option<ExecResultAndState<ExecutionResult>>, Report>
fn transact_replay( &mut self, tx: Self::Tx, is_system: bool, ) -> Result<Option<ExecResultAndState<ExecutionResult>>, Report>
Replays a transaction, skipping unsupported system envelopes.
is_system preserves the RPC envelope classification that conversion to Self::Tx may
discard. Returning None must not mutate the EVM, database, or inspector.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".