COOPENOMICS  v1
Кооперативная Экономика
Класс eosio::token

#include <eosio.token.hpp>

Граф наследования:eosio::token:

Классы

struct  account
 Таблица аккаунтов хранит балансы токенов для каждого аккаунта. Подробнее...
 
struct  currency_stats
 Таблица статистики валют хранит информацию о токенах. Подробнее...
 

Открытые типы

using create_action = eosio::action_wrapper<"create"_n, &token::create >
 
using issue_action = eosio::action_wrapper<"issue"_n, &token::issue >
 
using retire_action = eosio::action_wrapper<"retire"_n, &token::retire >
 
using transfer_action = eosio::action_wrapper<"transfer"_n, &token::transfer >
 
using open_action = eosio::action_wrapper<"open"_n, &token::open >
 
using close_action = eosio::action_wrapper<"close"_n, &token::close >
 

Открытые члены

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)
 Закрывает аккаунт для указанного токена. Позволяет владельцу закрыть аккаунт для указанного токена, если баланс равен нулю. Подробнее...
 

Открытые статические члены

static asset get_supply (const name &token_contract_account, const symbol_code &sym_code)
 
static asset get_balance (const name &token_contract_account, const name &owner, const symbol_code &sym_code)
 

Закрытые типы

typedef eosio::multi_index< "accounts"_n, accountaccounts
 
typedef eosio::multi_index< "stat"_n, currency_statsstats
 

Закрытые члены

void sub_balance (const name &owner, const asset &value)
 
void add_balance (const name &owner, const asset &value, const name &ram_payer)
 
void is_can_transfer (const name &from, const name &to)
 

Подробное описание

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.

Определения типов

◆ accounts

typedef eosio::multi_index< "accounts"_n, account > eosio::token::accounts
private

◆ close_action

using eosio::token::close_action = eosio::action_wrapper<"close"_n, &token::close>

◆ create_action

using eosio::token::create_action = eosio::action_wrapper<"create"_n, &token::create>

◆ issue_action

using eosio::token::issue_action = eosio::action_wrapper<"issue"_n, &token::issue>

◆ open_action

using eosio::token::open_action = eosio::action_wrapper<"open"_n, &token::open>

◆ retire_action

using eosio::token::retire_action = eosio::action_wrapper<"retire"_n, &token::retire>

◆ stats

typedef eosio::multi_index< "stat"_n, currency_stats > eosio::token::stats
private

◆ transfer_action

using eosio::token::transfer_action = eosio::action_wrapper<"transfer"_n, &token::transfer>

Методы

◆ add_balance()

void eosio::token::add_balance ( const name &  owner,
const asset &  value,
const name &  ram_payer 
)
private

◆ get_balance()

static asset eosio::token::get_balance ( const name &  token_contract_account,
const name &  owner,
const symbol_code &  sym_code 
)
inlinestatic

◆ get_supply()

static asset eosio::token::get_supply ( const name &  token_contract_account,
const symbol_code &  sym_code 
)
inlinestatic

◆ is_can_transfer()

void eosio::token::is_can_transfer ( const name &  from,
const name &  to 
)
private

◆ sub_balance()

void eosio::token::sub_balance ( const name &  owner,
const asset &  value 
)
private

Объявления и описания членов классов находятся в файлах: