Cheatcodes Reference
CheatTarget
- enum for selecting contracts to target with cheatcodesCheatSpan
- enum for specifying the number of target calls for a cheatprank
- changes the caller address for contracts, for a number of callsstart_prank
- changes the caller address for contractsstop_prank
- cancels theprank
/start_prank
for contractsroll
- changes the block number for contracts, for a number of callsstart_roll
- changes the block number for contractsstop_roll
- cancels theroll
/start_roll
for contractswarp
- changes the block timestamp for contracts, for a number of callsstart_warp
- changes the block timestamp for contractsstop_warp
- cancels thewarp
/start_warp
for contractselect
- changes the sequencer address for contracts, for a number of callsstart_elect
- changes the sequencer address for contractsstop_elect
- cancels theelect
/start_elect
for contractsspoof
- changes the transaction context for contracts, for a number of callsstart_spoof
- changes the transaction context for contractsstop_spoof
- cancels thespoof
/start_spoof
for contractsmock_call
- mocks a number of contract calls to an entry pointstart_mock_call
- mocks contract call to an entry pointstop_mock_call
- cancels themock_call
/start_mock_call
for an entry pointget_class_hash
- retrieves a class hash of a contractreplace_bytecode
- replace the class hash of a contractl1_handler_execute
- executes a#[l1_handler]
function to mock a message arriving from Ethereumspy_events
- createsEventSpy
instance which spies on events emitted by contractsstore
- stores values in targeted contact's storageload
- loads values directly from targeted contact's storage
ℹ️ Info To use cheatcodes you need to add
snforge_std
package as a development dependency in yourScarb.toml
using appropriate release tag.[dev-dependencies] snforge_std = { git = "https://github.com/foundry-rs/starknet-foundry.git", tag = "v0.12.0" }