Skip to content

Commit 6bb1d4b

Browse files
committed
add smart contract quiz
1 parent ff30fd6 commit 6bb1d4b

File tree

5 files changed

+190
-1
lines changed

5 files changed

+190
-1
lines changed

public/content/smart-contracts/index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,7 @@ They can perform computations, create currency, store data, mint [NFTs](/glossar
8080
- [Smart contracts for developers](/developers/docs/smart-contracts/)
8181
- [Learn to write smart-contracts](/developers/learning-tools/)
8282
- [Mastering Ethereum - What is a Smart Contract?](https://github.com/ethereumbook/ethereumbook/blob/develop/07smart-contracts-solidity.asciidoc#what-is-a-smart-contract)
83+
84+
<Divider />
85+
86+
<QuizWidget quizKey="smart-contracts" />

src/components/Quiz/stories/QuizzesStats.stories.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ const meta = {
2121
web3: [false, 0],
2222
daos: [false, 0],
2323
stablecoins: [false, 0],
24+
"smart-contracts": [false, 0],
2425
},
2526
totalCorrectAnswers: 0,
2627
},

src/data/quizzes/index.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ const quizzes = {
5454
title: "stablecoins",
5555
questions: ["m001", "m002", "m003", "m004", "m005"],
5656
},
57+
"smart-contracts": {
58+
title: "smart-contracts",
59+
questions: ["n001", "n002", "n003", "n004", "n005"],
60+
},
5761
} satisfies RawQuizzes
5862

5963
export const ethereumBasicsQuizzes: QuizzesSection[] = [
@@ -81,6 +85,10 @@ export const ethereumBasicsQuizzes: QuizzesSection[] = [
8185
id: "security",
8286
level: "beginner",
8387
},
88+
{
89+
id: "smart-contracts",
90+
level: "beginner",
91+
},
8492
]
8593

8694
export const usingEthereumQuizzes: QuizzesSection[] = [

src/data/quizzes/questionBank.ts

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1610,6 +1610,137 @@ const questionBank = {
16101610
],
16111611
correctAnswerId: "m005-d",
16121612
},
1613+
//smart-contract
1614+
n001: {
1615+
prompt: "n001-prompt",
1616+
answers: [
1617+
{
1618+
id: "n001-a",
1619+
label: "n001-a-label",
1620+
explanation: "n001-a-explanation",
1621+
},
1622+
{
1623+
id: "n001-b",
1624+
label: "n001-b-label",
1625+
explanation: "n001-b-explanation",
1626+
},
1627+
{
1628+
id: "n001-c",
1629+
label: "n001-c-label",
1630+
explanation: "n001-c-explanation",
1631+
},
1632+
{
1633+
id: "n001-d",
1634+
label: "n001-d-label",
1635+
explanation: "n001-d-explanation",
1636+
},
1637+
],
1638+
correctAnswerId: "n001-c",
1639+
},
1640+
n002: {
1641+
prompt: "n002-prompt",
1642+
answers: [
1643+
{
1644+
id: "n002-a",
1645+
label: "n002-a-label",
1646+
explanation: "n002-a-explanation",
1647+
},
1648+
{
1649+
id: "n002-b",
1650+
label: "n002-b-label",
1651+
explanation: "n002-a-explanation",
1652+
},
1653+
{
1654+
id: "n002-c",
1655+
label: "n002-c-label",
1656+
explanation: "n002-a-explanation",
1657+
},
1658+
{
1659+
id: "n002-d",
1660+
label: "n002-d-label",
1661+
explanation: "n002-d-explanation",
1662+
},
1663+
],
1664+
correctAnswerId: "n002-b",
1665+
},
1666+
n003: {
1667+
prompt: "n003-prompt",
1668+
answers: [
1669+
{
1670+
id: "n003-a",
1671+
label: "n003-a-label",
1672+
explanation: "n003-a-explanation",
1673+
},
1674+
{
1675+
id: "n003-b",
1676+
label: "n003-b-label",
1677+
explanation: "n003-b-explanation",
1678+
},
1679+
{
1680+
id: "n003-c",
1681+
label: "n003-c-label",
1682+
explanation: "n003-c-explanation",
1683+
},
1684+
{
1685+
id: "n003-d",
1686+
label: "n003-d-label",
1687+
explanation: "n003-d-explanation",
1688+
},
1689+
],
1690+
correctAnswerId: "n003-d",
1691+
},
1692+
n004: {
1693+
prompt: "n004-prompt",
1694+
answers: [
1695+
{
1696+
id: "n004-a",
1697+
label: "n004-a-label",
1698+
explanation: "n004-a-explanation",
1699+
},
1700+
{
1701+
id: "n004-b",
1702+
label: "n004-b-label",
1703+
explanation: "n004-b-explanation",
1704+
},
1705+
{
1706+
id: "n004-c",
1707+
label: "n004-c-label",
1708+
explanation: "n004-c-explanation",
1709+
},
1710+
{
1711+
id: "n004-d",
1712+
label: "n004-d-label",
1713+
explanation: "n004-d-explanation",
1714+
},
1715+
],
1716+
correctAnswerId: "n004-b",
1717+
},
1718+
n005: {
1719+
prompt: "n005-prompt",
1720+
answers: [
1721+
{
1722+
id: "n005-a",
1723+
label: "n005-a-label",
1724+
explanation: "n005-a-explanation",
1725+
},
1726+
{
1727+
id: "n005-b",
1728+
label: "n005-b-label",
1729+
explanation: "n005-b-explanation",
1730+
},
1731+
{
1732+
id: "n005-c",
1733+
label: "n005-c-label",
1734+
explanation: "n005-c-explanation",
1735+
},
1736+
{
1737+
id: "n005-d",
1738+
label: "n005-d-label",
1739+
explanation: "n005-d-explanation",
1740+
},
1741+
],
1742+
correctAnswerId: "n005-a",
1743+
},
16131744
} as const satisfies QuestionBank
16141745

