Adding automatic execution of certain logic at the beginning of each block is being done in the Mint Module. The section elaborates on all the begin-blocker executions in the Mint module. Minting parameters are recalculated and inflation is paid at the beginning of each block.
Checking if the chain has moved from one phase to another, including the final phase, and re-setting the minter in case the phase has changed, is a begin-blocker operation implemented in the Mint module. It is implemented as follows:
If the phase has changed, set the minter with the changed parameters:
Since the SGE Network chain is predominantly reliant on phases for its inflation model, the phase_provision keeps track of the total amount of tokens to be distributed in the current phase. This value is calculated every time there is a phase change.
Calculate the provisions generated for each block based on the current phase provisions. The provisions are then minted by the mint module's ModuleMinterAccount and then transferred to the auth's FeeCollector ModuleAccount.