Welcome to

Creating an ERC20 Token on Ethereum

Example Code Download

You can download the complete example code by clicking here.

Introduction

9 lessons

This Book's Mission

The Ethereum blockchain has been described as the driving force behind the next generation of the internet. The blockchain has built-in smart contract capabilities, a large developer community, and its own native cryptocurrency. In this section we will learn about how the book is structured and get you equipped with the tools you'll need to start writing your own blockchain and smart contracts.

LESSON

What's in This Book?

This section borrows code and code examples from throughout the internet to explain some of the key concepts of blockchain and Solidity development. The code has been commented on, explained, and updated as needed. Special thanks to these authors for helping the blockchain community more approachable through the code and blogs that they created - [StephenGrider](https://github.com/StephenGrider/EthereumCasts), [Savjee](https://www.savjee.be/2017/07/Writing-tiny-blockchain-in-JavaScript/), [Xavier Decuyper](https://www.codementor.io/@savjee/how-to-build-a-blockchain-with-javascript-part-1-k7d373dtk), and [Alibaba Cloud](https://www.alibabacloud.com/blog/build-your-own-blockchain-with-javascript_595314) - thank you for the inspiration!

LESSON

Getting Familiar with Blockchain

4 lessons

Basics of Blockchain

Before we dive into the Ethereum blockchain and start writing smart contracts, let's explore what a blockchain actually is. This chapter will jump into some of the fundamentals and give you a practical understanding of what blockchains are. This section will walk you through a coding exercise that will enable you to write a blockchain from scratch.

LESSON

Writing a Simple Blockchain

This section borrows code from [Savjee](https://www.savjee.be/2017/07/Writing-tiny-blockchain-in-JavaScript/), [Xavier Decuyper](https://www.codementor.io/@savjee/how-to-build-a-blockchain-with-javascript-part-1-k7d373dtk), and [Alibaba Cloud](https://www.alibabacloud.com/blog/build-your-own-blockchain-with-javascript_595314). Thank you for the inspiration!

LESSON

Ethereum Blockchain

4 lessons

Section Introduction

Now that we understand how blockchains work, let's dive into the Ethereum blockchain. There are various concepts from the protocol itself, how accounts work and the blockchain's underlying cryptocurrency which can be tricky to understand. This chapter will explore the Ethereum blockchain in detail and help you get comfortable with some of the basics.

LESSON

What is Ethereum

Proof of work (PoW) is a form of cryptographic zero-knowledge proof in which one party (the prover) proves to others (the verifiers) that a certain amount of computational effort has been expended for some purpose. Verifiers can subsequently confirm this expenditure with minimal effort on their part. [Source](https://en.wikipedia.org/wiki/Proof_of_work)

LESSON

Cryptocurrencies on Ethereum

6 lessons

Token Standards

DAI is a stable coin that is backed by the ether cryptocurrency. It also has a set of smart contracts that allow people to lock their ether and create stablecoins called Dai. The Dai token has a price target of $1 USD and allows people to trade between other cryptocurrencies without worrying about volatility.

LESSON

Writing a Simple Smart Contract

3 lessons

Writing a Simple Smart Contract

Smart contracts can be used to create anything on the Ethereum blockchain. Developers can write software, cryptocurrencies, or anything that their mind imagines. This section will introduce the Solidity programming language and enable the reader to start writing their first smart contract.

LESSON

Remix IDE

The following code was inspired by [StephenGrider](https://github.com/StephenGrider/EthereumCasts). The Inbox.sol is a common smart contract example to identify how to read and write to a blockchain through a smart contract. Minor updates have been made to the code to align with a newer version of Solidity.

LESSON

Diving Deeper Into Smart Contracts

8 lessons

Diving Deeper Into Smart Contracts

Smart contracts can be used to design any type of software, including games. In this chapter, we will continue building on our Solidity skills by writing a smart contract game. Some of the key concepts introduced in this chapter will include payable functions and function modifiers.

LESSON

Play games... win money!

Thank you again to [StephenGrider](https://github.com/StephenGrider/EthereumCasts). Both the Inbox.sol and Lottery.sol contracts were excellent inspirations for the Money Game smart contract. They explain a lot of the key concepts in Solidity programming.

LESSON

Creating a Token Smart Contracts for the Blockchain Part 1

8 lessons

Creating a Token Smart Contracts for the Blockchain Part 1

One of the most popular uses of smart contracts is to create ERC-20 tokens. In this chapter, we will learn about the ERC-20 token standard and start writing some of the smart contracts required to create the ERC-20 token for the Ethereum blockchain.

LESSON

Creating a Token Smart Contracts for the Blockchain Part 2

3 lessons

Creating a Token Smart Contracts for the Blockchain Part 2

In this chapter, we will continue writing the ERC-20 token smart contracts. We will learn about how smart contracts follow object oriented programming by importing contracts we created in the previous chapter into the smart contracts we will be writing in this chapter. In this chapter, we will have the basic ERC-20 token implemented with Solidity.

LESSON

Creating a Token Smart Contracts for the Blockchain Part 3

2 lessons

Creating a Token Smart Contracts for the Blockchain Part 3

Now that we have the basic implementation of the ERC-20 token created, let's create a few smart contracts that we can use to add more functionality to the token smart contract we will be creating. At the end of this chapter, we will be ready to compile and deploy our token smart contract.

LESSON

Compiling and Deploying the ERC-20 Smart Contract

10 lessons

Compiling and Deploying the ERC-20 Smart Contract

Since our main token smart contract has several different smart contracts involved, in this chapter, we will use a tool called Truffle to simplify smart contract compilation and deployment. At the end of this chapter, we will use Truffle and another tool called Infura to send our token smart contract to a public Ethereum test network.

LESSON

Conclusion

Appendix

Changelog