As the SRC20 is open source, it allows token issuers and service providers alike to freely use this protocol stack and build custom solutions and services on top of it.
The following four contracts are created in relation to a specific SRC20 token and interact with one another and other global SRC20 smart contracts.
For each new SRC20 token, one of each of these smart contracts is newly created.
Manages whitelists and greylists for holders of a specific SRC20 token.
This contract defines the supported token contract features for a specific SRC20 token (e.g. account or contract freezing, additional minting or burning tokens) and allows to check the state of the token contract (e.g if it is currently paused for transfers).
This contract defines the owner of the token contract and all assigned roles. Manages the addresses that can perform restricted actions for a specific SRC20 token as defined by the contract owner. SRC20 tokens can have four types of roles:
Each of the following (pre-existing) smart contracts exist across the SRC20 network and each SRC20 token interacts and registers with them.
Registry of all SRC20 tokens created and 'hodler' of the associated SWM stakes
Registry of asset data for all SRC20 tokens (meta data, esp. NAV)
Manages the minting of SRC20 and corresponding SWM stakes of additional tokens added to an existing SRC20
As the SRC20 smart contracts need to reference each other, there is a specific deployment order for creating a new SRC20 token.
Deploy Smart Contracts
Step 1: Deploy a new SRC20 Transfer Rules Smart Contract
Step 2: Deploy a new SRC20 Featured Smart Contract
Step 3: Deploy a new SRC20 Roles Smart Contract
Create and Register Token: Sign a transaction to build and deploy your token exactly as per the configured specifications and register with the global SRC20 contracts
SRC20 Factory Smart Contract
Asset Registry Smart Contract
SRC20 Registry Smart Contract
Mint SRC20 Tokens
Step 4: Authorize withdrawal of the SWM stake to enable minting of tokens
Step 5: Mint the tokens by initiating withdrawal of the SWM stake and minting of SRC20 tokens; Deploys a new SRC20 Featured Smart Contract; in the set-up of this deployment the contracts from the previous steps need to be referenced
Note: Swarm.app is a dapp, which allows you to easily configure your SRC20 token set-up and in the final step the contracts are deployed accordingly and in the correct sequence