Tip3 token root contract interface. RootTokenContract is a root contract for tip3 token.
More...
#include <RootTokenContract.hpp>
|
| void | constructor (string name, string symbol, uint8 decimals, uint256 root_pubkey, address_opt root_owner, uint128 total_supply) |
| |
| bool | setWalletCode (cell wallet_code) |
| |
| address | deployWallet (uint256 pubkey, address_opt owner, uint128 tokens, uint128 evers, opt< cell > notify) |
| |
| address | deployEmptyWallet (uint256 pubkey, address_opt owner, uint128 evers) |
| |
| void | grant (address dest, uint128 tokens, uint128 evers, opt< cell > notify) |
| |
|
bool | mint (uint128 tokens) |
| | Mint tokens. Allocates new tokens (increases total_supply_).
|
| |
|
uint128 | requestTotalGranted () |
| | Request total granted value to be called from other contracts.
|
| |
|
string | getName () |
| | Get token name.
|
| |
|
string | getSymbol () |
| | Get token symbol.
|
| |
|
uint8 | getDecimals () |
| | Get token decimals.
|
| |
|
uint256 | getRootKey () |
| | Get public key of the Root.
|
| |
|
address_opt | getRootOwner () |
| | Get owner contract address of the Root (optional)
|
| |
|
uint128 | getTotalSupply () |
| | Get total supply (allocated tokens)
|
| |
|
uint128 | getTotalGranted () |
| | Get total granted tokens.
|
| |
|
bool | hasWalletCode () |
| | Is wallet code already initialized (by IRootTokenContract::setWalletCode())
|
| |
|
cell | getWalletCode () |
| | Get wallet code.
|
| |
| address | getWalletAddress (uint256 pubkey, address_opt owner) |
| | Calculate wallet address using (pubkey, owner) pair. More...
|
| |
|
uint256 | getWalletCodeHash () |
| | Get wallet code hash.
|
| |
Tip3 token root contract interface. RootTokenContract is a root contract for tip3 token.
◆ constructor()
| void constructor |
( |
string |
name, |
|
|
string |
symbol, |
|
|
uint8 |
decimals, |
|
|
uint256 |
root_pubkey, |
|
|
address_opt |
root_owner, |
|
|
uint128 |
total_supply |
|
) |
| |
Constructor of RootTokenContract. Requires next additional initialization call IRootTokenContract::setWalletCode().
- Parameters
-
| name | Token name. |
| symbol | Token short symbol. |
| decimals | Decimals for ui purposes. ex: balance 100 with decimals 2 will be printed as 1.00. |
| root_pubkey | Root public key |
| root_owner | Owner contract address for internal ownership. |
| total_supply | Total supply. Originally allocated tokens. Tokens may be also allocated later using IRootTokenContract::mint() call. If you want to have fixed tokens pool, you need to implement such an owner contract, that will never call IRootTokenContract::mint(). |
◆ deployEmptyWallet()
| address deployEmptyWallet |
( |
uint256 |
pubkey, |
|
|
address_opt |
owner, |
|
|
uint128 |
evers |
|
) |
| |
Deploy a new empty token wallet. Anyone may request to deploy an empty wallet (using internal message with attached evers).
- Parameters
-
| pubkey | New wallet's public key. |
| owner | New wallet's internal owner address. |
| evers | Evers to be sent to the deployable wallet. Must be less that attached (to the call) evers value. |
◆ deployWallet()
| address deployWallet |
( |
uint256 |
pubkey, |
|
|
address_opt |
owner, |
|
|
uint128 |
tokens, |
|
|
uint128 |
evers, |
|
|
opt< cell > |
notify |
|
) |
| |
Deploy a new token wallet and grant some tokens. Maybe only called by Root owner. Should be provided pubkey (for external owned wallet) or owner (for internal owned wallet).
- Parameters
-
| pubkey | New wallet's public key. |
| owner | New wallet's internal owner address. |
| tokens | Amount of tokens to be granted to the wallet. |
| evers | Evers to be sent to the deployable wallet. |
| notify | Payload (arbitrary cell) - if specified, will be transmitted into dest owner's notification. |
◆ getWalletAddress()
| address getWalletAddress |
( |
uint256 |
pubkey, |
|
|
address_opt |
owner |
|
) |
| |
Calculate wallet address using (pubkey, owner) pair.
- Parameters
-
| pubkey | Public key of the wallet. |
| owner | Internal owner address of the wallet. |
◆ grant()
| void grant |
( |
address |
dest, |
|
|
uint128 |
tokens, |
|
|
uint128 |
evers, |
|
|
opt< cell > |
notify |
|
) |
| |
Grant tokens to dest token wallet. Tokens must be first allocated using IRootTokenContract::mint() call. Maybe only called by Root owner.
- Parameters
-
| dest | Token wallet address |
| tokens | Amount of tokens to be granted. |
| evers | Amount of evers to be attached to message. If the method called by internal message, will be ignored (rest attached evers will be transmitted). |
| notify | Payload (arbitrary cell) - if specified, will be transmitted into dest owner's notification. |
◆ setWalletCode()
| bool setWalletCode |
( |
cell |
wallet_code | ) |
|
Set wallet code. Additional initialization method required to fit external message size limits (16k). Contract will check code hash to be TIP3_WALLET_CODE_HASH, defined at compilation.
The documentation for this interface was generated from the following file: