Skip to main content

sysio.token

Overview

The sysio.token contract defines structures and actions for creating, issuing, and managing tokens on Wire-based blockchains. It allows for creating new tokens, managing balances, and transferring tokens between accounts. It also includes utility methods for checking token supply and balances.

Actions

create

Creates a new token with a specified maximum supply.

Parameter NameDescription
issuerThe account that creates the token.
maximum_supplyThe maximum supply of the token being created.

It allows issuer to create a token in supply of maximum_supply. If validation is successful a new entry in currency_stats for token symbol scope gets created.

issue

Issues a specified quantity of tokens to the given account.

Parameter NameDescription
toThe account to issue tokens to (must be the issuer).
quantityThe amount of tokens to be issued.
memoA memo string accompanying the token issue.

retire

Retires a specified quantity of tokens, reducing the total supply.

Parameter NameDescription
quantityThe quantity of tokens to retire.
memoA memo string accompanying the transaction.

transfer

Transfers tokens from one account to another.

Parameter NameDescription
fromThe account to transfer tokens from.
toThe account to transfer tokens to.
quantityThe quantity of tokens to transfer.
memoA memo string accompanying the transaction.

open

Opens a zero-balance account for a specific token symbol at the expense of the RAM payer.

Parameter NameDescription
ownerThe account to be created.
symbolThe token symbol for which to open the account.
ram_payerThe account paying for the RAM.

close

Closes the token account for the specified owner and symbol, provided the balance is zero.

Parameter NameDescription
ownerThe owner of the account to be closed.
symbolThe token symbol for the account to be closed.

Static Methods

get_supply

Returns the total supply of a specified token.

Parameter NameDescription
token_contract_accountThe account that manages the token contract.
sym_codeThe symbol code of the token.

get_balance

Returns the balance of a specified token for a given account.

Parameter NameDescription
token_contract_accountThe account that manages the token contract.
ownerThe account to check the balance for.
sym_codeThe symbol code of the token.

Tables

accounts

Stores token balances for each account.

FieldDescription
balanceThe token balance for the account.

currency_stats

Stores information about the supply and issuer of each token.

FieldDescription
supplyThe current supply of the token.
max_supplyThe maximum supply allowed for the token.
issuerThe account that created the token.