Cheatcodes Reference

  • mock_call - mocks a number of contract calls to an entry point

  • start_mock_call - mocks contract call to an entry point

  • stop_mock_call - cancels the mock_call / start_mock_call for an entry point

  • get_class_hash - retrieves a class hash of a contract

  • replace_bytecode - replace the class hash of a contract

  • l1_handler - executes a #[l1_handler] function to mock a message arriving from Ethereum

  • spy_events - creates EventSpy instance which spies on events emitted by contracts

  • spy_messages_to_l1 - creates L1MessageSpy instance which spies on messages to L1 sent by contracts

  • store - stores values in targeted contact's storage

  • load - loads values directly from targeted contact's storage

  • CheatSpan - enum for specifying the number of target calls for a cheat

Execution Info

Caller Address

Block Info

Block Number

Block Timestamp

Sequencer Address

Transaction Info

Transaction Version

Transaction Max Fee

Transaction Signature

Transaction Hash

Transaction Chain ID

Transaction Nonce

Transaction Resource Bounds

Transaction Tip

Transaction Paymaster Data

Transaction Nonce Data Availability Mode

Transaction Fee Data Availability Mode

Transaction Account Deployment

Account Contract Address

ℹ️ Info To use cheatcodes you need to add snforge_std package as a development dependency in your Scarb.toml using the appropriate version.

[dev-dependencies]
snforge_std = "0.33.0"