Granite Upgrade Activates in05d:23h:27m:30s

Native Minter with PoS

How the Native Minter precompile enables staking rewards

The Native Minter Precompile is essential for native token staking because it allows the staking manager contract to mint new tokens as rewards for validators and delegators. Without this capability, there would be no way to programmatically reward validators for securing the network.

The NativeTokenStakingManager contract mints rewards by calling the INativeMinter precompile at address 0x0200000000000000000000000000000000000001.

Setup Requirements

The NativeTokenStakingManager contract must be granted admin privileges on the Native Minter precompile to mint rewards. Without these privileges, the staking manager cannot mint rewards and reward distribution will fail.

For this course, we will activate the Native Minter precompile in the genesis configuration. Since the staking manager contract is deployed after the L1 is created, we'll add its address to the precompile's allowlist in later chapters once the contract address is known.

Note that precompile can also be added to a chain after deployment through a network upgrade, but this will be covered in another course.

Reward Minting Flow

The reward minting flow involves multiple contracts working together to distribute rewards to validators and delegators:

The _reward() Function

The core reward minting happens through the _reward() internal function in NativeTokenStakingManager:

function _reward(address account, uint256 amount) internal override {
    nativeMinter.mintNativeCoin(account, amount);
}

This simple function wraps the Native Minter precompile's mintNativeCoin(address addr, uint256 amount) function, which performs the actual token minting at the protocol level.

Is this guide helpful?