You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/pages/lessons/projects/6.mdx
+40-33Lines changed: 40 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,8 @@ import { LessonHeader } from "../../../components/mdx/LessonHeader";
21
21
22
22
## About this lesson
23
23
24
-
If you're eager to learn how to create your first ERC20 token, you're in the right place.
24
+
If you're eager to learn how to create your first ERC20 token, you're in the right place. There are
25
+
a multitude of uses for the ERC20, and we'll introduce you to some of them.
25
26
We'll be building a smart contract with a range of developer tools, including the use of Foundry.
26
27
If you are new to coding, we suggest that you first complete our _Getting Started with Smart Contract
27
28
Development_ project, to get to grips with the basics of Solidity you'll need in
@@ -41,41 +42,51 @@ source of much of our well-being. 🌱
41
42
42
43
## What are we creating?
43
44
44
-
At the end of this lesson you will be able to create your own ERC20 tokens, and
45
-
you will be able to change its properties in any way you need.
45
+
By the end of this lesson you will have created your own ERC20 token, and
46
+
you will be able to change its properties in any way you need.
47
+
But before we go any further, let's check-in and see what building blocks you have already.
46
48
47
-
## Tokens, Crypto, Coins, ERC20, is it all the same?
49
+
<SideDrawer
50
+
buttonText="Warm-up Questions"
51
+
title="Check out Your Previous Knowledge"
52
+
>
53
+
<Questionquestion="lesson-6/1-intro/Q1" />
54
+
<Questionquestion="lesson-6/1-intro/Q2" />
55
+
<Questionquestion="lesson-6/1-intro/Q3" />
56
+
<Questionquestion="lesson-6/1-intro/Q4" />
57
+
<Questionquestion="lesson-6/1-intro/Q5" />
58
+
</SideDrawer>
48
59
49
-
Let's begin with some context, so we all speak the same language.
60
+
We hope that was a little eye-opener for what's to come!
50
61
51
-
The Ethereum blockchain (and most EVM-compatible blockchains) has a native token
52
-
that is used to pay for transaction costs, and also to reward validators in
53
-
Proof of Stake, or previously miners in Proof of Work. In Ethereum that native
54
-
token is Ether (or ETH), in Polygon its MATIC, and so on.
55
62
56
-
Let's focus on the Ethereum blockchain for the sake of clarity.
57
63
58
-
Every _other_ Token or "Crypto" you see, use or interact with in Ethereum is
59
-
basically a smart contract that lets you send these tokens, receive them and
60
-
check your balance.
64
+
### Tokens, Crypto, Coins, ERC20, is it all the same?
61
65
62
-
Stablecoins like **DAI**, Tether (**USDT**), USD Coin (**USDC**) or tokens from
66
+
Let's begin with some context, so we all speak the same language. The Ethereum blockchain, and most EVM-compatible blockchains, have a native token that is used to pay for transaction costs, and also to reward validators in
67
+
Proof of Stake (previously miners in Proof of Work). In Ethereum that native
68
+
token is Ether (or ETH), in Polygon its MATIC, and so on. But let's focus on the Ethereum blockchain for the sake of clarity.
69
+
70
+
Every _other_ Token or "Crypto" you see, use or interact with on Ethereum is
71
+
basically a smart contract that lets you send these tokens, receive them and
72
+
check your balance. Stablecoins like **DAI**, Tether (**USDT**), USD Coin (**USDC**) or tokens from
63
73
projects like Uniswap (**UNI**), MakerDAO (**MKR**), Basic Attention Token
64
74
(**BAT**) are all smart contracts that follow a standard, the ERC20 standard.
65
75
66
-
## Why do we want to create yet another Token?
76
+
###Why would we want to create yet another Token?
67
77
68
-
A lot of reasons, but here are some:
78
+
{/*A lot of reasons, but here are some:
69
79
70
-
- We are learning and we want to know how the ecosystem works
71
-
- We have a project or DAO that needs some means of governance
72
-
- We have a community that wants to be a part, take some ownership or support
80
+
- We are learning, and we want to know how the ecosystem works
81
+
- We have a project, or DAO that needs some means of governance
82
+
- We have a community that wants to be a part of, take some ownership of, or support
73
83
our project
74
84
- We need a token with extra functionality that doesn't exist yet
75
85
76
-
The possibilities are endless.
86
+
The possibilities are endless.*/}
87
+
A lot of reasons, but here are some. The most fundamental one is that we are learning, and want to know how the ecosystem works. Or we have a project, or DAO that needs some means of governance, or a community that wants take some ownership, be part of, or simply support our project. Maybe we need a token with extra functionality that doesn't even exist yet. The possibilities are endless!
77
88
78
-
## What do we need to do with our Tokens?
89
+
###What do we need to do with our Tokens?
79
90
80
91
Some basic functionality that our tokens need to provide are:
81
92
@@ -85,13 +96,16 @@ Some basic functionality that our tokens need to provide are:
85
96
- Approve an amount of tokens from an account to be spent by a third-party
86
97
account
87
98
99
+
{/**@7i7o it might be cool to have these sentences to open a paragraph before the side-drawer, instead of on line 132
100
+
Although I don't know if you want to 'associate' OZ with the actual functions and events you lay out in the side-drawer. */}
101
+
Has someone created a battle-tested library for the standard? Yes. OpenZeppelin, among others, has created an implementation we can inherit to create our own tokens easily. Here is a quick overview of what {/*maybe another word choice for 'what' e.g. 'functionality' or 'the components'*/} a contract needs in order to be called an ERC20 Token
102
+
contract:
103
+
88
104
<SideDrawerbuttonText="More info on the ERC20 Standard">
89
105
90
106
To achive the functionality needed for an ERC20 token, the standard requires us
91
107
to implement 9 methods and 2 events.
92
108
93
-
Here is a quick overview of what our contracts needs to be called an ERC20 Token
94
-
contract:
95
109
96
110
```solidity
97
111
// Methods:
@@ -115,17 +129,12 @@ You can check the details in the full EIP-20 titled
115
129
116
130
</SideDrawer>
117
131
118
-
## Has someone created a battle-tested library for the standard?
119
-
120
-
Yes. OpenZeppelin (among others) has created an implementation we can inherit to
121
-
create our own tokens easily.
132
+
{/*Has someone created a battle-tested library for the standard? Yes. OpenZeppelin, among others, has created an implementation we can inherit to create our own tokens easily.*/}
122
133
123
134
## Let's code, but first...
124
135
125
136
Before we start hacking away without any structure to follow, what is our
126
-
project's structure and what do we want to achieve?
127
-
128
-
Since we are _BUIDLING_, i'd like to think of our project, or smart contract,
137
+
project's structure and what do we want to achieve? Since we are _BUIDLING_, I'd like to think of our project, or smart contract,
129
138
the same way as we would _roughly_ build a house:
130
139
131
140
* 1 - Foundations
@@ -135,9 +144,7 @@ the same way as we would _roughly_ build a house:
135
144
* 5 - Final touches
136
145
137
146
Before we build, we need a stable, leveled surface to place our foundations so
138
-
we can build on top.
139
-
140
-
The tools for coding and the project's file/folder structure will be our
147
+
we can build on top. The tools for coding and the project's file/folder structure will be our
0 commit comments