Operating the Sablier Protocol Manually

Paul Razvan Berg
Feb 7, 2020 · 4 min read

Sablier is built on top of Ethereum, a blockchain that has been running uninterruptedly since its inception. This means that even if MetaMask, Wallet Connect or the Sablier Interface are malfunctioning, you are always able to interact with the Sablier protocol.

This is a guide aimed at technical users familiar with Ethereum and smart contract technology. We will use the Etherscan blockchain explorer, but you can use any other web interface with dapp capabilities, such as MyEtherWallet.

Contracts, ABI, and descriptions

Smart contract architecture, addresses, ABIs, and function descriptions for the protocol are available at docs.sablier.finance.

Contract

Sablier v1.1 (the latest version of the protocol) runs on top of one monolith contract, which is not upgradeable and has no owner:

This guide will focus on interacting with this contract on Ethereum Mainnet. But the same logic applies to all other networks Sablier is deployed on.

Connect to Etherscan

Go to the smart contract page on Etherscan:

You will notice that the source code is verified, which means you can use Etherscan’s “Write Contract” feature.

Connect to MetaMask by clicking “Connect to Web3”.

How to get the stream id?

Throughout this article, we will make references to a “stream id”.

To find this value, you have to look at your transaction history and inspect the event logs. Specifically, you have to find the CreateStream event for the Money Streaming Engine. Here’s an example for the stream with id 100,048:

Alternatively, if you know the URL of your stream on pay.sablier.finance or app.sablier.finance, the number at the end of the URL is the stream id.

1. Create Streams

To create streams using Etherscan, use the createStream function on the Money Streaming Engine:

createStream on Etherscan

Steps

To get the proper timestamp for step 4 and 5, you can use this epoch converter.

2. Withdraw from Streams

To withdraw from streams using Etherscan, use the withdrawFromStream function on the Money Streaming Engine:

withdrawFromStream on Etherscan

Steps:

Side note: you can trigger this action only if you’re either the sender or the recipient of the stream. For all other third-party accounts, the contract call will revert.

3. Cancel Streams

To cancel streams using Etherscan, use the cancelStream function on the Money Streaming Engine:

cancelStream on Etherscan

Side note: you can trigger this action only if you’re either the sender or the recipient of the stream, otherwise the contract call will revert.

Wrap Up

There is a number of other secondary functions you can call on the Money Streaming Engine, but we will let you discover them on your own. All functions are thoroughly documented in our protocol documentation.

Many thanks to Kaden Zipfel for his contribution and feedback on this blog post.

If you ever have trouble operating the Sablier protocol, please join the #development channel in the Sablier Discord server; our team, and members of the community, look forward to helping you.‌

Sablier

The protocol for real-time finance on Ethereum