Custom EVM Audit: What to Review in a Forked or Modified EVM
Quick answer. Audit every difference from upstream Ethereum: gas metering and limits, opcode and state changes, custom precompiles and system contracts, RPC behavior, and the bridge between the EVM and native modules. Then test it differentially against reference clients.
Video transcript
Every EVM change is code all nodes must run identically, and that existing contracts were never written for. Audit every difference from upstream Ethereum.
In August 2026, one shared Cosmos EVM bug was exploited on six chains.
Three things raise the stakes. Consensus, since disagreeing nodes split the chain. Shared code, since forks inherit upstream bugs. And hidden assumptions about Ethereum's semantics.
An audited upstream only covers unchanged code. A 2021 geth bug hit BSC, a geth fork, about 12 minutes before Ethereum.
Gas is the chain's defense against denial of service. Monad, MegaEVM and HyperEVM each change the model. Price changes against measured worst-case work, and enforce limits on every path.
State bugs can mint money. Optimism's geth fork let a self-destructing contract's balance be paid out and kept. The finder was paid just over two million dollars.
Precompiles must rebuild the EVM's guarantees by hand. Aurora's withdrawal precompiles were reachable by delegate call, and a Cosmos EVM staking precompile underflowed a balance. Test every call type, reverts, balance arithmetic and upstream parity.
Then test differentially. BlockSec ran Aurora and Moonbeam against geth and found eight bugs. Run upstream fixtures, fuzz precompiles, replay historical transactions and diff traces, then repeat after every upstream release.
Guardian reviews new chains before launch, and Vanguard adds a second independent audit team. Read the full article, or talk to Guardian.
Many chains now run a modified EVM. Monad reprices gas, MegaETH adds a storage gas dimension, and HyperEVM is wired to Hyperliquid's own L1.
Each change is code that every node must run identically, and that existing contracts were never written for.
In August 2026, a bug in shared Cosmos EVM code was exploited on six chains.
Why EVM Changes Are High Risk
Three things make execution changes riskier than contract changes:
- Consensus: every node must compute the same state, or the chain splits.
- Shared code: forks inherit upstream bugs, and must ship upstream fixes.
- Hidden assumptions: contracts and tools expect Ethereum's semantics.
The review reaches past the interpreter into consensus-adjacent code: block building, fee handling and the hooks into native modules.
Consensus failures happen. In August 2021, a geth memory bug, triggered through the dataCopy precompile, made some Ethereum nodes compute a different state root at block 13107518: a minority chain split.
Geth's post-mortem says the same attack hit BSC, a geth fork, about 12 minutes earlier. BSC was among the downstream projects geth had told to be ready to upgrade.
Shared code spreads both features and bugs. revm, the Rust EVM, calls itself a framework for "different EVM variants such as Optimism," and MegaETH's MegaEVM is built on it.
Gas Metering and DoS
Gas is the chain's defense against denial of service. Any repricing must still cover each operation's real worst-case cost.
Newer chains change the model itself:
- Monad charges gas on the gas limit, not gas used, and prices memory linearly up to 8 MB.
- Monad groups storage into pages of 128 slots; the first access to a page pays the cold cost.
- MegaEVM adds storage gas as a second dimension, with four separate per-transaction limits.
- MegaEVM forwards 98/100 of gas to subcalls, and caps gas after reads of volatile data.
- HyperEVM runs 1-second blocks capped at 3M gas beside 1-minute blocks capped at 30M.
Underpricing is the classic bug. BlockSec found Aurora's modexp precompile could, in specific cases, charge less gas than the specification requires.
Price every changed opcode and precompile against measured worst-case work. Enforce every new limit on every path, including eth_call and gas estimation.
Opcode and State Semantics
Changed semantics break contracts quietly. For how opcodes and storage behave on Ethereum, see how the EVM works. Arbitrum documents several differences:
block.numberreturns an estimate of the block number on the first non-Arbitrum ancestor chain.block.prevrandaoandblock.difficultyreturn the constant 1.msg.senderon a message from a parent chain contract is that contract's alias.
MegaEVM disabled SELFDESTRUCT, then re-enabled it under EIP-6780. On Monad, an EIP-7702-delegated account cannot fall below 10 MON, and CREATE and CREATE2 are banned when it is called as a contract.
Changed state handling can create money from nothing. In 2022, Jay Freeman (saurik) found that Optimism's geth fork let a self-destructing contract's balance be paid out and also kept.
That minted ETH on the L2, and Optimism paid him $2,000,042. The bug sat in the fork's own patches to geth's state code, which he advised removing.
Custom Precompiles and System Contracts
Precompiles run native code behind an EVM address. Every guarantee the EVM normally enforces has to be rebuilt by hand.
Call context
Aurora's withdrawal precompiles could be reached through DELEGATECALL, letting a caller withdraw without being debited.
The reporter, pwning.eth, received $6M in AURORA tokens in 2022. Aurora says no user funds were lost.
Native state
Cosmos EVM reconciles EVM balances with the chain's bank module. When a vesting account delegated locked funds through the staking precompile, an unchecked underflow wrapped its balance to about 2256.
The bug was reported in April 2026 and patched quietly. Fixed releases shipped on August 19, and six chains were exploited from August 20 to 25.
Cosmos Labs says it had "incorrectly concluded" that only networks without 18-decimal configurations were at risk. Every Cosmos EVM chain turned out to be affected.
Per its post-mortem, attackers swapped stolen tokens for about $2.87M on DEXes and sold an estimated $2.85M on centralized exchanges.
Bridges to the native chain
HyperEVM moves a token to HyperCore when it is sent to a system address, crediting it from the emitted Transfer event.
Hyperliquid's docs warn there are "no checks that the system address has sufficient supply." For bridge design in general, see cross-chain bridge security.
What to test
- Call every precompile through CALL, DELEGATECALL and STATICCALL.
- Keep EVM state and native module state consistent across reverts.
- Check arithmetic wherever EVM and native balances meet.
- Match upstream input handling and gas pricing for standard precompiles.
RPC and Node Interfaces
The RPC layer runs the EVM too, for every eth_call and gas estimate. Geth caps both at 50M gas by default, and eth_call at 5 seconds.
A new gas model needs matching caps, and gas estimates that agree with real execution.
Interfaces drift as well. Hyperliquid's public HyperEVM RPC has no websocket support, and big blocks have their own bigBlockGasPrice method.
Monad has no global mempool, and its full nodes do not serve arbitrary historic state. Wallets, indexers and bridges must be tested against each difference.
Differential Testing
The strongest check runs the same inputs through your EVM and a reference client, then compares the results.
BlockSec did this for Aurora and Moonbeam against geth. It found eight bugs, most in precompiles; others involved nonces and PUSH operands.
The goevmlab toolkit, built for EVM fuzzers and trace diffs, lists bugs it found in Nethermind, Geth and Besu.
Ethereum's execution-specs repository generates fixtures "that can be used to validate execution client implementations." A practical program:
- Run upstream's test fixtures, with a written list of intended divergences.
- Fuzz precompiles and repriced opcodes against the reference.
- Replay historical transactions through both clients and diff the traces.
- Repeat after every upstream release you merge.
What App Teams Should Check
Teams deploying onto a custom EVM inherit its quirks. Two public Guardian reports show how:
- For USDT0 on Hyperliquid, users could name HyperCore's 0x2222 system contract as receiver, with unclear handling that might duplicate tokens (L-01, resolved).
- For Abracadabra's HyperEVM deployment, Guardian flagged 20 block confirmations as possibly too few, since reorg risk was "relatively unknown" (I-01, acknowledged).
For the wiring checks around each new chain, see multichain stablecoin deployment verification.
How Guardian Reviews Chains
Guardian's audits include pre-production reviews for new protocols, markets, chains and token systems.
Vanguard adds a second independent audit team and an invariant fuzzing suite.
The systems around a chain get their own tests. Offchain automation pentests cover keepers, relayers, bots and threshold signers. Infrastructure pentests cover cloud accounts, pipelines and vendor consoles.
Frequently Asked Questions
What is a custom EVM audit?
It is a security review of a chain's modified execution layer. It covers changed gas rules, opcodes and state handling, custom precompiles and system contracts, RPC behavior, and the links to native modules, all tested against upstream Ethereum.
Is a fork of geth or revm safe if upstream is audited?
Only the unchanged code carries upstream's assurance. Every modification needs its own review, and the fork must ship upstream security fixes quickly: a 2021 geth bug hit BSC about 12 minutes before Ethereum.
Why are custom precompiles risky?
They run native code behind an EVM address, so the EVM's usual guarantees do not apply automatically. The Aurora and Cosmos EVM bugs were both reached through precompiles: one via DELEGATECALL, one via the staking precompile's balance handling.
What should dapp teams check before deploying on a custom EVM?
Read the chain's documented differences from Ethereum: gas charging, opcode results, account rules and bridge mechanics. Test on the chain itself, not only on an Ethereum fork, and set confirmations to the chain's real reorg risk.
Sources
- Cosmos Labs: Cosmos EVM GHSA-7g4w-cg88-2cq2 post-mortem (August 28, 2026)
- The Hacker News: Cosmos EVM flaw exploited (August 28, 2026)
- go-ethereum: Minority split post-mortem (August 2021)
- bluealloy (GitHub): revm (accessed November 5, 2026)
- MegaETH: MegaEVM specification (accessed November 5, 2026)
- megaeth-labs (GitHub): mega-evm (accessed November 5, 2026)
- Monad docs: Differences between Monad and Ethereum (accessed November 5, 2026)
- Hyperliquid docs: HyperEVM (accessed November 5, 2026)
- Hyperliquid docs: Dual-block architecture (accessed November 5, 2026)
- Hyperliquid docs: HyperCore and HyperEVM transfers (accessed November 5, 2026)
- Arbitrum docs: Solidity support (accessed November 5, 2026)
- Jay Freeman (saurik): Attacking an Ethereum L2 with Unbridled Optimism (February 2022)
- Aurora: Aurora Mitigates Its Inflation Vulnerability (June 7, 2022)
- BlockSec: Systematic Approach to Maintaining EVM Compatibility and Security (March 27, 2023)
- holiman (GitHub): goevmlab (accessed November 5, 2026)
- Ethereum (GitHub): execution-specs (accessed November 5, 2026)
- Geth docs: Command-line options (accessed November 5, 2026)
- Guardian: USDT0 Hyperliquid Deployment report (March 2025)
- Guardian: Abracadabra Hyperliquid OFT Deployment report (May 2025)
- Guardian: Audits and pentests
Review your chain before it launches
Guardian's pre-production reviews cover new chains, and its pentests cover the systems around them.