Skip to content

Commit 1619cc1

Browse files
committed
Add outro, change references from Goerli to Sepolia
1 parent 129022e commit 1619cc1

File tree

4 files changed

+54
-63
lines changed

4 files changed

+54
-63
lines changed

pages/lessons/projects/2.mdx

Lines changed: 52 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ accounts as we progress from one development environment to the next. We'll be u
9595
- an API key from an RPC provider
9696
- optional - an account for that provider
9797

98-
Lots of fun! And no worries, we'll give you all those steps in due course.
98+
Lots of fun to come! And no worries, we'll give you all those steps in due course.
9999

100100

101101
## Set up your environment
@@ -118,8 +118,8 @@ comfortable with another package manager, feel free to use it.
118118
<InstallNpm/>
119119
</SideDrawer>
120120

121-
Let’s create and `cd` into our D_D Academy projects folder, and create a
122-
folder for our NFT project:
121+
Let’s create and `cd` into a D_D Academy projects folder, and create a
122+
folder for our NFT project and `cd` into that too:
123123

124124
```bash
125125
# create a folder for all our D_D Academy projects
@@ -145,27 +145,13 @@ dependencies are needed in the `package.json` file in the root of the project.
145145

146146
## Create your project
147147

148-
Once we have our environment set up, we need to create a project.
148+
Once we have our environment set up, we need to set up a project.
149149

150150
![you.shall.not.pass.jpeg](/assets/lessons/2/img_3.jpeg)
151151

152-
We run the `npx hardhat` command to create a basic project:
152+
We run the `npx hardhat` command to generate a basic project:
153153

154-
<SideDrawer buttonText="What on Earth is Hardhat?">
155-
Since we’re flying to Jupiter, we need safety apparel! And that’s what Hardhat is. It provides a blockchain for us along the way, where we can have lots of ETH in our wallet, and we can waste as much as we want, and get hit on the head with
156-
asteroids without getting any scars.
157-
158-
Hardhat lets us do all the things we did in Remix, but instead of clicking
159-
‘Deploy’ and ‘Compile’ buttons, or reading our logs from inside the browser
160-
IDE, we will be writing our commands in the console and debugging our errors
161-
from a code editor on our ‘local’ computer.
162154

163-
Hardhat is simply a set of tools that includes a local mini blockchain that
164-
can run on your machine.
165-
</SideDrawer>
166-
167-
After you enter your `npx hardhat` command, what information can you see? What
168-
are those ten lines and what is?
169155

170156
```less
171157
// 888 888 888 888 888
@@ -186,6 +172,19 @@ are those ten lines and what is?
186172
Quit
187173
```
188174

175+
<SideDrawer buttonText="What on Earth is Hardhat?">
176+
Since we’re flying to Jupiter, we need safety apparel! And that’s what Hardhat is. It provides a blockchain for us along the way, where we can have lots of ETH in our wallet, and we can waste as much as we want, and get hit on the head with
177+
asteroids without getting any scars.
178+
179+
Hardhat lets us do all the things we did in Remix, but instead of clicking
180+
‘Deploy’ and ‘Compile’ buttons, or reading our logs from inside the browser
181+
IDE, we will be writing our commands in the console and debugging our errors
182+
from a code editor on our ‘local’ computer.
183+
184+
Hardhat is simply a set of tools that includes a local mini blockchain that
185+
can run on your machine.
186+
</SideDrawer>
187+
189188
We choose `Create a Javascript project` and Hardhat will create an example
190189
project for us. It will give us 3 prompts for options. Choosing the defaults is
191190
ok for us. Here's what mine asked me:
@@ -214,7 +213,7 @@ npm install --save-dev hardhat @nomicfoundation/hardhat-toolbox @nomicfoundation
214213
```
215214
</Callout>
216215

217-
- After these selections, you can expect to see some messages regarding vulnerabilities, npm warnings for deprecated files and prompts to audit. No need to worry, this is to be expected in development, and we all got a shock the first time too! However, if you get messages that say 'ERROR', then jump into the forum and ask for guidance.
216+
- After these selections, you can expect to see some messages regarding vulnerabilities, npm warnings for deprecated files and prompts to audit. No need to worry or take action, this is to be expected in development, and we all got a shock the first time too! However, if you get messages that say 'ERROR', then jump into the forum and ask for guidance.
218217

