You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lessons/projects/2.mdx
+23-14Lines changed: 23 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -160,7 +160,7 @@ ok for us. Here's what mine asked me:
160
160
✔ Do you want to install this sample project's dependencies with npm (@nomicfoundation/hardhat-toolbox)? (Y/n) · y
161
161
```
162
162
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)
164
164
- **Do you want to add a .gitignore?** → Select 'y'. If you are patient to
165
165
finish the lesson, you'll learn what it's for
166
166
- **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
656
656
the contract, waits for it to be deployed and then prints the address of our
657
657
deployed contract to the console.
658
658
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
+
659
669
Now, to run the script we type this in the console:
660
670
661
671
```bash
@@ -714,7 +724,7 @@ For us to get our contract out of our computers and into the real world, we are
714
724
going to run the deploy again, but this time to a testnet.
715
725
716
726
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)
718
728
719
729
Before we go any further, let's take an extra step for precaution, until the
720
730
next project where we are going to learn how to use collaborative tools to store
@@ -727,14 +737,14 @@ hardhat.config.js
727
737
728
738
In order to do this we need:
729
739
730
-
- An ethereum wallet that can connect to Rinkeby.
740
+
- An ethereum wallet that can connect to Goerli.
731
741
[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/),
- A minor change in the Hardhat Configuration file
739
749
740
750
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
760
770
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.
761
771
762
772
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.
764
774
765
775
When the app is created, you'll see a "View Key" button, or similar. Press it
766
776
and copy the HTTP link, we'll use it in our next step.
0 commit comments