Bank
Empowering Assets: Your Dynamic Token Management Solution
Overview:
The banking system within Unit Network stands as a cornerstone of its functionality, providing a robust and adaptable framework for managing assets and executing transactions seamlessly.
Through a diverse array of functionalities, storage solutions, and specialized roles allocated to distinct banks, the network guarantees the efficient and secure handling of a wide range of asset types.
This documentation serves to elucidate the essential technical components of Unit Network's banking system, catering to both users and developers by offering a thorough comprehension of its inner workings.
Technical Insights:
Every asset type within the Unit Network is associated with a specific bank, identified by its token ID.
The bank pallet exposes five primary extrinsic functions for asset transfer, facilitating smooth transactions:
Users can transfer assets to a designated bank.
Asset creators hold the privilege to transfer assets from the originating bank to users.
Banks are empowered to transfer assets to other banks and treasuries.
Each executed transfer triggers an event in the Unit blockchain, signaling either the successful completion of the transfer or an error indication in case of failure due to reasons like insufficient balance or lack of permission.
Key Highlights:
Token creators possess the authority to transfer assets between users, banks, and treasuries.
Banks are uniquely identified by their IDs, mirroring the IDs of the tokens they represent.
Upon token creation, a default supply (which is fixed but adjustable) is minted to the respective token's bank.
Outgoing transfers from a bank result in an increment in the total circulating supply of the transferred tokens.
Token creators retain the capability to increase the total supply; however, all tokens must remain within the bank. The token creator can only change the total supply or the token symbol if none of the tokens inside the bank have been transferred out of it For example, if you create the $EXAMPLE token, you, as the token creator, can only change the total supply or symbol if no $EXAMPLE token has been transferred out of its bank. Once a $EXAMPLE token is transferred from the $EXAMPLE bank, you will no longer be able to change the total supply or token symbol.
Modifications to the default supply of newly created tokens can be accomplished through the assets pallet.
Storage Management:
The BankTokens storage type monitors the quantity of tokens within a specified bank, with token ID and bank ID serving as the access keys to retrieve the token balance.
The NextTransactionId storage type maintains the identifier for the forthcoming transaction; the first transaction of a bank is denoted by ID 0, incrementing sequentially with each subsequent transaction, with the bank ID acting as the access key.
BankTransactions storage type preserves transaction details, accessible through bank ID and transaction ID, encompassing token ID, amount, sender, and receiver information.
Diverse Bank Types:
In the Unit Network ecosystem, various bank types fulfill specialized roles in managing an extensive array of assets, ranging from fiat stable tokens to user-generated and wrapped cryptocurrencies.
These banks not only facilitate transactions and asset storage but also uphold the stability and integrity of the managed tokens.
Each bank type boasts distinctive characteristics and operational mechanisms meticulously crafted to cater to the specific requisites of the supported asset types.
Note:
Last updated