Flex
Flex exchange system
Public Member Functions | List of all members
IRootTokenContract Interface Reference

Tip3 token root contract interface. RootTokenContract is a root contract for tip3 token. More...

#include <RootTokenContract.hpp>

Public Member Functions

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.
 

Detailed Description

Tip3 token root contract interface. RootTokenContract is a root contract for tip3 token.

Member Function Documentation

◆ 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
nameToken name.
symbolToken short symbol.
decimalsDecimals for ui purposes. ex: balance 100 with decimals 2 will be printed as 1.00.
root_pubkeyRoot public key
root_ownerOwner contract address for internal ownership.
total_supplyTotal 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
pubkeyNew wallet's public key.
ownerNew wallet's internal owner address.
eversEvers 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
pubkeyNew wallet's public key.
ownerNew wallet's internal owner address.
tokensAmount of tokens to be granted to the wallet.
eversEvers to be sent to the deployable wallet.
notifyPayload (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
pubkeyPublic key of the wallet.
ownerInternal 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
destToken wallet address
tokensAmount of tokens to be granted.
eversAmount of evers to be attached to message. If the method called by internal message, will be ignored (rest attached evers will be transmitted).
notifyPayload (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: