Flow

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

Returns `balance` only if the balance is lesser than the total debt

Summary

Returns balance only if the balance is lesser than the total debt in SablierFlow::_coveredDebt

meanwhile one of the core features of the protocol is to ensure flexibility of the protocol according to the docs, and Users might expect to cover their total debt when the balance less than or equals the debt, but with the current logic, that won’t happen.

Vulnerability Details

Here are the details:

uint256 totalDebt = _totalDebtOf(streamId);
// If the stream balance is less than or equal to the total debt, return the stream balance.
if (balance < totalDebt) {
return balance;
}

Impact

Users might expect to cover their total debt when the balance equals the debt, but with the current logic, that won’t happen, skipping the line of code to the next one in the function.

Returning just the balance can prevent users from covering their total debt if it exactly equals the balance, which could prevent some actions from succeeding if they depend on a complete debt coverage check and limiting the flexibilty of the protocol.

Tools Used

Manual Review

Recommendations

I will recommend this to the codebase below:

- if (balance < totalDebt) {
- return balance;
- }
+if (balance <= totalDebt) {
+ return balance;
+}
Updates

Lead Judging Commences

inallhonesty Lead Judge 8 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement
Assigned finding tags:

[INVALID]`_coveredDebtOf` discrepancy between condition and comment `balance < totalDebt`

Support

FAQs

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