What is an EOS token
Unlike Ethereum, on EOS, the token is included in the standard smart contract package. If Ethereum has ERC-20 tokens, then on EOS smart contracts the token standard is called eosio.token. With this smart contract, you can create your tokens, set their name and the maximum issue volume, enter some amount into circulation and transfer from account to account. EOS tokens on the EOS blockchain are issued in accordance with the same contract.
The “url” parameter shows which node you are connected to. Information about API endpoints can be found on the official website of the project.
Cleos is a command line utility for interacting with EOS nodes (nodeos) in the REST API. In order to interact with the EOS blockchain, you need to send commands to cleos. You can install cleos using Docker, AWS Image, or compatible code. As a result, cleos will be installed on your terminal.
“Wallets are client programs that store keys that are associated (or unrelated) with rights to one or more accounts. Ideally, a wallet has a closed (encrypted) and open (decrypted) state protected by a password with high entropy. The EOS repository is equipped with the cleos command line interface, which associates nodes with the keosd component »
The password for this wallet will need to be stored in a safe place, because if you lose it, you can never restore the keys that are in this wallet. Now you need to create two key pairs for both types of rights: property rights and activity rights. After that, we import them into our wallet.
“In order to do something on the EOS blockchain, you need to have an account in it. An account is a human-readable name that is stored on the blockchain. It may belong to one person or group of persons depending on the setting of rights.
An account is required to complete any transactions on the blockchain, ”from the“ Accounts and Rights ”section. In essence, an account is a set of public and private keys associated with a specific name. Keys are stored in the wallet. Accounts are stored on the EOS blockchain. If you already have an account with a certain amount of EOS, then to create a local account, you simply type in the command line cleos create account, but You won’t be able to create an account on EOS Mainnet.
To create an account on Mainnet, you will need the help of someone who already has such an account, and this is not free. Moreover, you can only create accounts with 12 characters in length, using lowercase letters from a to z and numbers from 1 to 5. However, these are very strict restrictions.
To create shorter accounts you will have to participate in auctions. Since EOS accounts can be resold, the best names will be quickly captured by computer squatters. With all this in mind, and to save time and money, we will now open an account in Testnet, not for Mainnet, for educational purposes.
The EOS Jungle Testnet is almost an exact copy of Mainnet. Go to jungle.cryptolions.io and click on the Create Account link. You will be asked to enter an account name and two keys. Use the two public keys created earlier. Confirm account creation.
Now we need to buy some RAM to publish our contract. The EOS blockchain has a special platform where memory is sold at a market price, taking into account supply and demand. For people with money, this is a great opportunity to capitalize on speculation.
Transfer multiple EOS tokens to your account using the EOS Jungle Testnet Faucet faucet.
After that, type cleos system buyram on the command line to buy RAM for EOS tokens.
First of all, we need to upload our contract to the blockchain. To do this, type cleos set contract on the command line and set the following parameters:
- Account – the account to which the contract relates.
- Contract-dir – contract directory.
- Wast-file – a WAST or WASM file containing a text version of the contract.
- Abi-file – ABI description of the contract.
As you can see, the wast and abi files must be specified. If you create a contract using the source code, you can find them in the ./build/contracts/eosio.token/ folder. For our convenience, both of these files are stored here – wast / abi. At the set contract command line, enter the name of our account. Since our wast / abi files are named the same as the directory, these parameters can be omitted.
Finally, we can create and issue our own token. To do this, we need to perform the create and issue actions in the push action command, specifying the following parameters:
- Contract – the account to which the contract is attached.
- Action – the action to be performed under this contract.
- Data – contract terms.
Let’s create and put into circulation YLV tokens.
We went all the way: from installing cleos and understanding how the eosio.token standard works, to issuing our own tokens and transferring them to other accounts. We achieved all this with the help of the EOS Jungle Testnet, which is almost no different from the EOS Mainnet. In Mainnet, everything will work in exactly the same way, only you will need to use other API endpoints and pay for accounts and RAM.