Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions public/content/smart-contracts/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,7 @@ They can perform computations, create currency, store data, mint [NFTs](/glossar
- [Smart contracts for developers](/developers/docs/smart-contracts/)
- [Learn to write smart-contracts](/developers/learning-tools/)
- [Mastering Ethereum - What is a Smart Contract?](https://github.com/ethereumbook/ethereumbook/blob/develop/07smart-contracts-solidity.asciidoc#what-is-a-smart-contract)

<Divider />

<QuizWidget quizKey="smart-contracts" />
2 changes: 1 addition & 1 deletion src/components/FeedbackWidget/FixedDot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const FixedDot = forwardRef<HTMLButtonElement, FixedDotProps>(
>
<span
className={cn(
"line-clamp-2 hidden h-full items-center font-bold text-white leading-5",
"line-clamp-2 hidden h-full items-center font-bold leading-5 text-white",
isExpanded && "lg:flex"
)}
>
Expand Down
1 change: 1 addition & 0 deletions src/components/Quiz/stories/QuizzesStats.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const meta = {
web3: [false, 0],
daos: [false, 0],
stablecoins: [false, 0],
"smart-contracts": [false, 0],
defi: [false, 0],
gas: [false, 0],
},
Expand Down
13 changes: 13 additions & 0 deletions src/data/quizzes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,15 @@ const quizzes = {
title: "DeFi",
questions: ["defi-1", "defi-2", "defi-3", "defi-4", "defi-5"],
},
"smart-contracts": {
title: "smart-contracts",
questions: [
"smart-contracts-1",
"smart-contracts-2",
"smart-contracts-3",
"smart-contracts-4",
],
},
} satisfies RawQuizzes

const ethereumBasicsQuizzesRaw: QuizzesSection[] = [
Expand All @@ -125,6 +134,10 @@ const ethereumBasicsQuizzesRaw: QuizzesSection[] = [
id: "security",
level: "beginner",
},
{
id: "smart-contracts",
level: "beginner",
},
]
export const ethereumBasicsQuizzes: QuizzesSection[] = addNextQuiz(
ethereumBasicsQuizzesRaw
Expand Down
6 changes: 6 additions & 0 deletions src/data/quizzes/questionBank.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,12 @@ const questionBankConfig: QuestionBankConfig = {
{ totalAnswers: 4, correctAnswer: 4 },
{ totalAnswers: 4, correctAnswer: 1 },
],
"smart-contracts": [
{ totalAnswers: 4, correctAnswer: 3 },
{ totalAnswers: 4, correctAnswer: 2 },
{ totalAnswers: 4, correctAnswer: 4 },
{ totalAnswers: 4, correctAnswer: 2 },
],
}

const charFromIdx = (idx: number) => String.fromCharCode(97 + idx)
Expand Down
40 changes: 38 additions & 2 deletions src/intl/en/learn-quizzes.json
Original file line number Diff line number Diff line change
Expand Up @@ -658,5 +658,41 @@
"defi-5-c-label": "Bitcoin",
"defi-5-c-explanation": "This is incorrect. Bitcoin is a simple network for storing value, not for running advanced programs. DeFi requires a more flexible system, like Ethereum, that can run complex programs to handle loans and trades automatically.",
"defi-5-d-label": "Traditional financial institutions",
"defi-5-d-explanation": "This is incorrect. DeFi apps don’t need traditional financial institutions. They use blockchain programs called smart contracts to handle transactions automatically."
}
"defi-5-d-explanation": "This is incorrect. DeFi apps don’t need traditional financial institutions. They use blockchain programs called smart contracts to handle transactions automatically.",
"smart-contracts-1-prompt": "How are smart contracts characterized?",
"smart-contracts-1-a-label": "Smart contracts are just like legal contracts, but stored digitally on the blockchain to save the content securely.",
"smart-contracts-1-a-explanation": "Smart contracts use a similar logic to traditional contracts, but otherwise have little in common.",
"smart-contracts-1-b-label": "Linked to autonomous AI systems that execute transactions",
"smart-contracts-1-b-explanation": "Smart contracts execute transactions predictably according to 'if-this-then-that' logic prescribed in the code—they do not use AI",
"smart-contracts-1-c-label": "Onchain programs following 'if-this-then-that' logic, guaranteed to execute according to its own rules",
"smart-contracts-1-c-explanation": "A smart contract is an Ethereum account deployed with unchangeable code that determines its functionality.",
"smart-contracts-1-d-label": "They are the rules behind the Ethereum Blockchain, developed together with lawyers to ensure legal compliance.",
Comment thread
wackerow marked this conversation as resolved.
"smart-contracts-1-d-explanation": "Smart contracts are pieces of code that can be created by developers and deployed on a blockchain.",
"smart-contracts-2-prompt": "What is a metaphor that most closely characterizes the functioning of smart contracts?",
"smart-contracts-2-a-label": "A bank",
"smart-contracts-2-a-explanation": "Banks require manual execution and are structured as hierarchical entities, whereas smart contracts are executed predictable by computers with unchangeable rules.",
"smart-contracts-2-b-label": "A digital vending machine",
"smart-contracts-2-b-explanation": "The vending machine will only dispense your desired product after all requirements are met: specific inputs guarantee deterministic outputs. This is similar to the logic of smart contracts.",
"smart-contracts-2-c-label": "A calculator",
"smart-contracts-2-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 'if-this-then-that' logic.",
"smart-contracts-2-d-label": "A website",
"smart-contracts-2-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.",
"smart-contracts-3-prompt": "Which is NOT a main characteristic of smart contracts?",
"smart-contracts-3-a-label": "Deterministic execution",
"smart-contracts-3-a-explanation": "The main benefit of a smart contract is that it deterministically executes unambiguous code, without human interpretation or bias.",
"smart-contracts-3-b-label": "Public record",
"smart-contracts-3-b-explanation": "With smart contracts on a public blockchain, anyone can instantly track asset transfers and other related information.",
"smart-contracts-3-c-label": "Privacy protection",
"smart-contracts-3-c-explanation": "As blockchains are pseudonymous networks, transactions are tied publicly to a unique cryptographic address, not an identity.",
"smart-contracts-3-d-label": "Ability to change",
"smart-contracts-3-d-explanation": "A smart contract cannot be changed once created—it is guaranteed to execute according to the rules defined by its code.",
"smart-contracts-4-prompt": "Which is NOT an application of smart contracts?",
"smart-contracts-4-a-label": "Stablecoins",
"smart-contracts-4-a-explanation": "Stablecoins are token objects which are defined and tracked using smart contracts.",
"smart-contracts-4-b-label": "Protocol changes",
"smart-contracts-4-b-explanation": "While protocol changes can sometimes use smart contracts, their creation and definition are proposed through transparent online forums and implemented in client software.",
"smart-contracts-4-c-label": "Non-fungible tokens (NFTs)",
"smart-contracts-4-c-explanation": "Smart contracts are used to define a wide range of NFTs, ranging from digital art to asset ownership certificates.",
"smart-contracts-4-d-label": "Open currency exchange",
"smart-contracts-4-d-explanation": "Decentralized exchanges (DEXs) are build using smart contracts to operate without centralized control."
}
11 changes: 6 additions & 5 deletions src/lib/utils/translations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,22 +231,23 @@ const getRequiredNamespacesForPath = (relativePath: string) => {
// Quizzes
// Note: Add any URL paths that have quizzes here
if (
path.startsWith("/defi/") ||
path.startsWith("/eth/") ||
path.startsWith("/gas/") ||
path.startsWith("/layer-2/") ||
path.startsWith("/layer-2/learn/") ||
path.startsWith("/nft/") ||
path.startsWith("/quizzes/") ||
path.startsWith("/roadmap/merge/") ||
path.startsWith("/roadmap/scaling/") ||
path.startsWith("/run-a-node/") ||
path.startsWith("/security/") ||
path.startsWith("/smart-contracts/") ||
path.startsWith("/stablecoins/") ||
path.startsWith("/staking/solo/") ||
path.startsWith("/wallets/") ||
path.startsWith("/web3/") ||
path.startsWith("/what-is-ethereum/") ||
path.startsWith("/quizzes/") ||
path.startsWith("/stablecoins/") ||
path.startsWith("/defi/") ||
path.startsWith("/gas/")
path.startsWith("/what-is-ethereum/")
) {
requiredNamespaces = [...requiredNamespaces, "learn-quizzes"]
}
Expand Down