Reproduced Exploit
ERC-20 fees are permanently locked in Treasury — frozen funds
The Treasury exposes a native-ETH withdrawal only. ERC-20 fee tokens accumulate at the contract and the attempted token recovery selector reverts, leaving the balance frozen.
Loss
ERC-20 fee balances sent to Treasury cannot be recovered
Chain
Ethereum
Category
dos
Date
Mar 2025
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: 57056-erc-20-tokens-cannot-be-withdrawn-from-treasury-contract-tra. Standalone Foundry PoC and full write-up: 57056-erc-20-tokens-cannot-be-withdrawn-from-treasury-contract-tra_exp in the
evm-hack-registrymirror.
Vulnerability classes: vuln/dos/frozen-funds · vuln/logic/missing-check
Reproduction: self-contained synthetic Foundry reduction; see output.txt.
Key info#
| Field | Value |
|---|---|
| Loss | ERC-20 fee balances sent to Treasury cannot be recovered |
| Vulnerable contract | Treasury.withdraw (ETH-only) |
| Attacker EOA | 0x1111111111111111111111111111111111111111 |
| Attack contract | FeeToken and Treasury via Exploit |
| Attack tx | Exploit.run() |
| Chain / block / date | Ethereum model · block 0 · 2025-03 |
| Compiler | solc 0.8.24 (synthetic) |
| Bug class | Missing ERC-20 withdrawal path |
TL;DR#
The Treasury exposes a native-ETH withdrawal only. ERC-20 fee tokens accumulate at the contract and the attempted token recovery selector reverts, leaving the balance frozen.
Background#
Otim accepts registered ERC-20 fee tokens but the reviewed Treasury implementation only checks address(this).balance. This reduction models the asset-flow mismatch.
The vulnerable code#
function withdraw(address target, uint256 value) external {
(bool ok,) = payable(target).call{value: value}(""); // ETH only
require(ok);
}
Root cause#
The contract has no owner-authorized IERC20(token).transfer recovery function, so token balances are not part of the withdrawal design.
Preconditions#
- Users pay fees with an ERC-20 accepted by the protocol.
- The token is transferred to Treasury.
Attack walkthrough#
Exploitmints 1,000 fee tokens to Treasury.- It calls the absent
withdrawTokenselector. - The
Proofevent at output.txt:373 shows all 1,000 tokens remain locked.
Diagrams#
Remediation#
Add an owner-authorized, checked ERC-20 withdrawal that rejects zero targets and emits an event; cover every supported fee asset with recovery tests.
How to reproduce#
cd evm-hack-registry/57056-erc-20-tokens-cannot-be-withdrawn-from-treasury-contract-tra_exp
forge test -vvvvv
Sources#
Sources & further analysis#
Reproductions & code
- Standalone PoC + full trace: 57056-erc-20-tokens-cannot-be-withdrawn-from-treasury-contract-tra_exp (evm-hack-registry mirror).
- AuditVault finding: 57056-erc-20-tokens-cannot-be-withdrawn-from-treasury-contract-tra.
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.