1
1
---
2
2
i18n : ' erc20'
3
- title : Your own Token w/ Foundry
3
+ title : Your own Token with Foundry
4
4
description :
5
5
Create and deploy an ERC20 Token (UNI, MKR, DAI, etc.) using the Foundry
6
6
toolkit.
7
7
icons :
8
8
[
9
- ' git' ,
10
9
' solidity' ,
11
10
' foundry' ,
12
11
' openzeppelin' ,
@@ -63,10 +62,7 @@ Some basic functionality that our tokens need to provide are:
63
62
- Approve an amount of tokens from an account to be spent by a third-party
64
63
account
65
64
66
- <!-- Side Drawer -->
67
-
68
- <details>
69
- <summary>More info on the ERC20 Standard</summary>
65
+ <SideDrawer buttonText = " More info on the ERC20 Standard" >
70
66
71
67
To achive the functionality needed for an ERC20 token, the standard requires us
72
68
to implement 9 methods and 2 events.
@@ -94,16 +90,14 @@ event Approval(address indexed _owner, address indexed _spender, uint256 _value)
94
90
You can check the details in the full EIP-20 titled
95
91
[ ERC-20: Token Standard] ( https://eips.ethereum.org/EIPS/eip-20#token )
96
92
97
- </details >
93
+ </SideDrawer >
98
94
99
95
## Has someone created a battle-tested library for the standard?
100
96
101
97
Yes. OpenZeppelin (among others) has created an implementation we can inherit to
102
98
create
103
99
our own tokens easily.
104
100
105
- <!-- Open Zeppelin Side Drawer / Callout -->
106
-
107
101
## Let's code, but first...
108
102
109
103
Before we start hacking away without any structure to follow, what is our
@@ -112,11 +106,11 @@ project's structure and what do we want to achieve?
112
106
Since we are _ BUIDLING_ , i'd like to think of our project, or smart contract,
113
107
the same way as we would _ roughly_ build a house:
114
108
115
- - 1. Foundations
116
- - 2. Structure: Framing, Walls and Roof
117
- - 3. Doors and Windows
118
- - 4. Security
119
- - 5. Final touches
109
+ * 1 - Foundations
110
+ * 2 - Structure: Framing, Walls and Roof
111
+ * 3 - Doors and Windows
112
+ * 4 - Security
113
+ * 5 - Final touches
120
114
121
115
Before we build, we need a stable, leveled surface to place our foundations so
122
116
we can build on top.
@@ -504,10 +498,7 @@ locked (only) for intruders!
504
498
505
499
Congratulations! We have built a fully functioning token!
506
500
507
- <!-- Side Drawer -->
508
-
509
- <details>
510
- <summary>Here's my final Solidity code</summary>
501
+ <SideDrawer buttonText = " Here's my final Solidity code" >
511
502
512
503
Here we have our fully functioning house, I mean... token:
513
504
@@ -542,7 +533,7 @@ contract MyToken is ERC20, AccessControl {
542
533
}
543
534
```
544
535
545
- </details >
536
+ </SideDrawer >
546
537
547
538
Given that we have our house completed, you might want to add a personalized
548
539
detail to it, like a special furniture, wall paint, or make it a smart home.
@@ -787,4 +778,4 @@ be live and kicking.
787
778
788
779
Now that we have built our house and it's has been accepted in the real estate
789
780
register, we can invite our friends by transferring them some MTK, or ** even**
790
- minting them some tokens, even if that affects your tokenomics : wink :
781
+ minting them some tokens, even if that affects your tokenomics 😉
0 commit comments