Skip to main content

State

The mint module maintains several pieces of state to track minting parameters, current provisions, and historical data.

Params

The module parameters define the minting behavior and can be updated through governance.

MintDenom

The denomination of the token to be minted.

  • Type: string
  • Example: "adt"
  • Validation: Must be a valid Cosmos SDK denomination

GenesisEpochProvisions

The initial amount of tokens to mint per epoch at genesis or when minting starts.

  • Type: math.LegacyDec
  • Example: 76923076923075000000000000 (approximately 76.92M DT per week in 18-decimal adt)
  • Validation: Must be non-negative

EpochIdentifier

The identifier of the epoch to use for minting. This must match an epoch registered in the epochs module.

  • Type: string
  • Example: "week"
  • Validation: Cannot be blank, must be a valid epoch identifier

ReductionPeriodInEpochs

The number of epochs between each reduction of minting provisions.

  • Type: int64
  • Example: 52 (one year if using weekly epochs)
  • Validation: Must be positive

ReductionFactor

The multiplier applied to epoch provisions at each reduction period.

  • Type: math.LegacyDec
  • Example: 0.8 (reduces minting by 20% each period)
  • Validation: Must be between 0 and 1 (inclusive)

DistributionProportions

Defines how minted tokens are distributed between different destinations.

message DistributionProportions {
// staking defines the proportion of minted tokens allocated to staking rewards
math.LegacyDec staking = 1;

// community_pool defines the proportion of minted tokens allocated to the community pool
math.LegacyDec community_pool = 2;
}
  • Type: DistributionProportions
  • Example: {staking: 1.0, community_pool: 0.0} (100% to staking)
  • Validation:
    • Each proportion must be non-negative
    • staking + community_pool must equal 1.0

MintingRewardsDistributionStartEpoch

The epoch number when minting should begin. Minting will not occur before this epoch.

  • Type: int64
  • Example: 27 (start after ~0.5 years with weekly epochs)
  • Validation: Must be non-negative

MaxSupply

The maximum total supply of tokens that can ever be minted. When the total supply reaches this limit, minting stops.

  • Type: math.LegacyDec
  • Example: 100000000000000000000000000000 (100B DT in 18-decimal adt)
  • Validation: Must be positive

BurnReplacementRatio

The governance-controlled ratio r applied to last epoch's observed adt burn to compute the replacement mint component each epoch (replacement = r · B_{n-1}).

  • Type: math.LegacyDec
  • Example: 0 (replacement disabled — default at upgrade)
  • Validation: Must be in [0, 1]

Minter

The minter tracks the current minting state that changes over time.

message Minter {
// epoch_provisions represent the total epoch token provisions for the current epoch
math.LegacyDec epoch_provisions = 1;
}

EpochProvisions

The current amount of tokens to mint per epoch. This value:

  • Starts at GenesisEpochProvisions
  • Reduces by ReductionFactor every ReductionPeriodInEpochs epochs
  • Is used to calculate the amount to mint each epoch

Historical State

The module maintains historical data for transparency and auditability.

LastReductionEpochNum

The epoch number when the last reduction was applied.

  • Type: int64
  • Purpose: Used to determine when the next reduction should occur
  • Calculation: Next reduction occurs when currentEpoch >= lastReductionEpoch + reductionPeriodInEpochs

ReductionEpochs

A map storing the reduction factor applied at each reduction epoch.

  • Type: collections.Map[int64, string]
  • Key: Epoch number when reduction occurred
  • Value: Reduction factor applied (as decimal string)
  • Purpose: Historical record of all reductions for auditability

EpochProvisionsHistory

A map storing the epoch provisions for each epoch.

  • Type: collections.Map[int64, string]
  • Key: Epoch number
  • Value: Epoch provisions at that epoch (as decimal string)
  • Purpose: Complete historical record of minting amounts

Burn-Replacement State

These three collections support the burn-replacement mechanism. All three are written on every successful AfterEpochEnd invocation — including the at-cap branch where no minting occurs — so the history collections remain dense and indexable by epoch number with no gaps.

LastEpochSupplyColl

Singleton item storing the adt supply snapshot persisted at the end of the last AfterEpochEnd. Used as S_prev in next epoch's burn-diff computation B_n = max(0, S_prev − S_current).

  • Type: collections.Item[math.Int] (serialised as decimal string)
  • Value: currentSupply + cappedTotal at the end of the last hook invocation
  • Purpose: Reference point for supply-diff burn observation

BurnHistoryColl

Map storing the observed adt burn for each epoch.

  • Type: collections.Map[int64, string]
  • Key: Epoch number n
  • Value: B_n — burns observed during epoch n (math.Int as decimal string)
  • Purpose: Historical record of burns; B_{n-1} is read at epoch n to compute replacement

ReplacementMintHistoryColl

Map storing the replacement-mint amount recorded for each epoch.

  • Type: collections.Map[int64, string]
  • Key: Epoch number n
  • Value: Replacement-mint amount recorded at epoch n (math.Int as decimal string)
  • Purpose: Historical record of replacement minting; subject to the replacement-priority bookkeeping rule when the MaxSupply cap is hit

State Keys

The module uses the following keys for state storage:

MinterKey                 = collections.NewPrefix(0) // Key for minter
ReductionEpochsKey = collections.NewPrefix(1) // Prefix for reduction epochs map
ParamsKey = collections.NewPrefix(2) // Key for params
LastReductionEpochKey = collections.NewPrefix(3) // Key for last reduction epoch number
EpochProvisionsKey = collections.NewPrefix(4) // Prefix for epoch provisions history map
LastEpochSupplyKey = collections.NewPrefix(5) // Key for last epoch adt supply snapshot
BurnHistoryKey = collections.NewPrefix(6) // Prefix for burn history map
ReplacementMintHistoryKey = collections.NewPrefix(7) // Prefix for replacement-mint history map

Example State Evolution

Genesis (Epoch 0):

Params:
{ genesis_epoch_provisions: 76923076923075000000000000, reduction_period_in_epochs: 52, reduction_factor: 0.8, ... }
Minter: { epoch_provisions: 76923076923075000000000000 }
LastReductionEpochNum: 0

After First Reduction (Epoch 52):

Minter: { epoch_provisions: 61538461538460000000000000  // 76923076923075000000000000 * 0.8 }
LastReductionEpochNum: 52
ReductionEpochs: { 52: "0.8" }
EpochProvisionsHistory: { 51: "76923076923075000000000000", 52: "61538461538460000000000000", ... }

After Second Reduction (Epoch 104):

Minter: {
epoch_provisions: 49230769230768000000000000 // 61538461538460000000000000 * 0.8
}
LastReductionEpochNum: 104
ReductionEpochs: {
52: "0.8",
104: "0.8"
}
EpochProvisionsHistory: {
...,
103: "61538461538460000000000000",
104: "49230769230768000000000000",
...
}