Flow

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

SabilierFlow::depletionTimeOf doesnt do what is specifed in the natspec

Summary
https://github.com/Cyfrin/2024-10-sablier/blob/8a2eac7a916080f2022527408b004578b21c51d0/src/interfaces/ISablierFlow.sol#L118-L121
The actual implementation of the function doesnt follow the natspec

Vulnerability Details
If the total debt is less than
/// or equal to stream balance, it returns 0. as stated by the natspec
while the implemented is like this

if (snapshotDebtScaled + _ongoingDebtScaledOf(streamId) >= balanceScaled + oneMVTScaled) {
return 0;
}

which is the opposite of what is stated in the natspec and hence doesnt actially run when the totalDebt is greater than balance which is what it is supposed to do

Impact
The function doesnt work as expected

Tools Used

manual analysis

Recommendations

The function should be rewritten using


if (snapshotDebtScaled + _ongoingDebtScaledOf(streamId) <= balanceScaled + oneMVTScaled) {
return 0;
}

Updates

Lead Judging Commences

inallhonesty Lead Judge
about 1 year ago
inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Appeal created

silver_eth Submitter
about 1 year ago
silver_eth Submitter
about 1 year ago
inallhonesty Lead Judge
about 1 year ago
inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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