Reproduced Exploit
BaseGauge pays the distributor-wide reward rate and empties the other gauge's share
The gauge's own notified rate is 100 ether per second. The shared distributor's getRewardRate is 200 ether per second because a second gauge is funded from the same stream. _calculatePendingRewards writes that rate into currentRate and the single staker is paid 200 ether. claimFixed, which keeps th…
Loss
100 ether of reward tokens that belonged to the other gauge
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: 66176-h-14-incorrect-reward-calculation-in-calculatependingreward. Standalone Foundry PoC and full write-up: 66176-h-14-incorrect-reward-calculation-in-calculatependingreward_exp in the
evm-hack-registrymirror.
Vulnerability classes:
vuln/logic/reward-calculation
Key info#
| Field | Value |
|---|---|
| Loss | 100 ether of reward tokens that belonged to the other gauge |
| Vulnerable contract | BaseGauge._calculatePendingRewards |
| Attacker EOA | 0x1111111111111111111111111111111111111111 |
| Attack contract | Exploit |
| Attack tx | Exploit.run() |
| Chain / block / date | Ethereum model · block 0 · 2025-05 |
| Compiler | solc 0.8.27, cancun, via IR |
| Bug class | Gauge copies the shared distributor rate |
TL;DR#
The gauge's own notified rate is 100 ether per second. The shared distributor's getRewardRate is 200 ether per second because a second gauge is funded from the same stream. _calculatePendingRewards writes that rate into currentRate and the single staker is paid 200 ether. claimFixed, which keeps the notified rate, pays 100 ether and leaves 100 ether in the gauge.
Background#
Pashov Audit Group's May 2025 Regnum Aurum review, finding H-14 (AuditVault 66176). BaseGauge reads the reward rate from IGaugeRewardsDistributor.getRewardRate whenever a distributor is configured. That rate is not this gauge's notified amount.
The vulnerable code#
currentRate = rate; // @> VULN: distributor-wide rate replaces this gauge's notified rate
// FIX: keep the rate stored when this gauge was notified
The change that removes the harm:
- currentRate = rate;
+ // keep notifiedRate
Root cause#
The pending-reward formula multiplies currentRate by the elapsed time. The assignment replaces the gauge-local rate with the distributor's global rate before that multiplication. One second at timestamp 1 therefore pays 200 ether instead of 100 ether.
Preconditions#
- Distributor rate is 200 ether per second. This gauge was notified 100 ether per second and was funded with a 200 ether pot.
- One staker owns the entire gauge supply.
lastUpdateis 0 and the block timestamp is 1, so one second of rewards is due.
Attack walkthrough#
- The staker deposits 1 ether of gauge weight.
- Fair payout at the notified rate is 100 ether.
claimloadsgetRewardRateand stores 200 ether incurrentRate.- The gauge transfers 200 ether to the staker and its balance is 0.
- The control
claimFixedpays 100 ether and leaves 100 ether in the gauge.
Diagrams#
Impact#
The staker receives 200 ether. Half of that was the other gauge's allocation. After the buggy claim the reward pot is empty, so the other gauge cannot pay its stakers.
Remediation#
Do not copy getRewardRate from the distributor over the rate stored when this gauge was notified. Pay notifiedRate.
How to reproduce#
cd 66176-h-14-incorrect-reward-calculation-in-calculatependingreward_exp
forge test -vv
test_exploit is the harm. The control test is the guarded path. Captured output is output.txt.
Sources#
- AuditVault finding: https://github.com/Auditware/AuditVault/blob/main/findings/66176-h-14-incorrect-reward-calculation-in-calculatependingreward.md
- Pashov report: https://github.com/pashov/audits/blob/master/team/md/RegnumAurum-security-review_2025-05-06.md
- Quoted function:
BaseGauge._calculatePendingRewards
Sources & further analysis#
Reproductions & code
- Standalone PoC + full trace: 66176-h-14-incorrect-reward-calculation-in-calculatependingreward_exp (evm-hack-registry mirror).
- AuditVault finding: 66176-h-14-incorrect-reward-calculation-in-calculatependingreward.
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.