Skip to content

Commit

Permalink
docs: natspec
Browse files Browse the repository at this point in the history
  • Loading branch information
smol-ninja committed May 23, 2024
1 parent 621ff8c commit bcde47a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/SablierV2OpenEnded.sol
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ contract SablierV2OpenEnded is
}
}

/// @dev Calculates the streamed amount.
/// @dev Calculates the streamed amount since last update.
function _streamedAmountOf(uint256 streamId, uint40 time) internal view returns (uint128) {
uint40 lastTimeUpdate = _streams[streamId].lastTimeUpdate;

Expand All @@ -355,7 +355,7 @@ contract SablierV2OpenEnded is
return 0;
}

// Calculate the amount streamed since last update. Each number is normalized to 18 decimals.
// Calculate the amount streamed since last update. Each value is normalized to 18 decimals.
unchecked {
// Calculate how much time has passed since the last update.
uint128 elapsedTime = time - lastTimeUpdate;
Expand Down Expand Up @@ -424,10 +424,10 @@ contract SablierV2OpenEnded is
// Effect: update the stream time.
_updateTime(streamId, uint40(block.timestamp));

// Effect: sum up the remaining amount that the recipient is able to withdraw.
// Effect: update the remaining amount with the streamed amount.
_streams[streamId].remainingAmount += recipientAmount;

// Effect: change the rate per second.
// Effect: update the rate per second.
_streams[streamId].ratePerSecond = newRatePerSecond;

// Log the adjustment.
Expand Down
3 changes: 2 additions & 1 deletion src/types/DataTypes.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ library OpenEnded {
/// subtracted by the sum of withdrawn amounts, denoted in 18 decimals.
/// @param ratePerSecond The amount of assets that is increasing by every second, denoted in 18 decimals.
/// @param sender The address streaming the assets, with the ability to pause the stream.
/// @param lastTimeUpdate The Unix timestamp for the streamed amount calculation.
/// @param lastTimeUpdate The Unix timestamp which gets updated in {_adjustRatePerSecond}, {_restartStream} and
/// {_withdrawAt} through {_updateTime} .
/// @param isStream Boolean indicating if the struct entity exists.
/// @param isPaused Boolean indicating if the stream is paused.
/// @param isTransferable Boolean indicating if the stream NFT is transferable.
Expand Down

0 comments on commit bcde47a

Please sign in to comment.