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.

Mar 2025Ethereumdos2 min read

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

evm-hack-analyzer

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.

Loading fork state…

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-registry mirror.


Vulnerability classes: vuln/dos/frozen-funds · vuln/logic/missing-check

Reproduction: self-contained synthetic Foundry reduction; see output.txt.

Key info#

FieldValue
LossERC-20 fee balances sent to Treasury cannot be recovered
Vulnerable contractTreasury.withdraw (ETH-only)
Attacker EOA0x1111111111111111111111111111111111111111
Attack contractFeeToken and Treasury via Exploit
Attack txExploit.run()
Chain / block / dateEthereum model · block 0 · 2025-03
Compilersolc 0.8.24 (synthetic)
Bug classMissing 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#

SOLIDITY
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#

  1. Exploit mints 1,000 fee tokens to Treasury.
  2. It calls the absent withdrawToken selector.
  3. The Proof event at output.txt:373 shows all 1,000 tokens remain locked.

Diagrams#

flowchart LR U[Fee payer] --> T[Treasury ERC-20 balance] T --> X[ETH-only withdraw] X --> L[Token remains frozen]

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#

BASH
cd evm-hack-registry/57056-erc-20-tokens-cannot-be-withdrawn-from-treasury-contract-tra_exp
forge test -vvvvv

Sources#

Reference: https://github.com/trailofbits/publications/blob/master/reviews/2025-03-otim-smart-wallet-securityreview.pdf


Sources & further analysis#

Reproductions & code

Alerts & third-party analyses

  • Web3Sec X hacked database: search.
  • Rekt leaderboard: search.
  • Solodit incident search: search.

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.