Skip to content

Commit

Permalink
Merge pull request #3394 from iotaledger/devx/add-quizzes-to-evm-to-m…
Browse files Browse the repository at this point in the history
…ove-section

feat (devx) - Add Quizzes to Developer >  EVM to Move Section
  • Loading branch information
Ginowine authored Oct 25, 2024
2 parents 4cff616 + e1c5283 commit 0f7d5ec
Show file tree
Hide file tree
Showing 7 changed files with 109 additions and 5 deletions.
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions docs/content/developer/evm-to-move/creating-nft.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
title: Creating an ERC-721-like NFT
---

import Quiz from '@site/src/components/Quiz';
import {questions} from '../../../site/static/json/developer/evm-to-move/creating-nft.json';

## How this works in Solidity / EVM

NFTs (Non-Fungible-Tokens) are a popular building block commonly used in the EVM ecosystem. The most widely used standard on EVM-based chains is the ERC-721 standard, which allows a smart contract to mint and transfer NFTs with some basic metadata. These standard NFTs can be used on many different platforms in a common way to be viewed, traded, and used in other ways.
Expand Down Expand Up @@ -64,3 +67,5 @@ To sum up the most important differences between the two approaches:

NFTs in Move are clearly a big improvement over the afterthought counterparts in the EVM/Solidity ecosystem. There are more assurances and better usability when it comes to asset management.

## Quizzes
<Quiz questions={questions} />
6 changes: 6 additions & 0 deletions docs/content/developer/evm-to-move/creating-token.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
title: Creating an ERC-20-like token
---

import Quiz from '@site/src/components/Quiz';
import {questions} from '../../../site/static/json/developer/evm-to-move/creating-token.json';

## How this works in Solidity / EVM

One of the most commonly used building blocks in Solidity/EVM is a contract implementing the [ERC-20 token standard](https://ethereum.org/en/developers/docs/standards/tokens/erc-20/). The ERC-20 Token standard is for fungible tokens, allowing anyone to deploy their tokens on a chain that works with other dApps expecting them. There's little magic going on here; a token is just a regular smart contract with certain standardized functionality implemented (like a function to get the token's name, symbol, decimals, and functionality to transfer tokens to other addresses). The deployed token contract keeps track of all balances, so if you hold an ERC-20 token, that actually means that a mapping inside that token contract keeps track of how many of those tokens belong to your address.
Expand Down Expand Up @@ -117,3 +120,6 @@ To sum up the most important differences between the two approaches:
| Non-enforced standard functionality (you can implement the ERC-20 functions as you please, including in for users undesired ways) | Enforced standard functionality (every `Coin` can be used in the same way and under the same assumptions) |

While the Solidity/EVM approach is easy to work with and modify from a developer's perspective, it does have its downsides from an end-user perspective. You can not simply assume every ERC-20 token can be transferred as you expected without thoroughly reading and understanding the source code of those smart contracts, which is something most people can't do or don't do, given how time-consuming this is. This can lead to things like getting taxed for transfers (part of the transfer could go to the project deploying, for example), being blocked from doing a transfer (either with a malicious token or through a regulated framework), or simply losing all your tokens because they can be moved based on the logic implemented in the token contract. With the standard `Coin` implementation, this is not the case. You can assume that if you hold a `Coin`, you can always freely transfer it without any further limitations, as long as it's a `Coin` object. The logic is fixed, documented, and well-known.

## Quizzes
<Quiz questions={questions} />
8 changes: 7 additions & 1 deletion docs/content/developer/evm-to-move/tooling-apis.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
title: Tooling and APIs
---

import Quiz from '@site/src/components/Quiz';
import {questions} from '../../../site/static/json/developer/evm-to-move/tooling-apis.json';

## Tooling for EVM/Solidity

EVM has been around for a while and has built a comprehensive library of tools and utilities to interact with the network and contracts. We can categorize the most important tools in various sections and provide the equivalent for IOTA Move in the next section.
Expand Down Expand Up @@ -50,4 +53,7 @@ Like with Solidity and Hardhat, you can write IOTA Move code in any editor, in c

## Conclusion

IOTA Move is quite new compared to the EVM ecosystem, and this is reflected in the amount of tooling available. The tooling available, though, is often offered as part of the core software, is of high quality, and offers everything you need to develop, interact with, and manage your dApps successfully.
IOTA Move is quite new compared to the EVM ecosystem, and this is reflected in the amount of tooling available. The tooling available, though, is often offered as part of the core software, is of high quality, and offers everything you need to develop, interact with, and manage your dApps successfully.

## Quizzes
<Quiz questions={questions} />
32 changes: 32 additions & 0 deletions docs/site/static/json/developer/evm-to-move/creating-nft.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"questions": [
{
"questionText": "What is one key advantage of NFTs in IOTA Move compared to Solidity/EVM NFTs?",
"answerOptions": [
{ "answerText": "Every object is an NFT by default.", "isCorrect": true },
{ "answerText": "NFTs can only be found if you have the smart contract address.", "isCorrect": false },
{ "answerText": "Token logic must be abstracted in external libraries.", "isCorrect": false },
{ "answerText": "Metadata is always hosted off-chain.", "isCorrect": false }
]
},
{
"questionText": "In the ERC-721 standard, what does the `tokenURI` typically point to?",
"answerOptions": [
{ "answerText": "An on-chain metadata file.", "isCorrect": false },
{ "answerText": "A JSON file containing metadata.", "isCorrect": true },
{ "answerText": "The owner's wallet address.", "isCorrect": false },
{ "answerText": "The NFT's image data.", "isCorrect": false }
]
},
{
"questionText": "What is a disadvantage of using ERC-721 NFTs with off-chain metadata?",
"answerOptions": [
{ "answerText": "Metadata cannot be accessed by other contracts.", "isCorrect": false },
{ "answerText": "There is no enforcement of standard NFT behavior.", "isCorrect": false },
{ "answerText": "If the off-chain data is lost, the metadata is also lost.", "isCorrect": true },
{ "answerText": "The NFTs cannot be transferred between owners.", "isCorrect": false }
]
}
]
}

