Skip to content

Commit fc0b20b

Browse files
committed
Add intro; add mini-quizzes throughout; update final quiz; correct text errors
1 parent 817fef5 commit fc0b20b

17 files changed

+414
-157
lines changed

pages/lessons/projects/1.mdx

Lines changed: 60 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ import { LessonHeader } from '../../../components/mdx/LessonHeader'
88

99
<LessonHeader title="Lesson 1: Intro to Smart Contract Development" />
1010

11+
## About this lesson
12+
13+
Welcome to our introductory lesson on smart contract development, blockchain fundamentals and your first taste of coding with the Solidity language. For this lesson, you don’t really need to have development experience, although we expect you to have a ‘technical mindset’ to be able to proceed. We would recommend *Build a basic NFT* as a subsequent lesson for getting familiar with more advanced concepts and developer tooling. But first things first.
14+
15+
We have some questions for you throughout the lesson for testing your previous knowledge, predicting next steps in the lesson, and letting you see for yourself how well you're absorbing the new content. There's also a quiz at the end, of course, so make sure you're checking out all the side-drawers for a deeper dive of the new concepts. To complete the lesson, expect somewhere between one and four hours depending on your previous experience and the need to learn new ideas. Please set the pomodoro timer regularly in the menu header to ensure you’re taking regular breaks to 'go touch some grass’.
16+
1117
## What are we building?
1218

1319
We’re going to build a **smart contract**, but what on Jupiter is a smart
@@ -20,11 +26,13 @@ Let's pause here for a couple questions to give you a taste of what's to come
2026
and give yourself a chance to test what you already know.
2127

2228
<SideDrawer buttonText="Warm-up questions" title="Warm-up questions">
23-
<Question question="question-1" />
24-
<Question question="question-2" />
29+
<Question question="intro-Q1" />
30+
<Question question="intro-Q2" />
31+
<Question question="intro-Q3" />
2532
</SideDrawer>
2633
<br/>
27-
<br/>
34+
35+
Did you set the pomodoro?
2836

2937
How was that? No stress if the answers didn't come naturally. We're here to fill
3038
in the gaps! If you're interested in more context before moving along to the
@@ -51,7 +59,7 @@ _money trail_. And this was one of the main intentions of blockchains.
5159
Transparency. There are ever-growing use cases for the types of transactions,
5260
financial and non-financial. Let’s move on. The blocks are secured to each other
5361
with cryptography. A similar type of encryption that is used to secure the
54-
Signal or Telegram apps on your smartphone. (Any other examples?) If someone
62+
Signal or Telegram apps on your smartphone. If someone
5563
did try to change any information on the chain, the alarm bells would go off.
5664

