Skip to content

Commit

Permalink
Add Quizzes to ICTT Course (#188)
Browse files Browse the repository at this point in the history
  • Loading branch information
owenwahlgren authored Oct 11, 2024
1 parent c0f090d commit 5d58613
Show file tree
Hide file tree
Showing 13 changed files with 169 additions and 9 deletions.
132 changes: 132 additions & 0 deletions components/quizzes/quizData.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
"l1-tokenomics": {
"title": "L1 Tokenomics",
"quizzes": ["201", "202", "203", "204", "205", "206", "207", "208", "209"]
},
"interchain-token-transfer": {
"title": "Interchain Token Transfer",
"quizzes": ["118", "119", "120", "121", "122", "123", "124", "125", "126", "127"]
}
},
"quizzes": {
Expand Down Expand Up @@ -221,6 +225,134 @@
"hint": "Think about how Avalanche allows developers to modify Virtual Machines.",
"explanation": "Unlike one-chain-fits all systems, which requires a wide consensus to make changes, Avalanche allows for straightforward customization of Virtual Machines, making it more adaptable to unique use cases.",
"chapter": "Virtual Machine Customization"
},
"118": {
"question": "Which of the following best describes the role of a native token in an EVM-based blockchain?",
"options": [
"It is used only for staking and governance within the blockchain.",
"It serves as both a means of value transfer and as the gas token for executing transactions and smart contracts.",
"It is used exclusively for purchasing NFTs on the blockchain.",
"It has no functional role other than being a store of value."
],
"correctAnswers": [1],
"hint": "Consider both value transfer and execution costs in the network.",
"explanation": "In an EVM-based blockchain, the native token serves as both a means of value transfer within the network and as the gas token for executing transfers or smart contracts. Some blockchains optionally choose to also use the native token as their staking and governance token.",
"chapter": "Interchain Token Transfer"
},
"119": {
"question": "What is the purpose of marking a function as 'payable' in Solidity?",
"options": [
"It allows the function to receive ERC-20 tokens.",
"It enables the function to execute without gas fees.",
"It allows the function to receive native blockchain tokens.",
"It prevents the function from modifying state variables."
],
"correctAnswers": [2],
"hint": "Think about how functions handle incoming funds.",
"explanation": "In Solidity, marking a function as 'payable' allows it to accept native blockchain tokens like ETH or AVAX. Without 'payable', the function cannot receive native tokens.",
"chapter": "Interchain Token Transfer"
},
"120": {
"question": "What is the purpose of the `approve()` function in the ERC-20 token standard?",
"options": [
"It allows an address to transfer tokens to another address directly.",
"It grants an allowance for another account to spend the balance of an account.",
"It returns the total supply of the token.",
"It checks the balance of a specific address."
],
"correctAnswers": [1],
"hint": "Consider how a spender gets permission to spend tokens from an owner's account.",
"explanation": "The `approve()` function allows an owner to authorize a spender to withdraw tokens from the owner's account, up to a specified limit, enabling the spender to use `transferFrom()` to transfer tokens.",
"chapter": "Interchain Token Transfer"
},
"121": {
"question": "Why is it necessary to call the `approve()` function before transferring ERC-20 tokens to a smart contract?",
"options": [
"Because it sets the gas fee for the transaction.",
"It is not necessary; tokens can be transferred without approval.",
"To check the balance of the smart contract.",
"To authorize the smart contract to transfer tokens from your account."
],
"correctAnswers": [3],
"hint": "Consider how a smart contract gets permission to spend tokens from your account.",
"explanation": "The `approve()` function allows a user to authorize a smart contract to withdraw tokens from their account up to a specified limit. This enables the smart contract to use `transferFrom()` to transfer tokens on behalf of the user.",
"chapter": "Interchain Token Transfer"
},
"122": {
"question": "Why are native tokens wrapped into ERC-20 tokens like wAVAX or wETH?",
"options": [
"To increase their transaction speed on the blockchain.",
"To reduce the supply of the native token.",
"To represent native assets as ERC-20 tokens for compatibility with DeFi applications.",
"To convert them into stablecoins pegged to fiat currencies."
],
"correctAnswers": [2],
"hint": "Consider how wrapping affects interoperability within the EVM ecosystem.",
"explanation": "Wrapping native tokens into ERC-20 tokens allows them to conform to the ERC-20 standard, making them compatible with decentralized applications, exchanges, and smart contracts that require ERC-20 tokens. This enhances interoperability and usability within the blockchain ecosystem.",
"chapter": "Interchain Token Transfer"
},
"123": {
"question": "Which of the following best describes the 'Lock & Mint' mechanism in asset bridging?",
"options": [
"Locking assets on the source blockchain and minting equivalent tokens on the target blockchain.",
"Burning assets on both the source and target blockchains simultaneously.",
"Using custodians to manage and transfer assets between blockchains.",
"Releasing assets without the need for smart contracts or locking mechanisms."
],
"correctAnswers": [0],
"hint": "Consider how assets are secured on one chain and represented on another.",
"explanation": "In the 'Lock & Mint' mechanism, assets are locked in a smart contract on the source blockchain, and an equivalent amount of wrapped tokens are minted on the target blockchain. This allows the asset's value to be transferred and used on a different blockchain.",
"chapter": "Interchain Token Transfer"
},
"124": {
"question": "Which type of smart contract exploit allows attackers to repeatedly withdraw funds before the contract's state is updated?",
"options": [
"Reentrancy Attacks",
"Arithmetic Errors",
"Logic Flaws",
"Phishing Attacks"
],
"correctAnswers": [0],
"hint": "Consider exploits involving recursive calls to a contract.",
"explanation": "Reentrancy attacks exploit a contract's ability to call itself before the initial function call is completed, allowing attackers to repeatedly withdraw funds before the contract's state is updated.",
"chapter": "Interchain Token Transfer"
},
"125": {
"question": "Which statement is true about token transfers in the Avalanche Interchain Token Transfer Design?",
"options": [
"Only ERC20 tokens can be transferred; native tokens are not supported.",
"Transfers must involve the same token type on both home and remote chains.",
"Any combination of ERC20 and native tokens can be transferred between home and remote chains.",
"Token transfers require approval from network administrators."
],
"correctAnswers": [2],
"hint": "Consider the flexibility of token types allowed in transfers.",
"explanation": "The Avalanche Interchain Token Transfer Design supports transferring tokens with any combination of ERC20 and native tokens between home and remote chains, including ERC20 to ERC20, ERC20 to Native, Native to ERC20, and Native to Native.",
"chapter": "Interchain Token Transfer"
},
"126": {
"question": "What is the purpose of the `_tokenMultiplier` in the `TokenRemote` contract when bridging assets between chains with different decimal systems?",
"options": [
"It adjusts the token amount to match the decimal system of the target chain by multiplying or dividing as necessary.",
"It locks the tokens on the source chain before transfer.",
"It handles the minting of new tokens on the target chain.",
"It calculates the transaction fees for cross-chain transfers."
],
"correctAnswers": [0],
"hint": "Consider how token amounts are scaled between chains with different decimal places.",
"explanation": "The `_tokenMultiplier` is used to scale the token amounts when transferring between chains with different decimal systems. It is calculated based on the difference in decimals between the home and remote tokens and ensures that the token value remains consistent across chains.",
"chapter": "Interchain Token Transfer"
},
"127": {
"question": "Can there be multiple TokenRemotes for a single TokenHome?",
"hint": "Think about how tokens are transferred between chains and where they originate from.",
"options": [
"Yes",
"No"
],
"correctAnswers": [0],
"explanation": "Yes, there can be multiple TokenRemotes for a single TokenHome. This allows the same token to be bridged to multiple chains, enabling cross-chain interoperability and use cases across different blockchain networks.",
"chapter": "Interchain Token Transfer"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ A native token in a blockchain running the Ethereum Virtual Machine (EVM) refers
- Dexalot: ALOT
- many more...

The native token serves as both a means of value transfer within the EVM network and as the gas token for executing transfers or smart contracts. Therefore, native tokens play a crucial role in the EVM chain by enabling participants to interact with and utilize the platform's decentralized features, serving as the foundational unit of value.
The native token serves as both a means of value transfer within the EVM network and as the gas token for executing transfers or smart contracts. Therefore, native tokens play a crucial role in the EVM chain by enabling participants to interact with and utilize the platform's decentralized features, serving as the foundational unit of value.
<Quiz quizId="118" />
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,5 @@ Well done! You transferred native tokens to a Smart Contract.
It's important to understand the distinction between Native Tokens and ERC-20 tokens. Native tokens, such as `AVAX` or `ETH`, are transferred directly to payable functions within the smart contract. This process is straightforward and involves sending the tokens to the contract's address, invoking the payable function.

On the other hand, ERC-20 tokens require a different approach due to their standardized interface. We will cover that in the following sections.

<Quiz quizId="119" />
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,4 @@ Returns the amount which _spender is still allowed to withdraw from _owner.
Transfers _value amount of tokens from address _from to address _to


<Quiz quizId="120" />
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,6 @@ cast call $ERC20_CONTRACT_L1 "balanceOf(address)(uint256)" $ERC20_RECEIVER_L1 --
```

</Step>
</Steps>
</Steps>

<Quiz quizId="121" />
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,4 @@ Examples of Wrapped Tokens:
- wETH
- BTC.b (this is not only wrapped, but also bridged to the Avalanche Ecosystem but represented as ERC20 to gain compatibility with the Avalanche C-chain ecosystem.)





<Quiz quizId="122" />
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,5 @@ Advanced bridges such as Avalanche Interchain Token Transfer utilize native cros
- Enhanced Liquidity: Bridging increases the liquidity of assets by allowing them to be used across different DeFi platforms and blockchain networks. This enhances trading opportunities and financial activities.
- Interoperability: It fosters interoperability between different blockchains, enabling users to access a broader range of services and applications.
- Flexibility: Users can move assets to chains with lower fees, faster transaction times, or better functionalities, optimizing their experience and strategies.

<Quiz quizId="123" />
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,5 @@ Phishing and social engineering attacks target users or administrators rather th
6. **Insurance and Compensation**: Use insurance mechanisms or compensation funds to mitigate the impact of potential losses from breaches.

By understanding and addressing these common bridge hacks, developers and users can better protect their assets and improve the overall security of cross-chain bridging solutions.

<Quiz quizId="124" />
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@ Home contract instances specify the asset to be transferred as either an ERC20 t
- `Native` -> `ERC20`
- `Native` -> `Native`

The remote tokens are designed to have compatibility with the token transferrer on the home chain by default, and they allow custom logic to be implemented in addition. For example, developers can inherit and extend the `ERC20TokenRemote` contract to add additional functionality, such as a custom minting, burning, or transfer logic.
The remote tokens are designed to have compatibility with the token transferrer on the home chain by default, and they allow custom logic to be implemented in addition. For example, developers can inherit and extend the `ERC20TokenRemote` contract to add additional functionality, such as a custom minting, burning, or transfer logic.

<Quiz quizId="125" />
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ In this example, our _R<sub>a</sub>_ chain is `myblockchain`, our _R<sub>b</sub>
3. Perform a multi-hop transfer of `TOK` from `myblockchain` to `myblockchain2`, with a 'hop' through the Avalanche C-Chain


<Quiz quizId="127"/>
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,6 @@ For example, transferring `100 × 10^{18}` (which is 100 USDC in the 18-decimal

This results in 100 × 10^6 USDC, which correctly represents 100 USDC in the 6-decimal system.

By applying this multiplier, tokens retain their value across chains with different decimal systems.
By applying this multiplier, tokens retain their value across chains with different decimal systems.

<Quiz quizId="126" />
14 changes: 14 additions & 0 deletions content/course/interchain-token-transfer/certificate.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: Course Completion Certificate
updated: 2024-10-11
authors: [owenwahlgren]
icon: BadgeCheck
---

import CertificatePage from '@/components/certificates';

You've made it to the end of the course. Let's check your progress and get your certificate.

<CertificatePage courseId="interchain-token-transfer"/>

Thank you for participating in this course. We hope you found it informative and enjoyable!
4 changes: 3 additions & 1 deletion content/course/interchain-token-transfer/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
"---Cross-Chain Token Swaps---",
"...13-cross-chain-token-swaps",
"---Scaling Token Decimals---",
"...14-scaling-decimals"
"...14-scaling-decimals",
"---Conclusion---",
"certificate"
]
}

0 comments on commit 5d58613

Please sign in to comment.