crates/cheatcodes/README.md
Foundry cheatcodes definitions and implementations.
assets/: JSON interface and specificationspec/: Defines common traits and structssrc/: Rust implementations of the cheatcodesAll 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.
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:
forge-std to generate user-friendly Solidity interfacesIf you are making use of the JSON interface, please don't hesitate to open a PR to add your project to this list!
Please see the cheatcodes dev documentation on how to add new cheatcodes.