Manage Tokens¶
Introduction¶
Any appchain deployed through Tanssi is sovereign and free to define the governance model that best fits its use case. The appchain governor has superpowers over the chain administration. Consequently, they can call privileged functions, such as updating the runtime and managing native token-related operations, among other actions.
There are some actions related to the native token management that are available to the appchain governor on the Tanssi dApp:
- Mint tokens - mints new tokens, increasing the total supply
- Update balances - increases or decreases the balance of an account, affecting the total supply
- Transfer tokens - executes a forced token transfer from one account to another
- Configure gas dynamics - only available on EVM-compatible appchains, this action changes the EIP-1559 configuration, affecting the transaction pricing mechanism
In this guide, you'll learn how to execute the previously listed actions using the Tanssi dApp.
Checking Prerequisites¶
For the examples in this guide, you will need to have the following:
- A Tanssi appchain (Snap or Dedicated)
- The account you used when registering the appchain, imported in any of the supported wallets
- Your appchain's Sudo account, also imported in any of the supported wallets
Note
The appchain's registration account is always a Substrate one, whereas the appchain's Sudo account depends on the chain type. If the chain is EVM-compatible, then the Sudo account will be an Ethereum type and, otherwise, a Substrate type.
Retrieving the Registration Account¶
If you're unsure what your registration account is, you can query it directly from the Tanssi orchestrator chain, which keeps records of every registered appchain. To do so, head to the Chain state section on the Polkadot.js Apps connected to the orchestrator chain for snap appchains or dedicated appchains, and take the following steps:
- Select the registrar storage module
- Select registrarDeposit
- Insert your appchain ID
- Press + icon
You'll see the registration account at the bottom.
Note
The dApp will show your appchain in the dashboard only if you have the registration account properly set.
Retrieving the Sudo Account¶
If you're unsure what your Tanssi appchain's Sudo account is, you can find it in your Tanssi Dashboard underneath the Properties section.
Warning
It's critical to protect your Sudo account key with the utmost security precautions, as it grants privileged access to your Tanssi appchain.
Accessing the Token Management Panel¶
The Tanssi dApp implements a smooth interface, allowing the appchain governor to access and execute privileged functions. To do so, head to the Tanssi dApp, and then:
- Click on the Manage button
- Click on the Token Management button.
Now you have direct access to the actions presented in the introduction:
- Mint Tokens
- Update Balances
- Transfer Tokens
- Configure Gas Dynamics
Note
If you don't see your appchain's details on the dashboard, make sure to comply with the prerequisites.
Minting Tokens¶
The appchain governor can mint new tokens, increasing its total supply. To do so, in the Token Management panel, click on the Mint tokens button, and then:
-
Insert the address that will hold the newly minted tokens
Note
The destination address must be Ethereum type if the chain is EVM-compatible and a Substrate type otherwise.
-
Insert the amount of tokens to mint
- Click on Mint
You'll be asked to sign the transaction with the appchain's governor account. Once the transaction has gone through, the destination account's balance will have been increased by the desired amount.
Updating Balances¶
The appchain governor can increase or decrease the balance of any account, thus affecting the total supply. To do so, in the Token Management panel, click on the Update Balances button, and then:
-
Insert the address that will hold the newly minted tokens. Once you enter the address, its current balance will be displayed
Note
The destination address must be Ethereum type if the chain is EVM-compatible and a Substrate type otherwise.
-
Insert the new balance the address will hold
- Click on Update
You'll be asked to sign the transaction with the appchain's governor account. Once the transaction has gone through, the destination account's balance will reflect exactly the desired amount, regardless of previous holdings.
Executing Forced Transfers¶
The appchain governor can reassign balances, forcing a token transfer from one account to another. To do so, in the Token Management panel, click on the Transfer Tokens button, and then:
- Insert the origin address that will transfer its tokens
-
Insert the destination address that will receive the tokens
Note
The origin and destination addresses must be Ethereum type if the chain is EVM-compatible and Substrate type otherwise.
-
Insert the amount of tokens to transfer
- Click on Transfer
You'll be asked to sign the transaction with the appchain's governor account. Once the transaction has gone through, the destination account will have received the number of tokens from the origin address.
Setting Gas Dynamics¶
Note
This option only applies to EVM-compatible appchains.
The governor of an EVM-compatible appchain can change its EIP-1559 configuration, affecting the transaction pricing mechanism. To do so, in the Token Management panel, click on the Gas Dynamics button, and then:
- Insert the new base fee, expressed in Wei units (10-18)
- Insert the elasticity value
- Click on Update Dynamics
You'll be asked to sign the transaction with the appchain's governor account. Once the transaction has gone through, the appchain's fee mechanism will run with the new transaction pricing parameters.
| Created: June 4, 2024