Etherscan: Manual Operations
Introduction
Just like any other open protocol, Sablier V2 can be interacted with directly through a blockchain explorer like Etherscan.
In this guide, we will show you how to create a stream and withdraw from a stream by manually interacting with the Sablier V2 Core contracts on Etherscan.
If you're interested in interacting with V1, please refer to this article.
Creating a Stream
Prerequisites
Before being able to create a stream using the Sablier V2 Core contracts you need to have granted a sufficient token allowance. See the Allowances section below for a guide on how to do that.
Step 1: Go to contract page
Head over to our deployments list to pick the contract address you want to interact with.
For each chain, that will be either SablierV2LockupLinear
, SablierV2LockupDynamic
, or SablierV2LockupTranched
. In
this tutorial, we will create a LockupLinear stream on Sepolia.
Once you find the right contract, click on the address to access its explorer's page. Click on the "Contract" tab, and then on the "Write Contract" sub-tab.
You can now connect your wallet to the interface by clicking on "Connect to Web3".
Step 2: Fill in parameters
We will now proceed to create our first stream. Let's go with the following parameters:
- a
LockupLinear
stream - and a deposit of 20,000 DAI
- starting Jan 1, 2025
- ending Jan 1, 2026
- with no cliff
- non-cancelable
- and transferrable
As the start and end date are fixed, we'll be using the
createWithTimestamps
method. Please note that using
createWithDurations
is
also possible if you specify durations instead of the timestamps.
Open the "createWithTimestamps" method, and start filling in the stream details:
{
"sender": "0xe0ae83a6b9cc4f24d0638dc27179f311671e4e2a",
"recipient": "0xb4bf8a8475d1e8e9a2088f118ad0e2cdc2896183",
"totalAmount": 20000000000000000000000,
"asset": "0x97cb342cf2f6ecf48c1285fb8668f5a4237bf862",
"cancelable": false,
"transferable": true,
"timestamps": [1704067200, 0, 1735689600],
"broker": ["0x0000000000000000000000000000000000000000", 0]
}
If the Etherscan UI does not break down the inputs into separate fields (like in the screenshot above), you will have to provide it like this:
[
"0xe0ae83a6b9cc4f24d0638dc27179f311671e4e2a",
"0xb4bf8a8475d1e8e9a2088f118ad0e2cdc2896183",
"20000000000000000000000",
"0x97cb342cf2f6ecf48c1285fb8668f5a4237bf862",
false,
true,
[1704067200, 0, 1735689600],
["0x0000000000000000000000000000000000000000", 0]
]
In case of a tuple, ensure to follow the best practices:
- Use square brackets
- Wrap addresses in double quotes
- Wrap large numbers in quotes
Follow this guide from Etherscan to learn how to correctly format input data for Write Contract tab.
As an example, in the screenshot below, we are providing input parameters for
createWithTimestampsLL
function in
SablierV2BatchLockup
contract. As you can see, since batch
requires a tuple and does not break it down into separate fields, we had to use
the above method.
Sender
If the stream is cancelable, the sender is the wallet that will have the ability to cancel and renounce the stream. But if the stream is non-cancelable, the sender cannot cancel the stream.
Most users will set their own wallet address as the sender.
Recipient
The address you want to stream tokens to. The owner of this address is the stream recipient and will receive tokens on withdraw.
Total Amount
This is the total amount of assets available to be streamed, DECIMALS INCLUDED. If the asset has 18 decimals, for
example, you will need to add eighteen zeros after the amount. Let's say you want to stream 20,000 DAI like in this
example, you will need to fill in 20000000000000000000000
.
The total amount will also include any broker fee. While fees are kept at zero in Sablier UI, the total amount should be equal to the streamed amount plus the broker fee amount.
Asset
The asset is the contract address of the ERC-20 token being streamed. You can obtain this from the Sablier Interface or from any other Etherscan explorer. Please double check the token address is correct before continuing.
Cancelable
This field indicates whether or not you want the stream to be cancelable. This can be set to either true
or false
.
If set to true, the stream will be cancelable.
You can make a cancelable stream non-cancelable after the stream has been created, but if it's a non-cancelable stream, it cannot become cancelable post-creation.