16 static constexpr
unsigned ROOT_TIMESTAMP_DELAY = 1800;
17 using root_replay_protection_t = replay_attack_protection::timestamp<ROOT_TIMESTAMP_DELAY>;
28 [[
internal, external]]
34 address_opt root_owner,
44 [[
internal, external, answer_id]]
50 [[
internal, external, answer_id]]
61 [[
internal, answer_id]]
72 [[
internal, external, answer_id]]
83 [[
internal, external, answer_id]]
84 bool mint(uint128 tokens) = 15;
87 [[
internal, answer_id]]
137 using IRootTokenContractPtr = handle<IRootTokenContract>;
160 static std::pair<StateInit, uint256> execute(
DRootTokenContract root_data, cell root_code) {
162 prepare_persistent_data<IRootTokenContract, root_replay_protection_t>(
163 root_replay_protection_t::init(), root_data);
164 StateInit root_init { {}, {}, root_code, root_data_cl, {} };
165 cell root_init_cl = build(root_init).make_cell();
166 return { root_init, uint256(tvm_hash(root_init_cl)) };
TONTokenWallet contract interfaces and data-structs.
RootTokenContract persistent data struct.
Definition: RootTokenContract.hpp:140
string symbol_
Token short symbol.
Definition: RootTokenContract.hpp:142
uint256 root_pubkey_
Root public key.
Definition: RootTokenContract.hpp:144
uint128 total_supply_
Total supply of allocated tokens (in the pool).
Definition: RootTokenContract.hpp:146
address_opt root_owner_
Root internal owner (owner contract).
Definition: RootTokenContract.hpp:145
string name_
Token name.
Definition: RootTokenContract.hpp:141
uint128 total_granted_
Total granted tokens (to the wallets).
Definition: RootTokenContract.hpp:147
uint8 decimals_
Decimals for ui purposes. ex: balance 100 with decimals 2 will be printed as 1.00.
Definition: RootTokenContract.hpp:143
optcell wallet_code_
Token wallet code.
Definition: RootTokenContract.hpp:148
RootTokenContract events interface.
Definition: RootTokenContract.hpp:153
Tip3 token root contract interface. RootTokenContract is a root contract for tip3 token.
Definition: RootTokenContract.hpp:24
uint128 requestTotalGranted()
Request total granted value to be called from other contracts.
bool hasWalletCode()
Is wallet code already initialized (by IRootTokenContract::setWalletCode())
uint256 getRootKey()
Get public key of the Root.
string getName()
Get token name.
uint8 getDecimals()
Get token decimals.
address getWalletAddress(uint256 pubkey, address_opt owner)
Calculate wallet address using (pubkey, owner) pair.
void grant(address dest, uint128 tokens, uint128 evers, opt< cell > notify)
uint128 getTotalGranted()
Get total granted tokens.
uint128 getTotalSupply()
Get total supply (allocated tokens)
void constructor(string name, string symbol, uint8 decimals, uint256 root_pubkey, address_opt root_owner, uint128 total_supply)
bool mint(uint128 tokens)
Mint tokens. Allocates new tokens (increases total_supply_).
string getSymbol()
Get token symbol.
cell getWalletCode()
Get wallet code.
uint256 getWalletCodeHash()
Get wallet code hash.
address_opt getRootOwner()
Get owner contract address of the Root (optional)
address deployEmptyWallet(uint256 pubkey, address_opt owner, uint128 evers)
address deployWallet(uint256 pubkey, address_opt owner, uint128 tokens, uint128 evers, opt< cell > notify)
bool setWalletCode(cell wallet_code)