-
Notifications
You must be signed in to change notification settings - Fork 237
About Super Token Factory
Super tokens can be created through the super token factory registered in the host contract. By doing so, the super token created delegates its logic contract update process to the governance process.
Note that, super tokens created not through the factory can still use the host contract.
Anyone can create an Super Token wrapper of an underlying ERC20 token. By doing so, the logic contract of the created Super Token is managed by the Superfluid governance.
It is worth noting that all wrappers created should have the same functionality.
There are three upgradability choices:
- NON_UPGRADABLE (enum value 0, deprecated, and will fail)
- SEMI_UPGRADABLE (enum value 1, semi upgradable, meaning governance will upgrade its logic contract manually)
- FULL_UPGRADABLE (enum value 2, full-upgradability, meaning it follows the latest logic contract)
For auditors:
Note that the underlyingToken
must implement "decimals", "name" and "symbol" public methods (non ERCO20 standard), it is by design, and does not compromise the factory security in any ways (DON'T TRUST, VERIFY!)
The createERC20Wrapper
created one practical problem, there is no trusted source that sets which Super Token wrapper is the "cononical". As a result createCanonicalERC20Wrapper
was created.
As part of its original hope, createCanonicalERC20Wrapper
should only allow the first created Super Token to be "canonical" by the rule; after that createCanonicalERC20Wrapper
will revert.
Initially we also attempted to make sure that the canonical wrapper Super Token address to be deterministic using CREATE2
. But due to backward-compatibility constraints, Super Tokens that were created before createCanonicalERC20Wrapper
cannot satisfy the deterministicity. Hence a simpler registra table is used internally instead.
Additional helper functions:
computeCanonicalERC20WrapperAddress
getCanonicalERC20Wrapper
To create a custom super token, initializeCustomSuperToken
is provided to complete the custom super token initialization and hand over its upgradability control to the Superfluid governance.
Official guide is available here. To make your token visible in Superfluid applications, you should also follow the Token Dashboard Submission guide.
- Governance Overview
- For Contributors
- Development Process
- Protocol EVMv1 Operations
- Protocol EVMv1 Technical Notes
- Protocol EVMv1 Core Subgraph