# Loss of reward tokens during initiating withdrawal due to cooldown

Withdrawing during reward-claim cooldown skips external reward claim, so exiting user forfeits unclaimed rewards to remaining holders.

- Payout: Audit contest
- Severity: medium
- Program: Notional
- Found by: 0xDeoGratias
- Disclosed: 2025-06-27
- Write-up quality: 6/10
- Original: https://github.com/sherlock-audit/2025-06-notional-exponent-judging/issues/669
- Library page: https://bugbountylibrary.com/r/sherlock%3A2025-06-notional-exponent%3AM-15
- Tags: area:web3 domain:web3 impact:funds-loss kind:contest platform:sherlock sev:medium tech:solidity technique:source-review vuln:accounting-error vuln:reward-distribution

**Target:** AbstractRewardManager / RewardManagerMixin reward accounting
**Root cause:** _claimVaultRewards returns early when block.timestamp < lastClaimTimestamp + forceClaimAfter, so accumulatedRewardPerVaultShare is stale when a user initiates withdrawal and claims their final rewards.
**Steps:**
1. Set forceClaimAfter=15min, effectiveSupply=10, accumulatedRewardPerVaultShare=0.
2. At T5 rewards accrue; claim updates accumulatedRewardPerVaultShare to 0.5 and lastClaimTimestamp=T5.
3. At T10 user calls initiateWithdraw; _initiateWithdraw calls _updateAccountRewards -> _claimVaultRewards.
4. Cooldown check `block.timestamp < lastClaimTimestamp + forceClaimAfter` returns early, skipping claim of 5 WETH accrued since T5.
5. _claimRewardToken pays user based on stale 0.5 accumulator, giving 2.5 WETH instead of 5; remainder accrues to other holders.
**How found:** Code review of reward accounting invariant: effectiveSupply changes must be preceded by a claim to update accumulators; noticed the early-return cooldown guard violates this on withdrawal.
**Exploitation:** Any withdrawing user during the cooldown window loses their share of rewards accrued since the last claim; remaining holders capture it. No attacker action needed beyond timing a withdrawal.
**Insight:** When a claim is gated by a cooldown, check every path that mutates share supply (deposit/withdraw/escrow) — any supply change during cooldown leaves the per-share accumulator stale and misallocates rewards.

