Skip to content
Business logic Audit finding Intermediate

Manager can retroactively apply new rate to past time, misallocating emissions - Invariant Broken

The staking contract's setMintRate function overwrites the mint rate without first applying rewards for the elapsed time, so the next reward update charges the entire past interval at the new rate. A manager can retroactively change the rate and distort emissions, overpaying or underpaying rewards.

0xB4nkz Follow with 0xCrypt0nite, 0xDjango and 47 others

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2025-09-super-dca-judging/issues/928 

## Found by 
0xB4nkz, 0xCrypt0nite, 0xDjango, 0xaxaxa, 0xheartcode, 0xlookman, 0xpetern, Aamirusmani1552, Al-Qa-qa, Bbash, BengalCatBalu, Boy2000, BoyD, DemiGods, DuoSec, HeckerTrieuTien, Ironsidesec, JeRRy0422, JuggerNaut, LonWof-Demon, NHristov, Ollam, R, Sir\_Shades, VCeb, Victor\_TheOracle, Xmanuel, alekso91, cholakovvv, denys\_sosnovskyi, engineer, farman1094, har0507, heavyw8t, itsRavin, jayjoshix, ke1caM, khaye26, maigadoh, merlin, ni8mare, peazzycole, r1ver, shieldrey, silver\_eth, soloking, tinnohofficial, tobi0x18, vinica\_boy, vivekd, whitehair0330, x0t0wt1w

### Summary

The staking system is supposed to [guarantee](https://github.com/sherlock-audit/2025-09-super-dca/blob/main/README.md?plain=1#L53C1-L55C97):

> - Exact increment formula:
>   - On any call that triggers `_updateRewardIndex()` with `elapsed = block.timestamp - lastMinted` and totalStakedAmount > 0:
>     - rewardIndex increases by `Math.mulDiv(elapsed * mintRate, 1e18, totalStakedAmount)` **exactly**.

But in `SuperDCAStaking.sol`, `setMintRate()` overwrites `mintRate` immediately without first applying rewards for the elapsed time. This breaks the invariant: the next reward update uses the **new** rate for the **past** interval, instead of the old rate. A manager (or attacker with control) can backdate a rate change and distort emissions.

### Root Cause

In `setMintRate()` (around [line 171](https://github.com/sherlock-audit/2025-09-super-dca/blob/main/super-dca-gauge/src/SuperDCAStaking.sol#L171) in `SuperDCAStaking.sol`):

```solidity
mintRate = newMintRate; // ❌ overwrites before old rewards are applied
```

Since `_updateRewardIndex()` isn’t called first, the entire `elapsed = now - lastMinted` window gets charged at the *new* rate.

### Internal Pre-conditions

1. `totalStakedAmount > 0`.
2. Time has passed since `lastMinted`.
3. Authorized address calls `setMintRate(newRate)` before any update.

### External Pre-conditions

* None.

### Attack Path

1. Stakers are earning at rate 10/sec.
2. 1000 seconds pass, but no update occurs.
3. Manager calls `setMintRate(1000)`.
4. On next accrual, `_updateRewardIndex()` applies the whole 1000 seconds at 1000/sec, not 10/sec.

### Impact

* The intended invariant (“past time is priced at the old rate”) is broken.
* Rewards are overpaid or underpaid depending on rate change.
* This can be abused by a malicious manager, or simply distort rewards if done accidentally.

### PoC

*In the above example,*

* Should mint: `1000 * 10 = 10,000`.
* Actually mints: `1000 * 1000 = 1,000,000`.

### Mitigation

Apply old rewards first, then update the rate:

```solidity
_updateRewardIndex();  // �
 apply old rate to past interval
mintRate = newMintRate;
```

## Discussion

**sherlock-admin2**

The protocol team fixed this issue in the following PRs/commits:
https://github.com/Super-DCA-Tech/super-dca-gauge/pull/46

The original report as published on Sherlock, by 0xB4nkz. Images and videos are our own copies; raw HTML is shown as text. View it on Sherlock.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the setMintRate function assigns the new rate before calling _updateRewardIndex, so the elapsed interval is priced at the new rate instead of the old one.

Impact

Rewards could be overpaid or underpaid depending on the rate change, and a malicious manager could abuse this to distort emissions.

What the attacker needed

TotalStakedAmount > 0; time has passed since lastMinted; authorized address calls setMintRate

The fix

The protocol team fixed this issue by applying old rewards first and then updating the rate.

How it was found

  1. Stakers are earning at an initial rate.
  2. A long period passes without any reward update.
  3. The manager calls setMintRate with a much higher value.
  4. On the next accrual, the whole elapsed period is charged at the new rate.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

A staking contract pays rewards at a certain rate per second. When an admin changes that rate, the contract should first pay out what was earned at the old rate, then switch. Here it switched first, so the whole past period got paid at the new rate, which can massively overpay or underpay people.

What is Business logic?

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.

More by 0xB4nkz

View all

1 more disclosed report, best first.

More from Super DCA Liquidity Network

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.