# Reward index not checkpointed on parameter change

Admin setters that change reward rate, multiplier or commission without first settling accrued rewards

_Area: DeFi accounting and math bugs. Seen in 4 disclosed reports; latest 2026-08-20. Updated 2026-11-09._

## How it works
Reward accounting keeps a running index (reward-per-share) that only advances when someone interacts. Rewards earned but not yet claimed live in the gap between the stored index and the current parameters. When an admin or config path writes a new rate, multiplier, commission or end-time *without first checkpointing the index*, that gap is re-priced under the new parameters. The result is retroactive: rewards already earned but unclaimed are silently rewritten, inflated or stranded. The broken assumption is that parameter state and accrual state move together; a setter that writes one without settling the other breaks it.

## Where it shows up
- Admin/config setters touching emission rate, reward rate, multiplier, commission, or period end-time.
- A setter that writes new params but never calls the checkpoint/update-index function first.
- Cross-contract calls whose decoded return type can silently fall into a default/zero branch, skipping the index update.

## How to review
For every setter that mutates reward parameters, confirm the invariant: **the reward index is checkpointed immediately before any parameter write, so no unaccrued rewards are re-priced.** Then check:
- Every admin setter that mutates emission/rate/end-time has a prior index checkpoint [E3](https://bugbountylibrary.com/r/c4%3A2026-04-k2%3AM-06.md).
- Cross-contract return values are decoded at the correct width; a type mismatch must not hit a zero/default fallback that skips the index update [E3](https://bugbountylibrary.com/r/c4%3A2026-04-k2%3AM-06.md).

## How finders spotted it
- Reviewed admin setters and noticed missing checkpoint calls, then spotted a `u128`/`i128` mismatch in the `scaled_total_supply` invocation hitting the `_ => 0` fallback [E3](https://bugbountylibrary.com/r/c4%3A2026-04-k2%3AM-06.md).

## Variants seen
- Admin setter skips index checkpoint; a type mismatch skips it too [E3](https://bugbountylibrary.com/r/c4%3A2026-04-k2%3AM-06.md).

## Impact and severity
Medium. Unaccrued rewards are miscredited retroactively [E3](https://bugbountylibrary.com/r/c4%3A2026-04-k2%3AM-06.md). Impact scales with pool size and how often parameters change.

## Evidence
- E1: https://bugbountylibrary.com/r/sherlock%3A2024-06-magicsea%3AM-2.md
- E2: https://bugbountylibrary.com/r/cantina%3Agoat_mar2024%3A3.1.3.md
- E3: https://bugbountylibrary.com/r/c4%3A2026-04-k2%3AM-06.md
- E4: https://bugbountylibrary.com/r/c4%3A2025-10-hybra-finance%3AM-05.md
