logoAcademy

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, that allows for fine-grained permissioning which address can mint more native tokens. These addresses are not necessarily owned by a single entity, but can also be managed by a multi-sig or DAO.

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).

Native Minter
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
 
interface INativeMinter is IAllowList {
  event NativeCoinMinted(address indexed sender, address indexed recipient, uint256 amount);
 
  // Mint [amount] number of native coins and send to [addr]
  function mintNativeCoin(address addr, uint256 amount) external;
}
 
interface IAllowList {
  event RoleSet(uint256 indexed role, address indexed account, address indexed sender, uint256 oldRole);
 
  // Enabled addresses can mint native tokens
  function setEnabled(address addr) external;  
 
  // Admins can mint native tokens and enable/disable addresses
  function setManager(address addr) external;
  
  // Admins can mint native tokens and enable/disable addresses and give/revoke manager and admin rights
  function setAdmin(address addr) external;
 
  // Revoke the role from that address
  function setNone(address addr) external;
 
  // Read the status of [addr].
  function readAllowList(address addr) external view returns (uint256 role);
}

There can be rich permissioning structures around precompiles with three roles:

In the upcoming chapter, we will only use an admin address in order to keep the exercide simple.

Updated:

On this page

No Headings
Edit on Github