32 changes: 32 additions & 0 deletions docs/site/static/json/developer/evm-to-move/creating-token.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"questions": [
{
"questionText": "What is a key difference between ERC-20 tokens in Solidity/EVM and tokens in IOTA Move?",
"answerOptions": [
{ "answerText": "ERC-20 tokens are stored as owned objects in IOTA Move.", "isCorrect": false },
{ "answerText": "Both native tokens and custom tokens in IOTA Move are Coin objects.", "isCorrect": true },
{ "answerText": "Solidity uses TreasuryCap and Metadata objects for token management.", "isCorrect": false },
{ "answerText": "IOTA Move tokens can only be created using the wIOTA standard.", "isCorrect": false }
]
},
{
"questionText": "What is the purpose of the TreasuryCap in IOTA Move's token management?",
"answerOptions": [
{ "answerText": "It manages token ownership", "isCorrect": false },
{ "answerText": "It enforces token transfers", "isCorrect": false },
{ "answerText": "It allows minting and burning of tokens", "isCorrect": true },
{ "answerText": "It defines the token's metadata", "isCorrect": false }
]
},
{
"questionText": "What is the benefit of using the CoinManager in IOTA Move?",
"answerOptions": [
{ "answerText": "It provides transparent and standardized token management.", "isCorrect": true },
{ "answerText": "It allows tokens to bypass standard Coin functionality.", "isCorrect": false },
{ "answerText": "It supports unlimited minting without restrictions.", "isCorrect": false },
{ "answerText": "It disables the TreasuryCap object.", "isCorrect": false }
]
}
]
}

23 changes: 23 additions & 0 deletions docs/site/static/json/developer/evm-to-move/tooling-apis.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"questions": [
{
"questionText": "Which tool in the IOTA Move ecosystem is similar to Hardhat for building, testing, and deploying smart contracts?",
"answerOptions": [
{ "answerText": "IOTA Client CLI", "isCorrect": true },
{ "answerText": "Remix", "isCorrect": false },
{ "answerText": "ethers.js", "isCorrect": false },
{ "answerText": "Metamask", "isCorrect": false }
]
},
{
"questionText": "Which of the following is a wallet commonly used for IOTA Move-based dApps?",
"answerOptions": [
{ "answerText": "Safe", "isCorrect": false },
{ "answerText": "WalletConnect", "isCorrect": false },
{ "answerText": "IOTA Wallet", "isCorrect": true },
{ "answerText": "Gnosis", "isCorrect": false }
]
}
]
}

0 comments on commit 0f7d5ec

Please sign in to comment.