Reproduced Exploit
Polynomial — Hedging during liquidation over-hedges the LiquidityPool
Liquidation already balances short inventory and powerPerp burn, but pool.liquidate still hedges again and burns pool funds as fees
Chain
Other
Category
liquidation
Date
Mar 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: 20225-h-02-hedging-during-liquidation-is-incorrect-code4rena-polyn. Standalone Foundry PoC and full write-up: 20225-h-02-hedging-during-liquidation-is-incorrect-code4rena-polyn_exp in the
evm-hack-registrymirror.
Vulnerability classes: vuln/liquidation/incorrect-hedge · vuln/accounting/double-count
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/20225-h-02-hedging-during-liquidation-is-incorrect-code4rena-polyn_exp.sol.
AuditVault taxonomy: lang/solidity · sector/perpetuals · platform/code4rena · severity/high · genome: liquidation-logic
Key info#
| Impact | HIGH — Liquidation already balances short inventory and powerPerp burn, but pool.liquidate still hedges again and burns pool funds as fees |
| Protocol | Polynomial Protocol |
| Finding | Code4rena — Polynomial Protocol, 2023-03 · #20225 |
| Report | 2023-03-polynomial |
| Source | AuditVault |
| Status | Audit finding — reproduced as a standalone local synthetic PoC. |
| Compiler | ^0.8.24 (PoC) |
TL;DR#
Liquidation already balances short inventory and powerPerp burn, but pool.liquidate still hedges again and burns pool funds as fees
See the vulnerable line marked // @> VULN in test/20225-h-02-hedging-during-liquidation-is-incorrect-code4rena-polyn.sol and the
end-to-end Exploit.run() that asserts the harm.
Diagrams#
Impact#
Liquidation already balances short inventory and powerPerp burn, but pool.liquidate still hedges again and burns pool funds as fees
Sources#
- AuditVault finding
- Code4rena report
- Reduced source: synthetic reconstruction of the blamed functions from the contest repo (see finding for verbatim snippets).
Sources & further analysis#
Reproductions & code
- Standalone PoC + full trace: 20225-h-02-hedging-during-liquidation-is-incorrect-code4rena-polyn_exp (evm-hack-registry mirror).
- AuditVault finding: 20225-h-02-hedging-during-liquidation-is-incorrect-code4rena-polyn.
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.