language/diem-framework/releases/artifacts/current/docs/modules/TreasuryComplianceScripts.md
<a name="0x1_TreasuryComplianceScripts"></a>
0x1::TreasuryComplianceScriptsThis module holds scripts relating to treasury and compliance-related activities in the Diem Framework.
Only accounts with a role of <code>Roles::TREASURY_COMPLIANCE</code> and <code>Roles::DESIGNATED_DEALER</code> can (successfully) use the scripts in this module. The exact role required for a transaction is determined on a per-transaction basis.
cancel_burn_with_amount
burn_with_amount
preburn
burn_txn_fees
tiered_mint
freeze_account
unfreeze_account
update_dual_attestation_limit
update_exchange_rate
update_minting_ability
add_vasp_domain
remove_vasp_domain
<a name="0x1_TreasuryComplianceScripts_cancel_burn_with_amount"></a>
cancel_burn_with_amount<a name="@Summary_0"></a>
Cancels and returns the coins held in the preburn area under <code>preburn_address</code>, which are equal to the <code>amount</code> specified in the transaction. Finds the first preburn resource with the matching amount and returns the funds to the <code>preburn_address</code>'s balance. Can only be successfully sent by an account with Treasury Compliance role.
<a name="@Technical_Description_1"></a>
Cancels and returns all coins held in the <code><a href="Diem.md#0x1_Diem_Preburn">Diem::Preburn</a><Token></code> resource under the <code>preburn_address</code> and return the funds to the <code>preburn_address</code> account's <code><a href="DiemAccount.md#0x1_DiemAccount_Balance">DiemAccount::Balance</a><Token></code>. The transaction must be sent by an <code>account</code> with a <code><a href="Diem.md#0x1_Diem_BurnCapability">Diem::BurnCapability</a><Token></code> resource published under it. The account at <code>preburn_address</code> must have a <code><a href="Diem.md#0x1_Diem_Preburn">Diem::Preburn</a><Token></code> resource published under it, and its value must be nonzero. The transaction removes the entire balance held in the <code><a href="Diem.md#0x1_Diem_Preburn">Diem::Preburn</a><Token></code> resource, and returns it back to the account's <code><a href="DiemAccount.md#0x1_DiemAccount_Balance">DiemAccount::Balance</a><Token></code> under <code>preburn_address</code>. Due to this, the account at <code>preburn_address</code> must already have a balance in the <code>Token</code> currency published before this script is called otherwise the transaction will fail.
<a name="@Events_2"></a>
The successful execution of this transaction will emit:
<a name="@Parameters_3"></a>
| Name | Type | Description |
|---|---|---|
| <code>Token</code> | Type | The Move type for the <code>Token</code> currenty that burning is being cancelled for. <code>Token</code> must be an already-registered currency on-chain. |
| <code>account</code> | <code>signer</code> | The signer of the sending account of this transaction, must have a burn capability for <code>Token</code> published under it. |
| <code>preburn_address</code> | <code>address</code> | The address where the coins to-be-burned are currently held. |
| <code>amount</code> | <code>u64</code> | The amount to be cancelled. |
<a name="@Common_Abort_Conditions_4"></a>
| Error Category | Error Reason | Description |
|---|---|---|
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_REQUIRES_CAPABILITY">Errors::REQUIRES_CAPABILITY</a></code> | <code><a href="Diem.md#0x1_Diem_EBURN_CAPABILITY">Diem::EBURN_CAPABILITY</a></code> | The sending <code>account</code> does not have a <code><a href="Diem.md#0x1_Diem_BurnCapability">Diem::BurnCapability</a><Token></code> published under it. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_INVALID_STATE">Errors::INVALID_STATE</a></code> | <code><a href="Diem.md#0x1_Diem_EPREBURN_NOT_FOUND">Diem::EPREBURN_NOT_FOUND</a></code> | The <code><a href="Diem.md#0x1_Diem_PreburnQueue">Diem::PreburnQueue</a><Token></code> resource under <code>preburn_address</code> does not contain a preburn request with a value matching <code>amount</code>. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_NOT_PUBLISHED">Errors::NOT_PUBLISHED</a></code> | <code><a href="Diem.md#0x1_Diem_EPREBURN_QUEUE">Diem::EPREBURN_QUEUE</a></code> | The account at <code>preburn_address</code> does not have a <code><a href="Diem.md#0x1_Diem_PreburnQueue">Diem::PreburnQueue</a><Token></code> resource published under it. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_NOT_PUBLISHED">Errors::NOT_PUBLISHED</a></code> | <code><a href="Diem.md#0x1_Diem_ECURRENCY_INFO">Diem::ECURRENCY_INFO</a></code> | The specified <code>Token</code> is not a registered currency on-chain. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_INVALID_ARGUMENT">Errors::INVALID_ARGUMENT</a></code> | <code><a href="DiemAccount.md#0x1_DiemAccount_EPAYEE_CANT_ACCEPT_CURRENCY_TYPE">DiemAccount::EPAYEE_CANT_ACCEPT_CURRENCY_TYPE</a></code> | The account at <code>preburn_address</code> doesn't have a balance resource for <code>Token</code>. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_LIMIT_EXCEEDED">Errors::LIMIT_EXCEEDED</a></code> | <code><a href="DiemAccount.md#0x1_DiemAccount_EDEPOSIT_EXCEEDS_LIMITS">DiemAccount::EDEPOSIT_EXCEEDS_LIMITS</a></code> | The depositing of the funds held in the prebun area would exceed the <code>account</code>'s account limits. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_INVALID_STATE">Errors::INVALID_STATE</a></code> | <code><a href="DualAttestation.md#0x1_DualAttestation_EPAYEE_COMPLIANCE_KEY_NOT_SET">DualAttestation::EPAYEE_COMPLIANCE_KEY_NOT_SET</a></code> | The <code>account</code> does not have a compliance key set on it but dual attestion checking was performed. |
<a name="@Related_Scripts_5"></a>
The total value of preburn for <code>Token</code> should decrease by the preburned amount.
<pre><code><b>ensures</b> post_total_preburn_value == total_preburn_value - amount; </code></pre>The balance of <code>Token</code> at <code>preburn_address</code> should increase by the preburned amount.
<pre><code><b>ensures</b> post_balance_at_addr == balance_at_addr + amount; <b>include</b> <a href="Diem.md#0x1_Diem_CancelBurnWithCapEmits">Diem::CancelBurnWithCapEmits</a><Token>; <b>include</b> <a href="DiemAccount.md#0x1_DiemAccount_DepositEmits">DiemAccount::DepositEmits</a><Token>{ payer: preburn_address, payee: preburn_address, amount: amount, metadata: x"" }; <b>aborts_with</b> [check] <a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_REQUIRES_CAPABILITY">Errors::REQUIRES_CAPABILITY</a>, <a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_NOT_PUBLISHED">Errors::NOT_PUBLISHED</a>, <a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_INVALID_ARGUMENT">Errors::INVALID_ARGUMENT</a>, <a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_LIMIT_EXCEEDED">Errors::LIMIT_EXCEEDED</a>, <a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_INVALID_STATE">Errors::INVALID_STATE</a>; </code></pre>Access Control: Only the account with the burn capability can cancel burning [H3].
<pre><code><b>include</b> <a href="Diem.md#0x1_Diem_AbortsIfNoBurnCapability">Diem::AbortsIfNoBurnCapability</a><Token>{account: account}; </code></pre> </details><a name="0x1_TreasuryComplianceScripts_burn_with_amount"></a>
burn_with_amount<a name="@Summary_6"></a>
Burns the coins held in a preburn resource in the preburn queue at the specified preburn address, which are equal to the <code>amount</code> specified in the transaction. Finds the first relevant outstanding preburn request with matching amount and removes the contained coins from the system. The sending account must be the Treasury Compliance account. The account that holds the preburn queue resource will normally be a Designated Dealer, but there are no enforced requirements that it be one.
<a name="@Technical_Description_7"></a>
This transaction permanently destroys all the coins of <code>Token</code> type stored in the <code><a href="Diem.md#0x1_Diem_Preburn">Diem::Preburn</a><Token></code> resource published under the <code>preburn_address</code> account address.
This transaction will only succeed if the sending <code>account</code> has a <code><a href="Diem.md#0x1_Diem_BurnCapability">Diem::BurnCapability</a><Token></code>, and a <code><a href="Diem.md#0x1_Diem_Preburn">Diem::Preburn</a><Token></code> resource exists under <code>preburn_address</code>, with a non-zero <code>to_burn</code> field. After the successful execution of this transaction the <code>total_value</code> field in the <code><a href="Diem.md#0x1_Diem_CurrencyInfo">Diem::CurrencyInfo</a><Token></code> resource published under <code>0xA550C18</code> will be decremented by the value of the <code>to_burn</code> field of the preburn resource under <code>preburn_address</code> immediately before this transaction, and the <code>to_burn</code> field of the preburn resource will have a zero value.
<a name="@Events_8"></a>
The successful execution of this transaction will emit a <code><a href="Diem.md#0x1_Diem_BurnEvent">Diem::BurnEvent</a></code> on the event handle held in the <code><a href="Diem.md#0x1_Diem_CurrencyInfo">Diem::CurrencyInfo</a><Token></code> resource's <code>burn_events</code> published under <code>0xA550C18</code>.
<a name="@Parameters_9"></a>
| Name | Type | Description |
|---|---|---|
| <code>Token</code> | Type | The Move type for the <code>Token</code> currency being burned. <code>Token</code> must be an already-registered currency on-chain. |
| <code>tc_account</code> | <code>signer</code> | The signer of the sending account of this transaction, must have a burn capability for <code>Token</code> published under it. |
| <code>sliding_nonce</code> | <code>u64</code> | The <code>sliding_nonce</code> (see: <code><a href="SlidingNonce.md#0x1_SlidingNonce">SlidingNonce</a></code>) to be used for this transaction. |
| <code>preburn_address</code> | <code>address</code> | The address where the coins to-be-burned are currently held. |
| <code>amount</code> | <code>u64</code> | The amount to be burned. |
<a name="@Common_Abort_Conditions_10"></a>
| Error Category | Error Reason | Description |
|---|---|---|
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_NOT_PUBLISHED">Errors::NOT_PUBLISHED</a></code> | <code><a href="SlidingNonce.md#0x1_SlidingNonce_ESLIDING_NONCE">SlidingNonce::ESLIDING_NONCE</a></code> | A <code><a href="SlidingNonce.md#0x1_SlidingNonce">SlidingNonce</a></code> resource is not published under <code>account</code>. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_INVALID_ARGUMENT">Errors::INVALID_ARGUMENT</a></code> | <code><a href="SlidingNonce.md#0x1_SlidingNonce_ENONCE_TOO_OLD">SlidingNonce::ENONCE_TOO_OLD</a></code> | The <code>sliding_nonce</code> is too old and it's impossible to determine if it's duplicated or not. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_INVALID_ARGUMENT">Errors::INVALID_ARGUMENT</a></code> | <code><a href="SlidingNonce.md#0x1_SlidingNonce_ENONCE_TOO_NEW">SlidingNonce::ENONCE_TOO_NEW</a></code> | The <code>sliding_nonce</code> is too far in the future. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_INVALID_ARGUMENT">Errors::INVALID_ARGUMENT</a></code> | <code><a href="SlidingNonce.md#0x1_SlidingNonce_ENONCE_ALREADY_RECORDED">SlidingNonce::ENONCE_ALREADY_RECORDED</a></code> | The <code>sliding_nonce</code> has been previously recorded. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_REQUIRES_CAPABILITY">Errors::REQUIRES_CAPABILITY</a></code> | <code><a href="Diem.md#0x1_Diem_EBURN_CAPABILITY">Diem::EBURN_CAPABILITY</a></code> | The sending <code>account</code> does not have a <code><a href="Diem.md#0x1_Diem_BurnCapability">Diem::BurnCapability</a><Token></code> published under it. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_INVALID_STATE">Errors::INVALID_STATE</a></code> | <code><a href="Diem.md#0x1_Diem_EPREBURN_NOT_FOUND">Diem::EPREBURN_NOT_FOUND</a></code> | The <code><a href="Diem.md#0x1_Diem_PreburnQueue">Diem::PreburnQueue</a><Token></code> resource under <code>preburn_address</code> does not contain a preburn request with a value matching <code>amount</code>. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_NOT_PUBLISHED">Errors::NOT_PUBLISHED</a></code> | <code><a href="Diem.md#0x1_Diem_EPREBURN_QUEUE">Diem::EPREBURN_QUEUE</a></code> | The account at <code>preburn_address</code> does not have a <code><a href="Diem.md#0x1_Diem_PreburnQueue">Diem::PreburnQueue</a><Token></code> resource published under it. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_NOT_PUBLISHED">Errors::NOT_PUBLISHED</a></code> | <code><a href="Diem.md#0x1_Diem_ECURRENCY_INFO">Diem::ECURRENCY_INFO</a></code> | The specified <code>Token</code> is not a registered currency on-chain. |
<a name="@Related_Scripts_11"></a>
Access Control: Only the account with the burn capability can burn coins [H3].
<pre><code><b>include</b> <a href="Diem.md#0x1_Diem_AbortsIfNoBurnCapability">Diem::AbortsIfNoBurnCapability</a><Token>{account: account}; </code></pre> </details><a name="0x1_TreasuryComplianceScripts_preburn"></a>
preburn<a name="@Summary_12"></a>
Moves a specified number of coins in a given currency from the account's balance to its preburn area after which the coins may be burned. This transaction may be sent by any account that holds a balance and preburn area in the specified currency.
<a name="@Technical_Description_13"></a>
Moves the specified <code>amount</code> of coins in <code>Token</code> currency from the sending <code>account</code>'s <code><a href="DiemAccount.md#0x1_DiemAccount_Balance">DiemAccount::Balance</a><Token></code> to the <code><a href="Diem.md#0x1_Diem_Preburn">Diem::Preburn</a><Token></code> published under the same <code>account</code>. <code>account</code> must have both of these resources published under it at the start of this transaction in order for it to execute successfully.
<a name="@Events_14"></a>
Successful execution of this script emits two events:
<a name="@Parameters_15"></a>
| Name | Type | Description |
|---|---|---|
| <code>Token</code> | Type | The Move type for the <code>Token</code> currency being moved to the preburn area. <code>Token</code> must be an already-registered currency on-chain. |
| <code>account</code> | <code>signer</code> | The signer of the sending account. |
| <code>amount</code> | <code>u64</code> | The amount in <code>Token</code> to be moved to the preburn area. |
<a name="@Common_Abort_Conditions_16"></a>
| Error Category | Error Reason | Description |
|---|---|---|
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_NOT_PUBLISHED">Errors::NOT_PUBLISHED</a></code> | <code><a href="Diem.md#0x1_Diem_ECURRENCY_INFO">Diem::ECURRENCY_INFO</a></code> | The <code>Token</code> is not a registered currency on-chain. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_INVALID_STATE">Errors::INVALID_STATE</a></code> | <code>DiemAccount::EWITHDRAWAL_CAPABILITY_ALREADY_EXTRACTED</code> | The withdrawal capability for <code>account</code> has already been extracted. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_LIMIT_EXCEEDED">Errors::LIMIT_EXCEEDED</a></code> | <code><a href="DiemAccount.md#0x1_DiemAccount_EINSUFFICIENT_BALANCE">DiemAccount::EINSUFFICIENT_BALANCE</a></code> | <code>amount</code> is greater than <code>payer</code>'s balance in <code>Token</code>. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_NOT_PUBLISHED">Errors::NOT_PUBLISHED</a></code> | <code><a href="DiemAccount.md#0x1_DiemAccount_EPAYER_DOESNT_HOLD_CURRENCY">DiemAccount::EPAYER_DOESNT_HOLD_CURRENCY</a></code> | <code>account</code> doesn't hold a balance in <code>Token</code>. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_NOT_PUBLISHED">Errors::NOT_PUBLISHED</a></code> | <code><a href="Diem.md#0x1_Diem_EPREBURN">Diem::EPREBURN</a></code> | <code>account</code> doesn't have a <code><a href="Diem.md#0x1_Diem_Preburn">Diem::Preburn</a><Token></code> resource published under it. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_INVALID_STATE">Errors::INVALID_STATE</a></code> | <code><a href="Diem.md#0x1_Diem_EPREBURN_OCCUPIED">Diem::EPREBURN_OCCUPIED</a></code> | The <code>value</code> field in the <code><a href="Diem.md#0x1_Diem_Preburn">Diem::Preburn</a><Token></code> resource under the sender is non-zero. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_NOT_PUBLISHED">Errors::NOT_PUBLISHED</a></code> | <code><a href="Roles.md#0x1_Roles_EROLE_ID">Roles::EROLE_ID</a></code> | The <code>account</code> did not have a role assigned to it. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_REQUIRES_ROLE">Errors::REQUIRES_ROLE</a></code> | <code><a href="Roles.md#0x1_Roles_EDESIGNATED_DEALER">Roles::EDESIGNATED_DEALER</a></code> | The <code>account</code> did not have the role of DesignatedDealer. |
<a name="@Related_Scripts_17"></a>
Access Control: Only the account with a Preburn resource or PreburnQueue resource can preburn [H4].
<pre><code><b>aborts_if</b> !(<b>exists</b><<a href="Diem.md#0x1_Diem_Preburn">Diem::Preburn</a><Token>>(account_addr) || <b>exists</b><<a href="Diem.md#0x1_Diem_PreburnQueue">Diem::PreburnQueue</a><Token>>(account_addr)); </code></pre> </details><a name="0x1_TreasuryComplianceScripts_burn_txn_fees"></a>
burn_txn_fees<a name="@Summary_18"></a>
Burns the transaction fees collected in the <code>CoinType</code> currency so that the Diem association may reclaim the backing coins off-chain. May only be sent by the Treasury Compliance account.
<a name="@Technical_Description_19"></a>
Burns the transaction fees collected in <code>CoinType</code> so that the association may reclaim the backing coins. Once this transaction has executed successfully all transaction fees that will have been collected in <code>CoinType</code> since the last time this script was called with that specific currency. Both <code>balance</code> and <code>preburn</code> fields in the <code><a href="TransactionFee.md#0x1_TransactionFee_TransactionFee">TransactionFee::TransactionFee</a><CoinType></code> resource published under the <code>0xB1E55ED</code> account address will have a value of 0 after the successful execution of this script.
<a name="@Events_20"></a>
The successful execution of this transaction will emit a <code><a href="Diem.md#0x1_Diem_BurnEvent">Diem::BurnEvent</a></code> on the event handle held in the <code><a href="Diem.md#0x1_Diem_CurrencyInfo">Diem::CurrencyInfo</a><CoinType></code> resource's <code>burn_events</code> published under <code>0xA550C18</code>.
<a name="@Parameters_21"></a>
| Name | Type | Description |
|---|---|---|
| <code>CoinType</code> | Type | The Move type for the <code>CoinType</code> being added to the sending account of the transaction. <code>CoinType</code> must be an already-registered currency on-chain. |
| <code>tc_account</code> | <code>signer</code> | The signer of the sending account of this transaction. Must be the Treasury Compliance account. |
<a name="@Common_Abort_Conditions_22"></a>
| Error Category | Error Reason | Description |
|---|---|---|
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_REQUIRES_ADDRESS">Errors::REQUIRES_ADDRESS</a></code> | <code><a href="CoreAddresses.md#0x1_CoreAddresses_ETREASURY_COMPLIANCE">CoreAddresses::ETREASURY_COMPLIANCE</a></code> | The sending account is not the Treasury Compliance account. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_NOT_PUBLISHED">Errors::NOT_PUBLISHED</a></code> | <code><a href="TransactionFee.md#0x1_TransactionFee_ETRANSACTION_FEE">TransactionFee::ETRANSACTION_FEE</a></code> | <code>CoinType</code> is not an accepted transaction fee currency. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_INVALID_ARGUMENT">Errors::INVALID_ARGUMENT</a></code> | <code><a href="Diem.md#0x1_Diem_ECOIN">Diem::ECOIN</a></code> | The collected fees in <code>CoinType</code> are zero. |
<a name="@Related_Scripts_23"></a>
<a name="0x1_TreasuryComplianceScripts_tiered_mint"></a>
tiered_mint<a name="@Summary_24"></a>
Mints a specified number of coins in a currency to a Designated Dealer. The sending account must be the Treasury Compliance account, and coins can only be minted to a Designated Dealer account.
<a name="@Technical_Description_25"></a>
Mints <code>mint_amount</code> of coins in the <code>CoinType</code> currency to Designated Dealer account at <code>designated_dealer_address</code>. The <code>tier_index</code> parameter specifies which tier should be used to check verify the off-chain approval policy, and is based in part on the on-chain tier values for the specific Designated Dealer, and the number of <code>CoinType</code> coins that have been minted to the dealer over the past 24 hours. Every Designated Dealer has 4 tiers for each currency that they support. The sending <code>tc_account</code> must be the Treasury Compliance account, and the receiver an authorized Designated Dealer account.
<a name="@Events_26"></a>
Successful execution of the transaction will emit two events:
<a name="@Parameters_27"></a>
| Name | Type | Description |
|---|---|---|
| <code>CoinType</code> | Type | The Move type for the <code>CoinType</code> being minted. <code>CoinType</code> must be an already-registered currency on-chain. |
| <code>tc_account</code> | <code>signer</code> | The signer of the sending account of this transaction. Must be the Treasury Compliance account. |
| <code>sliding_nonce</code> | <code>u64</code> | The <code>sliding_nonce</code> (see: <code><a href="SlidingNonce.md#0x1_SlidingNonce">SlidingNonce</a></code>) to be used for this transaction. |
| <code>designated_dealer_address</code> | <code>address</code> | The address of the Designated Dealer account being minted to. |
| <code>mint_amount</code> | <code>u64</code> | The number of coins to be minted. |
| <code>tier_index</code> | <code>u64</code> | [Deprecated] The mint tier index to use for the Designated Dealer account. Will be ignored |
<a name="@Common_Abort_Conditions_28"></a>
| Error Category | Error Reason | Description |
|---|---|---|
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_NOT_PUBLISHED">Errors::NOT_PUBLISHED</a></code> | <code><a href="SlidingNonce.md#0x1_SlidingNonce_ESLIDING_NONCE">SlidingNonce::ESLIDING_NONCE</a></code> | A <code><a href="SlidingNonce.md#0x1_SlidingNonce">SlidingNonce</a></code> resource is not published under <code>tc_account</code>. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_INVALID_ARGUMENT">Errors::INVALID_ARGUMENT</a></code> | <code><a href="SlidingNonce.md#0x1_SlidingNonce_ENONCE_TOO_OLD">SlidingNonce::ENONCE_TOO_OLD</a></code> | The <code>sliding_nonce</code> is too old and it's impossible to determine if it's duplicated or not. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_INVALID_ARGUMENT">Errors::INVALID_ARGUMENT</a></code> | <code><a href="SlidingNonce.md#0x1_SlidingNonce_ENONCE_TOO_NEW">SlidingNonce::ENONCE_TOO_NEW</a></code> | The <code>sliding_nonce</code> is too far in the future. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_INVALID_ARGUMENT">Errors::INVALID_ARGUMENT</a></code> | <code><a href="SlidingNonce.md#0x1_SlidingNonce_ENONCE_ALREADY_RECORDED">SlidingNonce::ENONCE_ALREADY_RECORDED</a></code> | The <code>sliding_nonce</code> has been previously recorded. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_REQUIRES_ADDRESS">Errors::REQUIRES_ADDRESS</a></code> | <code><a href="CoreAddresses.md#0x1_CoreAddresses_ETREASURY_COMPLIANCE">CoreAddresses::ETREASURY_COMPLIANCE</a></code> | <code>tc_account</code> is not the Treasury Compliance account. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_REQUIRES_ROLE">Errors::REQUIRES_ROLE</a></code> | <code><a href="Roles.md#0x1_Roles_ETREASURY_COMPLIANCE">Roles::ETREASURY_COMPLIANCE</a></code> | <code>tc_account</code> is not the Treasury Compliance account. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_INVALID_ARGUMENT">Errors::INVALID_ARGUMENT</a></code> | <code><a href="DesignatedDealer.md#0x1_DesignatedDealer_EINVALID_MINT_AMOUNT">DesignatedDealer::EINVALID_MINT_AMOUNT</a></code> | <code>mint_amount</code> is zero. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_NOT_PUBLISHED">Errors::NOT_PUBLISHED</a></code> | <code><a href="DesignatedDealer.md#0x1_DesignatedDealer_EDEALER">DesignatedDealer::EDEALER</a></code> | <code><a href="DesignatedDealer.md#0x1_DesignatedDealer_Dealer">DesignatedDealer::Dealer</a></code> or <code><a href="DesignatedDealer.md#0x1_DesignatedDealer_TierInfo">DesignatedDealer::TierInfo</a><CoinType></code> resource does not exist at <code>designated_dealer_address</code>. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_REQUIRES_CAPABILITY">Errors::REQUIRES_CAPABILITY</a></code> | <code><a href="Diem.md#0x1_Diem_EMINT_CAPABILITY">Diem::EMINT_CAPABILITY</a></code> | <code>tc_account</code> does not have a <code><a href="Diem.md#0x1_Diem_MintCapability">Diem::MintCapability</a><CoinType></code> resource published under it. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_INVALID_STATE">Errors::INVALID_STATE</a></code> | <code><a href="Diem.md#0x1_Diem_EMINTING_NOT_ALLOWED">Diem::EMINTING_NOT_ALLOWED</a></code> | Minting is not currently allowed for <code>CoinType</code> coins. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_LIMIT_EXCEEDED">Errors::LIMIT_EXCEEDED</a></code> | <code><a href="DiemAccount.md#0x1_DiemAccount_EDEPOSIT_EXCEEDS_LIMITS">DiemAccount::EDEPOSIT_EXCEEDS_LIMITS</a></code> | The depositing of the funds would exceed the <code>account</code>'s account limits. |
<a name="@Related_Scripts_29"></a>
Access Control: Only the Treasury Compliance account can mint [H1].
<pre><code><b>include</b> <a href="Roles.md#0x1_Roles_AbortsIfNotTreasuryCompliance">Roles::AbortsIfNotTreasuryCompliance</a>{account: tc_account}; </code></pre> </details><a name="0x1_TreasuryComplianceScripts_freeze_account"></a>
freeze_account<a name="@Summary_30"></a>
Freezes the account at <code>address</code>. The sending account of this transaction must be the Treasury Compliance account. The account being frozen cannot be the Diem Root or Treasury Compliance account. After the successful execution of this transaction no transactions may be sent from the frozen account, and the frozen account may not send or receive coins.
<a name="@Technical_Description_31"></a>
Sets the <code><a href="AccountFreezing.md#0x1_AccountFreezing_FreezingBit">AccountFreezing::FreezingBit</a></code> to <code><b>true</b></code> and emits a <code><a href="AccountFreezing.md#0x1_AccountFreezing_FreezeAccountEvent">AccountFreezing::FreezeAccountEvent</a></code>. The transaction sender must be the Treasury Compliance account, but the account at <code>to_freeze_account</code> must not be either <code>0xA550C18</code> (the Diem Root address), or <code>0xB1E55ED</code> (the Treasury Compliance address). Note that this is a per-account property e.g., freezing a Parent VASP will not effect the status any of its child accounts and vice versa.
<a name="@Events_32"></a>
Successful execution of this transaction will emit a <code><a href="AccountFreezing.md#0x1_AccountFreezing_FreezeAccountEvent">AccountFreezing::FreezeAccountEvent</a></code> on the <code>freeze_event_handle</code> held in the <code><a href="AccountFreezing.md#0x1_AccountFreezing_FreezeEventsHolder">AccountFreezing::FreezeEventsHolder</a></code> resource published under <code>0xA550C18</code> with the <code>frozen_address</code> being the <code>to_freeze_account</code>.
<a name="@Parameters_33"></a>
| Name | Type | Description |
|---|---|---|
| <code>tc_account</code> | <code>signer</code> | The signer of the sending account of this transaction. Must be the Treasury Compliance account. |
| <code>sliding_nonce</code> | <code>u64</code> | The <code>sliding_nonce</code> (see: <code><a href="SlidingNonce.md#0x1_SlidingNonce">SlidingNonce</a></code>) to be used for this transaction. |
| <code>to_freeze_account</code> | <code>address</code> | The account address to be frozen. |
<a name="@Common_Abort_Conditions_34"></a>
| Error Category | Error Reason | Description |
|---|---|---|
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_NOT_PUBLISHED">Errors::NOT_PUBLISHED</a></code> | <code><a href="SlidingNonce.md#0x1_SlidingNonce_ESLIDING_NONCE">SlidingNonce::ESLIDING_NONCE</a></code> | A <code><a href="SlidingNonce.md#0x1_SlidingNonce">SlidingNonce</a></code> resource is not published under <code>tc_account</code>. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_INVALID_ARGUMENT">Errors::INVALID_ARGUMENT</a></code> | <code><a href="SlidingNonce.md#0x1_SlidingNonce_ENONCE_TOO_OLD">SlidingNonce::ENONCE_TOO_OLD</a></code> | The <code>sliding_nonce</code> is too old and it's impossible to determine if it's duplicated or not. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_INVALID_ARGUMENT">Errors::INVALID_ARGUMENT</a></code> | <code><a href="SlidingNonce.md#0x1_SlidingNonce_ENONCE_TOO_NEW">SlidingNonce::ENONCE_TOO_NEW</a></code> | The <code>sliding_nonce</code> is too far in the future. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_INVALID_ARGUMENT">Errors::INVALID_ARGUMENT</a></code> | <code><a href="SlidingNonce.md#0x1_SlidingNonce_ENONCE_ALREADY_RECORDED">SlidingNonce::ENONCE_ALREADY_RECORDED</a></code> | The <code>sliding_nonce</code> has been previously recorded. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_REQUIRES_ADDRESS">Errors::REQUIRES_ADDRESS</a></code> | <code><a href="CoreAddresses.md#0x1_CoreAddresses_ETREASURY_COMPLIANCE">CoreAddresses::ETREASURY_COMPLIANCE</a></code> | The sending account is not the Treasury Compliance account. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_REQUIRES_ROLE">Errors::REQUIRES_ROLE</a></code> | <code><a href="Roles.md#0x1_Roles_ETREASURY_COMPLIANCE">Roles::ETREASURY_COMPLIANCE</a></code> | The sending account is not the Treasury Compliance account. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_INVALID_ARGUMENT">Errors::INVALID_ARGUMENT</a></code> | <code><a href="AccountFreezing.md#0x1_AccountFreezing_ECANNOT_FREEZE_TC">AccountFreezing::ECANNOT_FREEZE_TC</a></code> | <code>to_freeze_account</code> was the Treasury Compliance account (<code>0xB1E55ED</code>). |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_INVALID_ARGUMENT">Errors::INVALID_ARGUMENT</a></code> | <code><a href="AccountFreezing.md#0x1_AccountFreezing_ECANNOT_FREEZE_DIEM_ROOT">AccountFreezing::ECANNOT_FREEZE_DIEM_ROOT</a></code> | <code>to_freeze_account</code> was the Diem Root account (<code>0xA550C18</code>). |
<a name="@Related_Scripts_35"></a>
<a name="0x1_TreasuryComplianceScripts_unfreeze_account"></a>
unfreeze_account<a name="@Summary_36"></a>
Unfreezes the account at <code>address</code>. The sending account of this transaction must be the Treasury Compliance account. After the successful execution of this transaction transactions may be sent from the previously frozen account, and coins may be sent and received.
<a name="@Technical_Description_37"></a>
Sets the <code><a href="AccountFreezing.md#0x1_AccountFreezing_FreezingBit">AccountFreezing::FreezingBit</a></code> to <code><b>false</b></code> and emits a <code>AccountFreezing::UnFreezeAccountEvent</code>. The transaction sender must be the Treasury Compliance account. Note that this is a per-account property so unfreezing a Parent VASP will not effect the status any of its child accounts and vice versa.
<a name="@Events_38"></a>
Successful execution of this script will emit a <code>AccountFreezing::UnFreezeAccountEvent</code> with the <code>unfrozen_address</code> set the <code>to_unfreeze_account</code>'s address.
<a name="@Parameters_39"></a>
| Name | Type | Description |
|---|---|---|
| <code>tc_account</code> | <code>signer</code> | The signer of the sending account of this transaction. Must be the Treasury Compliance account. |
| <code>sliding_nonce</code> | <code>u64</code> | The <code>sliding_nonce</code> (see: <code><a href="SlidingNonce.md#0x1_SlidingNonce">SlidingNonce</a></code>) to be used for this transaction. |
| <code>to_unfreeze_account</code> | <code>address</code> | The account address to be frozen. |
<a name="@Common_Abort_Conditions_40"></a>
| Error Category | Error Reason | Description |
|---|---|---|
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_NOT_PUBLISHED">Errors::NOT_PUBLISHED</a></code> | <code><a href="SlidingNonce.md#0x1_SlidingNonce_ESLIDING_NONCE">SlidingNonce::ESLIDING_NONCE</a></code> | A <code><a href="SlidingNonce.md#0x1_SlidingNonce">SlidingNonce</a></code> resource is not published under <code>account</code>. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_INVALID_ARGUMENT">Errors::INVALID_ARGUMENT</a></code> | <code><a href="SlidingNonce.md#0x1_SlidingNonce_ENONCE_TOO_OLD">SlidingNonce::ENONCE_TOO_OLD</a></code> | The <code>sliding_nonce</code> is too old and it's impossible to determine if it's duplicated or not. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_INVALID_ARGUMENT">Errors::INVALID_ARGUMENT</a></code> | <code><a href="SlidingNonce.md#0x1_SlidingNonce_ENONCE_TOO_NEW">SlidingNonce::ENONCE_TOO_NEW</a></code> | The <code>sliding_nonce</code> is too far in the future. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_INVALID_ARGUMENT">Errors::INVALID_ARGUMENT</a></code> | <code><a href="SlidingNonce.md#0x1_SlidingNonce_ENONCE_ALREADY_RECORDED">SlidingNonce::ENONCE_ALREADY_RECORDED</a></code> | The <code>sliding_nonce</code> has been previously recorded. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_REQUIRES_ADDRESS">Errors::REQUIRES_ADDRESS</a></code> | <code><a href="CoreAddresses.md#0x1_CoreAddresses_ETREASURY_COMPLIANCE">CoreAddresses::ETREASURY_COMPLIANCE</a></code> | The sending account is not the Treasury Compliance account. |
<a name="@Related_Scripts_41"></a>
<a name="0x1_TreasuryComplianceScripts_update_dual_attestation_limit"></a>
update_dual_attestation_limit<a name="@Summary_42"></a>
Update the dual attestation limit on-chain. Defined in terms of micro-XDX. The transaction can only be sent by the Treasury Compliance account. After this transaction all inter-VASP payments over this limit must be checked for dual attestation.
<a name="@Technical_Description_43"></a>
Updates the <code>micro_xdx_limit</code> field of the <code><a href="DualAttestation.md#0x1_DualAttestation_Limit">DualAttestation::Limit</a></code> resource published under <code>0xA550C18</code>. The amount is set in micro-XDX.
<a name="@Parameters_44"></a>
| Name | Type | Description |
|---|---|---|
| <code>tc_account</code> | <code>signer</code> | The signer of the sending account of this transaction. Must be the Treasury Compliance account. |
| <code>sliding_nonce</code> | <code>u64</code> | The <code>sliding_nonce</code> (see: <code><a href="SlidingNonce.md#0x1_SlidingNonce">SlidingNonce</a></code>) to be used for this transaction. |
| <code>new_micro_xdx_limit</code> | <code>u64</code> | The new dual attestation limit to be used on-chain. |
<a name="@Common_Abort_Conditions_45"></a>
| Error Category | Error Reason | Description |
|---|---|---|
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_NOT_PUBLISHED">Errors::NOT_PUBLISHED</a></code> | <code><a href="SlidingNonce.md#0x1_SlidingNonce_ESLIDING_NONCE">SlidingNonce::ESLIDING_NONCE</a></code> | A <code><a href="SlidingNonce.md#0x1_SlidingNonce">SlidingNonce</a></code> resource is not published under <code>tc_account</code>. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_INVALID_ARGUMENT">Errors::INVALID_ARGUMENT</a></code> | <code><a href="SlidingNonce.md#0x1_SlidingNonce_ENONCE_TOO_OLD">SlidingNonce::ENONCE_TOO_OLD</a></code> | The <code>sliding_nonce</code> is too old and it's impossible to determine if it's duplicated or not. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_INVALID_ARGUMENT">Errors::INVALID_ARGUMENT</a></code> | <code><a href="SlidingNonce.md#0x1_SlidingNonce_ENONCE_TOO_NEW">SlidingNonce::ENONCE_TOO_NEW</a></code> | The <code>sliding_nonce</code> is too far in the future. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_INVALID_ARGUMENT">Errors::INVALID_ARGUMENT</a></code> | <code><a href="SlidingNonce.md#0x1_SlidingNonce_ENONCE_ALREADY_RECORDED">SlidingNonce::ENONCE_ALREADY_RECORDED</a></code> | The <code>sliding_nonce</code> has been previously recorded. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_REQUIRES_ADDRESS">Errors::REQUIRES_ADDRESS</a></code> | <code><a href="CoreAddresses.md#0x1_CoreAddresses_ETREASURY_COMPLIANCE">CoreAddresses::ETREASURY_COMPLIANCE</a></code> | <code>tc_account</code> is not the Treasury Compliance account. |
<a name="@Related_Scripts_46"></a>
<a name="0x1_TreasuryComplianceScripts_update_exchange_rate"></a>
update_exchange_rate<a name="@Summary_47"></a>
Update the rough on-chain exchange rate between a specified currency and XDX (as a conversion to micro-XDX). The transaction can only be sent by the Treasury Compliance account. After this transaction the updated exchange rate will be used for normalization of gas prices, and for dual attestation checking.
<a name="@Technical_Description_48"></a>
Updates the on-chain exchange rate from the given <code>Currency</code> to micro-XDX. The exchange rate is given by <code>new_exchange_rate_numerator/new_exchange_rate_denominator</code>.
<a name="@Parameters_49"></a>
| Name | Type | Description |
|---|---|---|
| <code>Currency</code> | Type | The Move type for the <code>Currency</code> whose exchange rate is being updated. <code>Currency</code> must be an already-registered currency on-chain. |
| <code>tc_account</code> | <code>signer</code> | The signer of the sending account of this transaction. Must be the Treasury Compliance account. |
| <code>sliding_nonce</code> | <code>u64</code> | The <code>sliding_nonce</code> (see: <code><a href="SlidingNonce.md#0x1_SlidingNonce">SlidingNonce</a></code>) to be used for the transaction. |
| <code>new_exchange_rate_numerator</code> | <code>u64</code> | The numerator for the new to micro-XDX exchange rate for <code>Currency</code>. |
| <code>new_exchange_rate_denominator</code> | <code>u64</code> | The denominator for the new to micro-XDX exchange rate for <code>Currency</code>. |
<a name="@Common_Abort_Conditions_50"></a>
| Error Category | Error Reason | Description |
|---|---|---|
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_NOT_PUBLISHED">Errors::NOT_PUBLISHED</a></code> | <code><a href="SlidingNonce.md#0x1_SlidingNonce_ESLIDING_NONCE">SlidingNonce::ESLIDING_NONCE</a></code> | A <code><a href="SlidingNonce.md#0x1_SlidingNonce">SlidingNonce</a></code> resource is not published under <code>tc_account</code>. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_INVALID_ARGUMENT">Errors::INVALID_ARGUMENT</a></code> | <code><a href="SlidingNonce.md#0x1_SlidingNonce_ENONCE_TOO_OLD">SlidingNonce::ENONCE_TOO_OLD</a></code> | The <code>sliding_nonce</code> is too old and it's impossible to determine if it's duplicated or not. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_INVALID_ARGUMENT">Errors::INVALID_ARGUMENT</a></code> | <code><a href="SlidingNonce.md#0x1_SlidingNonce_ENONCE_TOO_NEW">SlidingNonce::ENONCE_TOO_NEW</a></code> | The <code>sliding_nonce</code> is too far in the future. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_INVALID_ARGUMENT">Errors::INVALID_ARGUMENT</a></code> | <code><a href="SlidingNonce.md#0x1_SlidingNonce_ENONCE_ALREADY_RECORDED">SlidingNonce::ENONCE_ALREADY_RECORDED</a></code> | The <code>sliding_nonce</code> has been previously recorded. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_REQUIRES_ADDRESS">Errors::REQUIRES_ADDRESS</a></code> | <code><a href="CoreAddresses.md#0x1_CoreAddresses_ETREASURY_COMPLIANCE">CoreAddresses::ETREASURY_COMPLIANCE</a></code> | <code>tc_account</code> is not the Treasury Compliance account. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_REQUIRES_ROLE">Errors::REQUIRES_ROLE</a></code> | <code><a href="Roles.md#0x1_Roles_ETREASURY_COMPLIANCE">Roles::ETREASURY_COMPLIANCE</a></code> | <code>tc_account</code> is not the Treasury Compliance account. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_INVALID_ARGUMENT">Errors::INVALID_ARGUMENT</a></code> | <code><a href="../../../../../../move-stdlib/docs/FixedPoint32.md#0x1_FixedPoint32_EDENOMINATOR">FixedPoint32::EDENOMINATOR</a></code> | <code>new_exchange_rate_denominator</code> is zero. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_INVALID_ARGUMENT">Errors::INVALID_ARGUMENT</a></code> | <code><a href="../../../../../../move-stdlib/docs/FixedPoint32.md#0x1_FixedPoint32_ERATIO_OUT_OF_RANGE">FixedPoint32::ERATIO_OUT_OF_RANGE</a></code> | The quotient is unrepresentable as a <code><a href="../../../../../../move-stdlib/docs/FixedPoint32.md#0x1_FixedPoint32">FixedPoint32</a></code>. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_LIMIT_EXCEEDED">Errors::LIMIT_EXCEEDED</a></code> | <code><a href="../../../../../../move-stdlib/docs/FixedPoint32.md#0x1_FixedPoint32_ERATIO_OUT_OF_RANGE">FixedPoint32::ERATIO_OUT_OF_RANGE</a></code> | The quotient is unrepresentable as a <code><a href="../../../../../../move-stdlib/docs/FixedPoint32.md#0x1_FixedPoint32">FixedPoint32</a></code>. |
<a name="@Related_Scripts_51"></a>
Access Control: Only the Treasury Compliance account can update the exchange rate [H5].
<pre><code><b>include</b> <a href="Roles.md#0x1_Roles_AbortsIfNotTreasuryCompliance">Roles::AbortsIfNotTreasuryCompliance</a>{account: tc_account}; </code></pre> </details><a name="0x1_TreasuryComplianceScripts_update_minting_ability"></a>
update_minting_ability<a name="@Summary_52"></a>
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.
<a name="@Technical_Description_53"></a>
This transaction sets the <code>can_mint</code> field of the <code><a href="Diem.md#0x1_Diem_CurrencyInfo">Diem::CurrencyInfo</a><Currency></code> resource published under <code>0xA550C18</code> to the value of <code>allow_minting</code>. Minting of coins if allowed if this field is set to <code><b>true</b></code> and minting of new coins in <code>Currency</code> is disallowed otherwise. This transaction needs to be sent by the Treasury Compliance account.
<a name="@Parameters_54"></a>
| Name | Type | Description |
|---|---|---|
| <code>Currency</code> | Type | The Move type for the <code>Currency</code> whose minting ability is being updated. <code>Currency</code> must be an already-registered currency on-chain. |
| <code>account</code> | <code>signer</code> | Signer of the sending account. Must be the Diem Root account. |
| <code>allow_minting</code> | <code>bool</code> | Whether to allow minting of new coins in <code>Currency</code>. |
<a name="@Common_Abort_Conditions_55"></a>
| Error Category | Error Reason | Description |
|---|---|---|
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_REQUIRES_ADDRESS">Errors::REQUIRES_ADDRESS</a></code> | <code><a href="CoreAddresses.md#0x1_CoreAddresses_ETREASURY_COMPLIANCE">CoreAddresses::ETREASURY_COMPLIANCE</a></code> | <code>tc_account</code> is not the Treasury Compliance account. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_NOT_PUBLISHED">Errors::NOT_PUBLISHED</a></code> | <code><a href="Diem.md#0x1_Diem_ECURRENCY_INFO">Diem::ECURRENCY_INFO</a></code> | <code>Currency</code> is not a registered currency on-chain. |
<a name="@Related_Scripts_56"></a>
<a name="0x1_TreasuryComplianceScripts_add_vasp_domain"></a>
add_vasp_domain<a name="@Summary_57"></a>
Add a VASP domain to parent VASP account. The transaction can only be sent by the Treasury Compliance account.
<a name="@Technical_Description_58"></a>
Adds a <code><a href="VASPDomain.md#0x1_VASPDomain_VASPDomain">VASPDomain::VASPDomain</a></code> to the <code>domains</code> field of the <code><a href="VASPDomain.md#0x1_VASPDomain_VASPDomains">VASPDomain::VASPDomains</a></code> resource published under the account at <code>address</code>.
<a name="@Parameters_59"></a>
| Name | Type | Description |
|---|---|---|
| <code>tc_account</code> | <code>signer</code> | The signer of the sending account of this transaction. Must be the Treasury Compliance account. |
| <code>address</code> | <code>address</code> | The <code>address</code> of the parent VASP account that will have have <code>domain</code> added to its domains. |
| <code>domain</code> | <code>vector<u8></code> | The domain to be added. |
<a name="@Common_Abort_Conditions_60"></a>
| Error Category | Error Reason | Description |
|---|---|---|
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_REQUIRES_ROLE">Errors::REQUIRES_ROLE</a></code> | <code><a href="Roles.md#0x1_Roles_ETREASURY_COMPLIANCE">Roles::ETREASURY_COMPLIANCE</a></code> | The sending account is not the Treasury Compliance account. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_REQUIRES_ADDRESS">Errors::REQUIRES_ADDRESS</a></code> | <code><a href="CoreAddresses.md#0x1_CoreAddresses_ETREASURY_COMPLIANCE">CoreAddresses::ETREASURY_COMPLIANCE</a></code> | <code>tc_account</code> is not the Treasury Compliance account. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_NOT_PUBLISHED">Errors::NOT_PUBLISHED</a></code> | <code><a href="VASPDomain.md#0x1_VASPDomain_EVASP_DOMAIN_MANAGER">VASPDomain::EVASP_DOMAIN_MANAGER</a></code> | The <code><a href="VASPDomain.md#0x1_VASPDomain_VASPDomainManager">VASPDomain::VASPDomainManager</a></code> resource is not yet published under the Treasury Compliance account. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_NOT_PUBLISHED">Errors::NOT_PUBLISHED</a></code> | <code><a href="VASPDomain.md#0x1_VASPDomain_EVASP_DOMAINS_NOT_PUBLISHED">VASPDomain::EVASP_DOMAINS_NOT_PUBLISHED</a></code> | <code>address</code> does not have a <code><a href="VASPDomain.md#0x1_VASPDomain_VASPDomains">VASPDomain::VASPDomains</a></code> resource published under it. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_INVALID_ARGUMENT">Errors::INVALID_ARGUMENT</a></code> | <code>VASPDomain::EDOMAIN_ALREADY_EXISTS</code> | The <code>domain</code> already exists in the list of <code><a href="VASPDomain.md#0x1_VASPDomain_VASPDomain">VASPDomain::VASPDomain</a></code>s in the <code><a href="VASPDomain.md#0x1_VASPDomain_VASPDomains">VASPDomain::VASPDomains</a></code> resource published under <code>address</code>. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_INVALID_ARGUMENT">Errors::INVALID_ARGUMENT</a></code> | <code><a href="VASPDomain.md#0x1_VASPDomain_EINVALID_VASP_DOMAIN">VASPDomain::EINVALID_VASP_DOMAIN</a></code> | The <code>domain</code> is greater in length than <code><a href="VASPDomain.md#0x1_VASPDomain_DOMAIN_LENGTH">VASPDomain::DOMAIN_LENGTH</a></code>. |
<a name="0x1_TreasuryComplianceScripts_remove_vasp_domain"></a>
remove_vasp_domain<a name="@Summary_61"></a>
Remove a VASP domain from parent VASP account. The transaction can only be sent by the Treasury Compliance account.
<a name="@Technical_Description_62"></a>
Removes a <code><a href="VASPDomain.md#0x1_VASPDomain_VASPDomain">VASPDomain::VASPDomain</a></code> from the <code>domains</code> field of the <code><a href="VASPDomain.md#0x1_VASPDomain_VASPDomains">VASPDomain::VASPDomains</a></code> resource published under account with <code>address</code>.
<a name="@Parameters_63"></a>
| Name | Type | Description |
|---|---|---|
| <code>tc_account</code> | <code>signer</code> | The signer of the sending account of this transaction. Must be the Treasury Compliance account. |
| <code>address</code> | <code>address</code> | The <code>address</code> of parent VASP account that will update its domains. |
| <code>domain</code> | <code>vector<u8></code> | The domain name. |
<a name="@Common_Abort_Conditions_64"></a>
| Error Category | Error Reason | Description |
|---|---|---|
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_REQUIRES_ROLE">Errors::REQUIRES_ROLE</a></code> | <code><a href="Roles.md#0x1_Roles_ETREASURY_COMPLIANCE">Roles::ETREASURY_COMPLIANCE</a></code> | The sending account is not the Treasury Compliance account. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_REQUIRES_ADDRESS">Errors::REQUIRES_ADDRESS</a></code> | <code><a href="CoreAddresses.md#0x1_CoreAddresses_ETREASURY_COMPLIANCE">CoreAddresses::ETREASURY_COMPLIANCE</a></code> | <code>tc_account</code> is not the Treasury Compliance account. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_NOT_PUBLISHED">Errors::NOT_PUBLISHED</a></code> | <code><a href="VASPDomain.md#0x1_VASPDomain_EVASP_DOMAIN_MANAGER">VASPDomain::EVASP_DOMAIN_MANAGER</a></code> | The <code><a href="VASPDomain.md#0x1_VASPDomain_VASPDomainManager">VASPDomain::VASPDomainManager</a></code> resource is not yet published under the Treasury Compliance account. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_NOT_PUBLISHED">Errors::NOT_PUBLISHED</a></code> | <code><a href="VASPDomain.md#0x1_VASPDomain_EVASP_DOMAINS_NOT_PUBLISHED">VASPDomain::EVASP_DOMAINS_NOT_PUBLISHED</a></code> | <code>address</code> does not have a <code><a href="VASPDomain.md#0x1_VASPDomain_VASPDomains">VASPDomain::VASPDomains</a></code> resource published under it. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_INVALID_ARGUMENT">Errors::INVALID_ARGUMENT</a></code> | <code><a href="VASPDomain.md#0x1_VASPDomain_EINVALID_VASP_DOMAIN">VASPDomain::EINVALID_VASP_DOMAIN</a></code> | The <code>domain</code> is greater in length than <code><a href="VASPDomain.md#0x1_VASPDomain_DOMAIN_LENGTH">VASPDomain::DOMAIN_LENGTH</a></code>. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_INVALID_ARGUMENT">Errors::INVALID_ARGUMENT</a></code> | <code><a href="VASPDomain.md#0x1_VASPDomain_EVASP_DOMAIN_NOT_FOUND">VASPDomain::EVASP_DOMAIN_NOT_FOUND</a></code> | The <code>domain</code> does not exist in the list of <code><a href="VASPDomain.md#0x1_VASPDomain_VASPDomain">VASPDomain::VASPDomain</a></code>s in the <code><a href="VASPDomain.md#0x1_VASPDomain_VASPDomains">VASPDomain::VASPDomains</a></code> resource published under <code>address</code>. |