pub trait FoundryExecutionHooks: EvmTypes {
// Provided methods
fn sync_transaction(_evm: &mut Evm<'_, Self>) { ... }
fn refresh_transaction(_evm: &mut Evm<'_, Self>) { ... }
fn refresh_switched_transaction(
evm: &mut Evm<'_, Self>,
_original: &AddressMap<Option<AccountInfo>>,
) { ... }
fn tx_call_depth_offset(_tx: &Self::Tx) -> u16 { ... }
}Expand description
Execution-family hooks for state Foundry changes outside ordinary EVM execution.
These operate on the running EVM, independently of factory configuration. evm2 still owns transaction and frame execution; the lifecycle and inspectors coordinate these hooks.
Provided Methods§
Sourcefn sync_transaction(_evm: &mut Evm<'_, Self>)
fn sync_transaction(_evm: &mut Evm<'_, Self>)
Folds the running transaction’s execution so far into network state derived from it, such
as Monad’s reserve-balance tracker. Call it before Foundry changes that state outside
execution, then call Self::refresh_transaction.
Sourcefn refresh_transaction(_evm: &mut Evm<'_, Self>)
fn refresh_transaction(_evm: &mut Evm<'_, Self>)
Rebases network state derived from the running transaction’s state onto that state after Foundry changed it outside execution, such as cheatcode writes and isolated calls. The change itself is not execution: Monad’s reserve-balance tracker recomputes the thresholds of its tracked accounts without recording debits or credits.
Sourcefn refresh_switched_transaction(
evm: &mut Evm<'_, Self>,
_original: &AddressMap<Option<AccountInfo>>,
)
fn refresh_switched_transaction( evm: &mut Evm<'_, Self>, _original: &AddressMap<Option<AccountInfo>>, )
Like Self::refresh_transaction, after a fork switch accepted the running transaction’s
changes: original holds the transaction-start info of the persistent accounts it carried.
Sourcefn tx_call_depth_offset(_tx: &Self::Tx) -> u16
fn tx_call_depth_offset(_tx: &Self::Tx) -> u16
Returns how many levels below the transaction its handler runs tx’s top-level calls,
such as one for Tempo’s AA transactions. A nested transaction lowers its initial call
depth by it, so its calls keep their depth in the surrounding trace.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
impl FoundryExecutionHooks for BaseEvmTypes
base only.impl FoundryExecutionHooks for BaseEvmTypes
Source§impl FoundryExecutionHooks for MonadEvmTypes
Available on crate feature monad only.
impl FoundryExecutionHooks for MonadEvmTypes
monad only.fn sync_transaction(evm: &mut Evm<'_, Self>)
fn refresh_transaction(evm: &mut Evm<'_, Self>)
fn refresh_switched_transaction( evm: &mut Evm<'_, Self>, original: &AddressMap<Option<AccountInfo>>, )
impl FoundryExecutionHooks for OpEvmTypes
optimism only.