Skip to main content
This tutorial builds a modular cheatcode playground in Foundry. You deploy a single contract to a Virtual Environment, then call its functions with cast send to exercise every Solidity precompile cheatcode from inside transactions.

What you build

Three files:
  • src/IVnetPrecompile.sol: the precompile interface.
  • src/MyTestSetup.sol: a playground contract. Each function wraps one precompile call, so you deploy once and call individual functions to manipulate one piece of state at a time.
  • script/Deploy.s.sol: a forge script deploy.

Function map

Prerequisites

  • A Tenderly account with a project.
  • Foundry installed (curl -L https://foundry.paradigm.xyz | bash && foundryup).

See also