|
void | create (const name &issuer, const asset &maximum_supply) |
| Создает новый токен с указанным максимальным предложением. Позволяет эмитенту создать токен с заданным символом и максимальным предложением. Подробнее...
|
|
void | issue (const name &to, const asset &quantity, const string &memo) |
| Выпускает токены указанному аккаунту. Позволяет эмитенту выпустить определенное количество токенов на аккаунт получателя. Подробнее...
|
|
void | retire (const asset &quantity, const string &memo) |
| Изымает токены из обращения. Позволяет эмитенту изъять определенное количество токенов из общего предложения. Подробнее...
|
|
void | transfer (const name &from, const name &to, const asset &quantity, const string &memo) |
| Переводит токены между аккаунтами. Позволяет отправителю перевести определенное количество токенов получателю. Подробнее...
|
|
void | open (const name &owner, const symbol &symbol, const name &ram_payer) |
| Открывает аккаунт для указанного токена. Позволяет ram_payer создать аккаунт owner с нулевым балансом для указанного токена. Подробнее...
|
|
void | close (const name &owner, const symbol &symbol) |
| Закрывает аккаунт для указанного токена. Позволяет владельцу закрыть аккаунт для указанного токена, если баланс равен нулю. Подробнее...
|
|
The eosio.token
sample system contract defines the structures and actions that allow users to create, issue, and manage tokens for EOSIO based blockchains. It demonstrates one way to implement a smart contract which allows for creation and management of tokens. It is possible for one to create a similar contract which suits different needs. However, it is recommended that if one only needs a token with the below listed actions, that one uses the eosio.token
contract instead of developing their own.
The eosio.token
contract class also implements two useful public static methods: get_supply
and get_balance
. The first allows one to check the total supply of a specified token, created by an account and the second allows one to check the balance of a token for a specified account (the token creator account has to be specified as well).
The eosio.token
contract manages the set of tokens, accounts and their corresponding balances, by using two internal multi-index structures: the accounts
and stats
. The accounts
multi-index table holds, for each row, instances of account
object and the account
object holds information about the balance of one token. The accounts
table is scoped to an EOSIO account, and it keeps the rows indexed based on the token's symbol. This means that when one queries the accounts
multi-index table for an account name the result is all the tokens that account holds at the moment.
Similarly, the stats
multi-index table, holds instances of currency_stats
objects for each row, which contains information about current supply, maximum supply, and the creator account for a symbol token. The stats
table is scoped to the token symbol. Therefore, when one queries the stats
table for a token symbol the result is one single entry/row corresponding to the queried symbol token if it was previously created, or nothing, otherwise.