Reproduced Exploit
Regnum Aurum: removing a distribution pool does not reduce totalWeight
removeDistributionPool deletes poolInfo[pool] and then subtracts poolInfo[pool].weight. The delete has already zeroed the weight, so totalWeight does not change. The next mint still divides by the old total. With A and B at weight 50, removing B leaves totalWeight at 100. A mint of 100 RAAC pays A…
Loss
50 of 100 minted RAAC stays in the minter. Pool A is paid 50 instead of 100
Chain
Ethereum
Category
logic
Date
May 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. 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.
Source & credit. Reproduction of a public audit finding curated by AuditVault — the original finding: 66171-h-09-removing-distribution-pool-in-raacminter-does-not-updat. Standalone Foundry PoC and full write-up: 66171-h-09-removing-distribution-pool-in-raacminter-does-not-updat_exp in the
evm-hack-registrymirror.
Vulnerability classes:
vuln/logic/incorrect-order-of-operations·vuln/logic/reward-calculation
Key info#
| Field | Value |
|---|---|
| Loss | 50 of 100 minted RAAC stays in the minter. Pool A is paid 50 instead of 100 |
| Vulnerable contract | RAACMinter.removeDistributionPool |
| Attacker EOA | 0x1111111111111111111111111111111111111111 (calls the documented updater removal) |
| Attack contract | Exploit |
| Attack tx | Exploit.run() |
| Chain / block / date | Ethereum model · block 0 · 2025-05 |
| Compiler | solc 0.8.27, cancun, via IR |
TL;DR#
removeDistributionPool deletes poolInfo[pool] and then subtracts poolInfo[pool].weight. The delete has already zeroed the weight, so totalWeight does not change. The next mint still divides by the old total. With A and B at weight 50, removing B leaves totalWeight at 100. A mint of 100 RAAC pays A 50. The other 50 never leaves the minter.
The vulnerable code#
poolInfo[pool].exists = false;
if (fixedMode) {
totalWeight = totalWeight - poolInfo[pool].weight;
delete poolInfo[pool];
} else {
delete poolInfo[pool];
totalWeight = totalWeight - poolInfo[pool].weight; // @> VULN: the weight just deleted is zero
}
The review's fix reads the weight before the delete:
- delete poolInfo[pool];
totalWeight = totalWeight - poolInfo[pool].weight;
+ delete poolInfo[pool];
Root cause#
delete on the struct clears weight and exists. The subtraction on the next line therefore loads 0. The removed pool's weight stays inside totalWeight and shrinks every later share. The pool is also left in distributionPools, so the mint loop still visits it and skips it because exists is false.
Preconditions#
- Two pools are registered at weight 50.
totalWeightis 100. - The updater removes pool B. That is the function's job, not an extra privilege.
- A later mint processes 100 RAAC that already sit on the minter.
Attack walkthrough#
- The updater calls
removeDistributionPoolon B. existsis cleared, then the struct is deleted.totalWeightis reduced by 0 and stays 100.processMintedRewards(100 ether)pays100 * 50 / 100to A.- 50 RAAC remains on the minter.
paidis 50. - The control subtracts 50 before the delete. The same mint pays A 100 and leaves the minter empty.
Diagrams#
Impact#
Depositors of the surviving pool receive half of a mint that should have been entirely theirs. The other half is not distributed to any pool. Repeating the removal against a larger set leaves a matching fraction of every later mint undistributed.
How to reproduce#
cd 66171-h-09-removing-distribution-pool-in-raacminter-does-not-updat_exp
forge test -vv
test_exploit_removed_weight_stays_in_total asserts totalWeight is 100, pool A received 50, and the minter still holds 50. test_control_subtracts_weight_before_delete asserts totalWeight is 50 and pool A receives 100.
Sources#
- AuditVault finding: https://github.com/Auditware/AuditVault/blob/main/findings/66171-h-09-removing-distribution-pool-in-raacminter-does-not-updat.md
- Same report, duplicate ingestion 66350: https://github.com/Auditware/AuditVault/blob/main/findings/66350-h-09-removing-distribution-pool-in-raacminter-does-not-updat.md
- Pashov review: https://github.com/pashov/audits/blob/master/team/md/RegnumAurum-security-review_2025-05-06.md
Sources & further analysis#
Reproductions & code
- Standalone PoC + full trace: 66171-h-09-removing-distribution-pool-in-raacminter-does-not-updat_exp (evm-hack-registry mirror).
- AuditVault finding: 66171-h-09-removing-distribution-pool-in-raacminter-does-not-updat.
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.