pub fn encode_update_minting_ability_script_function(
    currency: TypeTag,
    allow_minting: bool
) -> TransactionPayload
Expand description

Summary

Script to allow or disallow minting of new coins in a specified currency. This transaction can only be sent by the Treasury Compliance account. Turning minting off for a currency will have no effect on coins already in circulation, and coins may still be removed from the system.

Technical Description

This transaction sets the can_mint field of the Diem::CurrencyInfo<Currency> resource published under 0xA550C18 to the value of allow_minting. Minting of coins if allowed if this field is set to true and minting of new coins in Currency is disallowed otherwise. This transaction needs to be sent by the Treasury Compliance account.

Parameters

NameTypeDescription
CurrencyTypeThe Move type for the Currency whose minting ability is being updated. Currency must be an already-registered currency on-chain.
accountsignerSigner of the sending account. Must be the Diem Root account.
allow_mintingboolWhether to allow minting of new coins in Currency.

Common Abort Conditions

Error CategoryError ReasonDescription
Errors::REQUIRES_ADDRESSCoreAddresses::ETREASURY_COMPLIANCEtc_account is not the Treasury Compliance account.
Errors::NOT_PUBLISHEDDiem::ECURRENCY_INFOCurrency is not a registered currency on-chain.
  • TreasuryComplianceScripts::update_dual_attestation_limit
  • TreasuryComplianceScripts::update_exchange_rate