Token SCORE Factory: Token Extensions
Users can deploy IRC-2 and IRC-3 tokens on ICON fromToken SCORE Factory. Users can enter the parameters in the creation form and once the transaction is confirmed, the selected token is created without users having to write a single line of code.
Different extensions of IRC-2 and IRC-3 tokens can be deployed from TSF, but before that let’s look at some of the common terms of a token :
- Mintable
A mintable token can be minted out of thin air. However, in the IRC-2 contract, only the deployer can mint IRC-2 tokens whereas, in IRC-3 contracts, there are two options for minting. First where only the deployer can mint NFTs, and other, where anyone can mint NFTs.
- Burnable
A Burnable token means that the token can be destroyed. In both cases of IRC-2 and IRC-3, token holders can burn their tokens. In the case of IRC-3, no one can burn anyone else’s token unless it’s approved by the user.
- Pausable
It can be used to prevent any token operations, transfer, mint, and burn. This allows the deployer to fix any bugs in smart contracts or in ICOs. This is implemented in IRC2 only.
- Capped
It is used to limit the number of tokens that can be minted. It is defined while deploying mintable IRC2 contracts. When it is not specified, it defaults to the maximum amount of tokens that can be minted, given by 2**256 -1.
- Token Recovery
Token Recovery allows the SCORE owner to recover the IRC2 tokens sent to other SCORES, provided they have a fallback mechanism in place. It is implemented in Complete IRC2.
- Snapshot
It allows us to view the balance of an account and total supply at a particular block height. It’s implemented in the Complete IRC2 token.
- Approval
It allows a token owner to approve a token to someone else. Once someone is approved, then that user will be allowed to use the token on behalf of the owner. It is available for IRC3 tokens only.
- TokenURI
TokenURI is metadata for an IRC3 token. It should resolve to a JSON document that might look something like this:
{“name”: “Punk123”,“description”: “Description..”,“image”: “<ipfs image url>”,“rarity”: “2”}
Extensions for IRC2
- Basic
Allows creation of IRC2 as per the ICON IIP2 standard. When an initial supply is given, tokens are transferred to the deployer wallet on contract creation. This token can be later transferred to other addresses.
- Mintable
Basic + tokens can be minted. Only the deployer can mint the tokens. Users can specify the total number of tokens to be created. If a user fails to enter any amount in total supply, an uncapped token is created.
- Burnable
Basic + tokens can be burned. Token holders can burn the tokens they own.
- Pausable
Basic IRC2 + Token transfer operations can be paused. Only the deployer can pause/unpause the token.
- Mintable+Burnable
Basic + Mint + burn functionality. Tokens can be minted by the deployer, and token holders can burn them.
- Burnable+Pausable
Basic + burn + pause. Deployers can pause tokens & token owners can burn their tokens. Tokens cannot be minted and the total supply decreases when tokens are burned.
- Mintable+Burnable+Pausable
All mint, burn and pause functionality along with basic IRC2 token.
- Complete
All the previously mentioned functions + token recovery + snapshot. Token recovery can be done from tokens that implement the token fallback mechanism. And it also allows users to view total supply and balance at a specific block height.
Extensions for IRC3
- Mintable
An extension for the IRC3 token standard along with added minted functionality. It has two further extensions, one where only the deployer can mint new tokens, and the other where any user can mint them. On minting new tokens, there is a parameter called `tokenURI`, which can be supplied. It is the metadata for the token. It ideally is a JSON file, which contains information about the token. For example, on crypto punks, we can link name, and image URL as param in tokenUri. Once TokenURI is set, it cannot be changed later.
- Burnable
Mintable + burn functionality. It has two further extensions. First, where only the deployer can mint. And the second, where anyone can mint. Token holders can burn their tokens.