Skip to content

Commit 310cdae

Browse files
committed
feat: update sol pragma/terminal outputs/assets(screenshots) + checkpoint placeholders
2 parents 218e058 + bb28fe9 commit 310cdae

File tree

3 files changed

+25
-26
lines changed

3 files changed

+25
-26
lines changed

src/pages/lessons/projects/6.mdx

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
i18n: "erc20"
33
title: Your own Token with Foundry
44
description:
5-
Create and deploy an ERC20 Token (UNI, MKR, DAI, etc.) using the Foundry
5+
Create and deploy an ERC-20 Token (UNI, MKR, DAI, etc.) using the Foundry
66
toolkit.
77
icons: ["solidity", "foundry", "openzeppelin", "ethereum", "etherscan"]
88
---
@@ -12,7 +12,7 @@ import { LessonHeader } from "../../../components/mdx/LessonHeader";
1212

1313
<Layout
1414
title="Your own Token with Foundry"
15-
description="Create and deploy an ERC20 Token (UNI, MKR, DAI, etc.) using the Foundry
15+
description="Create and deploy an ERC-20 Token (UNI, MKR, DAI, etc.) using the Foundry
1616
toolkit."
1717
>
1818
<LessonHeader
@@ -21,8 +21,8 @@ import { LessonHeader } from "../../../components/mdx/LessonHeader";
2121

2222
## About this lesson
2323

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.
24+
If you're eager to learn how to create your first ERC-20 token, you're in the right place. There are
25+
a multitude of uses for the ERC-20, and we'll introduce you to some of them.
2626
We'll be building a smart contract with a range of developer tools, including the use of Foundry.
2727
If you are new to coding, we suggest that you first complete our _Getting Started with Smart Contract
2828
Development_ project, to get to grips with the basics of Solidity you'll need in
@@ -43,7 +43,7 @@ source of much of our well-being. 🌱
4343

4444
## What are we creating?
4545

46-
By the end of this lesson you will have created your own ERC20 token, and
46+
By the end of this lesson you will have created your own ERC-20 token, and
4747
you will be able to change its properties in any way you need.
4848
But before we go any further, let's check-in and see what building blocks you have already.
4949

@@ -62,7 +62,7 @@ We hope that was a little eye-opener for what's to come!
6262

6363

6464

65-
### Tokens, crypto, coins, ERC20. Is it all the same?
65+
### Tokens, crypto, coins, ERC-20. Is it all the same?
6666

6767
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
6868
Proof of Stake (previously miners in Proof of Work). In Ethereum that native
@@ -72,7 +72,7 @@ Every _other_ token or 'crypto' you see, use or interact with on Ethereum is
7272
basically a smart contract that lets you send these tokens, receive them and
7373
check your balance. Stablecoins like **DAI**, Tether (**USDT**), USD Coin (**USDC**), or tokens from
7474
projects like Uniswap (**UNI**), MakerDAO (**MKR**), Basic Attention Token
75-
(**BAT**) are all smart contracts that follow a standard. The ERC20 standard.
75+
(**BAT**) are all smart contracts that follow a standard. The ERC-20 standard.
7676

7777
### Why would we want to create yet another Token?
7878

@@ -89,12 +89,12 @@ Some basic functionality that our tokens need to provide are:
8989
account
9090

9191

92-
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 a contract needs in order to be called an ERC20 Token
92+
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 a contract needs in order to be called an ERC-20 Token
9393
contract:
9494

95-
<SideDrawer buttonText="More info on the ERC20 Standard">
95+
<SideDrawer buttonText="More info on the ERC-20 Standard">
9696

97-
To achive the functionality needed for an ERC20 token, the standard requires us
97+
To achive the functionality needed for an ERC-20 token, the standard requires us
9898
to implement 9 methods and 2 events.
9999

100100

@@ -146,7 +146,7 @@ mkdir d_d_academy
146146
cd d_d_academy
147147
```
148148

149-
You can use whatever tools you feel confident with, or accustumed to. For this example
149+
You can use whatever tools you feel confident with, or accustomed to. For this example
150150
we will be creating a Foundry project, but feel free to use Hardhat, or Truffle
151151
if that's your favourite flavor. The main focus of Foundry is that you don't
152152
need to use Javascript at all, if you don't want to. All the tools are CLI
@@ -264,7 +264,7 @@ Test result: ok. 2 passed; 0 failed; 0 skipped; finished in 27.32ms
264264
Ran 1 test suites: 2 tests passed, 0 failed, 0 skipped (2 total tests)
265265
```
266266

