Creating an ERC20 Token on Ethereum
This project introduces the fundamentals of blockchain, what the Ethereum blockchain is, and how to write smart contracts for the Ethereum blockchain.
What You Will Learn
Fundamentals of blockchain
How to write your own blockchain in JavaScript
Learn about the Ethereum blockchain
How to write smart contracts for the Ethereum blockchain
How to use Remix to compile and deploy your Ethereum smart contracts
Introduction to tokens on the blockchain
How to use smart contracts to create tokens on the Ethereum blockchain
How to use Truffle to compile and deploy your token smart contracts
In this course, we'll create an ERC-20 standard compliant token and send it to an public Ethereum test network (which isn't very different from sending it to the main Ethereum network).
Before we jump into that, we will learn what blockchains are, how the Ethereum blockchain works, and the start diving into smart contract development with Solidity.
The examples we'll work with in the book with will start off simple and then we will progressively work our way up to writing all the smart contracts required to create an ERC-20 token on the Ethereum blockchain.
After we write the smart contracts, we'll also get familiar with tools like Remix and Truffle so that we can compile our code and deploy it to the blockchain together.
We will work with local, test, and public blockchains so that you understand the differences between each one.
This course is 9 chapters of detailed content which is designed to give you everything you need to kick off your journey as a smart contract developer.
Along the way, we'll learn the following:
- How blockchains worth through a practical implementation of one with JavaScript
- How the Ethereum blockchain works and what makes it popular (i.e. smart contracts)
- How to write simple Solidity smart contracts
- How to write complex Soldity smart contracts that handle cryptocurrencies
- How to compile and deploy Solidity smart contracts with Remix
- How to write advanced Solidity smart contracts that can be used to create tokens on the Ethereum blockchain
- How to compile and deploy the token smart contracts using popular blockchain development tools like Truffle and Infura
By the end of this course you will understand how blockchains work, what the Ethereum blockchain is and what are the major use cases that are being worked on in that ecosystem. Once you get familiar with that, you will also be equipped with tactical and tangile skills to start writing smart contracts for the Ethereum blockchain.
Course Content
Introduction
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
LESSON
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
LESSON
LESSON
Getting Familiar with Blockchain
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
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
LESSON
Cryptocurrencies on Ethereum
LESSON
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
LESSON
Writing a Simple Smart Contract
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
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
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
LESSON
LESSON
LESSON
Creating a Token Smart Contracts for the Blockchain Part 2
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
LESSON
Creating a Token Smart Contracts for the Blockchain Part 3
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
LESSON
Compiling and Deploying the ERC-20 Smart Contract
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
LESSON
LESSON
Conclusion
Appendix
Changelog
Your Instructors
Frequently Asked Questions
Who is this course for?
This course is for software developers who want to learn how blockchains work and are interested in writing Soldity smart contracts for the Ethereum blockchain.
What if I need help?
You can ask us questions anytime through the community Discord channel, starting a discussion in the course, or by sending us a message.