Monad Standard Library (monad-std) is a collection of Monad-specific interfaces and testing helpers for Foundry.
It provides Solidity interfaces that track Monad runtime behavior and lightweight base contracts for ergonomic test usage.
forge install category-labs/monad-stdsrc/interfaces/IMonadStaking.sol defines the public interface for the staking precompile at 0x1000.
src/interfaces/IReserveBalance.sol defines the public interface for the reserve balance precompile at 0x1001 (MIP-4).
src/MonadVm.sol defines Monad Foundry cheatcodes exposed by Monad's VM interface.
src/MonadStdConstants.sol exposes canonical Monad addresses and typed handles:
MONAD_VM_ADDRESSSTAKING_ADDRESSRESERVE_BALANCE_ADDRESSMONAD_VMSTAKINGRESERVE_BALANCE
src/Base.sol and src/MonadTest.sol provide forge-std-style ergonomics for tests:
monadVmalias forMONAD_VMstakingalias forSTAKINGreserveBalancealias forRESERVE_BALANCEMonadTestas a convenience aggregate base
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.13 <0.9.0;
import {MonadTest} from "monad-std/MonadTest.sol";
contract ExampleTest is MonadTest {
function testUseMonadVm() public {
monadVm.setEpoch(42, false);
monadVm.setProposer(7);
monadVm.epochBoundary(43);
}
function testUseStakingInterface() public {
staking.getEpoch();
uint64 proposerValId = staking.getProposerValId();
staking.getValidator(proposerValId);
staking.getConsensusValidatorSet(0);
}
}The current Solidity support range is:
>=0.8.13 <0.9.0
forge fmt --check
forge build --sizes
forge test -vvvSee the contributing guide.
- Open an issue for bugs or feature requests.
Monad Standard Library is licensed under MIT.