Skip to content

Commit 9977fa1

Browse files
authored
Merge pull request #270 from Developer-DAO/main
bring `staging` back up to speed with `main`
2 parents 85116c2 + ad747c2 commit 9977fa1

File tree

14 files changed

+1069
-744
lines changed

14 files changed

+1069
-744
lines changed

src/pages/lessons/fundamentals/open_zeppelin.mdx

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
title: Open Zeppelin
3-
description: Overview of Open Zeppelin Contracts.
2+
title: OpenZeppelin
3+
description: Overview of OpenZeppelin Contracts.
44
icons: ["openzeppelin"]
55
author: ["piablo", "7i7o"]
66
---
@@ -9,10 +9,10 @@ import { LessonHeader } from "../../../components/mdx/LessonHeader";
99
import Layout from "../../../components/Layout";
1010

1111
<Layout
12-
title="Open Zeppelin"
13-
description="Overview of Open Zeppelin Contracts."
12+
title="OpenZeppelin"
13+
description="Overview of OpenZeppelin Contracts."
1414
>
15-
<LessonHeader title="Open Zeppelin Smart Contract Concepts" />
15+
<LessonHeader title="OpenZeppelin Smart Contract Concepts" />
1616

1717
We are going to stand on the shoulder of giants and leverage the power of open
1818
source to create our project in a simpler way, while not losing focus on
@@ -24,13 +24,13 @@ a lot of _hoping for the best_ that they wouldn’t get hacked. Since the space
2424
was new, there was a real need for developers who would specialise in rigorously
2525
auditing contracts, since they were holding a lot of value.
2626

27-
The Open Zeppelin team, slowly but surely, began to fill that gap creating a
27+
The OpenZeppelin team, slowly but surely, began to fill that gap creating a
2828
library of contracts that _have_ been rigorously audited and proven to be safe
2929
and robust by all the OG protocols of the Ethereum Network, and many more.
3030

3131
**So what are they and how do they help us?**
3232

33-
By (re)using and these Open Zeppelin libraries, we devs can reduce the amount of
33+
By (re)using and these OpenZeppelin libraries, we devs can reduce the amount of
3434
code we write, and that's a good thing. By reducing the _surface area for attack
3535
vectors_ our contracts are much less likely to be hacked. Since they are often
3636
used as an ecosystem standard, they allow for much easier collaboration among
@@ -44,12 +44,11 @@ at, the field of possibilities opens up exponentially. Exciting times to be
4444
developing!
4545

4646
To make development easier still and take advantage of their offerings, there is
47-
an OpenZeppeilin Wizard which lets you choose your own style of modularity,
47+
an OpenZeppelin Contracts Wizard which lets you choose your own style of modularity,
4848
whether that is to mint, burn, vote, give a range of access permissions, you
49-
name it, it’s there! Note the import of ERC721 in the one below…..I’ll stop
50-
nattering now! See for yourself:
49+
name it, it’s there! Note the import of `ERC721` in the one below.
5150

52-
![Open Zeppelin](/assets/lessons/open_zeppelin/ERC721.Ownable.png)
51+
![OpenZeppelin](/assets/lessons/open_zeppelin/ERC721.Ownable.png)
5352

5453
So when we write a new contract, and we need to **_inherit_** the tried and
5554
tested qualities or characteristics, we simply **_import_** those contracts into

src/pages/lessons/projects/3.mdx

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,13 @@ tiered NFTs and uncover the unique superpowers they possess. By the end of this
9191
tutorial, you will have gained a wealth of knowledge and accomplished the
9292
following steps:
9393

94-
- Setting up the development environment
94+
- Setting up a development environment
9595
- Writing and deploying a Solidity smart contract
9696
- Creating tiered NFTs with varying levels of rarity and attributes
97-
- Write scripts for deployment
98-
- Exploring additional functionalities and possibilities with tiered NFTs ... in
97+
- Writing scripts for deployment
98+
- Exploring additional functionalities and possibilities with tiered NFTs... in
9999
the smart contract!
100-
- Securely manage sensitive environment variables
100+
- Securely managing sensitive environment variables
101101
- Showcasing your tiered NFTs on a public marketplace
102102

103103
### Developer tooling
@@ -111,7 +111,7 @@ These tools include:
111111
- optional decentralized storage accounts
112112
- a web3 wallet for testing
113113
- some test MATIC
114-
- an API key from an RPC provider.
114+
- an API key from an RPC provider
115115

116116
We will guide you through each step, ensuring a fun and comprehensive learning
117117
experience. Let's get started on this exciting journey into the world of tiered
@@ -126,8 +126,8 @@ as our package manager, we'll create a Hardhat project and remove the default
126126
files we don't need.
127127

128128
Let’s first open a console and `cd` into our `d_d_academy` folder, or create it
129-
first if you haven't already. Then create a folder for our TierNFT project and
130-
make sure to `cd` into it too:
129+
first if you haven't already. Then create a folder for our TierNFT project, then
130+
`cd` into it:
131131

