Reproduced Exploit
Open Dollar — incorrect calculations for surplus auction creation
1. auctionSurplus compares surplusTransferPercentage to ONE_HUNDRED_WAD (always true). 2. amountToSell uses wmul(ONE_HUNDRED_WAD - pct) → ~99× surplusAmount. 3. At 100% transfer, a ghost auction of 297 still starts while 3 is transferred. 4. Double-counting breaks accounting and can underflow elsew…
Chain
Other
Category
untagged
Date
Oct 2023
Source
AuditVault
EVM Playground
Source-level debugger — step opcodes and Solidity in sync
The attack is replayed in an in-browser EVM preloaded with the exact dumped fork state. The execution tree shows every call; step by Solidity line or by opcode across all depths — source, Stack, Memory, Storage, Balances (native / ERC-20 / NFT), Transient storage and Return value stay in sync. Click a tree node, opcode, or source line to jump. No backend, no live RPC.
Source & credit. Reproduction of a public audit finding curated by AuditVault — the original finding: 29347-h-01-incorrect-calculations-for-surplus-auction-creation-cau. Standalone Foundry PoC and full write-up: 29347-h-01-incorrect-calculations-for-surplus-auction-creation-cau_exp in the
evm-hack-registrymirror.
Vulnerability classes: underflow · known-pattern · direct-drain · integer-bounds
Reproduction: a self-contained Foundry PoC that compiles & runs in an isolated project with only
forge-std— no fork, no RPC, noanvil_state. Full trace: output.txt. PoC: test/29347-h-01-incorrect-calculations-for-surplus-auction-creation-cau_exp.sol.
Key info#
| Impact | HIGH — ONE_HUNDRED_WAD used instead of WAD creates 99× inflated ghost surplus auctions and double-counts surplus |
| Protocol | Open Dollar |
| Vulnerable code | AccountingEngine |
| Bug class | underflow |
| Finding | Code4rena — Open Dollar, 2023-10 · #29347 · reporter tnquanghuy0512 |
| Report | code4rena.com/reports/2023-10-opendollar |
| Source | AuditVault |
| Status | Audit finding — caught in review, not exploited on-chain. Reproduced as a standalone local PoC. |
| Compiler | ^0.8.24 (PoC) |
This is an audit finding, not a historical on-chain incident. The PoC keeps
the vulnerable logic verbatim (marked @> VULN) and reduces dependencies
to the minimum needed to show the claimed harm.
TL;DR#
- auctionSurplus compares surplusTransferPercentage to ONE_HUNDRED_WAD (always true).
- amountToSell uses wmul(ONE_HUNDRED_WAD - pct) → ~99× surplusAmount.
- At 100% transfer, a ghost auction of 297 still starts while 3 is transferred.
- Double-counting breaks accounting and can underflow elsewhere.
The vulnerable code#
See test/29347-h-01-incorrect-calculations-for-surplus-auction-creation-cau.sol — the @> VULN marker is on the blamed line (line 130 in the synthetic).
Root cause#
Percentage math uses ONE_HUNDRED_WAD (100e18) where WAD (1e18) is required.
Preconditions#
Protocol operating conditions that make the path reachable (see finding report). No exotic privileges beyond those the real call path requires.
Attack walkthrough#
From output.txt: the Exploit.run() path executes the attack end-to-end and requires the harm.
Diagrams#
Impact#
Massively inflated surplus auctions plus full transfer — accounting insolvency risk.
Sources#
Sources & further analysis#
Reproductions & code
- Standalone PoC + full trace: 29347-h-01-incorrect-calculations-for-surplus-auction-creation-cau_exp (evm-hack-registry mirror).
- AuditVault finding: 29347-h-01-incorrect-calculations-for-surplus-auction-creation-cau.
Alerts & third-party analyses
These dashboards index community alerts tweets, post-mortems, and independent write-ups. Reach them through the protocol name above to cross-check this reproduction against other analyses.