Token Registry
Token Registry is used to keep list of ERC20 tokens available in the fMint protocol and to provide additional information about these tokens to the protocol itself as well as the external agents.
Accessing Token Registry
You need the contract ABI and deployment address to access the Token Registry instance deployed on the network.
Reading List of Known Tokens
Tokens are identified by the network address of their ERC20 contract. You can list array of known ERC20 contracts at the Token Registry uisng a public tokens list. The contract provides total number of known contracts as well as an entry point to obtain an address by index.
Single Token Details
You can use the tokens
entry point to access individual tokens by their known ERC20 contract addresses. This will provide the full set of information about each token. The meaning of each element is described in the contract structure.
Single Purpose Functions
The response to the call above shows details of the WFTM
token used by the fMint protocol as one of the collateral building tokens. Please check the TokenInformation structure for the details of the response elements.
Alternatively, you can access specific details about each token using single purpose functions. Some examples are shown in the code block below.
Please check the Token Registry contract source code or the ABI interface for the full list of available functions.
Add New Token
If you want to provide a new ERC20 token on the fMint protocol, you need to add the token information to the Token Registry contract. To do so, you need an authorized fMint administrative private key. We plan to make the fMint porotocol managable by the on-chain Governance in the future.
To make a new token available on fMint you have to meet following requirements.
You need an ERC20 contract of the token deployed on the network. You will need to provide the address of the ERC20 contract you wan to add.
The token must have a value in referential denomination (USD). You need a price oracle contract and the ERC20 token must be listed in the Oracle Proxy the fMint protocol uses right now. At the time of making this documentation, we use Band Protocol price oracles and their Band proxy to obtain prices of the tokens in the fMint protocol.
You should have a token logo, preferably in the SVG format so it can be scaled without loosing image quality. The logo must be published on a website with HTTS access and the URL address must be available as a permanent link. You will be responsible for making the logo available to end users.
You must decide if the token will be available for building the fMint collateral. This is signaled as the
canDeposit
parameter of typeboolean
.You must decide if the token will be mint-able. This is signaled as the
canMint
parameter of typeboolean
. In case of mint-able token, your ERC20 contract must be instructed to allow fMint core contract to callmint
function. AppropriateMinter
role must be granted to the fMint protocol core contract prior to adding the token to Token Registry. The address of the fMint core contract is0xbb634cafef389cdd03bb276c82738726079fcf2e
.
Update Existing Token
The update function allows authorized address to make changes to an existing token configuration. A token can be disabled to identify it should no longer be used by the protocol, the logo can be changed, price oracle address updated, etc.
Remove a Token
The Token Registry does not contain any function for removing listed token from the registry. Each token has a parameter called isActive
instead. The parameter can be changed by the updateToken
function at any time.
Disabled tokens can still be repaid in the protocol, their value is still registered towards user's position and the value is not lost. The protocol just prevents disabled tokens to be added to users' deposit for collateral position improvements and such tokens can not be minted in case of maint-able ERC20 contracts.
Once disabled tokens can be re-eabled using the updateToken
function, if the token is considered available for the fMint protocol purposes again.
Last updated