Skip to main content

Crate cheatcodes

Crate cheatcodes 

Source
Expand description

§foundry-cheatcodes

Foundry cheatcodes implementations.

Modules§

spec
Cheatcode specification for Foundry.

Structs§

BroadcastableTransaction
Helps collecting transactions from different forks.
CheatcodeAnalysis
Provides cached, on-demand syntactic and semantic analysis of a completed Compiler instance.
Cheatcodes
An EVM inspector that handles calls to various cheatcodes, each with their own behavior.
CheatcodesCore
Cheatcode state that does not depend on the execution engine.
CheatsConfig
Additional, configurable context the Cheatcodes inspector has access to
CheatsCtxt
The cheatcode context.
Error
Error thrown by cheatcodes.
Wallets
Cloneable wrapper around WalletsInner.
WalletsInner
Contains context for wallet management.

Enums§

ErrorKind
Kind of cheatcode errors.
ForgeContext
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§

CheatcodeDef
Cheatcode definition trait. Implemented by all Vm functions.
CheatcodesExecutor
Helper trait for running nested EVM operations from inside cheatcode implementations.

Functions§

current_execution_context
Returns the current forge execution context, if it has been set.
set_execution_context
Set forge command 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§

BroadcastableTransactions
List of transactions that can be broadcasted.
ExpectedCallTracker
Tracks the expected calls per address.
NestedEvmClosureFor
Nested EVM closure for a Foundry EVM network.
Result
Cheatcode result type.