Skip to main content
Foundry v1.8 or later includes first-class Monad execution support across Forge, Anvil, Cast, Chisel, traces, and cheatcodes. Use the official Foundry distribution for Monad development. For general Foundry usage, including writing tests and scripts, deployment, configuration, and cheatcodes, refer to the Foundry documentation.

Installation

Install the official Foundry installer:
Follow the installer instructions to add foundryup to your shell, then install the latest stable Foundry release:
Confirm that you are running Foundry v1.8.0 or later:
Foundry releases before v1.8 do not include Monad execution support.

Configure Monad execution

Set the execution network in your project’s foundry.toml:
foundry.toml
This setting makes local Forge, Cast, and Chisel execution use Monad’s gas model, opcode pricing, transaction rules, precompiles, and contract size limits. You can select Monad for a single command instead:

Hardfork selection

Local Monad execution defaults to the latest supported Monad hardfork, currently MonadTen. To reproduce an earlier hardfork, set it explicitly:
foundry.toml
You can also select a hardfork for a single command:
When Foundry forks Monad Mainnet or Testnet, it uses the endpoint’s chain ID and the forked block’s timestamp to select the active Monad hardfork automatically.

Monad execution features

For the complete list of protocol differences, see Differences between Monad and Ethereum.

Anvil

Use --network monad to start a local Anvil node with the Monad execution environment:
Anvil defaults to MonadTen for new local chains. You can also fork Monad Testnet or Mainnet:
When forking a canonical Monad endpoint, Anvil detects the Monad network from its chain ID and selects the active hardfork for the fork block.

Cast and Chisel

Cast and Chisel use the Monad execution environment when network = "monad" is set in foundry.toml. You can also pass --network monad directly to supported commands. All standard Cast and Chisel workflows remain available. Monad-specific precompile calls are decoded in traces with human-readable names and parameters.

CI integration

Use the official Foundry toolchain action and install v1.8.0 or later:
For example:

Migrating from Monad Foundry

The legacy Monad Foundry fork supports Monad execution only through the MonadNine hardfork. It does not support MonadTen or MIP-8 and should be migrated from.
To migrate:
  1. Install Foundry v1.8 or later with the official installer and run foundryup.
  2. Add network = "monad" to your foundry.toml, or pass --network monad to individual commands.
  3. Replace anvil --monad with anvil --network monad.
  4. Replace category-labs/foundry-toolchain@v1 with foundry-rs/foundry-toolchain@v1 in CI.
  5. Remove scripts that install Foundry from foundry.category.xyz or run foundryup --network monad.
The official release includes the Monad execution behavior, precompiles, trace decoding, and tooling integration previously provided by the fork, along with MonadTen support.