# Minter.sol#_executeInflationRateUpdate() inflationManager().checkpointAllGauges() is called after InflationRate is updated, causing users to lose rewards

Minter updates inflation rates before checkpointing gauges, so elapsed time is settled at the new decayed rate, shortchanging stakers' accrued rewards.

- Payout: Contest reward
- Severity: medium
- Program: Backd
- Credited: WatchPug
- Disclosed: 2022-07-19
- Write-up quality: 6/10
- Original: https://github.com/code-423n4/2022-05-backd-findings/issues/98
- Library page: https://bugbountylibrary.com/r/c4%3A2022-05-backd%3AM-06
- Tags: domain:web3 impact:funds-loss kind:contest platform:code4rena sev:medium tech:solidity technique:source-review vuln:accounting-error vuln:reward-distribution

**Target:** Minter.sol / InflationManager gauge checkpointing (Solidity tokenomics contracts)
**Root cause:** _executeInflationRateUpdate() decays currentInflationAmount* before calling inflationManager().checkpointAllGauges(); poolCheckpoint() then multiplies elapsed time by the already-reduced rate instead of the rate in effect during that period.
**Steps:**
1. Set state: currentInflationAmountAmm=12000 Bkd, annualInflationDecayAmm=50%, initialPeriodEnded=true, lastInflationDecay=11 months ago, _INFLATION_DECAY_PERIOD=1 year.
2. Alice is sole staker in AmmGauge; wait 1 month.
3. Call `Minter._executeInflationRateUpdate()`: rate is scaled by 50% first, then `checkpointAllGauges()` runs.
4. `AmmGauge.poolCheckpoint()` computes `currentRate * timeElapsed` using the decayed rate.
5. Alice claims and receives 500 Bkd instead of the expected 1000 Bkd.
**How found:** Code reading of the ordering in _executeInflationRateUpdate(): noticed checkpointAllGauges() is invoked after currentInflationAmount* is decayed, then traced poolCheckpoint() to confirm it reads the live (already-updated) rate for the whole elapsed window.
**Insight:** When a checkpoint settles elapsed time against a live rate getter, verify the rate mutation happens after settlement; any decay/parameter change before checkpoint retroactively reprices the entire un-settled window.