267-
As we mentioned earlier, we are going to use OpenZeppelin ERC20 implementation.
267+
As we mentioned earlier, we are going to use OpenZeppelin ERC-20 implementation.
268268
To use it, we need to install OpenZeppelin as a dependency in our project. To
269269
install dependencies in Foundry, we use:
270270

@@ -321,7 +321,7 @@ Everything's ready, so let's go ahead and start coding Solidity.
321321

322322
We need our house to have a structure and a floor plan with walls dividing the
323323
rooms. Let's think of that setting as the 9 methods and 2 events that we saw
324-
earlier for our code to be ERC20 compliant.
324+
earlier for our code to be ERC-20 compliant.
325325

326326
It's a great exercise to try and implement them from scratch, and we ecourage
327327
you to do that once you start diving deeper into Solidity. It is also a great
@@ -342,7 +342,7 @@ contract MyToken {
342342
}
343343
```
344344

345-
Once we have that, we can import and inherit OpenZeppelin ERC20:
345+
Once we have that, we can import and inherit OpenZeppelin ERC-20:
346346

347347
```solidity
348348
// SPDX-License-Identifier: MIT
@@ -355,7 +355,7 @@ contract MyToken is ERC20 {
355355
```
356356

357357
Now that we have the full implementation inherited, we still have to specify a
358-
few more things before compiling, because the ERC20 constructor **needs** to
358+
few more things before compiling, because the ERC-20 constructor **needs** to
359359
receive 2 parameters, i.e. the token's name and symbol, or it will raise an error. In
360360
order to do that, we define our constructor and call our inherited
361361
contract's constructor:
@@ -440,13 +440,13 @@ contract MyToken is ERC20 {
440440
When we define our `mint` function, we decide who will be the receiver of said
441441
new tokens. For the `burn` function on the other hand, we are only letting holders burn
442442
their **own** tokens by using `msg.sender` as the address to call the internal
443-
`_burn` function in the OpenZeppelin ERC20 implementation.
443+
`_burn` function in the OpenZeppelin ERC-20 implementation.
444444

445445
In a special case where someone approves operating on an amount of *their* tokens,
446446
we create a `burnFrom` function to be able to burn within that approved
447447
allowance from the other address. If we try to burn, or transfer, more than the
448-
approved allowance, the ERC20 implementation from OZ will revert the transaction
449-
because that's required by the ERC20 standard.
448+
approved allowance, the ERC-20 implementation from OZ will revert the transaction
449+
because that's required by the ERC-20 standard.
450450

451451
We have now created doors to our house, but we haven't put locks in them!
452452

@@ -579,7 +579,7 @@ A few examples could be:
579579

580580
- A token that accrues or drips more tokens, depending on how long have you been
581581
hodling. Tip: you can override functions like `balanceOf` and
582-
`_beforeTokenTransfer` / `_afterTokenTransfer` from the inherited ERC20
582+
`_beforeTokenTransfer` / `_afterTokenTransfer` from the inherited ERC-20
583583
- A token that can only be transferred or received if you hold another specific
584584
token, i.e. an NFT from a specific collection
585585
- A token that loses the balance if you don't transact or transfer it regularly

src/utils/questions/lesson-6/1-intro/Q2.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"answer": "ERC-20"
1010
},
1111
{
12-
"answer": "ERC-1155"
12+
"answer": "ERC-1559"
1313
},
1414
{
1515
"answer": "ERC-10"

src/utils/questions/lesson-6/1-intro/Q3.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,15 @@
22
"question": "What are some common use cases for creating ERC-20 tokens?",
33
"options": [
44
{
5-
"answer": "Supporting a project"
6-
},
7-
{
8-
"answer": "Governance for DAOs"
5+
"answer": "Supporting a project",
6+
"correct": true
97
},
108
{
11-
"answer": "Learning and experimentation"
9+
"answer": "Governance for DAOs",
10+
"correct": true
1211
},
1312
{
14-
"answer": "All of the above",
13+
"answer": "Learning and experimentation",
1514
"correct": true
1615
}
1716
]

0 commit comments

Comments
 (0)