Messages
The mint module supports one message type for updating module parameters through governance.
MsgUpdateParams
MsgUpdateParams
allows the module authority (typically the governance module) to update the mint module parameters.
message MsgUpdateParams {
option (cosmos.msg.v1.signer) = "authority";
// authority is the address that controls the module (typically the governance module)
string authority = 1;
// params defines the x/mint parameters to update
Params params = 2;
}
Fields
Authority
The address authorized to update parameters. This is typically the governance module address.
- Type:
string
- Validation: Must match the module's configured authority address
- Example:
"dchain10d07y265gmmuvt4z0w9aw880jnsr700j6zn9kn"
(governance module address)
Params
The complete set of new parameters to apply. All parameter fields must be provided and must pass validation.
- Type:
Params
- Validation: All parameter validation rules from 03_state.md apply
Response
message MsgUpdateParamsResponse {}
An empty response is returned on success.
Usage
This message is typically submitted through a governance proposal. The workflow is:
- A governance proposal is created with
MsgUpdateParams
as the proposal message - The community votes on the proposal
- If the proposal passes, the message is executed by the governance module
- The mint module validates the authority and new parameters
- If valid, the parameters are updated in state
Example Scenarios
Adjusting Distribution Proportions
A governance proposal could change the distribution to allocate some minting to the community pool:
{
"authority": "dchain10d07y265gmmuvt4z0w9aw880jnsr700j6zn9kn",
"params": {
"mint_denom": "udt",
"genesis_epoch_provisions": "76923076923075",
"epoch_identifier": "week",
"reduction_period_in_epochs": 52,
"reduction_factor": "0.8",
"distribution_proportions": {
"staking": "0.9",
"community_pool": "0.1"
},
"minting_rewards_distribution_start_epoch": 27,
"max_supply": "100000000000000000"
}
}
Changing Reduction Schedule
A governance proposal could adjust the reduction factor or period:
{
"authority": "dchain10d07y265gmmuvt4z0w9aw880jnsr700j6zn9kn",
"params": {
"mint_denom": "udt",
"genesis_epoch_provisions": "76923076923075",
"epoch_identifier": "week",
"reduction_period_in_epochs": 26,
"reduction_factor": "0.9",
"distribution_proportions": {
"staking": "1.0",
"community_pool": "0.0"
},
"minting_rewards_distribution_start_epoch": 27,
"max_supply": "100000000000000000"
}
}
Validation
The message handler performs the following validations:
- Authority Check: Verifies that
msg.Authority
matches the module's configured authority - Parameter Validation: All parameter validation rules are enforced:
mint_denom
must be a valid denominationgenesis_epoch_provisions
must be non-negativeepoch_identifier
cannot be blankreduction_period_in_epochs
must be positivereduction_factor
must be between 0 and 1- Distribution proportions must be non-negative and sum to 1.0
minting_rewards_distribution_start_epoch
must be non-negativemax_supply
must be positive
If any validation fails, the message execution is aborted and an error is returned.
Events
When parameters are successfully updated, no specific event is emitted by the mint module. However, the governance module will emit events related to the proposal execution.
Errors
Common errors that may occur:
ErrInvalidSigner
: The authority address doesn't match the expected authority- Parameter validation errors: Various errors if any parameter fails validation (see 03_state.md for specific validation rules)
Message Flow
Important Notes
- Parameters take effect immediately: Once updated, the new parameters are used in the next epoch's minting calculation
- No retroactive changes: Historical minting and reductions are not affected by parameter changes
- Genesis epoch provisions: Changing
genesis_epoch_provisions
does not reset the currentminter.epoch_provisions
. It only affects future reductions if the minter is reset - Max supply changes: Exercise caution when changing
max_supply
as it affects the token economics