Token Interface
Last updated
Was this helpful?
Last updated
Was this helpful?
This page contains a list of functions and events you can use to interact with the registry smart contracts
This section contains a list of functions you can use to interact with the registry smart contracts. The functions denoted with the [ERC-20] tag follow the .
Returns the name of the token - e.g. "MyToken".
This function is public and can be called by anyone without specific permissions applied.
Returns the symbol of the token. E.g. “HIX”.
This function is public and can be called by anyone without specific permissions applied.
Returns the number of decimals the token uses - e.g. 8, means to divide the token amount by 100000000 to get its user representation. To avoid dust on wallets the decimals value is always set to 0.
This function is public and can be called by anyone without specific permissions applied.
Returns the total token supply. Depending on the token parameter “autoMint” the total supply is either fixed (autoMint = False) or variable (autoMint = True).
This function always returns the total number of tokens that have been issued since the token has been deployed. In contrast to some ERC-20 implementations, this field doesn’t return the value of outstanding tokens. Burning tokens doesn’t reduce the total supply. To get the currently outstanding tokens, iterate over the holders array using the “number of holders” and “get holder” functions and sum the balances retrieved by calling the “balanceOf”, “activeBalanceOf” and/or “frozenBalanceOf” functions.
This function is public and can be called by anyone without specific permissions applied.
Returns the account balance of an account with address _owner. Please note, that this function returns the total balance of a holder including the frozen amount.
This function is public and can be called by anyone without specific permissions applied.
Transfers _value amount of tokens to address _to. Fires a Transfer event. Transfers of 0 values are treated as normal transfers and fire the Transfer event.
This function is public and can be called by anyone without specific permissions applied. The function throws if the message caller’s account balance does not have enough tokens to spend.
Transfers _value amount of tokens from address _from to address _to. Fires the Transfer event. Transfers of 0 values are treated as normal transfers and fire the Transfer event. The _from address can use the "approve" or "increaseAllowance" function to add an allowance for the message's caller to spend the tokens.
This function is public and can be called by anyone without specific permissions applied. The function throws unless the _from account has deliberately authorized the sender of the message via some mechanism.
We advise to use the safer "increaseAllowance" and "decreaseAllowance" functions described below.
This function is public and can be called by anyone without specific permissions applied. The function throws if the message caller’s account balance does not have enough tokens to spend.
Returns the amount which _spender is still allowed to withdraw from _owner.
This function is public and can be called by anyone without specific permissions applied.
This function is public and can be called by anyone without specific permissions applied. The function throws if the message caller’s account balance does not have enough tokens to spend.
Decreases the allowance with the subtractedAmount.
This function is public and can be called by anyone without specific permissions applied.
Returns the frozen balance of an account. Frozen tokens cannot be transferred to other wallets. Frozen balances can be burned.
This function is public and can be called by anyone without specific permissions applied.
This function returns the total number of account holders. You can use this function to iterate over the holders array using the "getHolder" function. The array starts with index 1.
This function is public and can be called by anyone without specific permissions applied.
This function returns the address of a holder with the given ID. The number of holders can be retrieved via the "numberOfHolders" function.
This function is public and can be called by anyone without specific permissions applied.
Returns true if the contract is paused and false if unpaused. While the contract is paused, the holder array as well as token amounts are stable.
If this is set to true, token transfers will fail. If autoMint is set to false and an initial total supply has been set, pausing the contract will also prohibit issuing token amounts. If autoMint is set to true and there is no initial total supply, minting tokens to addresses is still possible even though the contract is paused.
Pausing a contract doesn’t limit the ability to freeze or burn tokens.
This function is public and can be called by anyone without specific permissions applied.
This function returns true if whitelisting is disabled and false if the whitelisting mechanism is enabled.
This function is public and can be called by anyone without specific permissions applied.
This function returns the lock-up time for transfers. If the current date and time are prior to the lock-up time, transfers will always fail. The lock-up time doesn’t prohibit the minting of tokens.
This function is public and can be called by anyone without specific permissions applied.
This function returns the metadata for a specific token. MetadataJSON is set to contain a JSON object with the following key/values pairs: calculation_factor, issuer_company_name, isin.
This function is public and can be called by anyone without specific permissions applied.
This functions returns the SHA-256 hash digest integer value of the issuance document PDF file.
A paper contract hash with the value 0 has a special meaning: As long as it is 0, transfers cannot be unpaused.
This function is public and can be called by anyone without specific permissions applied.
Triggers when tokens are transferred, including zero value transfers. Also, the event is triggered when tokens are minted.
Triggered on any successful call to approve(address _spender, uint256 _value).
Triggered when the setting is updated.
Triggered when the paper contract hash is updated.
Triggered on an increase of the total supply of the token.
Triggered when tokens are credited to a holder account as a result of a primary market transaction against the issuer. The same transaction will also trigger the TokensMinted event if new tokens will be created to fill the order.
Triggered when fractions of holder balances with the IDs are frozen.
Triggered when fractions of holder balances with the IDs are unfrozen.
Triggered when function setMetadataJSON is called and metadataJSON is changed.
Triggered when function forcedTransferFrom is called.
Triggered when frozen tokens of holders are burned. Note that a burn doesn't reduce the return value of the total supply function.
Triggered when a atomic freeze and burn operation is executed for the address and amount. Note that a destroy transaction doesn't reduce the return value of the total supply function.
Allows _spender to withdraw from the message's sender account multiple times, up to the _value amount. If this function is called again it adds the value to the allowance. To prevent attack vectors like the one and discussed , the approve function will throw an error if the allowance for the spender is not 0. Clients must make sure to create user interfaces in such a way that they set the allowance first to 0 before setting it to another value for the same spender.
Increases the allowance with the addedAmount for the spender to withdraw tokens from the message's sender balance. This is safer alternative to the "approve" function (see for details).
With a PDF file downloaded from the , you can verify that the PDF file is the one referenced by comparing the hash digest values: The following Python script gives an example on how to compute the hash digest from the PDF file. The printed value should match the value returned by the "paperContractHash" function.
This section contains a list of events that can be emitted when interacting with the smart contract. Subscribe to these events in order to update your client directly on status changes. The events denoted with the [ERC-20] tag follow the .