alloy-monad-evm is the Alloy integration layer for Monad execution.
It wraps monad-revm behind alloy-evm traits so Foundry/Alloy-based execution stacks can instantiate Monad EVMs through standard interfaces.
For the staking precompile design and detailed semantics, see the monad-revm README:
MonadEvm:alloy_evm::Evmimplementation wrappingmonad_revm::MonadEvm.MonadEvmFactory:alloy_evm::EvmFactoryimplementation for building Monad EVM instances from Alloy environments.extend_monad_precompiles: helper that registers Monad staking precompile (0x1000) into aPrecompilesMap.
alloy-monad-evm does not reimplement staking logic. It delegates execution to monad-revm staking modules and focuses on wiring:
- Registers
0x1000viaPrecompilesMap::apply_precompileso the address is discoverable in precompile address sets. - Ensures precompile-aware tooling behavior (for example, Foundry warm precompile handling and better revert diagnostics).
- Routes write selectors through
monad_revm::staking::write::run_staking_write. - Routes read selectors through
monad_revm::staking::run_staking_with_reader. - Enforces direct-call behavior (
DELEGATECALL/CALLCODEand static contexts are rejected in this integration path).
This keeps staking behavior centralized in one place (monad-revm) while allowing Alloy-based runtimes to execute the same semantics.
- Monad gas model (cold access repricing, no refunds).
- Monad precompile repricing.
- Staking precompile at
0x1000(read + write + syscalls, viamonad-revm).
use alloy_evm::EvmFactory;
use alloy_monad_evm::MonadEvmFactory;
let factory = MonadEvmFactory::default();
let evm = factory.create_evm(db, env);use alloy_evm::precompiles::PrecompilesMap;
use alloy_monad_evm::extend_monad_precompiles;
let mut precompiles = PrecompilesMap::default();
extend_monad_precompiles(&mut precompiles);MonadEvmMonadEvmFactoryMonadContext(re-export frommonad-revm)MonadHandler(re-export frommonad-revm)extend_monad_precompiles
std(default)asm-keccak
Licensed under MIT license.