ERC-20 token standard

(For reference during this section, the standard can be found at the following link: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md)

This is the most common type of token in use today, and the one we will use in our implementation. We'll go through each part of the standard and discuss its purpose. Note that there are certain parts of the interface that must be included to adhere to the standard, and certain parts that are optional.

Using your editor of choice, create a new file in the contracts/ directory of your project, named PacktToken.sol. This file will become our ERC-20 token contract.

At the top of the file, we must first declare our Solidity compiler version, which, at the time of writing, is 0.4.24:

pragma solidity ^0.4.24;

Under this we can declare our contract, as follows:

contract PacktToken {

}

Let's begin by taking a look at the initial parts of the ERC-20 standard.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset