In this guide, we will explain how to implement hooks in your on-chain integration of Sablier.
These are the hooks that can be implemented by a recipient contract:
|Called when the stream is canceled by the sender.
|Called when the stream is renounced by the sender.
|Called when the sender or an approved NFT operator withdraws from the stream.
While it isn't mandatory, we highly recommend implementing the
onStreamCanceled and the
Doing so enables your contract to keep its internal accounting updated accurately.
Reverts in your hooks will NOT be picked up by Sablier. If your hook reverts, the original transaction will go through, but any state changes made by your hook will be reverted.