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
To begin our project, we should open a command line interface, a.k.a. console. Check your Operating System
97
-
options on how to use one below. We will be using `npm`, the package manager from Node, and its command `npx`that allows us to run or execute a package or one of its scripts. If you are
109
+
To begin our project, we should open a command line interface, a.k.a. a console. Check your operating system
110
+
options below on how to use one. We will also be using `npm`, the package manager from Node, and its command `npx`that allows us to run or execute a package or one of its scripts. If you are
98
111
comfortable with another package manager, feel free to use it.
99
112
100
113
<SideDrawertitle=""buttonText="Getting Started with the Command Line Interface">
- 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.
218
+
219
+
In a Hardhat project, the default folders are:
220
+
221
+
222
+
-`contracts/` where the source files for your contracts should be.
223
+
-`scripts/` where simple automation scripts go.
224
+
-`test/` where your tests should go.
225
+
226
+
We need to delete some files inside those folders so we can start our own project afresh:
205
227
206
228
```bash
207
229
rm contracts/*.sol
208
230
rm scripts/*.js
209
231
rm test/*.js
210
232
```
211
233
212
-
In a Hardhat project, the default folders are supposed to be for:
213
-
214
-
default paths
215
-
216
-
-`contracts/` is where the source files for your contracts should be.
217
-
-`scripts/` is where simple automation scripts go.
218
-
-`test/` is where your tests should go.
219
234
220
235
We now need to add our last dependency (OpenZeppelin contracts):
221
236
@@ -230,7 +245,7 @@ widely used and fully tested and audited.
230
245
<SideDrawerbuttonText="More on Open Zeppelin">
231
246
<OpenZeppelin/>
232
247
</SideDrawer>
233
-
<br/>
248
+
234
249
235
250
<SideDrawerbuttonText="Checkpoint Questions"title="Creating a Robust Development Environment">
@@ -247,9 +262,9 @@ widely used and fully tested and audited.
247
262
With our project folder ready, we can now fire up our Code Editor.
248
263
249
264
<Calloutemoji='💡'size='md'variant='info'>
250
-
We are using VSCode for this one (we think it has a good balance of costs vs.
251
-
benefits) but you can use whatever you feel comfortable with. A few of the more
252
-
popular code editors are VSCode, Atom, Sublime, Vim, emacs, and many more.
265
+
We are using [VS Code](https://code.visualstudio.com/download)for this project, we think it has a good balance of costs vs.
266
+
benefits. But you can use whatever you feel comfortable with. A few of the more
267
+
popular code editors are Atom, Sublime, Vim, Emacs, and many more.
253
268
254
269
</Callout>
255
270
@@ -277,11 +292,10 @@ copyright license, the second one defines the solidity version we are going to
277
292
be using for this contract and the last two lines are how we declare a smart
278
293
contract in solidity.
279
294
280
-
With an empty project, now we can start adding what we need to create our
281
-
awesome NFT collection. In particular, ERC721 (the
282
-
formal specification to follow for NFTs) have a lot of requirements to meet
283
-
(they should have a numbered ID, functions to transfer them, approve others as
284
-
delegates to transfer them, etc).
295
+
With an empty project, we can now start adding what we need to create our
296
+
awesome NFT collection. ERC721, the
297
+
formal specification to follow for NFTs, has a lot of requirements to meet. For example NFTs should have a numbered ID, functions to transfer them, and the ability to approve others as
298
+
delegates to transfer them, etc.
285
299
286
300
<SideDrawertitle=""buttonText="More about Token Standards">
287
301
<TokenStandards/>
@@ -296,8 +310,8 @@ going to use them inside our contract.
296
310
## Standing on the shoulder of giants
297
311
298
312
For this we are going to ‘inherit’ (think of _using the properties of_ or
299
-
_extending_ for now) the ERC721 contract from OpenZeppelin. In the same way you
300
-
_inherit_ the DNA and characteristics from your family/relatives.
313
+
_extending_ for now) the ERC721 contract from OpenZeppelin. Or the same way you
314
+
_inherit_ the DNA and characteristics from your relatives.
Good for you for taking on this extra adventure 🧙🏾
671
+
p.s. Good for you for taking on this extra adventure! 🧙🏾
657
672
<br/><br/>
658
673
</SideDrawer>
659
674
@@ -810,59 +825,60 @@ For us to get our contract out of our computers and into the real world, we are
810
825
going to run the deploy again, but this time to a testnet.
811
826
812
827
What is a testnet? It is a basically a whole running blockchain, but it runs
813
-
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)
828
+
only so people can try stuff out. On it, you have ETH, NFTs, other tokens, etc but they have no monetary value. This way, you can develop and test your contracts without fear of losing anything valuable. For the moment, we are choosing to do this on *Sepolia*. It's one of the many of Ethereum testnets.
814
829
815
-
Before we go any further, let's take an extra step for precaution, until the
816
-
next project where we are going to learn how to use collaborative tools to store
817
-
our projects. But until then, let's open our main folder's `.gitignore` file an
830
+
Before we go any further, let's take an extra step for precaution. In the
831
+
next project we'll learn how to use collaborative tools to store
832
+
our projects, but for now, let's open our root directory's `.gitignore` file an
818
833
add this line anywhere:
819
834
820
835
```bash
821
836
hardhat.config.js
822
837
```
823
838
824
-
In order to do this we need:
839
+
In order to deploy to a real testnet we'll need:
825
840
826
-
- An ethereum wallet that can connect to Goerli.
827
-
[Metamask](https://metamask.io/) is the most used.
828
-
- Some Goerli-Eth. You can ask for some in a faucet, it's free, although
829
-
some are faster than others! Options: [#1](https://goerlifaucet.com/),
- A minor change in the Hardhat configuration file
835
849
836
-
First and foremost, **security**. We are exploring new grounds, experimenting
837
-
and by doing so, we could make mistakes that we don't want to happen where we
838
-
have our money.
850
+
First and foremost, **security**. We are exploring new grounds, experimenting,
851
+
and by doing so, we could make mistakes that we wouldn't want to happen where we
852
+
have any assets of value.
839
853
840
854
We **strongly** recommend you use a separate wallet for developing, completely
841
-
independent from the one that holds your personal assets on the blockchain, if you have any.
855
+
independent from the one that holds any personal assets you might have on the blockchain.
856
+
For example, you could create a new profile for yourself in your favourite browser, and create
857
+
your developer wallet in there.
842
858
843
859
Wallets have a special number, called a private key. You should **never**,
844
860
**ever** share your private keys with **anyone**. If anyone has that number,
845
861
they can take full control of the wallet, and empty it of all that is in it!
846
862
847
863

848
864
849
-
To be able to deploy our contract, we are going to use that number, that's why
850
-
we recommend, yet again, to use a separate wallet for developing.
865
+
To be able to deploy our contract, we are going to use that private key, that's why
866
+
we recommend, yet again, to use a separate wallet containing only test tokens for developing.
851
867
852
868
We need to inform Hardhat which node we are using to connect to the
853
869
blockchain/network.
854
870
855
-
Once you have your wallet funded with test eth, you need sign up for one of the
856
-
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.
871
+
Once you have your wallet funded with test ETH, you'll need sign up for one of the
872
+
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.
857
873
858
874
Once you sign up, you'll be asked to create an App, be sure to select the
859
-
Goerli network there.
875
+
Sepolia network there.
860
876
861
877
When the app is created, you'll see a "View Key" button, or similar. Press it
862
878
and copy the HTTP link, we'll use it in our next step.
863
879
864
-
Once you have funded your wallet with fake eth, we can go ahead and change our
865
-
Hardhat configuration file. Go into your main project's folder and open
880
+
Once you have funded your wallet with fake ETH, we can go ahead and change our
881
+
Hardhat configuration file. Go into your project's main directory and open
0 commit comments