Native Token Minting Rights
Learn how to manage the native token minting rights.
Many chains have a hard-capped supply for their gas token. The Avalanche C-Chain uses AVAX as their gas token and there will only ever be 720m AVAX. This may not be optimal for enterprise use cases, especially if they want to create an experience with a valueless gas token.
Therefore, they have the option to mint more native tokens at any time. This can be done through the Native Minter Precompile. If a community running an Avalanche L1 wants to hard-cap the native token, that is perfectly doable as well. They just keep the native minter capabilities deactivated (which is the default).
The Native Minter Precompile allows for fine-grained permissioning which address can mint more native tokens. There can be rich permissioning structures around precompiles with three roles.
These addresses are not necessarily owned by a single entity, but can also be managed by a multi-sig or DAO.
Initial permissions
If the native minter precompile is activated, the initial addresses can be set in genesis.
If only an enabled address is set, only that address can mint native tokens. Allowing another address to mint native tokens would require a network upgrade.
Interacting with the NativeMinter from Solidity
The Stateful Precompile contract powering the ContractNativeMinter adheres to the following Solidity interface at 0x0200000000000000000000000000000000000001
:
mintNativeCoin takes an address and amount of native coins to be minted. The amount denotes the amount in minimum denomination of native coins (10^18). For example, if you want to mint 1 native coin (in AVAX), you need to pass 1 * 10^18 as the amount. A NativeCoinMinted event is emitted with the sender, recipient and amount when a native coin is minted.
In the upcoming chapter, we will only use an admin address in order to keep the exercise simple.