Expand description
Β§foundry-cheatcodes
Foundry cheatcodes implementations.
Re-exportsΒ§
pub extern crate foundry_cheatcodes_spec as spec;
Re-exportsΒ§
pub(crate) use Address;πpub(crate) use B256;πpub(crate) use U256;πpub(crate) use evm2::interpreter::GasTracker;πpub(crate) use Backend;πpub(crate) use CowBackend;πpub(crate) use LocalForkId;πpub(crate) use BlockEnvFor;πpub(crate) use EvmEnvFor;πpub(crate) use EvmFactoryFor;πpub(crate) use FoundryEvmFactory;πpub(crate) use FoundryEvmFor;πpub(crate) use FoundryEvmNetwork;πpub(crate) use SpecFor;πpub(crate) use evm_env;πpub(crate) use fork::CreateFork;π
ModulesΒ§
- Vm
- Foundry cheatcodes interface.
- base64 π
- config π
- crypto π
- Implementations of
CryptoCheatcodes. - env π
- Implementations of
Environmentcheatcodes. - error π
- evm π
- Implementations of
Evmcheatcodes. - expected_
emit π - Engine-free matching for the
expectEmitcheatcodes. - external_
storage π - Storage layouts for contracts that arenβt part of the local project.
- fs π
- Implementations of
Filesystemcheatcodes. - inspector π
- Cheatcode EVM inspector.
- json π
- Implementations of
Jsoncheatcodes. - monad π
monad - Monad staking cheatcodes.
- script π
- Implementations of
Scriptingcheatcodes. - state π
- Cheatcode state shared by both execution engines.
- string π
- Implementations of
Stringcheatcodes. - tempo π
- Cheatcodes that delegate to the imported Tempo precompile crates.
- test π
- Implementations of
Testingcheatcodes. - toml π
- Implementations of
Tomlcheatcodes. - utils π
- Implementations of
Utilitiescheatcodes. - version π
StructsΒ§
- Broadcastable
Transaction - Helps collecting transactions from different forks.
- Cheatcode
Analysis - Provides cached, on-demand syntactic and semantic analysis of a completed
Compilerinstance. - Cheatcodes
- An EVM inspector that handles calls to various cheatcodes, each with their own behavior.
- Cheatcodes
Core - Cheatcode state that does not depend on the execution engine.
- Cheats
Config - Additional, configurable context the
Cheatcodesinspector has access to - Cheats
Ctxt - The cheatcode context.
- Error
- Error thrown by cheatcodes.
- Prank
- Prank information.
- Record
Access - Records storage slots reads and writes.
- Storage
Hook - A callback registered for a storage access hook.
- Wallets
- Cloneable wrapper around
WalletsInner. - Wallets
Inner - Contains context for wallet management.
EnumsΒ§
- Error
Kind - Kind of cheatcode errors.
- Expected
Call Type - The type of expected call.
- Forge
Context - Forge execution contexts.
ConstantsΒ§
- DUMMY_
CREATE_ ADDRESS - Same reasoning as DUMMY_CALL_OUTPUT, but for creates.
StaticsΒ§
- DUMMY_
CALL_ OUTPUT - For some cheatcodes we may internally change the status of the call, i.e. in
expectRevert. Solidity will see a successful call and attempt to decode the return data. Therefore, we need to populate the return with dummy bytes so the decode doesnβt fail.
TraitsΒ§
- Cheatcode π
- Cheatcode implementation.
- Cheatcode
Def - Cheatcode definition trait. Implemented by all
Vmfunctions. - Cheatcodes
Backend - Backend access of the cheatcode inspector while an execution runs.
- Cheatcodes
Executor - Runs nested executions on behalf of cheatcodes.
FunctionsΒ§
- current_
execution_ context - Returns the current forge execution context, if it has been set.
- decode_
cheatcode_ call - Decodes a cheatcode call, reporting an unknown selector as a
Vminterface mismatch. - expect_
revert_ mismatch - Returns the error that a call reverting with
retdata, first failing inreverted_by, ends with when it does not meet avm.expectRevertofreasonfromreverter, orNonewhen it meets it. Withpartial_match, only the first 4 bytes ofreasonare compared. - message_
result - Returns the result of a message that did not execute, keeping its whole execution gas.
- parse_
value - Parses
sastylike thevm.parse*cheatcodes, with Forgeβs lenient fallbacks and error message. - precompile_
error π - revert_
frame - Stops the running frame with a revert carrying
output, before its current instruction runs or after it ran. - set_
execution_ context - Set
forgecommand current execution context for the duration of the program. Execution context is immutable, subsequent calls of this function wonβt change the context.
Type AliasesΒ§
- Broadcastable
Transactions - List of transactions that can be broadcasted.
- Expected
Call Tracker - Tracks the expected calls per address.
- Result
- Cheatcode result type.