DeFiFoundry
20,000 USDC
View results
Submission Details
Severity: high
Invalid

Inaccurate Epoch Reward Calculation Leading to Incorrect Reward Distribution

Summary

the current pending rewards formula does't count the pendings rewards accurately, the newstaked and newvestedstaked variable shd be subtracted form the pending rewards formula rather than addding it.

Vulnerability Details

https://github.com/Cyfrin/2024-08-fjord/blob/0312fa9dca29fa7ed9fc432fdcd05545b736575d/src/FjordStaking.sol#L702

the newvestedstaked is adding in this formula which has to be added in nextepoch period, which increases the rewards amount

uint256 pendingRewards = (currentBalance + totalVestedStaked + newVestedStaked)
- totalStaked - newStaked - totalRewards;

Impact

increases the rewards amount

Tools Used

manual code review

Recommendations

try replace considering this formula

uint256 pendingrewards = currentbalance - totalRewards + totalVestedstaking - newVestedstaking + totalstaked- newstaked ;
Updates

Lead Judging Commences

inallhonesty Lead Judge 9 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.