Hooks
The x/inflation
module implements the AfterEpochEnd
hook from the x/epoch
module in order to allocate inflation.
Epoch Hook: Inflation
The epoch hook handles the inflation logic which is run at the end of each epoch. It is responsible for minting and allocating the epoch mint provision as well as updating it:
Check if inflation is disabled. If it is, skip inflation, increment number of skipped epochs and return without proceeding to the next steps.
A block is commited, that signalizes that an
epoch
has ended (blockheader.Time
has surpassedepoch_start
+epochIdentifier
).Mint coin in amount of
epochMintProvision
and allocate according to inflation distribution to staking rewards, usage incentives and community pool.If a period ends with current epoch,
increment the period by 1 and set to store and
recalculate epochMintProvision and set to store.