Skip to main content

ISablierV2LockupRecipient

Git Source

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

NameTypeDescription
streamIduint256The id of the canceled stream.
senderaddressThe stream's sender, who canceled the stream.
senderAmountuint128The amount of assets refunded to the stream's sender, denoted in units of the asset's decimals.
recipientAmountuint128The 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

NameTypeDescription
streamIduint256The 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

NameTypeDescription
streamIduint256The id of the stream being withdrawn from.
calleraddressThe original msg.sender address that triggered the withdrawal.
toaddressThe address receiving the withdrawn assets.
amountuint128The amount of assets withdrawn, denoted in units of the asset's decimals.