By continuously spamming getReward/stake/withdraw function, attacker will make rewardPerTokenStoredvariable unchanged while the time keep increasing, lead to non reward will be claimable by all staker.
When updateRewardmodifier is called, it will update rewardPerTokenStoredand lastUpdateTime:
_rewardPerToken()function:
lastTimeRewardApplicable()function:
It can be seen that in _rewardPerToken()function, if (((_lastTimeRewardApplicable(rewardData.periodFinish) - ````rewardData.lastUpdateTime) * ````rewardData.rewardRate * 1e18) ````/ totalSupply);equal to 0, rewardPerTokenStoredwill be unchanged, but lastUpdateTimevalue is still updated. When totalSupplyis big enough, and attacker continuously call functions that have updateRewardmodifier (getReward/stake/withdraw), reward wont be updated.
Reward cant be claimed when totalSupplyis big enough because rewardPerTokenStored unchanged while time is up.
Manual review
Update lastUpdateTimeonly when rewardPerTokenStoredis increased
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.