From 82e226142ffb59727703a9141c67c136f46db87f Mon Sep 17 00:00:00 2001 From: Shiva-Sai-ssb <112751524+Shiva-Sai-ssb@users.noreply.github.com> Date: Wed, 9 Oct 2024 15:45:27 +0530 Subject: [PATCH] feat:add DeFi quiz [Fixes #13648] --- public/content/defi/index.md | 4 + .../Quiz/stories/QuizzesStats.stories.tsx | 1 + src/data/quizzes/index.ts | 9 ++ src/data/quizzes/questionBank.ts | 131 ++++++++++++++++++ src/intl/en/learn-quizzes.json | 47 ++++++- src/lib/utils/translations.ts | 3 +- 6 files changed, 193 insertions(+), 2 deletions(-) diff --git a/public/content/defi/index.md b/public/content/defi/index.md index 50c42acc22f..19d41c91073 100644 --- a/public/content/defi/index.md +++ b/public/content/defi/index.md @@ -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) + + + + \ No newline at end of file diff --git a/src/components/Quiz/stories/QuizzesStats.stories.tsx b/src/components/Quiz/stories/QuizzesStats.stories.tsx index 1025ef7dfe0..ea72221a869 100644 --- a/src/components/Quiz/stories/QuizzesStats.stories.tsx +++ b/src/components/Quiz/stories/QuizzesStats.stories.tsx @@ -21,6 +21,7 @@ const meta = { web3: [false, 0], daos: [false, 0], stablecoins: [false, 0], + defi: [false, 0], }, totalCorrectAnswers: 0, }, diff --git a/src/data/quizzes/index.ts b/src/data/quizzes/index.ts index 71cc4271f1c..b227fba4eef 100644 --- a/src/data/quizzes/index.ts +++ b/src/data/quizzes/index.ts @@ -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[] = [ @@ -92,6 +96,11 @@ export const usingEthereumQuizzes: QuizzesSection[] = [ { id: "stablecoins", level: "beginner", + next: "defi", + }, + { + id: "defi", + level: "beginner", next: "layer-2", }, { diff --git a/src/data/quizzes/questionBank.ts b/src/data/quizzes/questionBank.ts index cdf24060459..d37f50cf28c 100644 --- a/src/data/quizzes/questionBank.ts +++ b/src/data/quizzes/questionBank.ts @@ -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 diff --git a/src/intl/en/learn-quizzes.json b/src/intl/en/learn-quizzes.json index cb534e9412f..be6699c36a3 100644 --- a/src/intl/en/learn-quizzes.json +++ b/src/intl/en/learn-quizzes.json @@ -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." } diff --git a/src/lib/utils/translations.ts b/src/lib/utils/translations.ts index bdaa1b04fe5..dedef3a221c 100644 --- a/src/lib/utils/translations.ts +++ b/src/lib/utils/translations.ts @@ -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"] }