Skip to main content
Monad Foundry is a custom fork of Foundry that integrates Monad features directly into the familiar Foundry developer workflow. It uses monad-revm, to ensure that forge test, forge script, cast, anvil, and chisel all execute with Monad’s gas model, opcode pricing, and precompile behavior — so your local development environment matches Monad’s on-chain behavior. For general Foundry usage (writing tests, scripts, deployments, configuration, cheatcodes), refer to the Foundry Docs.

Installation

Install the Monad Foundry installer:
Then install Monad Foundry:
This installs all four binaries — forge, cast, anvil, and chisel — with Monad support.
The same installer also supports standard Foundry. Running foundryup without --network monad will install the official upstream Foundry release, so you can use both side by side.

Features

Monad EVM Execution

forge test and forge script execute with Monad EVM by default. The following differences from Ethereum are applied automatically:
  • Gas charging: Gas is charged based on gas_limit, not gas_used. There are no gas refunds. See Gas Pricing for details.
  • Contract size: Max contract size is 128KB
  • Initcode size: Max initcode size is 256KB
  • Precompile gas costs: See Opcode Pricing.
  • No blob transactions: EIP-4844 (type 3) transactions are not supported.
For the complete list of differences, see Differences between Monad and Ethereum.

Staking Precompile Support

All staking precompile view functions work in forge test at address 0x1000:

Trace Decoding

When running tests with verbose output (forge test -vvvv), staking calls are decoded with human-readable function names and parameters. The address 0x1000 is labeled as “Staking” in trace output. All staking state-changing functions (addValidator, delegate, undelegate, withdraw, compound, claimRewards, changeCommission, externalReward) and events (ValidatorRewarded, Delegate, Undelegate, Withdraw, ClaimRewards, CommissionChanged, EpochChanged, ValidatorStatusChanged) are decoded in traces. Example trace output:

Anvil with Monad EVM

Use anvil --monad to run a local development node with Monad EVM:
Monad EVM activates automatically when forking a Monad RPC endpoint (detected via chain ID), so you don’t need the --monad flag when forking.

Cast & Chisel

cast and chisel execute with Monad EVM by default. All standard commands work the same as upstream Foundry.

CI Integration

Use the Monad Foundry GitHub Action to install Monad Foundry in your CI workflows:
This installs the latest stable Monad Foundry (stable-monad) by default. You can also pin a specific version:
Full workflow example:
The action supports caching and works on all platforms (Linux, macOS, Windows). See the foundry-toolchain repo for all available options.

Releases & Versioning

Monad Foundry uses a v{upstream}-monad.{monad_version} versioning scheme. For example, v1.5.0-monad.0.1.0 is based on upstream Foundry v1.5.0 with Monad fork version 0.1.0. See the GitHub Releases for full release history.