Ask or search…
K
Links
Comment on page

Solidity

The Super Token Library allows you to work with money streams in Solidity

SuperTokenV1Library Contract

Quickstart Guide

Money Streaming with Solidity 101 | ETHGlobal Guides
ethglobal
Make a contract that streams money in under 10 minutes!

Example Code

Getting Set To Start Streams

Initialize the SuperTokenV1Library in your constructor with the below code.

Initializing the Library

// initializing the CFA Library
pragma solidity 0.8.14;
import {
ISuperfluid
} from "@superfluid-finance/ethereum-contracts/contracts/interfaces/superfluid/ISuperfluid.sol";
import {
ISuperToken
} from "@superfluid-finance/ethereum-contracts/contracts/interfaces/superfluid/ISuperToken.sol";
import {
SuperTokenV1Library
} from "@superfluid-finance/ethereum-contracts/contracts/apps/SuperTokenV1Library.sol";
contract SomeContractWithSuperTokenV1Library {
using SuperTokenV1Library for ISuperToken;
ISuperToken public token;
constructor(ISuperToken _token) {
token = _token;
}
// your contract code here...
}

Interacting With The CFA