Monad is a Layer-1 blockchain delivering high performance, true decentralization, and EVM compatibility. It supports a large globally distributed network (see the validator map), with intentionally minimal hardware requirements so that anyone may run a node. Performance comes from software architecture improvements rather than reliance on heavy hardware or node colocation. The result is an Ethereum-compatible Layer-1 blockchain with 10,000 tps of throughput, 400ms block frequency, and 800ms finality.
Monad Foundry is a custom fork of Foundry that integrates Monad features directly into the familiar Foundry developer workflow. To read more about Monad EVM differences vs Ethereum mainnet, check out Monad docs.
- Monad-specific opcode and precompile gas costs, no gas refunds, increased bytecode limits (128KB code, 256KB initcode), and no EIP-4844 blob transactions. See Monad EVM differences for full details.
- Full support for Monad staking precompile execution in tests/scripts via the Monad EVM stack.
- Support for staking view functions (
getEpoch,getProposerValId,getValidator,getDelegator,getWithdrawalRequest,getConsensusValidatorSet,getSnapshotValidatorSet,getExecutionValidatorSet,getDelegations,getDelegators) and state-changing functions (addValidator,delegate,undelegate,withdraw,compound,claimRewards,changeCommission,externalReward). - Full staking behavior is implemented in
monad-revmand consumed throughalloy-monad-evm. See the monad-revm README for design/lifecycle details. - Human-readable ABI decoding in
forge test -vvvvtraces for all staking functions and events. - Address
0x1000labeled as "Staking" in trace output.
- Monad staking cheatcodes are exposed from a separate cheatcode address:
0xc0FFeeCD43A10e1C2b0De63c6CDCFe5B7d0e0CEA
- Current implemented cheatcodes:
- Direct state controls:
setEpoch(uint64,bool),setProposer(uint64),setAccumulator(uint64,uint256) - Syscall wrappers:
blockReward(address,uint256),epochSnapshot(),epochChange(uint64),epochBoundary(uint64)
- Direct state controls:
- These cheatcodes are helper controls around lifecycle/state setup. Core staking operations (delegate/undelegate/claim/withdraw/etc.) still execute through the real staking precompile at
0x1000. - Solidity interface path in this repository:
testdata/utils/MonadVm.sol - End-to-end tests for current coverage:
testdata/default/cheats/MonadStaking.t.sol
forge testandforge scriptexecute with Monad EVM by default.- The default Monad hardfork is
MonadNine. - Set
monad_hardfork = "MonadEight" | "MonadNine" | "MonadNext"infoundry.tomlto choose a different default Monad hardfork for your project. forge verify-contractuses Monad-specific compilation settings.
- Supports both standard Ethereum EVM and Monad EVM.
- Use
anvil --monadto run a local node with Monad EVM. - Use
anvil --monad --hardfork MonadNineto select a specific Monad hardfork. Supported values:MonadEight,MonadNine,MonadNext. - Monad EVM also enables automatically when forking a Monad RPC (chain ID detection).
- Execute with Monad EVM by default.
- Standard Foundry uses
vm.setEvmVersion(...)to switch Ethereum execution hardforks. - Monad Foundry also accepts Monad hardfork names:
MonadEight,MonadNine,MonadNext. - On Monad, Ethereum hardfork names like
istanbulorshanghaiare accepted for compatibility but do not change the active Monad hardfork, because Monad hardfork selection is independent from Ethereumevm_version. - Prefer
monad_hardforkinfoundry.tomlfor project defaults, and usevm.setEvmVersion("MonadNine")only when a test or script needs to switch Monad execution behavior explicitly.
Install the Monad Foundry installer:
curl -L https://raw.githubusercontent.com/category-labs/foundry/monad/foundryup/install | bashImportant
Existing users with the legacy foundryup 1.5.0 launcher must run the installer command above
once. The legacy launcher cannot self-update to the new 1.5.0-monad-v1.0.0 version scheme.
Then install Monad Foundry:
foundryup --network monadThis installs all four binaries: forge, cast, anvil, and chisel with Monad support.
The stable channel resolves to the latest published, immutable Monad Foundry release tag.
Note: The same installer also supports standard Foundry. Running
foundryupwithout--network monadwill install the official upstream Foundry release, so you can use both side by side.
For general Foundry usage (writing tests, scripts, deployments, configuration, cheatcodes), refer to the Foundry Docs.
For Monad-specific EVM differences and staking precompile details, see the Monad Docs.
Licensed under either of Apache License, Version 2.0 or MIT License at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in these crates by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Monad Foundry is built as a fork of Foundry.