One, foreword

“Don’t talk to me about some bullshit love story, I just want to make money!”

This may be the voice of most chives. Since we want to make money, we should understand that the coin circle makes money fast, yes, it is to issue money!

Second, the issuing

Issuing coins on EOS is as simple as issuing coins on ETH. For issuing coins on EOS, we mainly use a smart contract called EOSIo. token, which runs to create a number of different tokens, each managed by a different user.

Before we deploy the Token contract, we first need to create an account to manage the contract.

2.1 Creating an Account

Here we create three accounts for testing, namely eosio.token, Langge111111 and Langge222222. Eosio. token is used to deploy the contract, and the other two accounts are used to test transfers. ./cleos create account eosio eosio.token EOS75bGH5NwCen69GczAgGkg9vVVMQAdqDDqNeZHAyxX2TxDMP5tT How EOS6u5pwb64P9HshRcWHFixgtU8WAe3yNHDjFJwKwLcuWYq4p1h1x section before creating your account already speak very detailed, go here, don’t understand children’s shoes can go back to review the previous section. EOS development complete analysis (III) : EOS account creation

Here we successfully created the eosio.token account

Since all operations are based on the wallet, we need to import the account into the wallet first. . / cleos wallet import – n eosio. Token – private – key 5 k3rgtjvymup1nxhbzm9aynnrr5y9shtzcmdmtb5vrea1ujmv8e EOS development fully (2) : Create, import, and unlock wallets with cleOS command line

2.2 Deploying the EOSIo. token contract

. / cleos set contract eosio. Token ~ / eos/build/contracts/eosio token – p eosio. First eosio token. The token is to deploy the contract account, The second eosio.token is the contract to be deployed. -P eosio.token means that the authorized account is eosio.token

2.3 Creating tokens

Eosio. Token the contract in ~ / eos/contracts/eosio token this directory below, we have a look at his file structure

If we open eosio.token. HPP, the C++ header file, we can see that it provides the following public methods, which I have commented out for easy understanding.

        /* * Create tokens ** issuer Issuer ** Total number of maximum_supply tokens */
         void create( account_name issuer,asset maximum_supply);
        /* * The contract owner uses the operation ** to receive the account ** quantity ** memo */
         void issue( account_name to, asset quantity, string memo );
        /* ** Transfer, ordinary users can also ** from the sending account ** to the receiving account ** quantity sent ** memo */
         void transfer( account_name from,account_name to,asset quantity,string memo)
Copy the code

To create the token, we just use the create() method here. The argument issue is the issuer, and the issuer has the right to freeze, recall, and whitelist the owner.

Execute the create() method, /cleos push action eosio.token create ‘[“eosio”,”100000000.00 LG”]’ -p eosio.token Eosio and 100000000.00 LG are passed, and the last one is authorization, which is active by default. Create 100000000.00 LG for eoSIo account with precision of 2 decimal places.

2.4 Sending tokens

./ CLEos push action eosio.token Issue ‘[” Langge111111 “,”10000.00 LG”,”airdrop”]’ -p eosio-j This instruction is to send 10000.00 LG for the langge111111 account, with a note of “airdrop” and output in JSON format.

There’s a little bit of print here, so I’ve only taken some of it. Let’s check the balance now to see if it has been received. /cleos get currency balance eosio.token langge111111 wE can see that the langge111111 account already has 10000.00 LG, and the other two accounts have zero LG.

Eosio = eoSIO; eoSIO = eoSIO; eoSIO = EOSIO; eoSIO = EOSIO; eoSIO = EOSIO The reason for this problem is that when creating a token, only the owner of the token is specified as the account EOSIO, while actually sending the token requires calling the issue method.

Next, we will execute the issue method again and send 5000.00 LG for eoSIo account.

** Warm tip: ** EOS wallet will automatically lock if it is not operated for a long time, the interval is about a few minutes, so you need to unlock the wallet again before continuing.

Check the balance again, at this time to the account.

2.5 transfer

./ CLEos push action eosio.token Transfer ‘[” Langge111111 “,” Langge222222 “,”5000.00 LG”,”test Transfer “]’ -p langge111111 Transfer 5000.00 LGS from account langge111111 to account Langge222222.

Check the balance again, arranged on, neat.

** Tips: ** Regardless of whether the issue() or transfer() method is called, the precision of sending tokens must be the same as that of creating (); otherwise, the operation will fail.

Third, summary

So far, we have mastered the whole process of ISSUING EOS coins, isn’t it quite easy, even better than issuing coins on ETH? What do we do next after the coin is handed out? This is a matter of opinion, however, wave brother only one request: circle money is rights protection do not say to see wave brother’s coin tutorial is OK. The next lecture will be about how to do it – hand by hand to implement an EOS smart contract. After all, we are a team that does things……