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

FjordStaking.sol::ClaimReward(bool) penaltyAmount gives inaccurate penalty

Summary

FjordStaking.sol::ClaimReward(bool) penaltyAmount gives inaccurate penalty when dividing.

Vulnerability Details

The division operator in solidity for thepenaltyAmount variable gives integer result. There is a chance of off-by-one error when the rewardAmountis odd.

Impact

The user will not get exactly 50% by losing 1 amount of reward every operation when the rewardAmount is an odd number.

Tools Used

None

Recommendations

Give an exclusive formula for rewardAmountwhenever the rewardAmountis odd or make sure that rewardAmountwill never be odd.

Updates

Lead Judging Commences

inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Lack of quality

Support

FAQs

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