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

Variable stakers could lose their pending Rewards.

Summary :

Vulnerability Details :

  • The issue is that the computation assumes that (currentBalance + totalVestedStaked + newVestedStaked) will always be greater than (totalStaked - newStaked - totalRewards).

  • However, there are edge cases that breaks that assumption,

  • When a negative rebase occurswhich is (totalStaked - newStaked - totalRewards) is greater than (currentBalance + totalVestedStaked + newVestedStaked) [ it happen when no one call the vestedStake and the users stake with an amount > currentBalance].

Impact :

The contract does not explicitly prevent or handle scenarios where the calculated staked amount (totalStaked - newStaked - totalRewards) becomes greater than the actual token balance (currentBalance + totalVestedStaked + newVestedStaked).When these occur, it will cause pendingRewards to revert in _checkEpochRollover().

Tools Used :

  • Manual code review.

Recommendations:

  • Add a require statement to validate that totalStaked - newStaked - totalRewards <= currentBalance + totalVestedStaked + newVestedStaked before critical operations

Updates

Lead Judging Commences

inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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