Skip to content

Latest commit

 

History

History
 
 

cheatcodes

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

foundry-cheatcodes

Foundry cheatcodes definitions and implementations.

Structure

  • assets/: JSON interface and specification
  • spec/: Defines common traits and structs
  • src/: Rust implementations of the cheatcodes

Overview

All cheatcodes are defined in a single sol! macro call in spec/src/vm.rs.

This, combined with the use of an internal Cheatcode derive macro, allows us to generate both the Rust definitions and the JSON specification of the cheatcodes.

Cheatcodes are manually implemented through the Cheatcode trait, which is called in the Cheatcodes inspector implementation.

See the cheatcodes dev documentation for more details.

JSON interface

The JSON interface is guaranteed to be stable, and can be used by third-party tools to interact with the Foundry cheatcodes externally.

For example, here are some tools that make use of the JSON interface:

If you are making use of the JSON interface, please don't hesitate to open a PR to add your project to this list!

Adding a new cheatcode

Please see the cheatcodes dev documentation on how to add new cheatcodes.