132132
```bash
133133
## (OPTIONAL) create a folder for our D_D Academy projects
@@ -149,14 +149,14 @@ npx hardhat
149149
```
150150

151151
<Callout emoji="💡" size="md" variant="info">
152-
The `--save-dev` flag used in the last command, lets the project know it's a
153-
development dependency (not needed in production). You can view what
152+
The `--save-dev` flag used in the last command lets the project know it's a
153+
development dependency, i.e., not needed in production. You can view what
154154
dependencies are needed in the `package.json` file in the root of the project.
155155
</Callout>
156156

157157
Choose `Create a Javascript project` and hardhat will create an example project
158-
for us. It will give us 3 prompts for options. Choosing the defaults is ok for
159-
us. Here's what mine asked me:
158+
for us. It will give us 3 prompts for options. The default options are okay for
159+
our purposes. Here are the prompts at the time of writing:
160160

161161
```less
162162
✔ What do you want to do? · Create a JavaScript project
@@ -184,6 +184,7 @@ npm install --save-dev hardhat @nomicfoundation/hardhat-toolbox
184184
```
185185
186186
</Callout>
187+
187188
In a Hardhat project, some of the default folders are:
188189
189190
- `contracts/` where the source files for your contracts should be.
@@ -205,11 +206,11 @@ We now need to add our last dependency. The OpenZeppelin contracts:
205206
npm install @openzeppelin/contracts
206207
```
207208
208-
<Callout emoji="💡" size="md" variant="info">
209-
Open Zeppelin developed a lot of standard contracts that are super powerful,
210-
widely used and fully tested and audited.
211-
</Callout>
212-
<SideDrawer buttonText="More on Open Zeppelin">
209+
OpenZeppelin is best known for implementing freely available contracts for
210+
various standards. They are powerful and widely used building blocks for Solidity
211+
developers, and come fully tested and audited.
212+
213+
<SideDrawer buttonText="More on OpenZeppelin">
213214
<OpenZeppelin />
214215
</SideDrawer>
215216
@@ -243,8 +244,8 @@ contracts. We'll write our smart contract step by step in five stages:
243244

244245
### Add a Mint Function
245246

246-
Let’s get started by inheriting OpenZeppelin's ERC721.sol like we did last time.
247-
We add a constructor to our contract, which will mirror the one from ERC721.sol.
247+
Let’s get started by inheriting OpenZeppelin's `ERC721` contract like we did last time.
248+
We add a constructor to our contract, which will mirror the one from `ERC721.sol`.
248249
249250
{/* @wolovim optional line?: Unlike in our *Basic NFT* lesson, where we added a third parameter to the constructor for storing the token's baseURI, we will have a different approach this time, which we will come to later. */}
250251

@@ -440,7 +441,7 @@ contract TierNFT is ERC721 {
440441
441442
### Create tokenURI function
442443
443-
When we inherited Open Zeppelin's ERC721, it gave us a function for `tokenURI` where we can store an image, a video, or much more. With the help of this ERC721 contract we have the ability to define **a base path** for creating a
444+
When we inherited OpenZeppelin's `ERC721`, it gave us a function for `tokenURI` where we can store an image, a video, or much more. With the help of this `ERC721` contract we have the ability to define **a base path** for creating a
444445
unique URI which adds the token ID to the end of it.
445446
446447
```solidity
@@ -494,11 +495,11 @@ it into the contract! Nifty, eh?
494495

495496
Let’s stop to break it down and examine it a little.
496497

497-
- Within the `tokenURI` function, you'll notice `override`, an ERC721 function
498+
- Within the `tokenURI` function, you'll notice `override`, an `ERC721` function
498499
we'll use, since we are not creating a separate JSON file to store images or
499500
other services, but creating it right here in the contract.
500-
- We also added `require(_exists(tokenId). "Nonexistent token");` . According to
501-
ERC721 specification, it is required to throw an error if the NFT doesn't
501+
- We also added `require(_exists(tokenId). "Nonexistent token");`. According to
502+
the ERC-721 specification, it is required to throw an error if the NFT doesn't
502503
exist.
503504
- `imageSVG` is a placeholder for our image, and we will deal with it a bit
504505
later.
@@ -755,7 +756,7 @@ We need to find a way to actually withdraw any funds our contract generates, oth
755756
import "@openzeppelin/contracts/access/Ownable.sol";
756757
````
757758
758-
And inherit `Ownable` from the Open Zeppelin contract into our own.
759+
And inherit `Ownable` from the OpenZeppelin contract into our own.
759760
760761
```solidity
761762
// Modify the contract definition, by adding 'Ownable' at the end of the line:
@@ -768,7 +769,7 @@ contract TierNFT is ERC721, Ownable {
768769
```
769770

770771
If your phone is ringing, or someone is knocking at your door right now, ignore
771-
all of it! Let’s get this withdraw function coded in here!!
772+
all of it! Let’s get this withdraw function coded in here!
772773

773774
```solidity
774775
// tokenURI function part of the code...

0 commit comments

Comments
 (0)