Welcome to the Vesting Scheduler smart contract developer quickstart. Here, you’ll learn how to schedule the vesting with Superfluid streams using the Vesting Scheduler. 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 Vesting Automation

Check out this high-level explainer.

You can find the codebase here.


Vesting Scheduler Addresses:

Polygon: 0xcFE6382B33F2AdaFbE46e6A26A88E0182ae32b0c

Optimism: 0x65377d4dfE9c01639A41952B5083D58964782892

Arbitrum: 0x55c8fc400833eEa791087cF343Ff2409A39DeBcC

Avalanche: 0x3fA8B653F9abf91428800C0ba0F8D145a71F97A1

Gnosis Chain: 0x0170FFCC75d178d426EBad5b1a31451d00Ddbd0D

Binance Smart Chain: 0x9B91c27f78376383003C6A12Ad12B341d016C5b9

Ethereum Mainnet: 0x39D5cBBa9adEBc25085a3918d36D5325546C001B

Vesting Scheduler Interface:

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

Setting Up Vesting

1. Set the correct permissions

The Vesting Scheduler contract never holds any of your tokens to vest, it simply uses permissions to move them for you from your wallet (or Safe). Here are the permissions you need to set up:

  1. Flow Operator Permissions

Give the Vesting 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

The address of the Vesting Scheduler contract