16151746
export default questionBank

src/intl/en/learn-quizzes.json

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,5 +568,50 @@
568568
"m005-c-label": "Buy them from an exchange",
569569
"m005-c-explanation": "Incorrect, this is a way to get stablecoins. Many exchanges and wallets let you buy stablecoins directly. Geographical restrictions may apply for centralized exchanges.",
570570
"m005-d-label": "Mine them",
571-
"m005-d-explanation": "Correct! Unlike bitcoin, you are unable to mine stablecoins."
571+
"m005-d-explanation": "Correct! Unlike bitcoin, you are unable to mine stablecoins.",
572+
"n001-prompt": "How are smart contracts characterized?",
573+
"n001-a-label": "Smart contracts are just like real (paper) contracts, but stored digitally on the blockchain to save the content securely.",
574+
"n001-a-explanation": "Smart contracts use a similar logic to traditional contracts, but otherwise have little in common.",
575+
"n001-b-label": "They are linked to an AI system, which allows them to make decisions that trigger blockchain transactions.",
576+
"n001-b-explanation": "Smart contracts can actually execute transactions automatically, but only according to an ‘if this then that’ logic that is prescribed in the code. They do not use AI.",
577+
"n001-c-label": "They are programs stored on the blockchain that follow an 'if this then that' logic, and are guaranteed to execute according to the rules defined by the code.",
578+
"n001-c-explanation": "A smart contract is a piece of code that can be executed automatically according to an 'if this then that' logic.",
579+
"n001-d-label": "They are the rules behind the Ethereum Blockchain, developed together with lawyers to ensure legal compliance.",
580+
"n001-d-explanation": "Smart contracts are pieces of code that can be created by developers and deployed on a blockchain.",
581+
"n002-prompt": "What is a metaphor that most closely characterizes the functioning of smart contracts?",
582+
"n002-a-label": "A bank",
583+
"n002-a-explanation": "Banks require manual intervention and are structured as hierarchical entities, whereas a smart contract automatically executes without intervention.",
584+
"n002-b-label": "A digital vending machine",
585+
"n002-b-explanation": "The vending machine will only dispense your desired product after all requirements are met - specific inputs guarantee predetermined outputs. This is similar to the logic of smart contracts.",
586+
"n002-c-label": "A calculator",
587+
"n002-c-explanation": "smart contract code can be used for calculations, but is not limited to that. Rather, smart contracts are blockchain-based programs that follow an 'if this then that' logic.",
588+
"n002-d-label": "A website",
589+
"n002-d-explanation": "A website is the frontend which captures user directions. A smart contract is the backend logic where these directions are executed, and the result may be returned.",
590+
"n003-prompt": "What is not one of the main characteristics of a smart contract?",
591+
"n003-a-label": "Automatic execution",
592+
"n003-a-explanation": "The main benefit of a smart contract is that it deterministically executes unambiguous code when certain conditions are met.",
593+
"n003-b-label": "Public record",
594+
"n003-b-explanation": "With smart contracts on a public blockchain, anyone can instantly track asset transfers and other related information.",
595+
"n003-c-label": "Privacy protection",
596+
"n003-c-explanation": "As blockchains are pseudonymous networks, transactions are tied publicly to a unique cryptographic address, not an identity.",
597+
"n003-d-label": "Ability to change",
598+
"n003-d-explanation": "A smart contract cannot be changed once created, it is guaranteed to execute according to the rules defined by its code.",
599+
"n004-prompt": "What is not one of the applications of smart contracts?",
600+
"n004-a-label": "Cryptocurrencies",
601+
"n004-a-explanation": "Cryptocurrencies are token objects which are defined and tracked on smart contracts.",
602+
"n004-b-label": "Protocol changes",
603+
"n004-b-explanation": "While protocol changes are enacted through a smart contract, their creation and definition are proposed through transparent online forums such as Github or Forum.",
604+
"n004-c-label": "Non Fungible Assets",
605+
"n004-c-explanation": "Smart contracts are used to define a wide range of NFTs, ranging from digital art to asset ownership certificates.",
606+
"n004-d-label": "DAOs",
607+
"n004-d-explanation": "The governing and voting rules of Decentralized Autonomous Organisations are defined within smart contracts for transparency.",
608+
"n005-prompt": "Who coined the term 'smart contract'?",
609+
"n005-a-label": "Nick Szabo",
610+
"n005-a-explanation": "The computer scientist and cryptographer Nick Szabo coined the term 'smart contract' in an essay from 1994. In 1996, he wrote an exploration of what they could do. Smart contracts on Ethereum later put this vision into practice.",
611+
"n005-b-label": "Satoshi Nakamoto",
612+
"n005-b-explanation": "Satoshi is the author of Bitcoin, which already has some basic smart contract functionalities. The term 'smart contract', however, was coined by Nick Szabo in 1994.",
613+
"n005-c-label": "Vitalik Buterin",
614+
"n005-c-explanation": "The Ethereum co-founder has contributed to our understanding of smart contracts today. The term, however, was coined by Nick Szabo in 1994.",
615+
"n005-d-label": "Gavin Wood",
616+
"n005-d-explanation": "Ethereum co-founder Gavin Wood is known for coining the term web3. The term 'smart contract', however, was coined by Nick Szabo in 1994."
572617
}

0 commit comments

Comments
 (0)