Welcome to the Stream Scheduling developer quickstart. Here, you’ll learn how to schedule the creation/deletion of a Superfluid stream with the Stream Scheduler automation. This guide assumes a knowledge of basic Solidity (such as the ERC20 standard, block.timestamp, etc.) and performing web3 calls. Let’s get started 🚀

What’s the Stream Scheduler

Check out this high-level explainer.

You can find the codebase here.

Resources

Stream Scheduler Interface:

protocol-monorepo/IFlowScheduler.sol at dev · superfluid-finance/protocol-monorepo

Scheduler Addresses:

Polygon: 0x47D34512492D95A3531A628e5B85e32fAFaC1b42

Binance Smart Chain: 0x1D65c6d3AD39d454Ea8F682c49aE7744706eA96d

Goerli (Testnet): 0xA6134E107FCAEAab6140CB8fb92Dbf5bd9EF6C86

Mumbai (Testnet): 0xF18825d412C061aEfEFB4dF46a1c077636dA50bf

Scheduling a Stream

1. Set the correct permissions

The Stream Scheduler contract never holds any of your tokens, it simply uses permissions to move them for you. Here are the permissions you need to set up:

  1. Flow Operator Permissions

Give the Stream Scheduler contract maximum permissions over creating streams on your behalf with the authorizeFlowOperatorWithFullControl function.

/**
 * @dev msgSender from `ctx` grants `flowOperator` create/update/delete permissions with flowRateAllowance as type(int96).max
 * @param token Super token address
 * @param flowOperator The permission grantee address
 * @param ctx Context bytes (see ISuperfluid.sol for Context struct)
 */
function authorizeFlowOperatorWithFullControl(
    ISuperfluidToken token,
    address flowOperator,
    bytes calldata ctx
)
		external virtual
		returns(bytes memory newCtx);

ISuperfluidToken token

Super Token that is being vested

address flowOperator