Skip to main content

Contents

  1. Contents
  2. State
  3. Begin Block
  4. Parameters
  5. Events

State

Params

  • Params: mint/params -> legacy_amino(params)
protobuf
message Params {
  option (amino.name) = "client/x/mint/Params";

  // type of coin to mint
  string mint_denom = 1;
  // inflation amount per year
  string inflations_per_year = 2 [
    (cosmos_proto.scalar)  = "cosmos.Dec",
    (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
    (gogoproto.nullable)   = false
  ];
  // expected blocks per year
  uint64 blocks_per_year = 3;
}

Begin Block

Minting parameters are calculated and inflation paid at the beginning of each block.

Inflation amount calculation

Inflation amount is calculated using an โ€œinflation calculation functionโ€ thatโ€™s
passed to the NewAppModule function. If no function is passed, then the SDKโ€™s default inflation function will be used (DefaultInflationCalculationFn). In case a custom inflation calculation logic is needed, this can be achieved by defining and passing a function that matches InflationCalculationFnโ€™s signature.
type InflationCalculationFn func(ctx sdk.Context, minter Minter, params Params, bondedRatio math.LegacyDec) math.LegacyDec

Parameters

The minting module contains the following parameters:
KeyTypeExample
MintDenomstringโ€stakeโ€
InflationsPerYearstring (dec)โ€œ20000000000000000โ€
BlocksPerYearstring (uint64)โ€œ10368000โ€
  • MintDenom is the coin denominator used.
  • InflationsPerYear is the target inflation per year, in 1e18 decimals.
  • BlocksPerYear is the target number of blocks per year.

Events

The minting module emits the following events:

BeginBlocker

TypeAttribute KeyAttribute Value
mintamountโ€1000โ€
โŒ˜I