Rewards will be lost when totalStaked == 0 #258
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
duplicate-369
🤖_258_group
AI based duplicate group recommendation
unsatisfactory
does not satisfy C4 submission criteria; not eligible for awards
Lines of code
https://github.com/code-423n4/2024-02-uniswap-foundation/blob/5a2761c8277541a24bc551fbd624413b384bea94/src/UniStaker.sol#L230
Vulnerability details
Impact
if totalStaked == 0, no rewards are distributed within this period. Unfortunately, all undistributed rewards are lost forever.
Proof of Concept
As above, rewardPerTokenAccumulatedCheckpoint is not updated but lastCheckpointTime is updated. As a result, all rewards during this period are lost forever.
Tools Used
Manual
Recommended Mitigation Steps
Revise the logic.
Assessed type
Uniswap
The text was updated successfully, but these errors were encountered: