ISablierV2LockupRecipient
Interface for recipient contracts capable of reacting to cancellations, renouncements, and withdrawals.
Implementation of this interface is optional. If a recipient contract doesn't implement this interface or implements it partially, function execution will not revert.
Functions
onStreamCanceled
Responds to sender-triggered cancellations.
Notes:
- This function may revert, but the Sablier contract will ignore the revert.
function onStreamCanceled(uint256 streamId, address sender, uint128 senderAmount, uint128 recipientAmount) external;
Parameters
Name | Type | Description |
---|---|---|
streamId | uint256 | The id of the canceled stream. |
sender | address | The stream's sender, who canceled the stream. |
senderAmount | uint128 | The amount of assets refunded to the stream's sender, denoted in units of the asset's decimals. |
recipientAmount | uint128 | The amount of assets left for the stream's recipient to withdraw, denoted in units of the asset's decimals. |
onStreamRenounced
Responds to renouncements.
Notes:
- This function may revert, but the Sablier contract will ignore the revert.
function onStreamRenounced(uint256 streamId) external;
Parameters
Name | Type | Description |
---|---|---|
streamId | uint256 | The id of the renounced stream. |
onStreamWithdrawn
Responds to withdrawals triggered by either the stream's sender or an approved third party.
Notes:
- This function may revert, but the Sablier contract will ignore the revert.
function onStreamWithdrawn(uint256 streamId, address caller, address to, uint128 amount) external;
Parameters
Name | Type | Description |
---|---|---|
streamId | uint256 | The id of the stream being withdrawn from. |
caller | address | The original msg.sender address that triggered the withdrawal. |
to | address | The address receiving the withdrawn assets. |
amount | uint128 | The amount of assets withdrawn, denoted in units of the asset's decimals. |