From da88c81c1e913bf9959cae650e311ff0390ebadc Mon Sep 17 00:00:00 2001 From: Gino Date: Thu, 17 Oct 2024 14:26:21 +0100 Subject: [PATCH 1/6] feat(devx) create quizzes for nft page --- .../developer/evm-to-move/creating-nft.json | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 docs/site/static/json/developer/evm-to-move/creating-nft.json diff --git a/docs/site/static/json/developer/evm-to-move/creating-nft.json b/docs/site/static/json/developer/evm-to-move/creating-nft.json new file mode 100644 index 00000000000..1b71d226b4e --- /dev/null +++ b/docs/site/static/json/developer/evm-to-move/creating-nft.json @@ -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 } + ] + } + ] + } + \ No newline at end of file From d16a3ef2eb8f9573c6beadf766da5ec598e46678 Mon Sep 17 00:00:00 2001 From: Gino Date: Thu, 17 Oct 2024 14:30:37 +0100 Subject: [PATCH 2/6] feat(devx) create quizzes for token page --- .../developer/evm-to-move/creating-token.json | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 docs/site/static/json/developer/evm-to-move/creating-token.json diff --git a/docs/site/static/json/developer/evm-to-move/creating-token.json b/docs/site/static/json/developer/evm-to-move/creating-token.json new file mode 100644 index 00000000000..73ae8483bdc --- /dev/null +++ b/docs/site/static/json/developer/evm-to-move/creating-token.json @@ -0,0 +1,41 @@ +{ + "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 } + ] + }, + { + "questionText": "What happens when a Coin object is transferred in IOTA Move?", + "answerOptions": [ + { "answerText": "The Coin object must be split if it's a partial amount.", "isCorrect": true }, + { "answerText": "The entire Coin is burned and a new one is minted.", "isCorrect": false }, + { "answerText": "The Coin is moved to the system's TreasuryCap.", "isCorrect": false }, + { "answerText": "A separate smart contract records the balance.", "isCorrect": false } + ] + } + ] + } + \ No newline at end of file From e315504ed91af5e5656eb761d71ac3575a0ee709 Mon Sep 17 00:00:00 2001 From: Gino Date: Thu, 17 Oct 2024 14:35:28 +0100 Subject: [PATCH 3/6] feat(devx) create quizzes for tooling apis page --- .../developer/evm-to-move/tooling-apis.json | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 docs/site/static/json/developer/evm-to-move/tooling-apis.json diff --git a/docs/site/static/json/developer/evm-to-move/tooling-apis.json b/docs/site/static/json/developer/evm-to-move/tooling-apis.json new file mode 100644 index 00000000000..2cd9cdc14c4 --- /dev/null +++ b/docs/site/static/json/developer/evm-to-move/tooling-apis.json @@ -0,0 +1,41 @@ +{ + "questions": [ + { + "questionText": "What is the most commonly used tool for EVM development?", + "answerOptions": [ + { "answerText": "Remix", "isCorrect": false }, + { "answerText": "Metamask", "isCorrect": false }, + { "answerText": "Hardhat", "isCorrect": true }, + { "answerText": "web3.js", "isCorrect": false } + ] + }, + { + "questionText": "Which tool in the IOTA Move ecosystem is similar to Hardhat for building, testing, and deploying smart contracts?", + "answerOptions": [ + { "answerText": "Move CLI", "isCorrect": true }, + { "answerText": "Remix", "isCorrect": false }, + { "answerText": "ethers.js", "isCorrect": false }, + { "answerText": "Metamask", "isCorrect": false } + ] + }, + { + "questionText": "Which API is most commonly used within the EVM ecosystem?", + "answerOptions": [ + { "answerText": "GraphQL", "isCorrect": false }, + { "answerText": "JSON-RPC", "isCorrect": true }, + { "answerText": "REST API", "isCorrect": false }, + { "answerText": "Move API", "isCorrect": false } + ] + }, + { + "questionText": "Which of the following is a wallet commonly used for EVM-based dApps?", + "answerOptions": [ + { "answerText": "Safe", "isCorrect": false }, + { "answerText": "WalletConnect", "isCorrect": false }, + { "answerText": "Metamask", "isCorrect": true }, + { "answerText": "Gnosis", "isCorrect": false } + ] + } + ] + } + \ No newline at end of file From 788253e0a7bde848ba6b490c7e3478b881ee3c0d Mon Sep 17 00:00:00 2001 From: Gino Date: Thu, 17 Oct 2024 14:42:35 +0100 Subject: [PATCH 4/6] feat(devx) link mdx files to json --- docs/content/developer/evm-to-move/creating-nft.mdx | 5 +++++ docs/content/developer/evm-to-move/creating-token.mdx | 6 ++++++ docs/content/developer/evm-to-move/tooling-apis.mdx | 8 +++++++- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/docs/content/developer/evm-to-move/creating-nft.mdx b/docs/content/developer/evm-to-move/creating-nft.mdx index 0ce4713f47d..243c2932164 100644 --- a/docs/content/developer/evm-to-move/creating-nft.mdx +++ b/docs/content/developer/evm-to-move/creating-nft.mdx @@ -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. @@ -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 + \ No newline at end of file diff --git a/docs/content/developer/evm-to-move/creating-token.mdx b/docs/content/developer/evm-to-move/creating-token.mdx index b66827a9065..45bc4db6fb7 100644 --- a/docs/content/developer/evm-to-move/creating-token.mdx +++ b/docs/content/developer/evm-to-move/creating-token.mdx @@ -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. @@ -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 + \ No newline at end of file diff --git a/docs/content/developer/evm-to-move/tooling-apis.mdx b/docs/content/developer/evm-to-move/tooling-apis.mdx index b787ae5c8e4..05c78aab7ef 100644 --- a/docs/content/developer/evm-to-move/tooling-apis.mdx +++ b/docs/content/developer/evm-to-move/tooling-apis.mdx @@ -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. @@ -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. \ No newline at end of file +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 + \ No newline at end of file From b26870dbc789b83d1823918356e8f8936acaf53f Mon Sep 17 00:00:00 2001 From: Gino Date: Thu, 17 Oct 2024 15:21:43 +0100 Subject: [PATCH 5/6] fix(devx) update tonic --- Cargo.lock | 8 ++++---- .../static/json/developer/evm-to-move/creating-token.json | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8250da9569a..8cb47548a46 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8902,7 +8902,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" dependencies = [ "cfg-if", - "windows-targets 0.52.6", + "windows-targets 0.48.5", ] [[package]] @@ -12010,7 +12010,7 @@ checksum = "0c1318b19085f08681016926435853bbf7858f9c082d0999b80550ff5d9abe15" dependencies = [ "bytes", "heck 0.5.0", - "itertools 0.13.0", + "itertools 0.10.5", "log", "multimap", "once_cell", @@ -12030,7 +12030,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e9552f850d5f0964a4e4d0bf306459ac29323ddfbae05e35a7c0d35cb0803cc5" dependencies = [ "anyhow", - "itertools 0.13.0", + "itertools 0.10.5", "proc-macro2 1.0.86", "quote 1.0.37", "syn 2.0.77", @@ -15459,7 +15459,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ "cfg-if", - "rand 0.8.5", + "rand 0.7.3", "static_assertions", ] diff --git a/docs/site/static/json/developer/evm-to-move/creating-token.json b/docs/site/static/json/developer/evm-to-move/creating-token.json index 73ae8483bdc..9c181161146 100644 --- a/docs/site/static/json/developer/evm-to-move/creating-token.json +++ b/docs/site/static/json/developer/evm-to-move/creating-token.json @@ -12,10 +12,10 @@ { "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 } + { "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 } ] }, { From e1c5283a78a8c58609e90ffc602664d6e397df77 Mon Sep 17 00:00:00 2001 From: Gino Date: Thu, 24 Oct 2024 14:32:36 +0100 Subject: [PATCH 6/6] fix(devx) implement review suggestions --- .../developer/evm-to-move/creating-token.json | 9 ------- .../developer/evm-to-move/tooling-apis.json | 24 +++---------------- 2 files changed, 3 insertions(+), 30 deletions(-) diff --git a/docs/site/static/json/developer/evm-to-move/creating-token.json b/docs/site/static/json/developer/evm-to-move/creating-token.json index 9c181161146..ea477e51010 100644 --- a/docs/site/static/json/developer/evm-to-move/creating-token.json +++ b/docs/site/static/json/developer/evm-to-move/creating-token.json @@ -26,15 +26,6 @@ { "answerText": "It supports unlimited minting without restrictions.", "isCorrect": false }, { "answerText": "It disables the TreasuryCap object.", "isCorrect": false } ] - }, - { - "questionText": "What happens when a Coin object is transferred in IOTA Move?", - "answerOptions": [ - { "answerText": "The Coin object must be split if it's a partial amount.", "isCorrect": true }, - { "answerText": "The entire Coin is burned and a new one is minted.", "isCorrect": false }, - { "answerText": "The Coin is moved to the system's TreasuryCap.", "isCorrect": false }, - { "answerText": "A separate smart contract records the balance.", "isCorrect": false } - ] } ] } diff --git a/docs/site/static/json/developer/evm-to-move/tooling-apis.json b/docs/site/static/json/developer/evm-to-move/tooling-apis.json index 2cd9cdc14c4..ef541a01085 100644 --- a/docs/site/static/json/developer/evm-to-move/tooling-apis.json +++ b/docs/site/static/json/developer/evm-to-move/tooling-apis.json @@ -1,38 +1,20 @@ { "questions": [ - { - "questionText": "What is the most commonly used tool for EVM development?", - "answerOptions": [ - { "answerText": "Remix", "isCorrect": false }, - { "answerText": "Metamask", "isCorrect": false }, - { "answerText": "Hardhat", "isCorrect": true }, - { "answerText": "web3.js", "isCorrect": false } - ] - }, { "questionText": "Which tool in the IOTA Move ecosystem is similar to Hardhat for building, testing, and deploying smart contracts?", "answerOptions": [ - { "answerText": "Move CLI", "isCorrect": true }, + { "answerText": "IOTA Client CLI", "isCorrect": true }, { "answerText": "Remix", "isCorrect": false }, { "answerText": "ethers.js", "isCorrect": false }, { "answerText": "Metamask", "isCorrect": false } ] }, { - "questionText": "Which API is most commonly used within the EVM ecosystem?", - "answerOptions": [ - { "answerText": "GraphQL", "isCorrect": false }, - { "answerText": "JSON-RPC", "isCorrect": true }, - { "answerText": "REST API", "isCorrect": false }, - { "answerText": "Move API", "isCorrect": false } - ] - }, - { - "questionText": "Which of the following is a wallet commonly used for EVM-based dApps?", + "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": "Metamask", "isCorrect": true }, + { "answerText": "IOTA Wallet", "isCorrect": true }, { "answerText": "Gnosis", "isCorrect": false } ] }