Deploy, Issue & Transfer Tokens
The InfraBlockchain network uses the built-in contract applied to the core without deploying the token contract. The sys.tokenabi
account contains the ABI of the Built-in Contract.
Every account can use transfer
, issue
, retire
, settokenmeta
, txfee
action
Step 1: Create the Token
To create a new token, call create
action with the correct parameters. This action accepts 1 argument, it consists of:
An issuer that is an eosio account. In this case, it's
systoken.a
. This issuer will be the one with the authority to callissue
and/or perform other actions such as closing accounts or retiring tokens.An
asset
type composed of two pieces of data, a floating-point number sets the maximum supply and asymbol
in capitalized alpha characters which represents the symbol. For example, "4,DUSD".
Below is a concise way to call this method, using positional arguments:
Step 2: Issue Tokens
The issuer systoken.a
can now issue new tokens. As mentioned earlier only the issuer can do so, therefore, -p systoken.a@active
must be provided to authorize the issue
action.
This time the output contains several actions: one issue
action and three transfer
actions. While the only action signed was issue
, the issue
action performed an inline transfer
and the inline transfer
notified the sender and receiver accounts. The output indicates all the action handlers that were called, the order they were called in, and whether any output was generated by the action.
Step 3: Transfer Tokens
Now that account systoken.a has been issued tokens, transfer some of them to account bob
.
Now check if bob
received the tokens using infra-cli get token balance
Check systoken.a
's balance. Notice that tokens were deducted from the account.
Excellent! Everything adds up.
What's Next?
Understanding ABI Files: Introduction to Application Binary Files (ABI) and how the ABI file correlates to the
eosio.token
contract.
Last updated