@@ -23,8 +23,9 @@ how well you're absorbing the new content. There's also a quiz at the end, of
23
23
course, so make sure you're checking out all the side-drawers for a deeper dive
24
24
of any new concepts. To complete the lesson, expect somewhere between one and
25
25
four hours depending on your previous experience and the need to learn new
26
- ideas. Remember your well-being and set the pomodoro timer in the menu header to ensure
27
- you’re taking regular breaks, and please do go outside and 'touch some grass’.
26
+ ideas. Remember your well-being and set the pomodoro timer in the menu header to
27
+ ensure you’re taking regular breaks, and please do go outside and 'touch some
28
+ grass’.
28
29
29
30
## What are we building?
30
31
@@ -139,8 +140,7 @@ means of communication on and with any blockchain. Not only does a user have an
139
140
address like this, but all the smart contracts on the blockchain have one as
140
141
well, and use them as a means of communication too. Like phone numbers, or
141
142
emails blockchain style! It’s becoming more common that a user will have an
142
- easier to remember alias for their address e.g.
143
- [ imsoeasy.] ( http://imsoeasy.xyz ) eth!
143
+ easier to remember alias for their address, e.g., imsoeasy.eth!
144
144
145
145
</SideDrawer >
146
146
@@ -244,7 +244,7 @@ folders in our workspace. We want to start fresh. Create a new folder named
244
244
The extension ` .sol ` is used for files in the Solidity language.
245
245
246
246
<SideDrawer
247
- buttonText = " Check-point Questions"
247
+ buttonText = " Checkpoint Questions"
248
248
title = " Blockchain and Solidity Smart Contracts"
249
249
>
250
250
<Question question = " lesson-1/tooling-Q1" />
@@ -254,7 +254,7 @@ The extension `.sol` is used for files in the Solidity language.
254
254
</SideDrawer >
255
255
<br />
256
256
257
- Go touch some grass ⌛😊
257
+ Well done! Now, go touch some grass! ⌛😊
258
258
259
259
## ** Now we begin writing our code**
260
260
@@ -420,8 +420,8 @@ contract WAGMI {
420
420
}
421
421
```
422
422
423
- Yes, there are some new keywords up there e.g. ** return** , ** returns** , ** view ** , etc, but
424
- don’t panic:
423
+ Yes, there are some new keywords up there e.g. ** return** , ** returns** ,
424
+ ** view ** , etc, but don’t panic:
425
425
426
426
` public ` defines the ** visibility** of our function and means it can be called
427
427
from anywhere e.g. directly calling it with our externally owned address (e.g.
@@ -487,16 +487,16 @@ function setMessage(string calldata newMessage) public {
487
487
}
488
488
```
489
489
490
- If you noticed, this function, unlike the previous ones, does not have the ** view **
491
- visibility keyword and it does indeed modify the state of our contract and the
492
- blockchain. Therefore, whenever someone calls this function in the future, their
493
- wallet is going to ask them to confirm a transaction on the blockchain. That
494
- means it will use some * gas * , which is a transaction fee of a small amount of eth,
495
- since we are using the Ethereum blockchain. As we progress on our learning
496
- journey we will hear a lot more about gas and fees, but that’s also for future
497
- lessons.
490
+ If you noticed, this function, unlike the previous ones, does not have the
491
+ ** view ** visibility keyword and it does indeed modify the state of our contract
492
+ and the blockchain. Therefore, whenever someone calls this function in the
493
+ future, their wallet is going to ask them to confirm a transaction on the
494
+ blockchain. That means it will use some _ gas _ , which is a transaction fee of a
495
+ small amount of eth, since we are using the Ethereum blockchain. As we progress
496
+ on our learning journey we will hear a lot more about gas and fees, but that’s
497
+ also for future lessons.
498
498
499
- <SideDrawer buttonText = " Check-point Questions" title = " Variables and Functions" >
499
+ <SideDrawer buttonText = " Checkpoint Questions" title = " Variables and Functions" >
500
500
<Question question = " lesson-1/varsFunctions-Q1" />
501
501
<Question question = " lesson-1/varsFunctions-Q2" />
502
502
<Question question = " lesson-1/varsFunctions-Q3" />
@@ -570,10 +570,11 @@ above we can write:
570
570
emit EventName(2, false, 'Hello World!');
571
571
```
572
572
573
- There’s a lot to unpack, so we’ll leave it there for now!
573
+ There’s a lot to unpack, so we’ll leave it there for now!
574
574
575
- Let’s create an event to log all the future messages sent to our smart contract and check the fortunes
576
- to see if the sent messages are worthy of “making it” in the web3 world. 😉 After our state variables, we can define our new event as:
575
+ Let’s create an event to log all the future messages sent to our smart contract
576
+ and check the fortunes to see if the sent messages are worthy of “making it” in
577
+ the web3 world. 😉 After our state variables, we can define our new event as:
577
578
578
579
``` solidity
579
580
// We add this line after our 'message' and 'messageCount' definitions
@@ -617,9 +618,9 @@ address that called the function. You also probably noticed how we compare
617
618
newMessage with ‘gm’. That’s because Solidity doesn’t have a way to easily
618
619
compare two strings of text. But with a little bit of encoding and decoding, we
619
620
can use abi.encodePacked() to convert the string into bytes and then use the
620
- hashing function keccak256() to compare the two ** hashes** . And if * they * are equal,
621
- the strings are equal too 🙌. You can be sure that we’ll be deep diving on these
622
- in future lessons, so no worries!
621
+ hashing function keccak256() to compare the two ** hashes** . And if _ they _ are
622
+ equal, the strings are equal too 🙌. You can be sure that we’ll be deep diving
623
+ on these in future lessons, so no worries!
623
624
624
625
<SideDrawer buttonText = " More on Events" >
625
626
@@ -635,7 +636,7 @@ in future lessons, so no worries!
635
636
636
637
</SideDrawer >
637
638
638
- <SideDrawer buttonText = " Check-point Questions" title = " All about Events" >
639
+ <SideDrawer buttonText = " Checkpoint Questions" title = " All about Events" >
639
640
<Question question = " lesson-1/events-Q1" />
640
641
<Question question = " lesson-1/events-Q2" />
641
642
<Question question = " lesson-1/events-Q3" />
@@ -718,9 +719,9 @@ Compiler sidebar icon.
718
719
</SideDrawer >
719
720
720
721
Now we are ready to deploy our contract. We can now head to the ** Deploy & Run**
721
- transactions icon in the sidebar. Below we can see a
722
- message that says ‘Currently you have no contract instances to interact with’,
723
- so we haven’t deployed anything yet.
722
+ transactions icon in the sidebar. Below we can see a message that says
723
+ ‘Currently you have no contract instances to interact with’, so we haven’t
724
+ deployed anything yet.
724
725
725
726
![ Contract Instance Warning] ( /assets/lessons/1/img_6.png )
726
727
@@ -736,8 +737,8 @@ Open the dropdown under **Deployed Contracts**, to see our function tabs:
736
737
- the orange one lets us trigger the setMessage function which will change the
737
738
state. Be sure to click on the little drop down menu on the right. From here
738
739
on, we can interact with our contract. Feel free to test the functions. Click
739
- on the getMessage and messageCount tabs before and after setting a new
740
- message to modify data on our contract.
740
+ on the getMessage and messageCount tabs before and after setting a new message
741
+ to modify data on our contract.
741
742
742
743
![ Available Interactive Options once Contract is Deployed] ( /assets/lessons/1/img_7.png )
743
744
@@ -784,4 +785,5 @@ what you didn’t know a little while ago, and what you know now!
784
785
785
786
Now, go to the community in
786
787
[ developerdao.peeranha.io] ( https://developerdao.peeranha.io ) to share your new
787
- Open Sourcerer powers! And afterwards get started on our _ Build a basic NFT_ lesson. See you soon!
788
+ Open Sourcerer powers! And afterwards get started on our _ Build a basic NFT_
789
+ lesson. See you soon!
0 commit comments