Transfer Ownership
This section assumes that you have already gone through the setup part.
See the Access Control guide for an overview of who is allowed to transfer ownership.
You may remember from the Types of Streams guide that each Sablier stream is wrapped in an ERC-721 non-fungible token (NFT). One of the key benefits of this design is that the recipient of the stream, who also holds ownership of the NFT, has the ability to transfer the NFT to a different address, effectively redirecting the streaming of assets to that new address.
To transfer ownership of a stream, invoke the ERC-721 safeTransferFrom
function on a stream whose current recipient is
the StreamManagement
contract:
loading...
This safeTransferFrom
function ensures that the new owner is a contract implementing the ERC721TokenReceiver
interface. If this check is not required, opt for the transferFrom
function instead:
loading...
In the examples above, the new owner is hard-coded for demonstration purposes. However, in a production environment, this would be an adjustable parameter determined by the user.