Reproduced Exploit

Regnum RToken applies the liquidity index twice and reports 157.5

The published example deposits 100 while liquidityIndex is 1. The index grows to 1.05, so that deposit reads 105. A second deposit of 50 is added straight onto the raw total, which is now 150. totalSupply multiplies by the index again: 150 * 1.05 = 157.5.

Jun 2025•Ethereum•arithmetic•3 min read

Loss

totalSupply reports 157.5. One application of the 1.05 index reports 154.999... The gap is 2.5 ether plus 1 w…

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: 66508-h-07-incorrect-rtoken-scaling-inflates-supply-and-breaks-res. Standalone Foundry PoC and full write-up: 66508-h-07-incorrect-rtoken-scaling-inflates-supply-and-breaks-res_exp in the evm-hack-registry mirror.


Vulnerability classes: vuln/arithmetic/index-scaling · vuln/defi/supply-accounting

Key info#

FieldValue
LosstotalSupply reports 157.5. One application of the 1.05 index reports 154.999... The gap is 2.5 ether plus 1 wei. The report's unrounded total is 155
Vulnerable contractRToken.totalSupply
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 classA new deposit is added to the raw total and the raw total is then multiplied by the liquidity index
flowchart TD A["Deposit 100 at index 1, then the index becomes 1.05"] --> B["Deposit 50 and add it raw"] B --> C["VULN totalSupply multiplies raw 150 by 1.05"] C --> D["The reported supply is 157.5"] B --> E["Control divides the new 50 by the index before adding it"] E --> F["The reported supply is 154.999..."]

TL;DR#

The published example deposits 100 while liquidityIndex is 1. The index grows to 1.05, so that deposit reads 105. A second deposit of 50 is added straight onto the raw total, which is now 150. totalSupply multiplies by the index again: 150 * 1.05 = 157.5.

The report's unrounded honest total is (100 * 1.05) + 50 = 155. Integer scaling divides the new 50 by 1.05 before storing it and then multiplies once, which is 154.999... wei short of 155 because 1.05 ether does not divide 50 ether evenly. The quoted path is 2.5 ether + 1 wei above that scaled total.

The vulnerable code#

SOLIDITY
function deposit(uint256 amount) external {
    raw += amount;
}

function totalSupply() public returns (uint256 supply) {
    supply = raw * idx / 1 ether; // @> VULN: the second deposit is multiplied by the index a second time
}

Impact#

Reserve and utilization math that reads this supply sees 157.5 where one pass of the index is 154.999... The second deposit of 50 is scaled a second time as soon as it is added.

How to reproduce#

BASH
cd 66508-h-07-incorrect-rtoken-scaling-inflates-supply-and-breaks-res_exp
forge test -vv

test_exploit_second_deposit_is_scaled_twice asserts 157.5 ether. test_control_scales_the_deposit_once asserts 154999999999999999999.

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.