← Lab /Software

Smart contract invariants block all known Ethereum exploits in benchmark

Human-authored invariants would have prevented every attack in the INVARIANTEVAL benchmark

Software arXiv 13 Aug 2026 Defense Prototype evidence

Published as “Smart Contract Invariants Protect Against Cybercriminals”

Why it matters

A single correctly placed invariant can stop multi-million-dollar exploits, but current automatic tools cannot discover them, highlighting a critical gap for practical smart-contract security.

Summary

Every human-authored invariant in the INVARIANTEVAL benchmark blocks its real-world attack (28/28, 100%) and preserves 98.3% of 108,637 historical transactions, but automatic invariant generators recover only 2 of the 28 needed invariants. The evidence comes from replaying both the exploit and the full transaction history on hardened bytecode.

What they found 2

  1. All 28 ground-truth invariants block both the proof-of-concept exploit and the actual attack transaction.

    “All 28 ground-truth invariants block: 1) the proof-of-concept exploit 2) the actual attack transaction. In both cases, the transaction reverts, it reverts at the expected vulnerable step, and it reverts with the revert message written in the invariant. This perfect result 28/28 (100%) is a consequence of our ground truth protocol.”

  2. Behavior of the hardened contracts matches the original contracts for 98.3% of replayed historical transactions.

    “106,815 (98.3% of total replayed) transactions pass the preservation check, indicating equivalent behaviour between the recompiled and hardened contracts; this is presented in column Pres. of Table III.”

Caveats 5

  • Some invariants are over-restrictive, causing legitimate user transactions to revert (1.4% of replays).
  • Tight numerical bounds can reject benign traffic during normal price volatility.
  • Only 2 of the 28 needed invariants are automatically recovered by existing tools.
  • There are 25 attacks for which we did not succeed in writing the securing invariant. This is because of our limited expertise of the target protocol and the time-bound budget.
  • Only 2 of the 28 ground-truth invariants can be synthesized, both by FLAMES; the other tools generate no matching invariant.

What’s new here 4

  • First large-scale, on-chain evaluation of invariants against 28 real Ethereum exploits.
  • Introduces PONDEREPLAY, a historical replay framework that verifies both attack blocking and functional preservation.
  • Provides a human-authored benchmark (INVARIANTEVAL) linking each exploit to a concrete attack-stopping invariant.
  • Shows that existing automatic invariant synthesis tools fail to generate the necessary guards for real attacks.