Skip to content

Commit

Permalink
feat(stream-manager): add aggregated 'withdrawableAmountOf' linear an…
Browse files Browse the repository at this point in the history
…d tranched stream
  • Loading branch information
gabrielstoica committed Aug 14, 2024
1 parent 1530288 commit e7877ef
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
9 changes: 7 additions & 2 deletions src/modules/invoice-module/sablier-v2/StreamManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,16 @@ abstract contract StreamManager is IStreamManager {
}

/// @inheritdoc IStreamManager
function streamedAmountOf(
function withdrawableAmountOf(
Types.Method streamType,
uint256 streamId
) public view returns (uint128 withdrawableAmount) {
withdrawableAmount = _getISablierV2Lockup(streamType).streamedAmountOf(streamId);
withdrawableAmount = _getISablierV2Lockup(streamType).withdrawableAmountOf(streamId);
}

/// @inheritdoc IStreamManager
function streamedAmountOf(Types.Method streamType, uint256 streamId) public view returns (uint128 streamedAmount) {
streamedAmount = _getISablierV2Lockup(streamType).streamedAmountOf(streamId);
}

/*//////////////////////////////////////////////////////////////////////////
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,21 @@ interface IStreamManager {
address to
) external returns (uint128 withdrawnAmount);

/// @notice See the documentation in {ISablierV2Lockup-withdrawableAmountOf}
/// Notes:
/// - `streamType` parameter has been added to retrieve from the according {ISablierV2Lockup} contract
function withdrawableAmountOf(
Types.Method streamType,
uint256 streamId
) external view returns (uint128 withdrawableAmount);

/// @notice See the documentation in {ISablierV2Lockup-streamedAmountOf}
/// Notes:
/// - `streamType` parameter has been added to retrieve data from the according {ISablierV2Lockup} contract
/// - `streamType` parameter has been added to retrieve from the according {ISablierV2Lockup} contract
function streamedAmountOf(
Types.Method streamType,
uint256 streamId
) external view returns (uint128 withdrawableAmount);
) external view returns (uint128 streamedAmount);

/// @notice See the documentation in {ISablierV2Lockup-cancel}
///
Expand Down

0 comments on commit e7877ef

Please sign in to comment.