# Directly sending dust token amount will slow down distribution in MultiFeeDistribution.sol

Anyone can send 1 wei of reward token to MultiFeeDistribution and call getReward, resetting rewardPerSecond and stretching reward vesting indefinitely.

- Payout: Audit contest
- Severity: high
- Program: LoopFi
- Found by: novamanbg
- Disclosed: 2025-02-17
- Write-up quality: 7/10
- Original: https://github.com/code-423n4/2024-07-loopfi-findings/issues/19
- Library page: https://bugbountylibrary.com/r/c4%3A2024-07-loopfi%3AH-15
- Tags: area:web3 domain:web3 impact:dos impact:funds-loss kind:contest platform:code4rena sev:high tech:evm tech:solidity technique:source-review vuln:accounting-error vuln:business-logic vuln:reward-distribution

**Target:** MultiFeeDistribution.sol reward distribution contract
**Root cause:** _notifyUnseenReward treats any positive balance delta as a new reward and recomputes rewardPerSecond = ((reward + leftover) * 1e12) / rewardsDuration, resetting periodFinish; a 1-wei donation restarts the whole vesting period at a tiny rate.
**Steps:**
1. Deploy MultiFeeDistribution, set lock types, stake as Alice, add 100 ether reward token via minter
2. Alice calls `getReward([rewardToken])`; warp 20 days; Alice calls `getReward` again
3. Bob transfers `1` wei of rewardToken directly to the contract
4. Bob calls `getReward([rewardToken])` to trigger `_notifyUnseenReward` -> `_notifyReward` with unseen=1
5. rewardPerSecond recomputed as ((1 + leftover) * 1e12) / rewardsDuration and periodFinish = now + rewardsDuration
6. Alice's daily accrual drops from ~3.33e18 to ~1e18; repeat loop of 20 iterations drives it to ~3.27e17
**How found:** Code reading of `_getReward` -> `_notifyUnseenReward`: noticed `unseen = balanceOf(this) - r.balance` treats any direct transfer as a new reward, and that `_notifyReward` unconditionally recomputes rewardPerSecond and resets periodFinish, so a dust delta restarts the whole schedule.
**Exploitation:** Attacker needs only 1 wei of the reward token per griefing round. Each round: transfer dust to contract, call getReward to force _notifyUnseenReward, which resets rewardPerSecond and periodFinish. Repeated daily, this continuously dilutes and extends the vesting, locking rewards for all stakers and delaying distribution indefinitely.
**Escalation:** Repeating the dust transfer + getReward loop each period compounds the slowdown (3.33e18 -> 3.27e17 per day over 20 rounds), and the attacker can keep doing it indefinitely at negligible cost.
**Insight:** In Synthetix-style staking forks, any permissionless path that calls notifyReward based on `balanceOf(this) - accountedBalance` lets an attacker reset rewardPerSecond/periodFinish with a 1-wei transfer; check whether notify is gated to a reward-minter role and whether periodFinish is only extended, never restarted, on small deltas.

