Expand description
Foundryβs main executor backend abstraction and implementation.
ModulesΒ§
- cow π
- A wrapper around
Backend
that is clone-on-write used for fuzzing. - diagnostic π
- error π
- in_
memory_ πdb - In-memory database.
- snapshot π
StructsΒ§
- Backend
- Provides the underlying
revm::Database
implementation. - Backend
Inner - Container type for various Backend related data
- Backend
State Snapshot - Represents a state snapshot taken during evm execution
- Blockchain
Db - A shareable Block database
- Blockchain
DbMeta - relevant identifying markers in the context of BlockchainDb
- CowBackend
- A wrapper around
Backend
that ensures onlyrevm::DatabaseRef
functions are called. - EmptyDB
Wrapper - An empty database that always returns default values when queried.
- Fork
- Represents a fork
- MemDb
- In-memory [
Database
] for Anvil. - Shared
Backend - A cloneable backend type that shares access to the backend data with all its clones.
- State
Snapshot - A minimal abstraction of a state at a certain point in time
- _Object
Safe π
EnumsΒ§
- Backend
Database Snapshot - Variants of a [revm::Database]
- Backend
Error - Errors that can happen when working with [
revm::Database
] - Database
Error - Errors that can happen when working with [
revm::Database
] - Revert
Diagnostic - Represents possible diagnostic cases on revert
- Revert
State Snapshot Action - What to do when reverting a state snapshot.
ConstantsΒ§
- DEFAULT_
PERSISTENT_ πACCOUNTS - All accounts that will have persistent storage across fork swaps.
- GLOBAL_
FAIL_ SLOT bytes32("failed")
, as a storage slot key intoCHEATCODE_ADDRESS
.
TraitsΒ§
- Database
Ext - An extension trait that allows us to easily extend the
revm::Inspector
capabilities
FunctionsΒ§
- apply_
state_ πchangeset - Applies the changeset of a transaction to the active journaled state and also commits it in the forked db
- commit_
transaction π - Executes the given transaction and commits state changes to the database and the journaled state, with an inspector.
- is_
contract_ πin_ state - Returns true of the address is a contract
- merge_
account_ πdata - Clones the data of the given
accounts
from theactive
database into thefork_db
This includes the data held in storage (CacheDB
) and kept in theJournaledState
. - merge_
db_ πaccount_ data - Clones the account data from the
active
db into theForkDB
- merge_
journaled_ πstate_ data - Clones the account data from the
active_journaled_state
into thefork_journaled_state
- update_
current_ πenv_ with_ fork_ env - This updates the currently used env with the forkβs environment
- update_
env_ πblock - Updates the envβs block with the blockβs data
- update_
state - Helper method which updates data in the state with the data from the database. Does not change state for persistent accounts (for roll fork to transaction and transact).
Type AliasesΒ§
- Backend
Result - Database
Result - Result alias with
DatabaseError
as error - ForkDB π
- Fork
Lookup πIndex - Represents the index of a fork in the created forks vector This is used for fast lookup
- Foundry
EvmIn MemoryDB - Type alias for an in-memory database.
- Journaled
State - Local
Fork Id - Represents a numeric
ForkId
valid only for the existence of theBackend
.