The T-REX Token Smart Contract is facilitating the compliant issuance, management, and transfer of security tokens. By integrating with Identity Registry and Compliance contracts, the token contract ensures that all token operations adhere to regulatory requirements.
Compliance and Identity Verification:
The token contract interacts with the Identity Registry to verify the identity of token holders. This ensures that only compliant and verified participants can hold and transfer tokens.
The Compliance contract is called to enforce transfer rules, restrictions, and other regulatory requirements, ensuring that all transactions meet the necessary legal standards.
Token Information Management:
The contract allows the owner to set and update essential token information, such as the token's name, symbol, and ONCHAINID. These updates are crucial for maintaining accurate and current metadata for the token.
Pause and Freeze Mechanisms:
The contract includes functions to pause all token transfers, providing a safeguard in emergency situations or during regulatory investigations.
Specific addresses can be frozen, either completely or partially, preventing them from transferring tokens. This feature is vital for compliance and security, allowing for swift action in case of suspicious activities.
Recovery and Forced Transfers:
Investors can recover tokens from a lost wallet to a new one, ensuring that access to tokens is not permanently lost due to wallet issues.
Forced transfers between compliant addresses can be executed to ensure regulatory and operational requirements are met, even if an address has frozen tokens.
Batch Operations:
The token contract supports batch operations for minting, burning, transferring, and freezing tokens. These batch functions are efficient and reduce transaction costs when dealing with multiple addresses.
While the token contract itself does not contain the logic for identity verification and compliance enforcement, it relies heavily on other contracts within the T-REX protocol to ensure these functionalities:
Identity Registry Contract: This contract maintains a registry of verified identities, ensuring that only authorized participants can interact with the token.
Compliance Contract: This contract enforces transfer rules and restrictions based on the regulatory requirements, ensuring that all token transactions comply with the law.
The token contract emits several events to log significant actions and changes:
UpdatedTokenInformation: Emitted when token information is updated, ensuring transparency and traceability of changes.
IdentityRegistryAdded: Emitted when the Identity Registry is set for the token, linking it to the compliance infrastructure.
ComplianceAdded: Emitted when the Compliance contract is set, ensuring the token is subject to regulatory rules.
RecoverySuccess: Emitted when a successful recovery of tokens is executed, ensuring lost tokens can be reclaimed.
AddressFrozen and TokensFrozen: Emitted when addresses or specific amounts of tokens are frozen, providing an audit trail for compliance actions.
Paused and Unpaused: Emitted when the token contract is paused or unpaused, signaling changes in the operational status of the token.
The Token Smart Contract interface defines a comprehensive set of functions and events essential for managing and regulating the lifecycle of the token. Below is a detailed breakdown of the interface functions, explaining their purpose, source, and functionality.
UpdatedTokenInformation
Event
Description: Emitted when the token information is updated. This includes updates to the token's name, symbol, decimals, version, and onchainID.
IdentityRegistryAdded
Event
Description: Emitted when the Identity Registry has been set for the token.
ComplianceAdded
Event
Description: Emitted when the Compliance contract has been set for the token.
RecoverySuccess
Event
Description: Emitted when an investor successfully recovers their tokens from a lost wallet to a new wallet.
AddressFrozen
Event
Description: Emitted when the wallet of an investor is frozen or unfrozen.
TokensFrozen
Event
Description: Emitted when a certain amount of tokens is frozen on a wallet.
TokensUnfrozen
Event
Description: Emitted when a certain amount of tokens is unfrozen on a wallet.
Paused
Event
Description: Emitted when the token contract is paused.
Unpaused
Event
Description: Emitted when the token contract is unpaused.
setName
Source: IToken
Description: Sets the token name. Only the owner of the token contract can call this function.
setSymbol
Source: IToken
Description: Sets the token symbol. Only the owner of the token contract can call this function.
setOnchainID
Source: IToken
Description: Sets the onchain ID of the token. Only the owner of the token contract can call this function.
pause
Source: IToken
Description: Pauses the token contract, preventing token transfers. Only an agent of the token can call this function.
unpause
Source: IToken
Description: Unpauses the token contract, allowing token transfers. Only an agent of the token can call this function.
setAddressFrozen
Source: IToken
Description: Sets the frozen status of a specific address. Only an agent of the token can call this function.
freezePartialTokens
Source: IToken
Description: Freezes a specific amount of tokens on a given address. Only an agent of the token can call this function.
unfreezePartialTokens
Source: IToken
Description: Unfreezes a specific amount of tokens on a given address. Only an agent of the token can call this function.
setIdentityRegistry
Source: IToken
Description: Sets the Identity Registry for the token. Only the owner of the token contract can call this function.
setCompliance
Source: IToken
Description: Sets the Compliance contract for the token. Only the owner of the token contract can call this function.
forcedTransfer
Source: IToken
Description: Forces a transfer of tokens between two whitelisted addresses. Only an agent of the token can call this function.
mint
Source: IToken
Description: Mints new tokens to a verified address. Only an agent of the token can call this function.
burn
Source: IToken
Description: Burns tokens from a specified address. Only an agent of the token can call this function.
recoveryAddress
Source: IToken
Description: Recovers tokens from a lost wallet to a new wallet for an investor. Only an agent of the token can call this function.
batchTransfer
Source: IToken
Description: Transfers tokens in batch to multiple addresses.
batchForcedTransfer
Source: IToken
Description: Forces transfers of tokens in batch between multiple pairs of addresses. Only an agent of the token can call this function.
batchMint
Source: IToken
Description: Mints tokens in batch to multiple addresses. Only an agent of the token can call this function.
batchBurn
Source: IToken
Description: Burns tokens in batch from multiple addresses. Only an agent of the token can call this function.
batchSetAddressFrozen
Source: IToken
Description: Sets the frozen status of multiple addresses in batch. Only an agent of the token can call this function.
batchFreezePartialTokens
Source: IToken
Description: Freezes tokens partially in batch for multiple addresses. Only an agent of the token can call this function.
batchUnfreezePartialTokens
Source: IToken
Description: Unfreezes tokens partially in batch for multiple addresses. Only an agent of the token can call this function.
Transfer
Event
Description: Emitted when value
tokens are moved from one account (from
) to another (to
).
Approval
Event
Description: Emitted when the allowance of a spender
for an owner
is set by a call to approve
. value
is the new allowance.
totalSupply
Source: IERC20
Description: Returns the total supply of tokens in existence.
balanceOf
Source: IERC20
Description:
Returns the amount of tokens owned by a specific account.
transfer
Source: IERC20
Description: Moves amount
tokens from the caller's account to a specified address.
allowance
Source: IERC20
Description: Returns the remaining number of tokens that spender
is allowed to spend on behalf of owner
through transferFrom
.
approve
Source: IERC20
Description: Sets amount
as the allowance of spender
over the caller's tokens.
transferFrom
Source: IERC20
Description: Moves amount
tokens from from
to to
using the allowance mechanism. amount
is then deducted from the caller's allowance.