Skip to content

Commit

Permalink
docs: polish natspec in depletionTimeOf
Browse files Browse the repository at this point in the history
Co-authored-by: Andrei Vlad Birgaoanu <[email protected]>
  • Loading branch information
smol-ninja and andreivladbrg committed Sep 6, 2024
1 parent bad6b13 commit 7f6ae6c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/SablierFlow.sol
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ contract SablierFlow is
uint128 solvencyAmount;

// Depletion time is defined as the UNIX timestamp beyond which the total debt exceeds stream balance.
// The following calculation assumes that at the depletion time, total debt = stream balance + 1.
// So we calculate it by solving: debt at depletion time = stream balance + 1. This ensures that we find the
// lowest timestamp at which the debt exceeds the balance.
// Safe to use unchecked because the calculations cannot overflow or underflow.
unchecked {
if (tokenDecimals == 18) {
Expand Down

0 comments on commit 7f6ae6c

Please sign in to comment.