language/diem-framework/releases/artifacts/release-1.2.0-rc0/docs/modules/AccountCreationScripts.md
<a name="0x1_AccountCreationScripts"></a>
0x1::AccountCreationScriptscreate_child_vasp_account
create_validator_operator_account
create_validator_account
create_parent_vasp_account
create_designated_dealer
<a name="0x1_AccountCreationScripts_create_child_vasp_account"></a>
create_child_vasp_account<a name="@Summary_0"></a>
Creates a Child VASP account with its parent being the sending account of the transaction. The sender of the transaction must be a Parent VASP account.
<a name="@Technical_Description_1"></a>
Creates a <code>ChildVASP</code> account for the sender <code>parent_vasp</code> at <code>child_address</code> with a balance of <code>child_initial_balance</code> in <code>CoinType</code> and an initial authentication key of <code>auth_key_prefix | child_address</code>. Authentication key prefixes, and how to construct them from an ed25519 public key is described here.
If <code>add_all_currencies</code> is true, the child address will have a zero balance in all available currencies in the system.
The new account will be a child account of the transaction sender, which must be a Parent VASP account. The child account will be recorded against the limit of child accounts of the creating Parent VASP account.
<a name="@Events_2"></a>
Successful execution will emit:
Successful execution with a <code>child_initial_balance</code> greater than zero will additionaly emit:
<a name="@Parameters_3"></a>
| Name | Type | Description |
|---|---|---|
| <code>CoinType</code> | Type | The Move type for the <code>CoinType</code> that the child account should be created with. <code>CoinType</code> must be an already-registered currency on-chain. |
| <code>parent_vasp</code> | <code>signer</code> | The reference of the sending account. Must be a Parent VASP account. |
| <code>child_address</code> | <code>address</code> | Address of the to-be-created Child VASP account. |
| <code>auth_key_prefix</code> | <code>vector<u8></code> | The authentication key prefix that will be used initially for the newly created account. |
| <code>add_all_currencies</code> | <code>bool</code> | Whether to publish balance resources for all known currencies when the account is created. |
| <code>child_initial_balance</code> | <code>u64</code> | The initial balance in <code>CoinType</code> to give the child account when it's created. |
<a name="@Common_Abort_Conditions_4"></a>
| Error Category | Error Reason | Description |
|---|---|---|
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_INVALID_ARGUMENT">Errors::INVALID_ARGUMENT</a></code> | <code><a href="DiemAccount.md#0x1_DiemAccount_EMALFORMED_AUTHENTICATION_KEY">DiemAccount::EMALFORMED_AUTHENTICATION_KEY</a></code> | The <code>auth_key_prefix</code> was not of length 32. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_REQUIRES_ROLE">Errors::REQUIRES_ROLE</a></code> | <code><a href="Roles.md#0x1_Roles_EPARENT_VASP">Roles::EPARENT_VASP</a></code> | The sending account wasn't a Parent VASP account. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_ALREADY_PUBLISHED">Errors::ALREADY_PUBLISHED</a></code> | <code><a href="Roles.md#0x1_Roles_EROLE_ID">Roles::EROLE_ID</a></code> | The <code>child_address</code> address is already taken. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_LIMIT_EXCEEDED">Errors::LIMIT_EXCEEDED</a></code> | <code><a href="VASP.md#0x1_VASP_ETOO_MANY_CHILDREN">VASP::ETOO_MANY_CHILDREN</a></code> | The sending account has reached the maximum number of allowed child accounts. |
| <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>CoinType</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 the sending account has already been extracted. |
| <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> | The sending account doesn't have a balance in <code>CoinType</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_EINSUFFICIENT_BALANCE">DiemAccount::EINSUFFICIENT_BALANCE</a></code> | The sending account doesn't have at least <code>child_initial_balance</code> of <code>CoinType</code> balance. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_INVALID_ARGUMENT">Errors::INVALID_ARGUMENT</a></code> | <code><a href="DiemAccount.md#0x1_DiemAccount_ECANNOT_CREATE_AT_VM_RESERVED">DiemAccount::ECANNOT_CREATE_AT_VM_RESERVED</a></code> | The <code>child_address</code> is the reserved address 0x0. |
<a name="@Related_Scripts_5"></a>
Access Control: Only Parent VASP accounts can create Child VASP accounts [A7].
<pre><code><b>include</b> <a href="Roles.md#0x1_Roles_AbortsIfNotParentVasp">Roles::AbortsIfNotParentVasp</a>{account: parent_vasp}; </code></pre> </details><a name="0x1_AccountCreationScripts_create_validator_operator_account"></a>
create_validator_operator_account<a name="@Summary_6"></a>
Creates a Validator Operator account. This transaction can only be sent by the Diem Root account.
<a name="@Technical_Description_7"></a>
Creates an account with a Validator Operator role at <code>new_account_address</code>, with authentication key <code>auth_key_prefix</code> | <code>new_account_address</code>. It publishes a <code><a href="ValidatorOperatorConfig.md#0x1_ValidatorOperatorConfig_ValidatorOperatorConfig">ValidatorOperatorConfig::ValidatorOperatorConfig</a></code> resource with the specified <code>human_name</code>. This script does not assign the validator operator to any validator accounts but only creates the account. Authentication key prefixes, and how to construct them from an ed25519 public key are described here.
<a name="@Events_8"></a>
Successful execution will emit:
<a name="@Parameters_9"></a>
| Name | Type | Description |
|---|---|---|
| <code>dr_account</code> | <code>signer</code> | The signer of the sending account of this transaction. Must be the Diem Root signer. |
| <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_account_address</code> | <code>address</code> | Address of the to-be-created Validator account. |
| <code>auth_key_prefix</code> | <code>vector<u8></code> | The authentication key prefix that will be used initially for the newly created account. |
| <code>human_name</code> | <code>vector<u8></code> | ASCII-encoded human name for the validator. |
<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>dr_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_EDIEM_ROOT">CoreAddresses::EDIEM_ROOT</a></code> | The sending account is not the Diem Root 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_EDIEM_ROOT">Roles::EDIEM_ROOT</a></code> | The sending account is not the Diem Root account. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_ALREADY_PUBLISHED">Errors::ALREADY_PUBLISHED</a></code> | <code><a href="Roles.md#0x1_Roles_EROLE_ID">Roles::EROLE_ID</a></code> | The <code>new_account_address</code> address is already taken. |
<a name="@Related_Scripts_11"></a>
Only Diem root may create Validator Operator accounts Authentication: ValidatorAccountAbortsIf includes AbortsIfNotDiemRoot. Checks that above table includes all error categories. The verifier finds an abort that is not documented, and cannot occur in practice:
Access Control: Only the Diem Root account can create Validator Operator accounts [A4].
<pre><code><b>include</b> <a href="Roles.md#0x1_Roles_AbortsIfNotDiemRoot">Roles::AbortsIfNotDiemRoot</a>{account: dr_account}; </code></pre> </details><a name="0x1_AccountCreationScripts_create_validator_account"></a>
create_validator_account<a name="@Summary_12"></a>
Creates a Validator account. This transaction can only be sent by the Diem Root account.
<a name="@Technical_Description_13"></a>
Creates an account with a Validator role at <code>new_account_address</code>, with authentication key <code>auth_key_prefix</code> | <code>new_account_address</code>. It publishes a <code><a href="ValidatorConfig.md#0x1_ValidatorConfig_ValidatorConfig">ValidatorConfig::ValidatorConfig</a></code> resource with empty <code>config</code>, and <code>operator_account</code> fields. The <code>human_name</code> field of the <code><a href="ValidatorConfig.md#0x1_ValidatorConfig_ValidatorConfig">ValidatorConfig::ValidatorConfig</a></code> is set to the passed in <code>human_name</code>. This script does not add the validator to the validator set or the system, but only creates the account. Authentication keys, prefixes, and how to construct them from an ed25519 public key are described here.
<a name="@Events_14"></a>
Successful execution will emit:
<a name="@Parameters_15"></a>
| Name | Type | Description |
|---|---|---|
| <code>dr_account</code> | <code>signer</code> | The signer of the sending account of this transaction. Must be the Diem Root signer. |
| <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_account_address</code> | <code>address</code> | Address of the to-be-created Validator account. |
| <code>auth_key_prefix</code> | <code>vector<u8></code> | The authentication key prefix that will be used initially for the newly created account. |
| <code>human_name</code> | <code>vector<u8></code> | ASCII-encoded human name for the validator. |
<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="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>dr_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_EDIEM_ROOT">CoreAddresses::EDIEM_ROOT</a></code> | The sending account is not the Diem Root 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_EDIEM_ROOT">Roles::EDIEM_ROOT</a></code> | The sending account is not the Diem Root account. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_ALREADY_PUBLISHED">Errors::ALREADY_PUBLISHED</a></code> | <code><a href="Roles.md#0x1_Roles_EROLE_ID">Roles::EROLE_ID</a></code> | The <code>new_account_address</code> address is already taken. |
<a name="@Related_Scripts_17"></a>
Only Diem root may create Validator accounts Authentication: ValidatorAccountAbortsIf includes AbortsIfNotDiemRoot. Checks that above table includes all error categories. The verifier finds an abort that is not documented, and cannot occur in practice:
Access Control: Only the Diem Root account can create Validator accounts [A3].
<pre><code><b>include</b> <a href="Roles.md#0x1_Roles_AbortsIfNotDiemRoot">Roles::AbortsIfNotDiemRoot</a>{account: dr_account}; </code></pre> </details><a name="0x1_AccountCreationScripts_create_parent_vasp_account"></a>
create_parent_vasp_account<a name="@Summary_18"></a>
Creates a Parent VASP account with the specified human name. Must be called by the Treasury Compliance account.
<a name="@Technical_Description_19"></a>
Creates an account with the Parent VASP role at <code>address</code> with authentication key <code>auth_key_prefix</code> | <code>new_account_address</code> and a 0 balance of type <code>CoinType</code>. If <code>add_all_currencies</code> is true, 0 balances for all available currencies in the system will also be added. This can only be invoked by an TreasuryCompliance account. <code>sliding_nonce</code> is a unique nonce for operation, see <code><a href="SlidingNonce.md#0x1_SlidingNonce">SlidingNonce</a></code> for details. Authentication keys, prefixes, and how to construct them from an ed25519 public key are described here.
<a name="@Events_20"></a>
Successful execution will emit:
<a name="@Parameters_21"></a>
| Name | Type | Description |
|---|---|---|
| <code>CoinType</code> | Type | The Move type for the <code>CoinType</code> currency that the Parent VASP account should be initialized with. <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>new_account_address</code> | <code>address</code> | Address of the to-be-created Parent VASP account. |
| <code>auth_key_prefix</code> | <code>vector<u8></code> | The authentication key prefix that will be used initially for the newly created account. |
| <code>human_name</code> | <code>vector<u8></code> | ASCII-encoded human name for the Parent VASP. |
| <code>add_all_currencies</code> | <code>bool</code> | Whether to publish balance resources for all known currencies when the account is created. |
<a name="@Common_Abort_Conditions_22"></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_NOT_PUBLISHED">Errors::NOT_PUBLISHED</a></code> | <code><a href="Diem.md#0x1_Diem_ECURRENCY_INFO">Diem::ECURRENCY_INFO</a></code> | The <code>CoinType</code> is not a registered currency on-chain. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_ALREADY_PUBLISHED">Errors::ALREADY_PUBLISHED</a></code> | <code><a href="Roles.md#0x1_Roles_EROLE_ID">Roles::EROLE_ID</a></code> | The <code>new_account_address</code> address is already taken. |
<a name="@Related_Scripts_23"></a>
Access Control: Only the Treasury Compliance account can create Parent VASP accounts [A6].
<pre><code><b>include</b> <a href="Roles.md#0x1_Roles_AbortsIfNotTreasuryCompliance">Roles::AbortsIfNotTreasuryCompliance</a>{account: tc_account}; </code></pre> </details><a name="0x1_AccountCreationScripts_create_designated_dealer"></a>
create_designated_dealer<a name="@Summary_24"></a>
Creates a Designated Dealer account with the provided information, and initializes it with default mint tiers. The transaction can only be sent by the Treasury Compliance account.
<a name="@Technical_Description_25"></a>
Creates an account with the Designated Dealer role at <code>addr</code> with authentication key <code>auth_key_prefix</code> | <code>addr</code> and a 0 balance of type <code>Currency</code>. If <code>add_all_currencies</code> is true, 0 balances for all available currencies in the system will also be added. This can only be invoked by an account with the TreasuryCompliance role. Authentication keys, prefixes, and how to construct them from an ed25519 public key are described here.
At the time of creation the account is also initialized with default mint tiers of (500_000, 5000_000, 50_000_000, 500_000_000), and preburn areas for each currency that is added to the account.
<a name="@Events_26"></a>
Successful execution will emit:
<a name="@Parameters_27"></a>
| Name | Type | Description |
|---|---|---|
| <code>Currency</code> | Type | The Move type for the <code>Currency</code> that the Designated Dealer should be initialized with. <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 this transaction. |
| <code>addr</code> | <code>address</code> | Address of the to-be-created Designated Dealer account. |
| <code>auth_key_prefix</code> | <code>vector<u8></code> | The authentication key prefix that will be used initially for the newly created account. |
| <code>human_name</code> | <code>vector<u8></code> | ASCII-encoded human name for the Designated Dealer. |
| <code>add_all_currencies</code> | <code>bool</code> | Whether to publish preburn, balance, and tier info resources for all known (SCS) currencies or just <code>Currency</code> when the account is created. |
<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> | 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_NOT_PUBLISHED">Errors::NOT_PUBLISHED</a></code> | <code><a href="Diem.md#0x1_Diem_ECURRENCY_INFO">Diem::ECURRENCY_INFO</a></code> | The <code>Currency</code> is not a registered currency on-chain. |
| <code><a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_ALREADY_PUBLISHED">Errors::ALREADY_PUBLISHED</a></code> | <code><a href="Roles.md#0x1_Roles_EROLE_ID">Roles::EROLE_ID</a></code> | The <code>addr</code> address is already taken. |
<a name="@Related_Scripts_29"></a>
Access Control: Only the Treasury Compliance account can create Designated Dealer accounts [A5].
<pre><code><b>include</b> <a href="Roles.md#0x1_Roles_AbortsIfNotTreasuryCompliance">Roles::AbortsIfNotTreasuryCompliance</a>{account: tc_account}; </code></pre> </details>