Tokens Interface
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.
event UpdatedTokenInformation(
string indexed _newName,
string indexed _newSymbol,
uint8 _newDecimals,
string _newVersion,
address indexed _newOnchainID
);
IdentityRegistryAdded
Event
Description: Emitted when the Identity Registry has been set for the token.
event IdentityRegistryAdded(address indexed _identityRegistry);
ComplianceAdded
Event
Description: Emitted when the Compliance contract has been set for the token.
event ComplianceAdded(address indexed _compliance);
RecoverySuccess
Event
Description: Emitted when an investor successfully recovers their tokens from a lost wallet to a new wallet.
event RecoverySuccess(
address indexed _lostWallet,
address indexed _newWallet,
address indexed _investorOnchainID
);
AddressFrozen
Event
Description: Emitted when the wallet of an investor is frozen or unfrozen.
event AddressFrozen(
address indexed _userAddress,
bool indexed _isFrozen,
address indexed _owner
);
TokensFrozen
Event
Description: Emitted when a certain amount of tokens is frozen on a wallet.
event TokensFrozen(
address indexed _userAddress,
uint256 _amount
);
TokensUnfrozen
Event
Description: Emitted when a certain amount of tokens is unfrozen on a wallet.
event TokensUnfrozen(
address indexed _userAddress,
uint256 _amount
);
Paused
Event
Description: Emitted when the token contract is paused.
event Paused(address _userAddress);
Unpaused
Event
Description: Emitted when the token contract is unpaused.
event Unpaused(address _userAddress);
setName
Source: IToken
Description: Sets the token name. Only the owner of the token contract can call this function.
function setName(string calldata _name) external;
setSymbol
Source: IToken
Description: Sets the token symbol. Only the owner of the token contract can call this function.
function setSymbol(string calldata _symbol) external;
setOnchainID
Source: IToken
Description: Sets the onchain ID of the token. Only the owner of the token contract can call this function.
function setOnchainID(address _onchainID) external;
pause
Source: IToken
Description: Pauses the token contract, preventing token transfers. Only an agent of the token can call this function.
function pause() external;
unpause
Source: IToken
Description: Unpauses the token contract, allowing token transfers. Only an agent of the token can call this function.
function unpause() external;
setAddressFrozen
Source: IToken
Description: Sets the frozen status of a specific address. Only an agent of the token can call this function.
function setAddressFrozen(address _userAddress, bool _freeze) external;
freezePartialTokens
Source: IToken
Description: Freezes a specific amount of tokens on a given address. Only an agent of the token can call this function.
function freezePartialTokens(address _userAddress, uint256 _amount) external;
unfreezePartialTokens
Source: IToken
Description: Unfreezes a specific amount of tokens on a given address. Only an agent of the token can call this function.
function unfreezePartialTokens(address _userAddress, uint256 _amount) external;
setIdentityRegistry
Source: IToken
Description: Sets the Identity Registry for the token. Only the owner of the token contract can call this function.
function setIdentityRegistry(address _identityRegistry) external;
setCompliance
Source: IToken
Description: Sets the Compliance contract for the token. Only the owner of the token contract can call this function.
function setCompliance(address _compliance) external;
forcedTransfer
Source: IToken
Description: Forces a transfer of tokens between two whitelisted addresses. Only an agent of the token can call this function.
function forcedTransfer(
address _from,
address _to,
uint256 _amount
) external returns (bool);
mint
Source: IToken
Description: Mints new tokens to a verified address. Only an agent of the token can call this function.
function mint(address _to, uint256 _amount) external;
burn
Source: IToken
Description: Burns tokens from a specified address. Only an agent of the token can call this function.
function burn(address _userAddress, uint256 _amount) external;
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.
function recoveryAddress(
address _lostWallet,
address _newWallet,
address _investorOnchainID
) external returns (bool);
batchTransfer
Source: IToken
Description: Transfers tokens in batch to multiple addresses.
function batchTransfer(address[] calldata _toList, uint256[] calldata _amounts) external;
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.
function batchForcedTransfer(
address[] calldata _fromList,
address[] calldata _toList,
uint256[] calldata _amounts
) external;
batchMint
Source: IToken
Description: Mints tokens in batch to multiple addresses. Only an agent of the token can call this function.
function batchMint(address[] calldata _toList, uint256[] calldata _amounts) external;
batchBurn
Source: IToken
Description: Burns tokens in batch from multiple addresses. Only an agent of the token can call this function.
function batchBurn(address[] calldata _userAddresses, uint256[] calldata _amounts) external;
batchSetAddressFrozen
Source: IToken
Description: Sets the frozen status of multiple addresses in batch. Only an agent of the token can call this function.
function batchSetAddressFrozen(address[] calldata _userAddresses, bool[] calldata _freeze) external;
batchFreezePartialTokens
Source: IToken
Description: Freezes tokens partially in batch for multiple addresses. Only an agent of the token can call this function.
function batchFreezePartialTokens(address[] calldata _userAddresses, uint256[] calldata _amounts) external;
batchUnfreezePartialTokens
Source: IToken
Description: Unfreezes tokens partially in batch for multiple addresses. Only an agent of the token can call this function.
function batchUnfreezePartialTokens(address[] calldata _userAddresses, uint256[] calldata _amounts) external;
ERC20 Functions
Transfer
Event
Description: Emitted when value
tokens are moved from one account (from
) to another (to
).
event Transfer(address indexed from, address indexed to, uint256 value);
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.
event Approval(address indexed owner, address indexed spender, uint256 value);
totalSupply
Source: IERC20
Description: Returns the total supply of tokens in existence.
function totalSupply() external view returns (uint256);
balanceOf
Source: IERC20
Description:
Returns the amount of tokens owned by a specific account.
function balanceOf(address account) external view returns (uint256);
transfer
Source: IERC20
Description: Moves amount
tokens from the caller's account to a specified address.
function transfer(address to, uint256 amount) external returns (bool);
allowance
Source: IERC20
Description: Returns the remaining number of tokens that spender
is allowed to spend on behalf of owner
through transferFrom
.
function allowance(address owner, address spender) external view returns (uint256);
approve
Source: IERC20
Description: Sets amount
as the allowance of spender
over the caller's tokens.
function approve(address spender, uint256 amount) external returns (bool);
transferFrom
Source: IERC20
Description: Moves amount
tokens from from
to to
using the allowance mechanism. amount
is then deducted from the caller's allowance.
function transferFrom(address from, address to, uint256 amount) external returns (bool);
Last updated