Reproduced Exploit

Regnum DEToken pays interest on tokens that were just transferred

The pool index is 1.5. Bob holds 100 deposited at index 1.1. Alice holds 1000 at the current index and transfers all of it to Bob. The quoted update adds the 1000 onto Bob's deposit first, then computes interest with Bob's old index:

Jun 2025•Ethereum•arithmetic•3 min read

Loss

Bob is credited 440 of interest. Interest on the 100 he already held is 40. The extra mint is 400

Chain

Ethereum

Category

arithmetic

Date

Jun 2025

Source

AuditVault

EVM Playground

Source-level debugger — step opcodes and Solidity in sync

evm-hack-analyzer

The attack replays in your browser. Step through it by Solidity line or by opcode.

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. Query opens a search over the trace: previous and next writes, balance changes and calls, breakpoints, and a diff of everything that changed between two steps. No backend, no live RPC.

Loading fork state…

Source & credit. Reproduction of a public audit finding curated by AuditVault — the original finding: 66501-c-04-incorrect-detoken-interest-causes-pool-drainage-and-los. Standalone Foundry PoC and full write-up: 66501-c-04-incorrect-detoken-interest-causes-pool-drainage-and-los_exp in the evm-hack-registry mirror.


Vulnerability classes: vuln/arithmetic/interest-on-transfer · vuln/defi/interest-mint

Key info#

FieldValue
LossBob is credited 440 of interest. Interest on the 100 he already held is 40. The extra mint is 400
Vulnerable contractDEToken.transfer
Attacker EOA0x1111111111111111111111111111111111111111
Attack contractExploit at 0x15452ec016c4dc8c549e7fe6ff4b26324ea8b7a4
Attack txExploit.run()
Chain / block / dateEthereum model · block 0 · 2025-06
Compilersolc 0.8.27, cancun, via IR
Bug classInterest uses the recipient balance after the incoming transfer and the recipient's old index
flowchart TD A["Pool index is 1.5. Bob holds 100 at index 1.1. Alice holds 1000"] --> B["Alice transfers 1000 to Bob"] B --> C["Bob's deposit becomes 1100 before interest is taken"] C --> D["VULN 1100 times 0.4 is 440"] D --> E["The extra above the 40 on his old balance is 400"] B --> F["Control takes interest on the 100 he already held"] F --> G["Interest is 40 and the 1000 still moves"]

TL;DR#

The pool index is 1.5. Bob holds 100 deposited at index 1.1. Alice holds 1000 at the current index and transfers all of it to Bob. The quoted update adds the 1000 onto Bob's deposit first, then computes interest with Bob's old index:

1100 * (1.5 - 1.1) = 440.

Interest on the balance he already held is 100 * 0.4 = 40. The fixed transfer uses that prior balance, returns 40, and still delivers the 1000. The extra interest is 400.

The vulnerable code#

SOLIDITY
deposits[to] += amount;
uint256 idx = indexes[to];
interest = deposits[to] * (poolIndex - idx) / 1 ether; // @> VULN: the tokens that just arrived earn Bob's old index gap

The sender side is the quoted debit, which does not mint the sender's accrued interest before the balance changes:

SOLIDITY
if (from != address(0) && from != to) {
    deposits[from] -= amount;
}

Impact#

The recipient is minted interest on tokens they did not hold across the index gap. In the published numbers that is 440 instead of 40, so 400 of interest is created by the transfer.

How to reproduce#

BASH
cd 66501-c-04-incorrect-detoken-interest-causes-pool-drainage-and-los_exp
forge test -vv

test_exploit_interest_uses_the_post_transfer_balance asserts 440. test_control_interest_uses_the_prior_balance asserts 40 and a Bob deposit of 1100.

Sources#


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.