219218
In a Hardhat project, the default folders are:
220219

@@ -370,8 +369,8 @@ contract ProjectNFT is ERC721 {
370369
}
371370
```
372371

373-
We made our totalSupply variable private and it will store exactly how many NFTs
374-
have been minted so far. In the next step we will use this variable to identify
372+
We made our totalSupply variable private and it will store the exact number of NFTs
373+
that have been minted. In the next step we will use this variable to identify
375374
each new NFT that’s created.
376375

377376

@@ -432,15 +431,12 @@ just yet.
432431
![cmon.do.something.nft.jpeg](/assets/lessons/2/img_8.jpeg)
433432

434433
We are missing the last piece of the puzzle. For now they are just a numbered
435-
proof of ownership from our contract, stored on the blockchain. So here is where
436-
the magic starts.
437-
438-
We can make our NFT collection about anything we want: text, images, music,
434+
proof of ownership from our contract stored on the blockchain. So here is where
435+
the magic starts. We can make our NFT collection about anything we want: text, images, music,
439436
videos, anything you want. But how?
440437

441-
The `ERC721` implementation we inherited has a function to store a `tokenURI`.
442-
443-
What is this black magic? This is just a unique URI, a web address if you prefer,
438+
The `ERC721` implementation we inherited has a function to store a `tokenURI`. But what
439+
is this strange magic? This is just a unique URI (Uniform Resource Identifier), a web address if you prefer,
444440
that points to something on the internet, whatever we want it to be. e.g. a video,
445441
an image.
446442

@@ -449,7 +445,7 @@ IDs of the NFTs. It gives a way to define a base path for a web address and just
449445
attaches the token ID at the end of it. So, if you wanted, you could upload your
450446
NFT info (we'll look at how we store that later) to any web address, say
451447
`www.my-site.com/my-nft-collection`
452-
and number each info file with the corresponding ID (1, 2, 3, 4…).
448+
and number each file with the corresponding ID (1, 2, 3, 4…).
453449

454450
We are not going to limit the size of our collection for this project.
455451

@@ -573,7 +569,7 @@ collection to have as NFTs. Each of them will have as a minimum a “name”,
573569
As you see in the example, under “image” we have a link to a file on the web,
574570
which we will refer to as Web2. So, if this website were to go down, our NFTs
575571
would lose their images, showing us the limitations of the centralization of
576-
web2 data storage.
572+
Web2 data storage.
577573

578574
![nft.pepe.jpeg](/assets/lessons/2/img_11.jpeg)
579575

@@ -602,17 +598,17 @@ computer that downloads a file using IPFS, also shares that file with others for
602598
a limited amount of time. You can make content available more permanently by
603599
*pinning* it, until you decide to *unpin* it.
604600

605-
To ease our path into the IPFS network, services for *pinning* content (e.g.
606-
Pinata) offer paid and free tiers that ensure that the files we upload are
601+
To ease our path into the IPFS network, services for *pinning* content, e.g.
602+
Pinata, offer paid and free tiers that ensure that the files we upload are
607603
*pinned* in IPFS.
608604

609-
So, go ahead and grab yourself a free pinata account at this
605+
So, go ahead and grab yourself a free Pinata account at this
610606
[link](https://www.pinata.cloud/).
611607

612608
One of the peculiarities of IPFS is that files, or better called ‘content’, are
613-
not referenced by name but by its 'CID'. It stands for Content IDentifier, and
609+
not referenced by name but by its CID. It stands for Content IDentifier, and
614610
that's because that jumble of letters is a hash of the content. Instead of being
615-
location-based, IPFS addresses a file by *what's in it*, i.e. its *content*. The
611+
location-based, IPFS addresses a file by *what's in it*, i.e. its content. The
616612
content identifier is a *unique cryptographic hash* of the content at that
617613
address.
618614

@@ -638,7 +634,7 @@ and
638634
Pay special attention to the json files folder, when you add `/1` to the end of
639635
the link, it opens the 1st json file, and does the same for the rest of the IDs.
640636
To achieve this, you need to add the json files all at the same time, as a
641-
**folder** into pinata, and then you get a CID for the folder, which you can
637+
**folder** into Pinata, and then you get a CID for the folder, which you can
642638
reference with the filenames at the end for each file.
643639

644640
Remember `_baseURI` function in our solidity contract? The one that was used to
@@ -703,11 +699,11 @@ const hre = require('hardhat')
703699
// We define a variable with the name of our contract
704700
const CONTRACT_NAME = 'ProjectNFT'
705701

706-
// The 3 parameters for our smart contract's constructor (CHANGE THIS!!!)
702+
// The 3 parameters for our smart contract's constructor (CHANGE THESE to your own NFT name and description)
707703
const NFT_NAME = 'Academy'
708704
const NFT_DESCRIPTION = 'D_D Academy Basic NFT Collection'
709705

710-
// Change this if you created your own images/JSONs:
706+
// CHANGE THIS if you created your own images/JSONs:
711707
const NFT_BASE_URI = 'https://gateway.pinata.cloud/ipfs/QmSCNdaA5JBT5D6V5FbivfZonKjdsMPeZeTyTWzq1D3yrJ/'
712708

713709
// We define a function with all we want Hardhat to run
@@ -767,7 +763,7 @@ This is the output i got:
767763

768764
![deploy.output.png](/assets/lessons/2/img_16.png)
769765

770-
Notice that ‘Compiled 10 Solidity files successfully’? But we only wrote 1
766+
Notice that ‘Compiled 11 Solidity files successfully’? But we only wrote 1
771767
Solidity file!
772768

773769
Well, we are actually inheriting some of OpenZeppelin's implementations, so the
@@ -799,7 +795,6 @@ placeholder before in our deploy.js file:
799795
// We print out the tokenURI
800796
console.log(`NFT 1 tokenURI: ${tokenURI}`)
801797

802-
}
803798
```
804799

