Skip to content

Commit

Permalink
feat:add DeFi quiz [Fixes ethereum#13648]
Browse files Browse the repository at this point in the history
  • Loading branch information
Shiva-Sai-ssb committed Oct 9, 2024
1 parent 75836bf commit 82e2261
Show file tree
Hide file tree
Showing 6 changed files with 193 additions and 2 deletions.
4 changes: 4 additions & 0 deletions public/content/defi/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -355,3 +355,7 @@ DeFi is an open-source movement. The DeFi protocols and applications are all ope

- [DeFi Llama Discord server](https://discord.defillama.com/)
- [DeFi Pulse Discord server](https://discord.gg/Gx4TCTk)

<Divider />

<QuizWidget quizKey="defi" />
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],
defi: [false, 0],
},
totalCorrectAnswers: 0,
},
Expand Down
9 changes: 9 additions & 0 deletions src/data/quizzes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ const quizzes = {
title: "stablecoins",
questions: ["m001", "m002", "m003", "m004", "m005"],
},
defi: {
title: "DeFi",
questions: ["n001", "n002", "n003", "n004", "n005"],
},
} satisfies RawQuizzes

export const ethereumBasicsQuizzes: QuizzesSection[] = [
Expand Down Expand Up @@ -92,6 +96,11 @@ export const usingEthereumQuizzes: QuizzesSection[] = [
{
id: "stablecoins",
level: "beginner",
next: "defi",
},
{
id: "defi",
level: "beginner",
next: "layer-2",
},
{
Expand Down
131 changes: 131 additions & 0 deletions src/data/quizzes/questionBank.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1610,6 +1610,137 @@ const questionBank = {
],
correctAnswerId: "m005-d",
},
// DEFI
n001: {
prompt: "n001-prompt",
answers: [
{
id: "n001-a",
label: "n001-a-label",
explanation: "n001-a-explanation",
},
{
id: "n001-b",
label: "n001-b-label",
explanation: "n001-b-explanation",
},
{
id: "n001-c",
label: "n001-c-label",
explanation: "n001-c-explanation",
},
{
id: "n001-d",
label: "n001-d-label",
explanation: "n001-d-explanation",
},
],
correctAnswerId: "n001-a",
},
n002: {
prompt: "n002-prompt",
answers: [
{
id: "n002-a",
label: "n002-a-label",
explanation: "n002-a-explanation",
},
{
id: "n002-b",
label: "n002-b-label",
explanation: "n002-b-explanation",
},
{
id: "n002-c",
label: "n002-c-label",
explanation: "n002-c-explanation",
},
{
id: "n002-d",
label: "n002-d-label",
explanation: "n002-d-explanation",
},
],
correctAnswerId: "n002-b",
},
n003: {
prompt: "n003-prompt",
answers: [
{
id: "n003-a",
label: "n003-a-label",
explanation: "n003-a-explanation",
},
{
id: "n003-b",
label: "n003-b-label",
explanation: "n003-b-explanation",
},
{
id: "n003-c",
label: "n003-c-label",
explanation: "n003-c-explanation",
},
{
id: "n003-d",
label: "n003-d-label",
explanation: "n003-d-explanation",
},
],
correctAnswerId: "n003-a",
},
n004: {
prompt: "n004-prompt",
answers: [
{
id: "n004-a",
label: "n004-a-label",
explanation: "n004-a-explanation",
},
{
id: "n004-b",
label: "n004-b-label",
explanation: "n004-b-explanation",
},
{
id: "n004-c",
label: "n004-c-label",
explanation: "n004-c-explanation",
},
{
id: "n004-d",
label: "n004-d-label",
explanation: "n004-d-explanation",
},
],
correctAnswerId: "n004-d",
},
n005: {
prompt: "n005-prompt",
answers: [
{
id: "n005-a",
label: "n005-a-label",
explanation: "n005-a-explanation",
},
{
id: "n005-b",
label: "n005-b-label",
explanation: "n005-b-explanation",
},
{
id: "n005-c",
label: "n005-c-label",
explanation: "n005-c-explanation",
},
{
id: "n005-d",
label: "n005-d-label",
explanation: "n005-d-explanation",
},
],
correctAnswerId: "n005-a",
},
} as const satisfies QuestionBank

export default questionBank
47 changes: 46 additions & 1 deletion src/intl/en/learn-quizzes.json
Original file line number Diff line number Diff line change
Expand Up @@ -568,5 +568,50 @@
"m005-c-label": "Buy them from an exchange",
"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.",
"m005-d-label": "Mine them",
"m005-d-explanation": "Correct! Unlike bitcoin, you are unable to mine stablecoins."
"m005-d-explanation": "Correct! Unlike bitcoin, you are unable to mine stablecoins.",
"n001-prompt": "What does DeFi stand for?",
"n001-a-label": "Decentralized Finance",
"n001-a-explanation": "Correct! DeFi refers to Decentralized Finance, a financial system built on Ethereum that operates without intermediaries like banks or financial institutions.",
"n001-b-label": "Digital Finance",
"n001-b-explanation": "This is incorrect. Digital Finance refers to financial services that are provided through digital platforms, but it doesn’t specifically imply decentralization.",
"n001-c-label": "Distributed Finance",
"n001-c-explanation": "This is incorrect. While 'distributed' could imply decentralization, the term used in the industry is 'Decentralized Finance,' not Distributed Finance.",
"n001-d-label": "Development Finance",
"n001-d-explanation": "This is incorrect. Development Finance typically refers to financial support provided for projects aimed at economic development, often in developing countries, and is unrelated to blockchain or DeFi.",
"n002-prompt": "What CAN'T you do with DeFi?",
"n002-a-label": "Send money around the globe.",
"n002-a-explanation": "This is incorrect. With DeFi, you can send value to anybody anywhere in the world, without any limits.",
"n002-b-label": "Ask customer support to revert your mistakes.",
"n002-b-explanation": "Correct! In DeFi, transactions are final and controlled by code rather than a company. If a mistake happens, like sending funds to the wrong address, there’s no customer support to help fix it. You need to be extra careful.",
"n002-c-label": "Borrow funds with collateral.",
"n002-c-explanation": "This is incorrect. With DeFi, you can borrow money instantly, avoiding the days-long approval process of traditional banks.",
"n002-d-label": "Trade your tokens 24/7.",
"n002-d-explanation": "This is incorrect. DeFi allows you to trade tokens 24/7. Markets are always open, and you can trade your ETH against USDT or any other currency anytime.",
"n003-prompt": "Which DeFi platform is known for allowing users to swap tokens directly with one another?",
"n003-a-label": "Uniswap",
"n003-a-explanation": "Correct! Uniswap is a decentralized exchange that allows users to trade (swap) tokens directly with each other using automated market-making mechanisms.",
"n003-b-label": "Aave",
"n003-b-explanation": "This is incorrect. Aave is a DeFi protocol focused on lending and borrowing, not token swaps.",
"n003-c-label": "PoolTogether",
"n003-c-explanation": "This is incorrect. PoolTogether runs no-loss lotteries which offer a new innovative way to save money.",
"n003-d-label": "MakerDao",
"n003-d-explanation": "This is incorrect. MakerDAO is a decentralized platform that allows users to issue and manage the DAI stablecoin, but it doesn’t focus on token swaps.",
"n004-prompt": "When you use a DeFi app and make a transaction, where is the transaction information kept?",
"n004-a-label": "ETH",
"n004-a-explanation": "This is incorrect. Data is not stored in ether (ETH). ETH is the native asset of the Ethereum blockchain.",
"n004-b-label": "My wallet",
"n004-b-explanation": "This is incorrect. A wallet is an application that manages your Ethereum account by connecting to the Ethereum blockchain. It doesn't store any data about your transaction history.",
"n004-c-label": "DeFi apps",
"n004-c-explanation": "This is incorrect. DeFi apps don’t store your transaction history directly. Instead, your transaction details are recorded on the Ethereum blockchain.",
"n004-d-label": "Ethereum blockchain",
"n004-d-explanation": "Correct! Ethereum as a blockchain stores all the data made by its users and apps. This allows validators to maintain the same state across the P2P network.",
"n005-prompt": "What makes Decentralized Finance (DeFi) possible on Ethereum?",
"n005-a-label": "Smart Contracts",
"n005-a-explanation": "Correct! Smart contracts are like digital 'if-then' statements written into Ethereum. They replace traditional contracts and middlemen, automatically executing transactions if certain conditions are met.",
"n005-b-label": "Middlemen",
"n005-b-explanation": "This is incorrect. Ethereum doesn't need middlemen for transactions to run. Everything runs on the chain through smart contracts.",
"n005-c-label": "Bitcoin",
"n005-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.",
"n005-d-label": "Traditional financial institutions",
"n005-d-explanation": "This is incorrect. DeFi apps don’t need traditional financial institutions. They use blockchain programs called smart contracts to handle transactions automatically."
}
3 changes: 2 additions & 1 deletion src/lib/utils/translations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,8 @@ const getRequiredNamespacesForPath = (relativePath: string) => {
path.startsWith("/web3/") ||
path.startsWith("/what-is-ethereum/") ||
path.startsWith("/quizzes/") ||
path.startsWith("/stablecoins/")
path.startsWith("/stablecoins/") ||
path.startsWith("/defi/")
) {
requiredNamespaces = [...requiredNamespaces, "learn-quizzes"]
}
Expand Down

0 comments on commit 82e2261

Please sign in to comment.