Hook
I found the bug at 3 AM. Not because I was looking for it, but because the math didn’t breathe right. The freshly funded Layer2 project — let’s call it ZK-Orbit — had just crossed $100M in total value locked. Its marketing screamed "Ethereum-scale, zero-knowledge finality." Its code screamed something else. A single unchecked arithmetic operation in the bridge contract allows an attacker to mint an unlimited amount of wrapped ETH. The pool remembers what the ticker forgets, and the ticker forgot to overflow.
Context
ZK-Orbit launched three weeks ago, backed by a tier-1 venture firm and a chorus of influencers. It promises near-instant withdrawals and a fraction of gas costs compared to Ethereum mainnet. In a bull market where every new L2 is hailed as the next scaling savior, ZK-Orbit’s TVL grew rapidly as users migrated liquidity from Arbitrum and Optimism. The narrative is perfect: faster, cheaper, safer. But safety is a function of code, not of marketing materials. Based on my audit experience from the 2017 ICO boom, I’ve learned that the most dangerous vulnerabilities are the ones that look like features. Here, the bridge contract’s deposit function uses a Solidity version prior to 0.8.0, meaning arithmetic underflows are not automatically reverted. The code is law, but audits are mercy — and this project never had a thorough one.
Core
Let me walk through the technical details. The bridge contract has a deposit function that accepts ETH, mints wrapped tokens, and updates a totalSupply variable. The critical line is: