### Install Dependencies Source: https://github.com/erc-3643/documentation/blob/main/README.md Run this command to install project dependencies using Yarn. ```bash yarn ``` -------------------------------- ### Start Local Development Server Source: https://github.com/erc-3643/documentation/blob/main/README.md Starts a local development server. Changes are reflected live without restarting. ```bash yarn start ``` -------------------------------- ### Get Claim Topics Function Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/claim-topics-registry.md Retrieves the array of all trusted claim topics currently stored in the registry. ```Solidity function getClaimTopics() external view returns (uint256[] memory); ``` -------------------------------- ### Get Compliance Contract Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/token.md Returns the Compliance contract linked to the token. ```Solidity function compliance() external view returns (ICompliance); ``` -------------------------------- ### Encode and Call Module Function in JavaScript Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/compliance/compliance.md Example of encoding function data for a module and calling it via the Compliance contract using ethers.js. Helper libraries should be used for encoding callData. ```javascript const complianceContract = new ethers.Contract(complianceAddress, ['function callModuleFunction(bytes calldata callData, address module)'], signer); const allowedCountryModule = new ethers.Interface(['function addAllowedCountry(uint256 country)']); const callData = allowedCountryModule.encodeFunctionData('addAllowedCountry', [42]); await complianceContract.callModuleFunction(callData, moduleAddress); ``` -------------------------------- ### Get Total Supply Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/token.md Returns the total amount of tokens currently in existence. This is a read-only operation. ```Solidity function totalSupply() public view returns (uint256); ``` -------------------------------- ### Get Token Version Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/token.md Retrieves the current TREX version of the token. The current version is 3.0.0. ```Solidity function version() external view returns (string memory); ``` -------------------------------- ### Get Balance Of User Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/token.md Returns the amount of tokens owned by a specific user address. Requires the user's address as input. ```Solidity function balanceOf( address _userAddress ) public view returns (uint256); ``` -------------------------------- ### Get Identity Registry Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/token.md Returns the Identity Registry contract linked to the token. ```Solidity function identityRegistry() external view returns (IIdentityRegistry); ``` -------------------------------- ### Get Partially Frozen Token Amount Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/token.md Returns the amount of tokens that are partially frozen on a given wallet. This amount is always less than or equal to the total balance of the wallet. ```Solidity function getFrozenTokens( address _userAddress ) external view returns (uint256); ``` -------------------------------- ### Get Stored Investor Country Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/identity-registry-storage.md Retrieves the country code for a given investor's wallet address. This is a read-only operation. ```Solidity function storedInvestorCountry( address _userAddress ) external view returns (uint16); ``` -------------------------------- ### Get Allowance Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/token.md Returns the remaining tokens a spender can withdraw on behalf of an owner. This value is initially zero and changes with approve() or transferFrom(). ```Solidity function allowance( address _owner, address _spender) public view virtual returns (uint256); ``` -------------------------------- ### decimals Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/token.md Returns the number of decimals used to get the token's user representation. This value is primarily for display purposes and does not affect arithmetic operations. ```APIDOC ## decimals ### Description Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5,05` (`505 / 1 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including `balanceOf()` and `transfer()`. ### Signature ```javascript Solidity function decimals() external view returns (uint8); ``` ``` -------------------------------- ### unbindToken Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/compliance/compliance.md Unbinds a token from the compliance contract. This operation can be performed by the owner of the compliance contract or the token itself. It emits a `TokenUnbound` event. It is important to bind modules before starting minting, as some modules may not be impacted, but others that restrict transfers based on time or balances won't see transfers that happened before they were bound. ```APIDOC ## unbindToken ### Description Unbinds a token from the compliance contract. Only the owner of the compliance can unbind a token, or the token itself. It emits a `TokenUnound(address token)` event. > :::caution > Because compliance modules build up their state when transfers occur, it is important to bind modules before starting > minting. Some modules may not be impacted (eg. country restrictions), but modules that restrict transfers based on > time or balances won't see transfers that happened before they were bound. ### Method Signature ```solidity function unbindToken(address _token); ``` ``` -------------------------------- ### Get Stored Identity Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/identity-registry-storage.md Retrieves the IIdentity contract associated with a given user address. This function is for viewing data and requires the user's wallet address as input. ```Solidity function storedIdentity( address _userAddress ) external view returns (IIdentity); ``` -------------------------------- ### Get Linked Identity Registries Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/identity-registry-storage.md Retrieves a list of all identity registry addresses currently linked to the storage contract. This is a view function and does not modify state. ```Solidity function linkedIdentityRegistries() external view returns (address[] memory); ``` -------------------------------- ### Build Static Website Source: https://github.com/erc-3643/documentation/blob/main/README.md Generates static content for hosting. The output is placed in the 'build' directory. ```bash yarn build ``` -------------------------------- ### Deploy Website (No SSH) Source: https://github.com/erc-3643/documentation/blob/main/README.md Deploys the website without using SSH. Replace '' with your actual username. ```bash GIT_USER= yarn deploy ``` -------------------------------- ### Deploy Website (SSH) Source: https://github.com/erc-3643/documentation/blob/main/README.md Deploys the website using SSH. This command builds the site and pushes to the 'gh-pages' branch. ```bash USE_SSH=true yarn deploy ``` -------------------------------- ### Token Constructor Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/token.md Use this constructor to initialize a new security token. It requires addresses for the identity registry and compliance contract, along with the token's name, symbol, decimals, and onchain ID. The sender of the transaction is automatically set as the owner. ```Solidity constructor( address _identityRegistry, address _compliance, string memory _name, string memory _symbol, uint8 _decimals, address _onchainID ) public; ``` -------------------------------- ### Updated Token Information Event Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/token.md Emitted during token creation by the constructor. Includes token name, symbol, decimals, version, and onchain ID. ```Solidity event UpdatedTokenInformation( string _newName, string _newSymbol, uint8 _newDecimals, string _newVersion, address _newOnchainID ); ``` -------------------------------- ### totalSupply Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/token.md Retrieves the total amount of tokens currently in existence. ```APIDOC ## totalSupply ### Description Returns the amount of tokens in existence. ### Method `view` ### Signature `function totalSupply() public view returns (uint256);` ``` -------------------------------- ### version Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/token.md Returns the TREX version of the token. Current version is 3.0.0. ```APIDOC ## version ### Description Returns the TREX version of the token. ### Method VIEW ### Endpoint N/A (Contract Function) ### Response #### Success Response - **version** (string) - The current TREX version of the token. ``` -------------------------------- ### Batch Unfreeze Partial Tokens Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/token.md Allows unfreezing tokens partially for multiple addresses in a batch. Be cautious as this transaction can exceed gas limits if the address list is too high. Only callable by a wallet set as an agent of the token. ```Solidity function batchUnfreezePartialTokens( address[] calldata _userAddresses, uint256[] calldata _amounts ) external; ``` -------------------------------- ### compliance Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/token.md Returns the Compliance contract linked to the token. ```APIDOC ## compliance ### Description Returns the Compliance contract linked to the token. ### Method VIEW ### Endpoint N/A (Contract Function) ### Response #### Success Response - **compliance** (ICompliance) - The address of the linked Compliance contract. ``` -------------------------------- ### callModuleFunction Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/compliance/compliance.md Calls a configuration method on a compliance module contract. Direct interaction with modules is discouraged; calls should be proxied through the Compliance Contract. Emits a ModuleInteraction event. ```APIDOC ## callModuleFunction ### Description Used to call a configuration method on a compliance module contract. Direct interaction with module is discouraged, and should instead go through the Compliance Contract that will proxy the call to the bound module. Emits a `ModuleInteraction(address indexed module, bytes4 functionSelector)` event. ### Method Signature ```solidity function callModuleFunction(bytes calldata callData, address _module); ``` ### JavaScript Example ```javascript const complianceContract = new ethers.Contract(complianceAddress, ['function callModuleFunction(bytes calldata callData, address module)'], signer); const allowedCountryModule = new ethers.Interface(['function addAllowedCountry(uint256 country)']); const callData = allowedCountryModule.encodeFunctionData('addAllowedCountry', [42]); await complianceContract.callModuleFunction(callData, moduleAddress); ``` ``` -------------------------------- ### isFrozen Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/token.md Returns the freezing status of a wallet. If `isFrozen` returns `true`, the wallet is frozen. If `isFrozen` returns `false`, the wallet is not frozen. Returning `true` doesn't mean that the balance is free, tokens could be blocked by a partial freeze or the whole token could be blocked by pause. ```APIDOC ## isFrozen ### Description Returns the freezing status of a wallet. ### Method VIEW ### Endpoint N/A (Contract Function) ### Parameters #### Path Parameters - **_userAddress** (address) - Required - The address of the wallet on which isFrozen is called. ### Response #### Success Response - **isFrozen** (bool) - True if the wallet is frozen, false otherwise. ``` -------------------------------- ### batchBurn Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/token.md Allows burning tokens in batch for multiple verified addresses. This function can only be called by a wallet set as an agent of the token. Use with caution as large batches might exceed gas limits. ```APIDOC ## batchBurn ### Description Function allowing to burn tokens in batch. Requires that the `_userAddresses` addresses are all verified addresses. This transaction could exceed gas limit if `_userAddresses.length` is too high, use with care or you could lose tx fees with an "OUT OF GAS" transaction. ### Parameters - `_userAddresses` (address[]): The addresses of the wallets concerned by the burn. - `_amounts` (uint256[]): The number of tokens to burn from the corresponding wallets. ### Remarks This function can only be called by a wallet set as agent of the token. Emits `_userAddresses.length` `Transfer` events. ### Solidity Signature ```solidity function batchBurn(address[] calldata _userAddresses, uint256[] calldata _amounts) external; ``` ``` -------------------------------- ### batchSetAddressFrozen Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/token.md Enables setting the frozen status for multiple addresses in a batch. This function is restricted to agents of the token and should be used cautiously with large lists to avoid exceeding gas limits. ```APIDOC ## batchSetAddressFrozen ### Description Function allowing to set frozen addresses in batch. This transaction could exceed gas limit if `_userAddresses.length` is too high, use with care or you could lose tx fees with an "OUT OF GAS" transaction. ### Parameters - `_userAddresses` (address[]): The addresses for which to update frozen status. - `_freeze` (bool[]): Frozen status of the corresponding address. ### Remarks This function can only be called by a wallet set as agent of the token. Emits `_userAddresses.length` `AddressFrozen` events. ### Solidity Signature ```solidity function batchSetAddressFrozen(address[] calldata _userAddresses, bool[] calldata _freeze) external; ``` ``` -------------------------------- ### Check Wallet Freezing Status Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/token.md Returns the freezing status of a specific wallet address. `true` indicates the wallet is frozen, `false` otherwise. This status does not account for partial freezes or contract-level pauses. ```Solidity function isFrozen( address _userAddress ) external view returns (bool); ``` -------------------------------- ### Batch Freeze Partial Tokens Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/token.md Allows freezing a specified amount of tokens for multiple addresses in batch. This transaction can exceed gas limits if the number of addresses is too high. The `_amounts` parameter specifies the quantity of tokens to freeze for each corresponding address. ```Solidity function batchFreezePartialTokens( address[] calldata _userAddresses, uint256[] calldata _amounts ) external; ``` -------------------------------- ### Set Claim Topics Registry Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/identity-registry.md Sets the address for the claim topics registry. This configuration method is available to the owner of the Identity Registry contract. ```solidity function setClaimTopicsRegistry(address claimTopicsRegistry); ``` -------------------------------- ### batchMint Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/token.md Enables the batch minting of tokens. It requires that all receiver addresses are verified. This function can only be called by an agent of the token. Be aware that large batch sizes might exceed the gas limit. ```APIDOC ## batchMint ### Description Function allowing to mint tokens in batch. Require that the `_toList` addresses are all verified addresses. This transaction could exceed gas limit if `_toList.length` is too high, use with care or you could lose tx fees with an "out of gas" transaction. This function can only be called by a wallet set as agent of the token. Emits `_toList.length` `Transfer` events. ### Parameters #### Path Parameters - **_toList** (address[]) - Required - The addresses of the receivers - **_amounts** (uint256[]) - Required - The number of tokens to mint to the corresponding receiver ### Method external ### Endpoint N/A (Contract Function) ### Request Example ```javascript Solidity function batchMint( address[] calldata _toList, uint256[] calldata _amounts ) external; ``` ### Response #### Success Response (200) Emits `Transfer` events. #### Response Example N/A (Contract Event) ``` -------------------------------- ### ERC20 Approval Event Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/token.md Emitted when an owner sets a spender's allowance. The value represents the new allowance. ```Solidity event Approval( address indexed owner, address indexed spender, uint256 value ); ``` -------------------------------- ### Batch Mint Tokens Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/token.md Use to mint tokens in batch to specified receivers. Ensure receiver addresses are verified. Be cautious of potential gas limit exceedance with large lists. ```Solidity function batchMint( address[] calldata _toList, uint256[] calldata _amounts ) external; ``` -------------------------------- ### Tokens Unfrozen Event Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/token.md Emitted when a specific amount of tokens is unfrozen from a wallet. Records the user address and the unfrozen amount. ```Solidity event TokensUnfrozen( address indexed _userAddress, uint256 _amount ); ``` -------------------------------- ### Add Module to Compliance Contract Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/compliance/compliance.md Use this method to add a module to the compliance contract. Only the owner can add modules. Emits a ModuleAdded event. ```solidity addModule(address _module); ``` -------------------------------- ### Recovery Success Event Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/token.md Emitted when an investor successfully recovers tokens. Records the lost wallet, new wallet, and investor's onchain ID. ```Solidity event RecoverySuccess( address _lostWallet, address _newWallet, address _investorOnchainID ); ``` -------------------------------- ### Call Module Function via Compliance Contract Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/compliance/compliance.md Proxy calls to a compliance module's configuration method through the Compliance contract. Direct interaction with modules is discouraged. Emits a ModuleInteraction event. ```solidity function callModuleFunction(bytes calldata callData, address _module); ``` -------------------------------- ### balanceOf Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/token.md Queries the balance of tokens owned by a specific address. ```APIDOC ## balanceOf ### Description Returns the amount of tokens owned by an investor. ### Parameters #### Path Parameters - **_userAddress** (address) - Required - The address of the investor's wallet. ### Method `view` ### Signature `function balanceOf(address _userAddress) public view returns (uint256);` ``` -------------------------------- ### batchTransfer Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/token.md Enables the issuance of transfers in batch. Requires that the sender and receiver addresses are not frozen, and the total value does not exceed the available balance. All 'to' addresses must be verified. Use with caution as high `_toList.length` can exceed gas limits. ```APIDOC ## batchTransfer ### Description Function allowing to issue transfers in batch. Requires that the `msg.sender` and `to` addresses are not frozen. Requires that the total value should not exceed available balance. Requires that the `to` addresses are all verified addresses. This transaction could exceed gas limit if `_toList.length` is too high, use with care or you could lose tx fees with an "out of gas" transaction. Emits `_toList.length` `Transfer` events. ### Parameters #### Path Parameters - `_toList` (address[]) - The addresses of the receivers. - `_amounts` (uint256[]) - The number of tokens to transfer to the corresponding receiver. ### Method External call (implicitly, as it's a contract function) ### Endpoint N/A (Smart Contract Function) ### Request Example ```solidity function batchTransfer(address[] calldata _toList, uint256[] calldata _amounts) external; ``` ### Response #### Success Response No explicit return value, but emits `Transfer` events for each successful transfer. #### Response Example (Emits `Transfer` events) ``` -------------------------------- ### batchFreezePartialTokens Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/token.md Allows freezing a specified amount of tokens for multiple addresses in a batch. Only token agents can call this function, and users should be mindful of potential gas limit issues with extensive address lists. ```APIDOC ## batchFreezePartialTokens ### Description Function allowing to freeze tokens partially in batch. This transaction could exceed gas limit if `_userAddresses.length` is too high, use with care or you could lose tx fees with an "OUT OF GAS" transaction. ### Parameters - `_userAddresses` (address[]): The addresses on which tokens need to be frozen. - `_amounts` (uint256[]): The amount of tokens to freeze on the corresponding address. ### Remarks This function can only be called by a wallet set as agent of the token. Emits `_userAddresses.length` `TokensFrozen` events. ### Solidity Signature ```solidity function batchFreezePartialTokens(address[] calldata _userAddresses, uint256[] calldata _amounts) external; ``` ``` -------------------------------- ### batchUnfreezePartialTokens Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/token.md Allows for the partial unfreezing of tokens in a batch. This function can only be called by an agent of the token. Use with caution as high `_userAddresses.length` could exceed gas limits. ```APIDOC ## batchUnfreezePartialTokens ### Description Function allowing to unfreeze tokens partially in batch. This transaction could exceed gas limits if `_userAddresses.length` is too high, use with care or you could lose tx fees with an "OUT OF GAS" transaction. ### Parameters #### Path Parameters - `_userAddresses` (address[]) - Required - The addresses on which tokens need to be unfrozen. - `_amounts` (uint256[]) - Required - The amount of tokens to unfreeze on the corresponding address. ### Constraints This function can only be called by a wallet set as agent of the token. ### Events emits `_userAddresses.length` `TokensUnfrozen` events ### Code ```javascript Solidity function batchUnfreezePartialTokens( address[] calldata _userAddresses, uint256[] calldata _amounts ) external; ``` ``` -------------------------------- ### recoveryAddress Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/token.md Allows an agent to force transfer tokens from a lost wallet to a new wallet for an investor. Emits TokensUnfrozen, Transfer, and RecoverySuccess events upon successful execution. ```APIDOC ## recoveryAddress ### Description Recovery function used to force transfer tokens from a lost wallet to a new wallet for an investor. This function can only be called by a wallet set as agent of the token. It emits a `TokensUnfrozen` event if there are frozen tokens on the lost wallet, a `Transfer` event, and a `RecoverySuccess` event if the recovery process is successful. ### Parameters #### Path Parameters - `_lostWallet` (address) - The wallet that the investor lost. - `_newWallet` (address) - The newly provided wallet on which tokens have to be transferred. - `_investorOnchainID` (address) - The onchainID of the investor asking for a recovery. ### Method External call (implicitly, as it's a contract function) ### Endpoint N/A (Smart Contract Function) ### Request Example ```solidity function recoveryAddress(address _lostWallet, address _newWallet, address _investorOnchainID) external returns (bool); ``` ### Response #### Success Response Returns `true` if the recovery process is successful. #### Response Example ```json { "success": true } ``` ``` -------------------------------- ### Notify Token Creation Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/compliance/compliance.md Call this function exclusively from the token contract when new tokens are minted. It updates module state variables for compliance checks. Use this for mints, not `transferred()`. The `amount` parameter can be replaced by `tokenId` for NFTs. ```solidity function created( address _to, uint256 _amount ); ``` -------------------------------- ### Add Claim Topic Function Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/claim-topics-registry.md Adds a trusted claim topic to the registry. Only the contract owner can call this function. Emits the 'ClaimTopicAdded' event. ```Solidity function addClaimTopic( int256 _claimTopic ) external; ``` -------------------------------- ### name Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/token.md Returns the human-readable name of the token. ```APIDOC ## name ### Description Returns the name of the token. ### Signature ```javascript Solidity function name() external view returns (string memory); ``` ``` -------------------------------- ### Address Frozen Event Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/token.md Emitted when an investor's wallet is frozen or unfrozen. Indicates the user address, freezing status, and the owner who initiated the action. ```Solidity event AddressFrozen( address indexed _userAddress, bool indexed _isFrozen, address indexed _owner ); ``` -------------------------------- ### addModule Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/compliance/compliance.md Adds a module to the compliance contract. This operation can only be performed by the owner of the compliance contract. It emits a ModuleAdded event. ```APIDOC ## addModule ### Description Used to add a module to the compliance contract. Only the owner of the compliance can add a module. Emits a `ModuleAdded(address indexed module)` event. ### Method Signature ```solidity addModule(address _module); ``` ``` -------------------------------- ### Force Token Recovery from Lost Wallet Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/token.md Use this function to transfer tokens from a lost wallet to a new one. It can only be called by an agent of the token and emits several events upon successful recovery. ```Solidity function recoveryAddress( address _lostWallet, address _newWallet, address _investorOnchainID ) external returns (bool); ``` -------------------------------- ### Burn Tokens Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/token.md Burn tokens from a specified address. If the address has insufficient free tokens but enough total balance, frozen tokens are reduced. Requires agent role. Emits TokensUnfrozen and Transfer events. ```Solidity function burn( address _userAddress, uint256 _amount ) external; ``` -------------------------------- ### Batch Burn Tokens Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/token.md Allows burning tokens from multiple addresses in a single transaction. Requires that all provided addresses are verified. This transaction can exceed gas limits if the number of addresses is too high. ```Solidity function batchBurn( address[] calldata _userAddresses, uint256[] calldata _amounts ) external; ``` -------------------------------- ### batchForcedTransfer Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/token.md Allows for the batch issuance of forced transfers. It requires that amounts do not exceed available balances and that receiver addresses are verified. This function can only be called by an agent of the token. Be cautious as high batch sizes may exceed gas limits. ```APIDOC ## batchForcedTransfer ### Description Function allowing to issue forced transfers in batch. Require that `_amounts[i]` should not exceed available balance of `_fromList[i]`. Require that the `_toList` addresses are all verified addresses. This transaction could exceed gas limit if `_fromList.length` is too high, use with care or you could lose tx fees with an "out of gas" transaction. This function can only be called by a wallet set as agent of the token. Emits `TokensUnfrozen` events if `_amounts[i]` is higher than the free balance of `_fromList[i]`. Emits `_fromList.length` `Transfer` events. ### Parameters #### Path Parameters - **_fromList** (address[]) - Required - The addresses of the senders - **_toList** (address[]) - Required - The addresses of the receivers - **_amounts** (uint256[]) - Required - The number of tokens to transfer to the corresponding receiver ### Method external ### Endpoint N/A (Contract Function) ### Request Example ```javascript Solidity function batchForcedTransfer( address[] calldata _fromList, address[] calldata _toList, uint256[] calldata _amounts ) external; ``` ### Response #### Success Response (200) Emits `TokensUnfrozen` and `Transfer` events. #### Response Example N/A (Contract Event) ``` -------------------------------- ### Approve Token Spending Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/token.md Sets the allowance for a spender to a specific amount. Returns a boolean indicating success. Consider reducing allowance to zero first to mitigate race conditions. ```Solidity function approve( address _spender, uint256 _amount ) public virtual returns (bool); ``` -------------------------------- ### symbol Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/token.md Returns the symbol of the token, typically a short abbreviation of the token's name. ```APIDOC ## symbol ### Description Returns the symbol of the token, usually a shorter version of the name. ### Signature ```javascript Solidity function symbol() external view returns (string memory); ``` ``` -------------------------------- ### increaseAllowance Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/token.md Atomically increases the allowance granted to a spender. ```APIDOC ## increaseAllowance ### Description Atomically increases the allowance granted to `spender` by the caller. This is an alternative to `approve()` that can be used as a mitigation for problems described in `approve()`. Emits an `Approval` event indicating the updated allowance. ### Requirements - `spender` cannot be the zero address. ### Parameters #### Path Parameters - **_spender** (address) - Required - The address of the spender. - **_addedValue** (uint256) - Required - The amount to add to the current allowance. ### Method `virtual` ### Returns - `bool` - Indicates if the operation succeeded. ### Signature `function increaseAllowance(address _spender, uint256 _addedValue) public virtual returns (bool);` ``` -------------------------------- ### identityRegistry Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/token.md Returns the Identity Registry contract linked to the token. ```APIDOC ## identityRegistry ### Description Returns the Identity Registry contract linked to the token. ### Method VIEW ### Endpoint N/A (Contract Function) ### Response #### Success Response - **identityRegistry** (IIdentityRegistry) - The address of the linked Identity Registry contract. ``` -------------------------------- ### Identity Registry Added Event Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/token.md Emitted when the IdentityRegistry is set for the token, either by the constructor or the setIdentityRegistry function. ```Solidity event IdentityRegistryAdded( address indexed _identityRegistry ); ``` -------------------------------- ### Compliance Added Event Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/token.md Emitted when the Compliance contract is set for the token, either by the constructor or the setCompliance function. ```Solidity event ComplianceAdded( address indexed _compliance ); ``` -------------------------------- ### onchainID Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/token.md Returns the address of the onchainID for the token, which provides information about the token managed by the issuer. ```APIDOC ## onchainID ### Description Returns the address of the onchainID of the token. The onchainID of the token gives all the information available about the token and is managed by the token issuer or his agent. ### Signature ```javascript Solidity function onchainID() external view returns (address); ``` ``` -------------------------------- ### addIdentityToStorage Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/identity-registry-storage.md Registers a new identity contract for a user, provided they do not already have one. This action can only be performed by an authorized agent. ```APIDOC ## addIdentityToStorage ### Description Adds an identity contract corresponding to a user address in the storage. Requires that the user doesn't have an identity contract already registered. This function can only be called by an address set as agent of the smart contract. ### Method POST (conceptual) ### Endpoint N/A (Contract Function) ### Parameters #### Path Parameters - **_userAddress** (address) - Required - The address of the user. - **_identity** (IIdentity) - Required - The address of the user's identity contract. - **_country** (uint16) - Required - The country of the investor. ### Emits `IdentityStored` event ``` -------------------------------- ### addClaimTopic Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/claim-topics-registry.md Adds a trusted claim topic to the registry. This function can only be called by the owner of the smart contract and emits a ClaimTopicAdded event. ```APIDOC ## addClaimTopic ### Description Adds a trusted claim topic (e.g., KYC=1, AML=2). This function is restricted to the owner of the smart contract and emits the `ClaimTopicAdded` event. ### Parameters #### Path Parameters - `_claimTopic` (int256) - Required - The claim topic index to add. ### Method `external` ``` -------------------------------- ### ClaimTopicAdded Event Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/claim-topics-registry.md Emitted when a claim topic is added to the registry. This event is triggered by the 'addClaimTopic' function. ```Solidity event ClaimTopicAdded( uint256 indexed claimTopic ); ``` -------------------------------- ### bindToken Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/compliance/compliance.md Binds a token to the compliance contract. Only bound tokens can inform the compliance contract and its modules of asset transfers. This operation can only be performed by the owner of the compliance contract. It emits a `TokenBound` event. ```APIDOC ## bindToken ### Description Binds a token to the compliance contract. Only bound tokens can inform the compliance and its module of asset transfers. Only the owner of the compliance can bind a token to an already configured compliance contract. It emits a `TokenBound(address token)` event. ### Method Signature ```solidity function bindToken(address _token); ``` ``` -------------------------------- ### Tokens Frozen Event Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/token.md Emitted when a specific amount of tokens is frozen on a wallet. Records the user address and the frozen amount. ```Solidity event TokensFrozen( address indexed _userAddress, uint256 _amount ); ``` -------------------------------- ### setAddressFrozen Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/token.md Manages the frozen status of a specific address for this token. Only an agent of the token can call this function, which emits an `AddressFrozen` event. ```APIDOC ## setAddressFrozen ### Description Sets an address's frozen status for this token. ### Parameters #### Path Parameters - `_userAddress` (address) - The address for which to update the frozen status. - `_freeze` (bool) - The frozen status of the address (true to freeze, false to unfreeze). ### Method External function call, callable only by an agent of the token. ### Emits `AddressFrozen` event ``` -------------------------------- ### getClaimTopics Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/claim-topics-registry.md Retrieves the array of trusted claim topics currently registered for the security token. ```APIDOC ## getClaimTopics ### Description Retrieves the array of trusted claim topics for the security token. ### Returns - `uint256[] memory` - An array of trusted claim topics. ### Method `external view` ``` -------------------------------- ### Bind Token to Compliance Contract Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/compliance/compliance.md Binds a token to the compliance contract. Only bound tokens can inform the contract of asset transfers. The owner of the compliance contract must perform this action. Emits a `TokenBound` event. ```solidity function bindToken(address _token); ``` -------------------------------- ### Freeze Partial Tokens Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/token.md Freezes a specified amount of tokens for a given user address. This function can only be called by an agent of the token and emits a TokensFrozen event. ```Solidity function freezePartialTokens( address _userAddress, uint256 _amount ) external; ``` -------------------------------- ### created Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/compliance/compliance.md Function called whenever tokens are given to an address. It can update state variables in the bound modules, which are used by module checks to determine compliance. It calls `moduleMintAction()` on each bound module. ```APIDOC ## created ### Description Function called whenever tokens are given to an address. This function can update state variables in the modules bound to the compliance these state variables being used by the module checks to decide if a transfer is compliant or not depending on the values stored in these state variables and on the parameters of the modules. In practice, it calls `moduleMintAction()` on each module bound to the compliance contract. ### Method `created` ### Parameters #### Path Parameters - **_to** (address) - Required - Address of the recipient of the created tokens. - **_amount** (uint256) - Required - Quantity of tokens created. (Can be replaced by `tokenId` for NFTs). ### Notes - This function can be called ONLY by the token contract bound to the compliance. - Modules handle transfers differently than mints and burn, make sure to call `created()` when you mint tokens and not the `transferred()` method. ### Request Example ```solidity function created( address _to, uint256 _amount ); ``` ``` -------------------------------- ### setCompliance Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/token.md Sets the compliance contract for the token. This function can only be called by the owner of the token smart contract and emits a `ComplianceAdded` event. ```APIDOC ## setCompliance ### Description Sets the compliance contract of the token. ### Parameters #### Path Parameters - `_compliance` (address) - Required - The address of the compliance contract to set. ### Notes Only the owner of the token smart contract can call this function. Emits a `ComplianceAdded` event. ### Code ```solidity function setCompliance( address _compliance ) external; ``` ``` -------------------------------- ### Set Identity Registry Storage Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/identity-registry.md Sets the address for the identity registry storage. This configuration method is available to the owner of the Identity Registry contract. ```solidity function setIdentityRegistryStorage(address identityRegistryStorage); ``` -------------------------------- ### mint Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/token.md Mint tokens to a specified address. This improved version allows minting to an address only if it is verified. The function can only be called by an agent of the token and emits a Transfer event upon successful execution. ```APIDOC ## mint ### Description Mint tokens on a wallet. Improved version of default mint method. Tokens can be minted to an address if only it is a verified address as per the security token. ### Parameters - `_to` (address) - Address to mint the tokens to. - `_amount` (uint256) - Amount of tokens to mint. ### Access This function can only be called by a wallet set as agent of the token. ### Events - Emits a `Transfer` event. ### Code ```javascript Solidity function mint( address _to, uint256 _amount ) external; ``` ``` -------------------------------- ### Mint Tokens Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/token.md Mint new tokens to a verified address. This function can only be called by a wallet set as an agent of the token. Emits a Transfer event. ```Solidity function mint( address _to, uint256 _amount ) external; ``` -------------------------------- ### name Function Signature Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/token.md Defines the signature for the name function, which returns the human-readable name of the token. ```Solidity function name() external view returns (string memory); ``` -------------------------------- ### getFrozenTokens Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/token.md Returns the amount of tokens that are partially frozen on a wallet. The amount of frozen tokens is always less than or equal to the total balance of the wallet. ```APIDOC ## getFrozenTokens ### Description Returns the amount of tokens that are partially frozen on a wallet. ### Method VIEW ### Endpoint N/A (Contract Function) ### Parameters #### Path Parameters - **_userAddress** (address) - Required - The address of the wallet on which getFrozenTokens is called. ### Response #### Success Response - **frozenTokens** (uint256) - The amount of partially frozen tokens. ``` -------------------------------- ### Batch Forced Transfer Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/token.md Use to issue forced transfers in batch. Ensure amounts do not exceed available balances and receiver addresses are verified. Be cautious of potential gas limit exceedance with large lists. ```Solidity function batchForcedTransfer( address[] calldata _fromList, address[] calldata _toList, uint256[] calldata _amounts ) external; ``` -------------------------------- ### storedIdentity Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/identity-registry-storage.md Fetches the identity contract associated with a given user's wallet address. ```APIDOC ## storedIdentity ### Description Returns the onchainID of an investor. ### Method GET (conceptual) ### Endpoint N/A (Contract Function) ### Parameters #### Path Parameters - **_userAddress** (address) - Required - The wallet address of the investor. ``` -------------------------------- ### Batch Set Address Frozen Status Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/token.md Enables setting the frozen status for multiple addresses in batch. This transaction can exceed gas limits if the number of addresses is too high. The `_freeze` parameter determines the frozen status for corresponding addresses. ```Solidity function batchSetAddressFrozen( address[] calldata _userAddresses, bool[] calldata _freeze ) external; ``` -------------------------------- ### Set Compliance Contract Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/token.md Sets the compliance contract for the token. This function is restricted to the token smart contract owner and emits a ComplianceAdded event. ```Solidity function setCompliance( address _compliance ) external; ``` -------------------------------- ### registerIdentity Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/identity-registry.md Registers a mapping between an asset owner address and an ONCHAINID. Requires that the user doesn't have an identity contract already registered. The method also expects a country integer code. This function can only be called by a wallet set as agent of the smart contract. ```APIDOC ## registerIdentity ### Description Registers a mapping between an asset owner address and an ONCHAINID. Requires that the user doesn't have an identity contract already registered. The method also expects a country integer code. This function can only be called by a wallet set as agent of the smart contract. ### Method `function registerIdentity( address userAddress, address identity, uint16 country );` ``` -------------------------------- ### Force Token Transfer Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/token.md Use this function to force a transfer when the sender has insufficient free tokens but enough total balance. It reduces frozen tokens to facilitate the transfer. Requires agent role. Emits TokensUnfrozen and Transfer events. ```Solidity function forcedTransfer( address _from, address _to, uint256 _amount ) external returns (bool); ``` -------------------------------- ### decreaseAllowance Function Signature Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/token.md Defines the signature for the decreaseAllowance function, which atomically decreases the allowance granted to a spender. This function emits an Approval event. ```Solidity function decreaseAllowance( address _spender, uint256 _subtractedValue ) public virtual returns (bool); ``` -------------------------------- ### burn Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/token.md Burn tokens from a specified wallet address. This function handles cases where the account may not have enough free tokens by reducing frozen tokens. It can only be called by an agent of the token and emits TokensUnfrozen and Transfer events under specific conditions. ```APIDOC ## burn ### Description Burn tokens on a wallet. In case the `account` address has not enough free tokens (unfrozen tokens) but has a total balance higher or equal to the `value` amount the amount of frozen tokens is reduced in order to have enough free tokens to proceed the burn, in such a case, the remaining balance on the `account` is 100% composed of frozen tokens post-transaction. ### Parameters - `_userAddress` (address) - Address to burn the tokens from. - `_amount` (uint256) - Amount of tokens to burn. ### Access This function can only be called by a wallet set as agent of the token. ### Events - Emits a `TokensUnfrozen` event if `_amount` is higher than the free balance of `_userAddress`. - Emits a `Transfer` event. ### Code ```javascript Solidity function burn( address _userAddress, uint256 _amount ) external; ``` ``` -------------------------------- ### Register Identity in Identity Registry Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/identity-registry.md Registers a mapping between an asset owner address and an ONCHAINID, including a country code. Requires the user to not have an identity already registered and can only be called by a contract agent. ```solidity function registerIdentity( address userAddress, address identity, uint16 country ); ``` -------------------------------- ### linkedIdentityRegistries Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/identity-registry-storage.md Retrieves a list of all identity registry addresses currently linked to the storage contract. ```APIDOC ## linkedIdentityRegistries ### Description Returns the identity registries linked to the storage contract. ### Method GET (conceptual) ### Endpoint N/A (Contract Function) ### Parameters None ### Response #### Success Response (200) - **identityRegistries** (address[]) - An array of addresses representing the linked identity registries. ``` -------------------------------- ### ERC20 Transfer Event Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/token.md Emitted when tokens are moved between accounts. The value may be zero. ```Solidity event Transfer( address indexed from, address indexed to, uint256 value ); ``` -------------------------------- ### IdentityStored Event Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/identity-registry-storage.md Emitted when an Identity is registered. Emitted by the 'registerIdentity' function. 'investorAddress' is the investor's wallet address, and 'identity' is the address of the onchainID smart contract. ```Solidity event IdentityStored( address indexed investorAddress, IIdentity indexed identity ); ``` -------------------------------- ### decimals Function Signature Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/token.md Defines the signature for the decimals function, which returns the number of decimals used for user representation of token values. This is for display purposes only and does not affect arithmetic operations. ```Solidity function decimals() external view returns (uint8); ``` -------------------------------- ### IdentityRegistryBound Event Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/identity-registry-storage.md Emitted when an Identity Registry is bound to the storage contract. Emitted by the 'addIdentityRegistry' function. 'identityRegistry' is the address of the added identity registry. ```Solidity event IdentityRegistryBound( address indexed identityRegistry ); ``` -------------------------------- ### transferFrom Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/token.md Moves a specified amount of tokens from a sender address to a recipient address using the allowance mechanism. Deducts the amount from the caller's allowance. Includes checks for token pausing, frozen addresses, sufficient balance, and verified recipient. ```APIDOC ## transferFrom ### Description ERC-20 overridden function that includes logic to check for trade validity. Moves `_amount` tokens from sender `_from` to recipient `_to` using the allowance mechanism. `_amount` is then deducted from the caller's allowance. Requires that the token is not paused, and that the from and to addresses are not frozen. Also requires that the value should not exceed the available balance and that the to address is a verified address. Emits a `Transfer` event. ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - None ### Method `transferFrom` (Solidity function) ### Endpoint N/A (Smart Contract Function) ### Parameters - **_from** (address) - The address of the sender. - **_to** (address) - The address of the receiver. - **_amount** (uint256) - The number of tokens to transfer. ### Returns - **bool** - `true` if successful, reverts if unsuccessful. ### Events - `Transfer` event is emitted on success. ### Example ```solidity function transferFrom(address _from, address _to, uint256 _amount) public whenNotPaused returns (bool); ``` ``` -------------------------------- ### setClaimTopicsRegistry Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/identity-registry.md Sets the claim topics registry address. This is a configuration method for the owner of the Identity Registry. ```APIDOC ## setClaimTopicsRegistry ### Description Sets the claim topics registry address. This is a configuration method for the owner of the Identity Registry. ### Method `function setClaimTopicsRegistry(address claimTopicsRegistry);` ``` -------------------------------- ### isVerified Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/identity-registry.md A read-only method that returns true if a given asset owner address is associated with an ONCHAINID that satisfies the requirements for claims topics and trusted issuers. The method first retrieves the paired ONCHAINID address for the asset holder address, and then verifies that there is at least one valid claim (correct signature and not revoked) issued by a trusted issuer for each required claim topic on the ONCHAINID contract. ```APIDOC ## isVerified ### Description A read only method that returns true if a given asset owner address is associated with an ONCHAINID that satisfies the requirements for claims topics and trusted issuers. The method first retrieve the paired ONCHAINID address for the asset holder address, and then verified that there is at least one valid claim (correct signature and not revoked) issuer by a trusted issuer for each required claim topic on the ONCHAINID contract. ### Method `function isVerified(address userAddress) public view returns (bool);` ``` -------------------------------- ### Bind Identity Registry Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/identity-registry-storage.md Adds a new identity registry address to the list of linked registries. This function can only be called by the owner of the storage contract. ```Solidity function bindIdentityRegistry( address _identityRegistry ) external; ``` -------------------------------- ### Transfer Ownership Function Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/claim-topics-registry.md Transfers the ownership of the ClaimTopicsRegistry contract to a new address. Only the current owner can execute this function. ```Solidity function transferOwnershipOnClaimTopicsRegistryContract( address _newOwner ) external; ``` -------------------------------- ### symbol Function Signature Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/token.md Defines the signature for the symbol function, which returns the token's symbol, typically a short name. ```Solidity function symbol() external view returns (string memory); ``` -------------------------------- ### Unfreeze Partial Tokens Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/token.md Unfreezes a specified amount of tokens for a given user address. This function requires caller to be an agent of the token and emits a TokensUnfrozen event. ```Solidity function unfreezePartialTokens( address _userAddress, uint256 _amount ) external; ``` -------------------------------- ### transfer Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/token.md Moves a specified amount of tokens from the caller's account to a recipient address. Includes checks for token pausing, frozen addresses, sufficient balance, and verified recipient. ```APIDOC ## transfer ### Description ERC-20 overridden function that includes logic to check for trade validity. Moves `_amount` tokens from the caller's account to the recipient `_to`. Requires that the token is not paused, and that the `msg.sender` and `_to` addresses are not frozen. Also requires that the `_amount` should not exceed the available balance and that the `_to` address is a verified address. Emits a `Transfer` event. ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - None ### Method `transfer` (Solidity function) ### Endpoint N/A (Smart Contract Function) ### Parameters - **_to** (address) - The address of the receiver. - **_amount** (uint256) - The number of tokens to transfer. ### Returns - **bool** - `true` if successful, reverts if unsuccessful. ### Events - `Transfer` event is emitted on success. ### Example ```solidity function transfer(address _to, uint256 _amount) public whenNotPaused returns (bool); ``` ``` -------------------------------- ### Set Address Frozen Status Source: https://github.com/erc-3643/documentation/blob/main/docs/suite/token.md Manages the frozen status of a specific address for this token. Only an agent wallet can call this function, which emits an AddressFrozen event. ```Solidity function setAddressFrozen( address _userAddress, bool _freeze ) external; ```