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

Uncessary redundant code

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

Impact

In FjordStaking.sol#L412 - #415, The code can be improved to remove redundancy and readability.

Tools Used

Manual Review

Recommendations

Remove this redundant code to improve readability/maintainability. Also checking if the amount is less code zero is uncessary cause it is an unsigned interger, so therefore it will automatically revert if the amount is less than zero

- if (depositedAmount - (withdrawnAmount + refundedAmount) <= 0) revert InvalidAmount();
uint256 _amount = depositedAmount - (withdrawnAmount + refundedAmount);
if (amount == 0) revert InvalidAmount();
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.