Stablecoin Contract Methods

The stablecoin contract includes all the methods that are available in the extended ERC-20 contract and additional methods that are specific to the stablecoin scenario.

Stablecoin Asset Methods

The stablecoin asset is based on the extended ERC-20 standard, and supports all of the generic methods for that standard. For more information about the generic ERC-20 methods, see Digital Assets APIs.

Note:

In the stablecoin contract, the executeHoldTokens method behaves differently from the generic version. The stablecoin version of the method always completes the full hold amount, and does not support partial transfers.

Account Policy Check Methods

createOrupdateAccountPolicy
This method creates or updates a policy for a specified account. This method can be called only by a Token Admin or Org Admin of the specified organization.
function createOrupdateAccountPolicy(
      AccountPolicyCheck calldata accountPolicyCheck
  ) external
Parameters:
  • asset: AccountPolicyCheck struct – A struct that defines account policy parameters, which includes the following fields:
    • accountPolicyId – Use the getAccountPolicyIdForAddress() method to generate this ID from the account address of the user to create the policy for.
    • kycCompliance – A string value (true or false) that indicates whether the account satisfies KYC (Know Your Customer) requirements.
    • amlCompliance – A string value (true or false) that indicates whether the account satisfies AML (Anti-Money Laundering) requirements.
    • riskScore – The risk score associated with the account, which is used for compliance evaluation.
    • restrictionFlag – A string value (true or false) that indicates whether the account is subject to restricted transfers. If set to true, direct transfers follow the transfer restriction bucket limits and hold transfers follow the lowest approval policy threshold.
getAccountPolicyById
This method gets the account policy details for a specified policy ID. This method can be called only by a Token Admin or Token Auditor, or an Org Admin or Org Auditor of the specified organization.
function getAccountPolicyById(
        string calldata accountPolicyId
    ) external view 
Parameters:
  • accountPolicyId: string – The unique account policy ID.
deleteAccountPolicy
This method deletes the policy for a specified policy ID. This method can be called only by a Token Admin or Org Admin of the specified organization.
function deleteAccountPolicy(string calldata accountPolicyId) public 
Parameters:
  • accountPolicyId: string – The unique account policy ID.

Approval Policy Check Methods

createOrupdateApprovalPolicy
This method creates or updates an approval policy. This method can be called only by a Token Admin.
function createOrupdateApprovalPolicy(
        ApprovalPolicyCheck calldata approvalPolicyCheck
    ) external
Parameters:
  • asset: ApprovalPolicyCheck struct – A struct that defines approval rules for a transaction, which includes the following fields:
    • approvalPolicyId – The unique approval policy ID.
    • transactionLowerLimit – The minimum transaction amount the approval policy applies to.
    • transactionUpperLimit – The maximum transaction amount the approval policy applies to.
    • numberOfApprovalsRequired – The total number of approvals needed before the transaction can be completed.
    • approverDetails – A list of approvers along with their assigned approval sequence, which defines the mandatory order for approvals.
getApprovalPolicyById
This method gets the approval policy details for a specified policy ID. This method can be called only by a Token Admin or Token Auditor.
function getApprovalPolicyById(
        string calldata approvalPolicyId
    ) external
Parameters:
  • approvalPolicyId: string – The unique approval policy ID.
deleteApprovalPolicy
This method deletes the approval policy for a specified policy ID. This method can be called only by a Token Admin.
function deleteApprovalPolicy(string calldata approvalPolicyId) public
Parameters:
  • approvalPolicyId: string – The unique approval policy ID.

Approval Transactions Methods

getApprovalTransactionsById
This method gets the approval transaction for a specified transaction ID. This method can be called only by a Token Admin or Token Auditor.
function getApprovalTransactionsById(
        string calldata opId
    )
Parameters:
  • opId: string – The approval transaction ID.
getApprovalStatusByOperationId
This method gets the approval transaction for a specified transaction ID. This method can be called only by a Token Admin or Token Auditor.
function getApprovalStatusByOperationId(
        string calldata opId
    )
Parameters:
  • opId: string – The unique operation ID.
approveTransaction
An approver can use this method to approve a hold transaction.
function approveTransaction(string calldata opId, uint256 amount) public
Parameters:
  • opId: string – The unique operation ID.
  • amount: uint256 – The number of on-hold tokens to approve for transfer.

Transfer Restriction Methods

You can use transfer restrictions to control the minimum and maximum transaction amounts that are allowed for token transfers. Transfer restrictions are applied when an account has the restrictionFlag value set to true. Transfer restrictions operate independently of the approval policy rules used for hold operations. The TransferRestriction asset sets the global lower and upper transfer limits that apply to all accounts where transfer restrictions are enabled. After the contract is deployed, administrators can retrieve or update these values using the following methods.

setOrupdateTransferRestriction
This method sets or updates the transfer restriction configuration by setting new lower and upper transaction limits. This method can be called only by a Token Admin.
 function setOrupdateTransferRestriction(
        uint256 transactionLowerLimit,
        uint256 transactionUpperLimit
    ) external
Parameters:
  • transactionLowerLimit – The minimum allowed transfer amount.
  • transactionUpperLimit – The maximum allowed transfer amount that can be processed without special governance.
getTransferRestriction
This method returns the current transfer restriction configuration, including the lower and upper transaction limits. This method can be called only by a Token Admin or Token Auditor.
function getTransferRestriction() external
Parameters:
  • none