Reproduced Exploit

Regnum Aurum: the same gauge is paid twice in one reward cycle

A cycle snapshots 100 RAAC across two gauges, 50 each. Paying gauge A sets its pending claim to 0 but does not consume distributionCycleBalance. The next distributeRewards for A sees a zero claim and a live cycle balance, recalculates, and pays A another 25 from what was left for B. A ends at 75. B…

May 2025•Ethereum•logic•3 min read

Loss

Gauge A receives 75 of a 100 RAAC cycle. Gauge B is left with 25

Chain

Ethereum

Category

logic

Date

May 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. 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: 66177-h-15-malicious-users-can-distribute-more-rewards-to-the-same. Standalone Foundry PoC and full write-up: 66177-h-15-malicious-users-can-distribute-more-rewards-to-the-same_exp in the evm-hack-registry mirror.


Vulnerability classes: vuln/logic/reward-calculation · vuln/logic/state-update

Key info#

FieldValue
LossGauge A receives 75 of a 100 RAAC cycle. Gauge B is left with 25
Vulnerable contractGaugeRewardsDistributor.distributeRewards
Attacker EOA0x1111111111111111111111111111111111111111
Attack contractExploit
Attack txExploit.run()
Chain / block / dateEthereum model · block 0 · 2025-05
Compilersolc 0.8.27, cancun, via IR
Bug classClearing pendingAllocations makes the next call allocate the gauge again

TL;DR#

A cycle snapshots 100 RAAC across two gauges, 50 each. Paying gauge A sets its pending claim to 0 but does not consume distributionCycleBalance. The next distributeRewards for A sees a zero claim and a live cycle balance, recalculates, and pays A another 25 from what was left for B. A ends at 75. B, paid afterwards, gets 25.

The vulnerable code#

SOLIDITY
if (gaugeShare == 0 && distributionCycleBalance[token] > 0) { // @> VULN
    // gauge already in the cycle is not a reason to skip
    _recalculateAllocations(token);
    gaugeShare = pendingAllocations[token][gauge];
}
// later, after a successful pay
pendingAllocations[token][gauge] = 0; // @> VULN

The report's fix is to refuse a second distribution to a gauge already paid in the cycle.

Root cause#

_distributeRewardToGauge zeros the gauge's pending amount so it cannot be paid twice. _checkAndAddGaugeToCycle treats that zero, while distributionCycleBalance is still positive, as "this gauge has not been allocated yet" and calls _recalculateAllocations. The recalculation overwrites every gauge's claim from the tokens still held, including gauges that were already paid.

Preconditions#

  • Two gauges are registered before the cycle starts.
  • The distributor holds 100 RAAC. The snapshot splits it 50 and 50.
  • Anyone may call distributeRewards. No role is required.

Attack walkthrough#

  1. The first call starts the cycle and pays A its 50. Pending A becomes 0. Pending B is still 50. The contract still holds 50.
  2. The second call for A hits gaugeShare == 0 && distributionCycleBalance > 0.
  3. Recalculation sets both claims to 25, half of the remaining balance. A is paid 25 more.
  4. B's later call pays the rewritten 25. A holds 75. B holds 25.

Diagrams#

flowchart TD A["Cycle snapshots 100 RAAC as 50 and 50"] --> B["First pay sends 50 to gauge A and zeros its claim"] B --> C["VULN zero claim plus a live cycle balance reallocates"] C --> D["Remaining 50 is split again"] D --> E["Gauge A is paid another 25 and holds 75"] E --> F["Gauge B is left with 25"]

Impact#

A caller can move another gauge's unsent rewards onto a gauge of their choice inside the same cycle. Here that is 25 RAAC, a quarter of the cycle, taken from gauge B. The fair split of this cycle was 50 and 50.

How to reproduce#

BASH
cd 66177-h-15-malicious-users-can-distribute-more-rewards-to-the-same_exp
forge test -vv

test_same_gauge_is_paid_twice_in_one_cycle asserts gauge A holds 75 RAAC and gauge B holds 25.

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.