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:
"udt"
- 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:
76923076923075
(approximately 76.92M DT per week in micro-units) - 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 equal1.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:
100000000000000000
(100B DT in micro-units) - Validation: Must be positive
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
everyReductionPeriodInEpochs
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
State Keys
The module uses the following keys for state storage:
ParamsKey = []byte{0x00} // Key for params
MinterKey = []byte{0x01} // Key for minter
LastReductionEpochKey = []byte{0x02} // Key for last reduction epoch number
ReductionEpochsKey = []byte{0x03} // Prefix for reduction epochs map
EpochProvisionsKey = []byte{0x04} // Prefix for epoch provisions history map
Example State Evolution
Genesis (Epoch 0):
Params: { genesis_epoch_provisions: 76923076923075, reduction_period_in_epochs: 52, reduction_factor: 0.8, ... }
Minter: { epoch_provisions: 76923076923075 }
LastReductionEpochNum: 0
After First Reduction (Epoch 52):
Minter: { epoch_provisions: 61538461538460 // 76923076923075 * 0.8 }
LastReductionEpochNum: 52
ReductionEpochs: { 52: "0.8" }
EpochProvisionsHistory: { 51: "76923076923075", 52: "61538461538460", ... }
After Second Reduction (Epoch 104):
Minter: {
epoch_provisions: 49230769230768 // 61538461538460 * 0.8
}
LastReductionEpochNum: 104
ReductionEpochs: {
52: "0.8",
104: "0.8"
}
EpochProvisionsHistory: {
...,
103: "61538461538460",
104: "49230769230768",
...
}