The 3 major components of the Superfluid framework
Now that you've opened your first token flow, you're hooked to learn more right? I promise I'll keep this brief so we can get back to hacking. There are three primitives of Superfluid:
Each primitive enables new features, however you don't have to use all of them. You can mix and match them depending your needs.
Agreements set the "rules" of how a Super Token can behave. The Superfluid framework is comprised of a single host contract, with multiple agreement contracts. An agreement contract must be on the approve-list, otherwise the host contract will not execute the agreement code.
Agreements are the building blocks that enable Superfluid to expand and add new features.
In the previous section, you used the Constant Flow Agreement, which enables you to flow tokens from your wallet. There is also the Instant Distribution Agreement, which allows sending tokens to multiple recipients in a single transaction. If you want to read the Solidity code, here are all the agreements:
protocol-monorepo/packages/ethereum-contracts/contracts/agreements at dev · superfluid-finance/protocol-monorepo
The Superfluid community is exploring the possibilites of what these two agreements can do. Eventually there will be more agreements, and there's an open invitation to help build and create them.
2. Super Tokens
In addition to agreements, the Superfluid framework also provides features at the token level. Here's a short list of super-powers:
ERC777 - tokens which can "react" to certain events using callbacks (erc777.org)
Batch capabilities - you can do multiple things in a single transaction
Meta-transactions - submit transactions on behalf of another account
Dive into the Solidity here:
protocol-monorepo/SuperToken.sol at dev · superfluid-finance/protocol-monorepo