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

in the `stakeVested()` function there is no point of using `getRefundedAmount()`

Summary

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

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

https://github.com/sablier-labs/v2-core/blob/ba1cda3b43ba3a5b542433e0f12f843398fd089f/src/interfaces/ISablierV2Lockup.sol#L158C5-L162C100

Vulnerability Details

the getRefundedAmount() function calculates the amount that the sender would be refunded if the stream were canceled.
when a stream get canceled it will be marked as a cold stream as the following:
https://github.com/sablier-labs/v2-core/blob/ba1cda3b43ba3a5b542433e0f12f843398fd089f/src/interfaces/ISablierV2Lockup.sol#L122C5-L125C75
there is no need of a local variable that is always zero.

Tools Used

manual review

Recommendations

to calculate the stream value we need only for :
depositedAmount,
withdrawnAmount.

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.