Skip to content

Commit

Permalink
chore: style linting lesson 3
Browse files Browse the repository at this point in the history
  • Loading branch information
wolovim committed Nov 20, 2023
1 parent bb28fe9 commit e009c33
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 51 deletions.
21 changes: 10 additions & 11 deletions src/pages/lessons/fundamentals/open_zeppelin.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Open Zeppelin
description: Overview of Open Zeppelin Contracts.
title: OpenZeppelin
description: Overview of OpenZeppelin Contracts.
icons: ["openzeppelin"]
author: ["piablo", "7i7o"]
---
Expand All @@ -9,10 +9,10 @@ import { LessonHeader } from "../../../components/mdx/LessonHeader";
import Layout from "../../../components/Layout";

<Layout
title="Open Zeppelin"
description="Overview of Open Zeppelin Contracts."
title="OpenZeppelin"
description="Overview of OpenZeppelin Contracts."
>
<LessonHeader title="Open Zeppelin Smart Contract Concepts" />
<LessonHeader title="OpenZeppelin Smart Contract Concepts" />

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

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

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

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

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

![Open Zeppelin](/assets/lessons/open_zeppelin/ERC721.Ownable.png)
![OpenZeppelin](/assets/lessons/open_zeppelin/ERC721.Ownable.png)

So when we write a new contract, and we need to **_inherit_** the tried and
tested qualities or characteristics, we simply **_import_** those contracts into
Expand Down
41 changes: 21 additions & 20 deletions src/pages/lessons/projects/3.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,14 @@ tiered NFTs and uncover the unique superpowers they possess. By the end of this
tutorial, you will have gained a wealth of knowledge and accomplished the
following steps:

- Setting up the development environment
- Writing and deploying a Solidity smart contract
- Creating tiered NFTs with varying levels of rarity and attributes
- Write scripts for deployment
- Exploring additional functionalities and possibilities with tiered NFTs ... in
- Set up a development environment
- Write and deploy a Solidity smart contract
- Create tiered NFTs with varying levels of rarity and attributes
- Write a script for deployment
- Explore additional functionalities and possibilities with tiered NFTs... in
the smart contract!
- Securely manage sensitive environment variables
- Showcasing your tiered NFTs on a public marketplace
- Showcase your tiered NFTs on a public marketplace

### Developer tooling

Expand All @@ -111,7 +111,7 @@ These tools include:
- optional decentralized storage accounts
- a web3 wallet for testing
- some test MATIC
- an API key from an RPC provider.
- an API key from an RPC provider

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

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

```bash
## (OPTIONAL) create a folder for our D_D Academy projects
Expand All @@ -149,14 +149,14 @@ npx hardhat
```

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

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

```less
✔ What do you want to do? · Create a JavaScript project
Expand Down Expand Up @@ -184,6 +184,7 @@ npm install --save-dev hardhat @nomicfoundation/hardhat-toolbox
```
</Callout>
In a Hardhat project, some of the default folders are:
- `contracts/` where the source files for your contracts should be.
Expand All @@ -205,11 +206,11 @@ We now need to add our last dependency. The OpenZeppelin contracts:
npm install @openzeppelin/contracts
```
<Callout emoji="💡" size="md" variant="info">
Open Zeppelin developed a lot of standard contracts that are super powerful,
widely used and fully tested and audited.
</Callout>
<SideDrawer buttonText="More on Open Zeppelin">
OpenZeppelin is best known for implementing freely available contracts for
various standards. They are powerful and widely used building blocks for Solidity
developers, and come fully tested and audited.
<SideDrawer buttonText="More on OpenZeppelin">
<OpenZeppelin />
</SideDrawer>
Expand Down Expand Up @@ -440,7 +441,7 @@ contract TierNFT is ERC721 {
### Create tokenURI function
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
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
unique URI which adds the token ID to the end of it.
```solidity
Expand Down Expand Up @@ -755,7 +756,7 @@ We need to find a way to actually withdraw any funds our contract generates, oth
import "@openzeppelin/contracts/access/Ownable.sol";
````
And inherit `Ownable` from the Open Zeppelin contract into our own.
And inherit `Ownable` from the OpenZeppelin contract into our own.
```solidity
// Modify the contract definition, by adding 'Ownable' at the end of the line:
Expand Down
13 changes: 6 additions & 7 deletions src/utils/questions/lesson-3/1-intro/Q1.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
{
"question": "Which steps are needed to code a basic smart contract for deployment?",
"question": "Which steps are needed to write a basic smart contract?",
"options": [
{
"answer": "Create a smart contract using a code editor."
},
{
"answer": "Create a project template."
"answer": "Use a code editor to write a smart contract",
"correct": true
},
{
"answer": "Install dependencies."
"answer": "Create a project template",
"correct": true
},
{
"answer": "All of the above.",
"answer": "Install dependencies",
"correct": true
}
]
Expand Down
8 changes: 4 additions & 4 deletions src/utils/questions/lesson-3/1-intro/Q2.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
"question": "What does the term 'gas' refer to in the context of Ethereum?",
"options": [
{
"answer": "Digital currency used for transactions."
"answer": "Digital currency used for transactions"
},
{
"answer": "Unit of measure for computational effort.",
"answer": "Unit of measure for computational effort",
"correct": true
},
{
"answer": "A poisonous fossil fuel."
"answer": "A poisonous fossil fuel"
},
{
"answer": "Encryption algorithm used in smart contracts."
"answer": "Encryption algorithm used in smart contracts"
}
]
}
4 changes: 2 additions & 2 deletions src/utils/questions/lesson-3/1-intro/Q3.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
"question": "Which of the following describes a URI?",
"options": [
{
"answer": "A Uniform Resource Identifier.",
"answer": "A Uniform Resource Identifier",
"correct": true
},
{
"answer": "A web address that points to content and information.",
"answer": "A web address that points to content and information",
"correct": true
}
]
Expand Down
8 changes: 4 additions & 4 deletions src/utils/questions/lesson-3/1-intro/Q4.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
"question": "Which of the following go into `hardhat.config.js` in an NFT project?",
"options": [
{
"answer": "NFT_NAME."
"answer": "NFT_NAME"
},
{
"answer": "RPC_API_KEY.",
"answer": "RPC_API_KEY",
"correct": true
},
{
"answer": "tokenURI."
"answer": "tokenURI"
},
{
"answer": "All of the above."
"answer": "All of the above"
}
]
}
6 changes: 3 additions & 3 deletions src/utils/questions/lesson-3/1-intro/Q5.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"question": "Which answer is 'truthier'?",
"question": "Which answer is true of NFT data storage?",
"options": [
{
"answer": "We need a `.json` file to store our NFT data."
"answer": "NFT data must be stored in a `.json` file."
},
{
"answer": "We can store NFT data in a smart contract.",
"answer": "NFT data can be stored in a smart contract.",
"correct": true
}
]
Expand Down

0 comments on commit e009c33

Please sign in to comment.