Flow

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

Edge Case in calculateAmountsFromFee

Vulnerability Details

In calculateAmountsFromFee, there is no validation to ensure the totalAmount is large enough to accommodate the fee. If fee is high or totalAmount is too low, it’s possible for feeAmount to equal or exceed totalAmount, leading to a netAmount of zero or even an underflow.

Impact

If the feeAmount equals or exceeds the totalAmount, the function may return unexpected results (e.g., a zero or negative net amount).

Tools Used

Recommendations

Add a validation to ensure totalAmount is sufficient to cover feeAmount. Alternatively, you could add logic to prevent cases where fee exceeds certain limits relative to totalAmount.

require(feeAmount < totalAmount, "Fee exceeds total amount");
Updates

Lead Judging Commences

inallhonesty Lead Judge 9 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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