Skip to content

Commit 66d33ac

Browse files
committed
content: removed rinkeby references and added hardhat.config instructions
1 parent 219e7e1 commit 66d33ac

File tree

1 file changed

+23
-14
lines changed

1 file changed

+23
-14
lines changed

lessons/projects/2.mdx

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ ok for us. Here's what mine asked me:
160160
✔ Do you want to install this sample project's dependencies with npm (@nomicfoundation/hardhat-toolbox)? (Y/n) · y
161161
```
162162
163-
- **Hardhat project root** → The folder where we want to create the project
163+
- **Hardhat project root** → Hit enter (this is the folder where we want to create the project)
164164
- **Do you want to add a .gitignore?** → Select 'y'. If you are patient to
165165
finish the lesson, you'll learn what it's for
166166
- **Do you want to install this sample project's dependencies with npm (…)?**
@@ -656,6 +656,16 @@ and a Base URI for our files. With that info set at the top, the script deploys
656656
the contract, waits for it to be deployed and then prints the address of our
657657
deployed contract to the console.
658658

659+
Before we run our script, we need to tell Hardhat what solidity version our
660+
contracts are using. For that, we need to go into the `hardhat.config.js` file
661+
in our root folder. Find the line that says `solidity: '0.8.xx',` and replace
662+
the `0.8.xx` for the pragma used in our contract: `0.8.12`.
663+
664+
We could have used a range of solidity versions e.g. `^0.8.0` in our contract,
665+
but we like to promote best practices by choosing a fixed solidity version
666+
and knowing beforehand nothing is going to change in our bytecode if a new
667+
version in that range is released.
668+
659669
Now, to run the script we type this in the console:
660670

661671
```bash
@@ -714,7 +724,7 @@ For us to get our contract out of our computers and into the real world, we are
714724
going to run the deploy again, but this time to a testnet.
715725

716726
What is a testnet? It is a basically a whole running blockchain, but it runs
717-
only so people can try stuff out. On it, you have eth, tokens, NFTs, but they have no monetary value. This way, you can develop and test your contracts without fear of losing real money. For the moment, we are choosing to do this on the Rinkeby (it's one of the many Ethereum testnets)
727+
only so people can try stuff out. On it, you have eth, tokens, NFTs, but they have no monetary value. This way, you can develop and test your contracts without fear of losing real money. For the moment, we are choosing to do this on the Goerli (it's one of the many Ethereum testnets)
718728

719729
Before we go any further, let's take an extra step for precaution, until the
720730
next project where we are going to learn how to use collaborative tools to store
@@ -727,14 +737,14 @@ hardhat.config.js
727737

728738
In order to do this we need:
729739

730-
- An ethereum wallet that can connect to Rinkeby.
740+
- An ethereum wallet that can connect to Goerli.
731741
[Metamask](https://metamask.io/) is the most used.
732-
- Some ~~Rinkeby~~-Eth. You can ask for some in a faucet, it's free, although
733-
some are faster than others! Options: [#1](https://rinkebyfaucet.com/),
734-
[#2](https://faucets.chain.link/rinkeby), [#3](https://faucet.rinkeby.io/)
742+
- Some Goerli-Eth. You can ask for some in a faucet, it's free, although
743+
some are faster than others! Options: [#1](https://goerlifaucet.com/),
744+
[#2](https://faucets.chain.link/goerli), [#3](https://faucet.paradigm.xyz/)
735745
- An API Key from an Ethereum RPC Node Provider
736746
([Alchemy](https://www.alchemy.com/), [Infura](https://infura.io/),
737-
[Ankr](https://rpc.ankr.com/eth_rinkeby))
747+
[Ankr](https://rpc.ankr.com/eth_goerli))
738748
- A minor change in the Hardhat Configuration file
739749

740750
First and foremost, **security**. We are exploring new grounds, experimenting
@@ -760,7 +770,7 @@ Once you have your wallet funded with test eth, you need sign up for one of the
760770
Ethereum RPC Node Providers. Alchemy and Infura are the most used, Ankr has a "community endpoint" without signing up that is not dedicated, to list a few options.
761771

762772
Once you sign up, you'll be asked to create an App, be sure to select the
763-
~~Rinkeby~~ network there.
773+
Goerli network there.
764774

765775
When the app is created, you'll see a "View Key" button, or similar. Press it
766776
and copy the HTTP link, we'll use it in our next step.
@@ -785,7 +795,7 @@ const RPC_API_KEY = 'YOUR-API-KEY-FROM-INFURA-OR-ALCHEMY'
785795
module.exports = {
786796
solidity: '0.8.12',
787797
networks: {
788-
rinkeby: {
798+
goerli: {
789799
url: RPC_API_KEY,
790800
accounts: [WALLET_PRIVATE_KEY],
791801
},
@@ -809,7 +819,7 @@ Please, if your are already a developer and you plan to use git to store your
809819
project, don't store your `hardhat.config.js` on it, because you will have your
810820
private key there.
811821

812-
Ok. We are ready, let's deploy to the Rinkeby testnet!
822+
Ok. We are ready, let's deploy to the Goerli testnet!
813823

814824
Now we need to run our deploy.js script and the deployment is going to cost us
815825
some eth (test eth, don't worry) from our wallet, since we are storing
@@ -821,7 +831,7 @@ deploy, delete all the lines we added to test the minting.
821831
Run:
822832

823833
```bash
824-
npx hardhat run scripts/deploy.js --network rinkeby
834+
npx hardhat run scripts/deploy.js --network goerli
825835
```
826836

827837
This is the output i got in my console:
@@ -836,12 +846,11 @@ key from `hardhat.config.js` to minimize the handling of the wallet. In the next
836846
project we will learn about tools to collaborate and store your projects online
837847

838848
So now we can go and explore the chain to find your contract (and mine too!).
839-
Just go to [Etherscan](https://rinkeby.etherscan.io/) (or
849+
Just go to [Goerli Etherscan](https://goerli.etherscan.io/) (or
840850
[Opensea](https://testnets.opensea.io/)) and search for the address of our
841851
deployed contract.
842852

843-
You can view my links as an example on
844-
[Etherscan](https://rinkeby.etherscan.io/address/0x76A9332DbBB0c497Eca36C2E4370227fff3C058f)
853+
You can view my links as an example on ~~[Etherscan](https://goerli.etherscan.io/address/0x76A9332DbBB0c497Eca36C2E4370227fff3C058f)~~
845854
and [Opensea](https://testnets.opensea.io/collection/soc)
846855

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

0 commit comments

Comments
 (0)