5765
So how is all this permission**lessness** possible? Can’t someone shut this
@@ -125,18 +133,21 @@ easier to remember alias for their address e.g.
125133
[imsoeasy.](http://imsoeasy.xyz)eth!
126134

127135
</SideDrawer>
128-
<br/>
136+
129137
<SideDrawer buttonText="What is a smart contract?">
130138

131139
A smart contract, as it suggests is a contract, but written into computer code
132-
and stored and executed on a blockchain. What does it let us do? In simple
133-
terms, it allows two parties to buy and sell something and confirm their
134-
signatures to close the sale. Until now, buying and selling of crypto tokens,
140+
and stored and executed on a blockchain. But what does it let us do? In simple terms,
141+
it allows two parties to buy and sell something and confirm their signatures to close the sale.
142+
143+
Until now, buying and selling of crypto tokens,
135144
and more recently NFTs, have seen most of the ‘on-chain’ activity and news
136-
coverage, but there is much, much more and the use cases for them on and
145+
coverage, but there is much, much more and the use cases for smart contracts on and
137146
off-chain is growing at an exponential rate, therefore the development of them
138-
couldn’t be more exciting. Humans have been buying, selling and signing
139-
contracts for millennia, what is new here? We don’t need a third party, central
147+
couldn’t be more exciting.
148+
149+
Humans have been buying, selling and signing
150+
contracts for millennia, so what is new here? We don’t need a third party, central
140151
authority or any kind of legal system to verify the transaction. The contract is
141152
in the code, the users sign it and the contract ‘smartly’ self-executes, in
142153
other words permissionlessly. Because the blockchains that we are learning about
@@ -221,6 +232,16 @@ folders in our workspace. We want to start fresh. Create a new folder named
221232

222233
The extension `.sol` is used for files in the Solidity language.
223234

235+
<SideDrawer buttonText="Check-point questions" title="Blockchain and Solidity smart contracts">
236+
<Question question="tooling-Q1" />
237+
<Question question="tooling-Q2" />
238+
<Question question="tooling-Q3" />
239+
<Question question="tooling-Q4" />
240+
</SideDrawer>
241+
<br/>
242+
243+
Go touch some grass and set pomodoro when you return
244+
224245
## **Now we begin writing our code**
225246

226247
The first line of a Solidity file is for the license, the second line lets the
@@ -461,6 +482,16 @@ since we are using the Ethereum blockchain. As we progress on our learning
461482
journey we will hear a lot more about Gas and Fees, but that’s also for future
462483
lessons.
463484

485+
<SideDrawer buttonText="Check-point questions" title="Variables and Functions">
486+
<Question question="varsFunctions-Q1" />
487+
<Question question="varsFunctions-Q2" />
488+
<Question question="varsFunctions-Q3" />
489+
<Question question="varsFunctions-Q4" />
490+
</SideDrawer>
491+
<br/>
492+
493+
Go touch some grass and set pomodoro when you return
494+
464495
## Events and dealing with on-chain storage
465496

466497
So far, we’ve learned to how make our contract store a message on the
@@ -592,6 +623,16 @@ in future lessons, so no worries!
592623

593624
</SideDrawer>
594625

626+
<SideDrawer buttonText="Check-point questions" title="All about events">
627+
<Question question="events-Q1" />
628+
<Question question="events-Q2" />
629+
<Question question="events-Q3" />
630+
{/* <Question question="events-Q4" /> */}
631+
</SideDrawer>
632+
<br/>
633+
634+
Go touch some grass and set pomodoro when you return
635+
595636
## Compile & Deploy
596637

597638
Now that we have written our smart contract in full, we can compile it and
@@ -600,15 +641,11 @@ tools in the sidebar for this. Here’s a brief description of the tools icons:
600641

601642
![Remix Menu](/assets/lessons/1/img_3.png)
602643

603-
At the top, the logo links us to the Home (and Help links) of Remix
604-
605-
Then, we have our File Explorer
606-
607-
The magnifying glass icon is for searching in files
608-
609-
Highlighted in red, the Solidity Compiler (our next step)
610-
611-
Highlighted in red, the Solidity Compiler (our next step)
644+
- At the top, the logo links us to the Home (and help links) of Remix
645+
- Then, we have our File Explorer
646+
- The magnifying glass icon is for searching in files
647+
- Highlighted in red, the Solidity Compiler (our next step)
648+
- Highlighted in green, Deploy & Run transactions
612649

613650
To compile our smart contract we should click on the **Solidity Compiler** icon
614651
in the sidebar (marked in the red box).
@@ -723,10 +760,10 @@ you see the magical spell that is being cast here?
723760

724761
Before you go ahead and tell us **what your future in web3 is**, have a check
725762
on what you didn’t know a little while ago, and what you know now!
726-
763+
<br /><br />
727764
<Quiz quiz="quiz-1"/>
728-
<br />
765+
<br /><br />
729766

730767
Now, go to the community in
731768
[developerdao.peeranha.io](https://developerdao.peeranha.io) to share your new
732-
Open Sourcerer powers!
769+
Open Sourcerer powers! And then get started on the *Build a basic NFT* lesson.

utils/questions/events-Q1.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"question": "What is the purpose of an indexed event parameter in Solidity? ",
3+
"options": [
4+
{
5+
"answer": "It ensures the event is recorded in the blockchain."
6+
},
7+
{
8+
"answer": "It stores the event parameters in the data portion of the log."
9+
},
10+
{
11+
"answer": "It enables efficient searching and filtering of events.",
12+
"correct": true
13+
}
14+
]
15+
}

utils/questions/events-Q2.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"question": "What is the purpose of defining an event in a Solidity contract? Multiple answers possible",
3+
"options": [
4+
{
5+
"answer": "It creates a transaction log where information can be stored more cheaply than on the blockchain."
6+
},
7+
{
8+
"answer": "It triggers a specific action when called.",
9+
"correct": true
10+
},
11+
{
12+
"answer": "It facilitates communication between smart contracts."
13+
},
14+
{
15+
"answer": "It allows the contract to store data on the blockchain.",
16+
"correct": true
17+
}
18+
]
19+
}

utils/questions/events-Q3.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"question": "What is the purpose of the transaction log in the blockchain?",
3+
"options": [
4+
{
5+
"answer": "To provide access to the blockchain's transaction history."
6+
},
7+
{
8+
"answer": "To record the execution steps of smart contract functions."
9+
},
10+
{
11+
"answer": "To store the event parameters emitted by smart contracts.",
12+
"correct": true
13+
},
14+
{
15+
"answer": "To store the source code of smart contracts."
16+
}
17+
]
18+
}
File renamed without changes.
File renamed without changes.

utils/questions/intro-Q3.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"question": "Which programming language is commonly used for writing smart contracts on the Ethereum blockchain?",
3+
"options": [
4+
{
5+
"answer": "Python"
6+
},
7+
{
8+
"answer": "Javascript"
9+
},
10+
{
11+
"answer": "Solidity",
12+
"correct": true
13+
},
14+
{
15+
"answer": "Java"
16+
}
17+
]
18+
}

utils/questions/tooling-Q1.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"question": "What is the key characteristic of a decentralized blockchain network?",
3+
"options": [
4+
{
5+
"answer": "Limited transparency of transactions. "
6+
},
7+
{
8+
"answer": "Central authority controlling the network."
9+
},
10+
{
11+
"answer": "Absence of a single controlling entity.",
12+
"correct": true
13+
},
14+
{
15+
"answer": "High collaboration among nodes."
16+
}
17+
]
18+
}

utils/questions/tooling-Q2.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"question": "What is the main purpose of rigorously testing a smart contract?",
3+
"options": [
4+
{
5+
"answer": "To ensure it can be updated easily in the future."
6+
},
7+
{
8+
"answer": "To prevent compromises and vulnerabilities.",
9+
"correct": true
10+
},
11+
{
12+
"answer": "To increase transparency in contract execution."
13+
}
14+
]
15+
}

utils/questions/tooling-Q3.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"question": "What is the purpose of creating a new file with the extension \".sol\" in the contracts folder?",
3+
"options": [
4+
{
5+
"answer": "To debug code quickly and easily."
6+
},
7+
{
8+
"answer": "To emulate a blockchain stack in Remix IDE."
9+
},
10+
{
11+
"answer": "To write Solidity code for smart contracts.",
12+
"correct": true
13+
}
14+
]
15+
}

0 commit comments

Comments
 (0)