eosio.token

Introduction

The eosio.token contract defines the structures and actions that allow users to create, issue, and manage tokens on EOSIO based blockchains. The core token EOS of the EOSIO mainnet are issued under the account eosio.token using this smart contract.

Types

There are a few types used in eosio.token as basic data structures. You can click the link in the action definitions to see how the types are defined.

Smart Contract

Actions

class token
ACTION create(eosio::name issuer, eosio::asset maximum_supply)
[source]

Create a token in supply of maximum_supply with an issuer account. If successful, a new entry in stat table for token symbol scope will be created. Transaction must be signed by the contract account itself.

ACTION issue(eosio::name to, eosio::asset quantity, string memo)
[source]

Issue quantity of tokens to account to with an optional memo that accompanies the token issue transaction. The token needs to be created in advance. Transaction must be signed by the issuer.

ACTION transfer(eosio::name from, eosio::name to, eosio::asset quantity, string memo)
[source]

Transfer quantity of tokens from account from to account to, with an optional memo that accompanies the transfer transaction. The token needs to be created in advance. Transaction must be signed by account from.

ACTION open(eosio::name owner, eosio::symbol symbol, eosio::name ram_payer)
[source]

Allows ram_payer to create an account owner with zero balance for token symbol at the expense of ram_payer. Transaction must be signed by account ram_payer.

ACTION close(eosio::name owner, eosio::symbol symbol)
[source]

This action is the opposite for open(), it closes the account owner for token symbol.

ACTION retire(eosio::asset quantity, string memo)
[source]

The opposite of create(). If all validations succeed, it debits the statstable.supply amount.

Tables

class token
TABLE stat
[source]
// scope is token symbol
eosio::asset supply; // supply.symbol is the primary key
eosio::asset max_supply;
eosio::name issuer;
TABLE accounts
[source]
// scope is owner
eosio::asset balance; // balance.symbol is the primary key