805800
Let's run the script again and see what it tells us! Here's my output:
@@ -843,8 +838,8 @@ In order to deploy to a real testnet we'll need:
843838
- Some Sepolia-ETH. You can ask for some in a faucet, it's free, although
844839
some are faster than others! Options: [#1](https://faucet.sepolia.dev/),
845840
[#2](https://www.infura.io/faucet/sepolia), [#3](https://faucet.quicknode.com/ethereum/sepolia)
846-
- An API Key from an Ethereum RPC Node Provider e.g. [Infura](https://app.infura.io/), or
847-
[Ankr](https://www.ankr.com/rpc/eth/eth_sepolia/).
841+
- An API Key from an Ethereum RPC Node Provider e.g. [Infura](https://app.infura.io/),
842+
[Ankr](https://www.ankr.com/rpc/eth/eth_sepolia/), or [Alchemy](https://dashboard.alchemy.com/)
848843
- A minor change in the Hardhat configuration file
849844

850845
First and foremost, **security**. We are exploring new grounds, experimenting,
@@ -866,18 +861,14 @@ To be able to deploy our contract, we are going to use that private key, that's
866861
we recommend, yet again, to use a separate wallet containing only test tokens for developing.
867862

868863
We need to inform Hardhat which node we are using to connect to the
869-
blockchain/network.
870-
871-
Once you have your wallet funded with test ETH, you'll need sign up for one of the
864+
blockchain network. Once you have your wallet funded with test ETH, you'll need sign up for one of the
872865
Ethereum RPC Node Providers. Alchemy and Infura are the most used. And Ankr has a 'community endpoint' which doesn't require a dedicated sign up, to list a few options.
873866

874-
Once you sign up, you'll be asked to create an App, be sure to select the
875-
Sepolia network there.
876-
877-
When the app is created, you'll see a "View Key" button, or similar. Press it
867+
After signing up, you'll be asked to create an App. Be sure to select the
868+
Sepolia network there. When the app is created, you'll see a 'View Key' button, or similar. Press it
878869
and copy the HTTP link, we'll use it in our next step.
879870

880-
Once you have funded your wallet with fake ETH, we can go ahead and change our
871+
With our wallet funded fake ETH, we can go ahead and change our
881872
Hardhat configuration file. Go into your project's main directory and open
882873
`hardhat.config.js`.
883874

@@ -917,7 +908,7 @@ password (the one you use to open it, NOT your seed phrase). It also shows you a
917908
notice so you know that you are entering the danger zone. Confirm and you'll be
918909
able to copy your private key. Paste it in to our `hardhat.config.js`
919910

920-
Please, if you are already a developer and you plan to use git to store your
911+
Please, if you are already a developer and you plan to use Git to store your
921912
project, don't store your `hardhat.config.js` on it, because you will have your
922913
private key there.
923914

@@ -930,11 +921,11 @@ private key there.
930921
</SideDrawer>
931922
<br/>
932923

933-
Ok. We are ready, let's deploy to the Goerli testnet!
924+
Ok. We are ready, let's deploy to the Sepolia testnet!
934925

935926
Now we need to run our deploy.js script and the deployment is going to cost us
936-
some eth (test eth, don't worry) from our wallet, since we are storing
937-
information (i.e. our contract) in the blockchain. We only have to add 2 words
927+
some ETH - test ETH, don't worry - from our wallet, since we are storing
928+
information, i.e. our contract on the blockchain. We only have to add 2 words
938929
to the command to let Hardhat know we are doing the real thing now. Remember
939930
our deploy script will create our contract AND mint one NFT. If you only want to
940931
deploy, delete all the lines we added to test the minting.
@@ -952,29 +943,29 @@ This is the output i got in my console:
952943
Remember we are deploying to the actual blockchain, a testnet, but a blockchain
953944
nonetheless.
954945

955-
Now that we have run the deploy script, delete the private key and the RPC API
956-
key from `hardhat.config.js` to minimize the handling of the wallet. In the next
946+
Now that we have run the deploy script, **delete the private key and the RPC API
947+
key from `hardhat.config.js`** to minimize the handling of the wallet. In the next
957948
project we will learn about tools to collaborate and store your projects online.
958949

959950
So now we can go and explore the chain to find your contract (and mine too!).
960-
Just go to [Goerli Etherscan](https://goerli.etherscan.io/) (or
951+
Just go to [Sepolia Etherscan](https://sepolia.etherscan.io/) (or
961952
[Opensea](https://testnets.opensea.io/)) and search for the address of our
962953
deployed contract.
963954

964-
You can view my links as an example on [Etherscan](https://goerli.etherscan.io/address/0x166A82F7cD8F7BA9D8C10b2cc792C1A20084564d)
955+
You can view my links as an example on [Sepolia Etherscan](https://sepolia.etherscan.io/address/0xc2c2Ae7Ba222384352ED022D8D1b53Ee7edc52AB)
965956
and [Opensea](https://testnets.opensea.io/collection/d-d-academy)
966957

967958
![opensea.png](/assets/lessons/2/img_20.png)
968959

969960
Wow, you have created your own NFT collection from scratch. What a superstar! You have learned tonnes of new concepts and code - that is really impressive! And now you're almost ready to test yourself a little bit more.
970961

971-
But first, we want you to go and 'touch some grass'. So why don't you scroll to the top and set the pomodoro timer, and when you come back after your well earned rest, take the quiz. Breathe and enjoy.
962+
But first, we want you to breathe and enjoy. So go and 'touch some grass', and when you come back after your well earned rest, take the quiz. <br/>
972963

973964
<br/>
974965
<Quiz quiz="lesson-2-quiz" />
975966
<br/>
976967

977-
Congratulations on your results. You're now a supreme open-sourcerer! See you in the next lesson, where you will be adding to your knowledge of creating ERC721s, by creating *tiered NFTs*. See you there....
968+
Congratulations on your results. You're now a supreme open-sourcerer! In the next lesson *tiered NFTs*, you will be building on top of what you did here, adding more functionality to your contracts and to your knowledge of creating ERC721s. After that we'll be doing some automated testing, and to wrap up, we'll be connecting everything up to a front end, so a user can easily interact with your creations. Lots of fun in the pipeline! See you in the next one and in our community [developerdao.peeranha.io](https://developerdao.peeranha.io)!
978969

979970

980971
import { ContributorFooter } from '../../../components/mdx/ContributorFooter'

public/assets/lessons/2/img_21

Whitespace-only changes.

utils/questions/lesson-2/5-sidedrawer-json-ipfs/Q2.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"correct": true
1010
},
1111
{
12-
"answer": "To create a hole where a file once was therefore deleting it from the network"
12+
"answer": "To create a storage slot where a file once was by deleting it from the network"
1313
}
1414
]
1515
}

utils/questions/lesson-2/5-sidedrawer-json-ipfs/Q5.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"correct": true
1919
},
2020
{
21-
"answer": "Please don't forget this"
21+
"answer": "I'm going to forget this"
2222
}
2323
]
2424
}

0 commit comments

Comments
 (0)