If the ratePerSecond is 0, dividing by it will cause a division by zero error. The function does not have a check for this scenario, which could lead to a transaction revert. This would negatively affect users who might have streams configured with a zero rate.
https://github.com/Cyfrin/2024-10-sablier/blob/main/src/SablierFlow.sol#L57-#L104.
The function does not handle cases where ratePerSecond is 0, leading to a division by zero error when calculating solvencyPeriod. This oversight could cause transaction reverts and disrupt the contract's functionality for streams with zero transfer rates.
Could cause transaction reverts for streams with a ratePerSecond of 0, leading to user frustration and potentially blocking specific streams from functioning as intended.
Manual Code Review
Add Division by Zero Check: You should place this check before any calculations that involve ratePerSecond. In the context of the depletionTimeOf function, add this check after the balance and snapshotDebtScaled calculations but before any division by ratePerSecond. This ensures the function exits early if ratePerSecond is zero:
Suggested fix
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.