Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Quizzes to ICTT Course #188

Merged
merged 3 commits into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
121 changes: 121 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"]
}
},
"quizzes": {
Expand Down Expand Up @@ -221,6 +225,123 @@
"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.",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add note that some blockchains use the native token also as their staking/governance token, but that this is optional

"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 allows the function to receive native blockchain tokens.",
"It enables the function to execute without gas fees.",
"It prevents the function from modifying state variables."
],
"correctAnswers": [1],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct answer always has index 1

"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 enables an owner to authorize a spender to transfer up to a certain amount from the owner's account.",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Grant 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.",
"To authorize the smart contract to transfer tokens from your account.",
"It is not necessary; tokens can be transferred without approval.",
"To check the balance of the smart contract."
],
"correctAnswers": [1],
"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 represent native assets as ERC-20 tokens for compatibility with DeFi applications.",
"To reduce the supply of the native token.",
"To convert them into stablecoins pegged to fiat currencies."
],
"correctAnswers": [1],
"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"
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add a question like "can there be multiple remotes for a single home"

}
}
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 @@ -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" />
Loading