Skip to content

Commit

Permalink
docs: polish natspec for _ongoingDebt
Browse files Browse the repository at this point in the history
Co-authored-by: Paul Razvan Berg <[email protected]>
  • Loading branch information
smol-ninja and PaulRBerg committed Sep 6, 2024
1 parent daffc49 commit bad6b13
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
needs: ["lint", "build"]
uses: "sablier-labs/reusable-workflows/.github/workflows/forge-test.yml@main"
with:
foundry-invariant-depth: 200
foundry-invariant-depth: 100
foundry-invariant-runs: 500
foundry-profile: "test-optimized"
match-path: "test/invariant/**/*.sol"
Expand Down
10 changes: 6 additions & 4 deletions src/SablierFlow.sol
Original file line number Diff line number Diff line change
Expand Up @@ -472,10 +472,12 @@ contract SablierFlow is
return totalDebt;
}

/// @dev When token decimal is less than 18 and rps is less than minimum transferable value, the denormalization
/// process introduces a time range [t, t+δ] during which the ongoing debt would result in the same value. Thus, to
/// avoid any loss to the users, this function returns a corrected time which is the lower bound, t in the range [t,
/// t+δ]. This corrected time is then stored as the snapshot time.
/// @dev When token decimal is less than 18, the `_ongoingDebtOf` function can be non-injective with respect to its
/// input parameter `time` due to the denormalization. This results into a time range [t, t+δ] during which it
/// would produce the same value. Thus, to minimise any loss to the users, this function returns a corrected time
/// which is the lower bound, t in the range [t, t+δ]. The corrected time is the nearest Unix timestamp that
/// produces the smallest remainder greater than the minimum transferable value. This corrected time is then stored
/// as the snapshot time.
///
/// @param streamId The ID of the stream.
/// @param time The time to calculate the ongoing debt.
Expand Down

0 comments on commit bad6b13

Please sign in to comment.