diff --git a/mover/ToanTri/README.md b/mover/ToanTri/README.md new file mode 100644 index 00000000..24852daf --- /dev/null +++ b/mover/ToanTri/README.md @@ -0,0 +1,54 @@ +## Basic Information + +- Sui Wallet Address: `0x752e3bd6fa3af28efef30f029338c6ec84d8bb7c8a3dc7c9cbc32b6b1e5e9d8f` + > First-time participants must complete the registration of the wallet address through the first task to have it merged. You should use this address for subsequent tasks. We will also use this address to credit the learning rewards. +- Github: `ToanTri` + +## Personal Introduction + +- Work Experience: `2 months` +- Tech Stack: `React`, `C++`, `Python`, `JavaScript` , etc. + > Important: Please take your personal introduction seriously. +- Years of experience in web2 development, particularly interested in Move, aiming to use Move as an entry point into blockchain. (This is just an example, please write your own introduction and feel free to add more details.) +- Contact: telegram `xxx` + +## Tasks + +### 01 hello move + +- [x] Sui CLI Version: sui 1.39.3 +- [x] Sui Wallet Screenshot: ![](images/sui_wallet.png) +- [x] Package ID: 0x2a2faca7d88f7323b67b68055f575cccaa63f9c575467d36e63fd6fa2b7eee30 +- [x] Package ID's Screenshot from Explorer: ![](images/package_id_Explorer.png) + +### 02 move coin + +- [x] `My Coin` Package ID: 0x218dd0d9ae8bbda16ec6f2e19a4ed47c49933b1a1dfe9d4bfb363f2a7bfc1272 +- [x] `Faucet Coin` Package ID: 0xfe65363e501980e3a9d24baa79c454c8fc11d17f3387aacb9a872e725f902306 +- [x] Transfer `My Coin` hash: F7rTBQDAZ2qHGmNHktKePYQkA8XsRNbFJTdAUPcgRcB2 +- [x] `Faucet Coin` address 1 mint hash: J7qMXyEAzAd9yAWEXRBFdndTk6LKBLuh8jBerk2tCK6z +- [x] `Faucet Coin` address 2 mint hash: ArPmHFBk67uQWEzud6gEogptrqD2qV4D5LCPUt3Bwsoj + +### 03 move nft + +- [x] NFT Package ID: 0xf64e04e1efb593f5feb8272023aa1de151fcbdc8f4fb84f700ceb5d97bc8c774 +- [x] NFT Object ID: 0xf4376807b862d4bbe63b1f38613d688589aeb0a4567ba797ba3892c9dfe3f7ff +- [x] Transfer NFT hash: wXni2mKtXpbwea46PmeQrDszTNcFn25zUguFhpb2gT2 +- [x] NFT's Screenshot from Explorer: ![](images/ToanNFT.png) + +### 04 move game + +- [ ] Game Package ID: +- [ ] Deposit Coin Hash: +- [ ] Withdraw Coin Hash: +- [ ] Play Game Hash: + +### 05 move swap + +- [ ] Swap Package ID: +- [ ] Call Swap Coin A -> Coin B hash: +- [ ] Call Swap Coin B -> Coin A hash: + +### 06 dapp-kit SDK PTB + +- [ ] Save Hash: diff --git a/mover/ToanTri/code/README.md b/mover/ToanTri/code/README.md new file mode 100644 index 00000000..e69de29b diff --git a/mover/ToanTri/code/Task3/create_Nft/.gitignore b/mover/ToanTri/code/Task3/create_Nft/.gitignore new file mode 100644 index 00000000..a007feab --- /dev/null +++ b/mover/ToanTri/code/Task3/create_Nft/.gitignore @@ -0,0 +1 @@ +build/* diff --git a/mover/ToanTri/code/Task3/create_Nft/Move.lock b/mover/ToanTri/code/Task3/create_Nft/Move.lock new file mode 100644 index 00000000..391f9503 --- /dev/null +++ b/mover/ToanTri/code/Task3/create_Nft/Move.lock @@ -0,0 +1,34 @@ +# @generated by Move, please check-in and do not edit manually. + +[move] +version = 3 +manifest_digest = "E418E0492675836FF5956562F361BE071E031551B20B86A878B10665697DE01D" +deps_digest = "F8BBB0CCB2491CA29A3DF03D6F92277A4F3574266507ACD77214D37ECA3F3082" +dependencies = [ + { id = "Sui", name = "Sui" }, +] + +[[move.package]] +id = "MoveStdlib" +source = { git = "https://github.com/MystenLabs/sui.git", rev = "framework/testnet", subdir = "crates\\sui-framework\\packages\\move-stdlib" } + +[[move.package]] +id = "Sui" +source = { git = "https://github.com/MystenLabs/sui.git", rev = "framework/testnet", subdir = "crates/sui-framework/packages/sui-framework" } + +dependencies = [ + { id = "MoveStdlib", name = "MoveStdlib" }, +] + +[move.toolchain-version] +compiler-version = "1.39.3" +edition = "2024.beta" +flavor = "sui" + +[env] + +[env.testnet] +chain-id = "4c78adac" +original-published-id = "0x218a297b1847fd9442d4ab43a4d31b915db24b68d87ebde5e9f36af11ac8362c" +latest-published-id = "0x218a297b1847fd9442d4ab43a4d31b915db24b68d87ebde5e9f36af11ac8362c" +published-version = "1" diff --git a/mover/ToanTri/code/Task3/create_Nft/Move.toml b/mover/ToanTri/code/Task3/create_Nft/Move.toml new file mode 100644 index 00000000..64c9f51f --- /dev/null +++ b/mover/ToanTri/code/Task3/create_Nft/Move.toml @@ -0,0 +1,37 @@ +[package] +name = "create_Nft" +edition = "2024.beta" # edition = "legacy" to use legacy (pre-2024) Move +# license = "" # e.g., "MIT", "GPL", "Apache 2.0" +# authors = ["..."] # e.g., ["Joe Smith (joesmith@noemail.com)", "John Snow (johnsnow@noemail.com)"] + +[dependencies] +Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "framework/testnet" } + +# For remote import, use the `{ git = "...", subdir = "...", rev = "..." }`. +# Revision can be a branch, a tag, and a commit hash. +# MyRemotePackage = { git = "https://some.remote/host.git", subdir = "remote/path", rev = "main" } + +# For local dependencies use `local = path`. Path is relative to the package root +# Local = { local = "../path/to" } + +# To resolve a version conflict and force a specific version for dependency +# override use `override = true` +# Override = { local = "../conflicting/version", override = true } + +[addresses] +create_nft = "0x0" + +# Named addresses will be accessible in Move as `@name`. They're also exported: +# for example, `std = "0x1"` is exported by the Standard Library. +# alice = "0xA11CE" + +[dev-dependencies] +# The dev-dependencies section allows overriding dependencies for `--test` and +# `--dev` modes. You can introduce test-only dependencies here. +# Local = { local = "../path/to/dev-build" } + +[dev-addresses] +# The dev-addresses section allows overwriting named addresses for the `--test` +# and `--dev` modes. +# alice = "0xB0B" + diff --git a/mover/ToanTri/code/Task3/create_Nft/sources/create_nft.move b/mover/ToanTri/code/Task3/create_Nft/sources/create_nft.move new file mode 100644 index 00000000..6d01d723 --- /dev/null +++ b/mover/ToanTri/code/Task3/create_Nft/sources/create_nft.move @@ -0,0 +1,45 @@ + +module 0x0::create_nft { + + use sui::object::{Self, UID}; + use std::string::{Self, String}; + use sui::url::{Self, Url}; + use sui::tx_context::{Self, TxContext}; + + public struct GitNFT has key, store { + + id: UID, + name: String, + image_url: Url, + creator: address + + } + + fun init(ctx: &mut TxContext) { + let obj = GitNFT { + id: object::new(ctx), + name: b"toantri".to_string(), + image_url: url::new_unsafe_from_bytes(b"https://tse1.mm.bing.net/th?id=OIP.CGk72oKzc6G4n4wC5bEZhAHaDX&pid=Api&P=0&h=180"), + creator: ctx.sender() + }; + + transfer::transfer(obj, ctx.sender()); + } + public entry fun mint_nft(ctx: &mut TxContext) { + transfer::transfer(GitNFT{ + id: object::new(ctx), + name: b"toantri".to_string(), + image_url: url::new_unsafe_from_bytes(b"https://tse1.mm.bing.net/th?id=OIP.CGk72oKzc6G4n4wC5bEZhAHaDX&pid=Api&P=0&h=180"), + creator: ctx.sender() + }, ctx.sender()) + } + + public entry fun transfer_nft( + nft: GitNFT, + recipient: address, + ctx: &mut TxContext + ) { + transfer::transfer(nft, recipient); + } +} + diff --git a/mover/ToanTri/code/Task3/create_Nft/tests/create_nft_tests.move b/mover/ToanTri/code/Task3/create_Nft/tests/create_nft_tests.move new file mode 100644 index 00000000..0a22dc16 --- /dev/null +++ b/mover/ToanTri/code/Task3/create_Nft/tests/create_nft_tests.move @@ -0,0 +1,18 @@ +/* +#[test_only] +module create_nft::create_nft_tests; +// uncomment this line to import the module +// use create_nft::create_nft; + +const ENotImplemented: u64 = 0; + +#[test] +fun test_create_nft() { + // pass +} + +#[test, expected_failure(abort_code = ::create_nft::create_nft_tests::ENotImplemented)] +fun test_create_nft_fail() { + abort ENotImplemented +} +*/ diff --git a/mover/ToanTri/code/task1/Hello_Move/.gitignore b/mover/ToanTri/code/task1/Hello_Move/.gitignore new file mode 100644 index 00000000..a007feab --- /dev/null +++ b/mover/ToanTri/code/task1/Hello_Move/.gitignore @@ -0,0 +1 @@ +build/* diff --git a/mover/ToanTri/code/task1/Hello_Move/Move.lock b/mover/ToanTri/code/task1/Hello_Move/Move.lock new file mode 100644 index 00000000..6fc27772 --- /dev/null +++ b/mover/ToanTri/code/task1/Hello_Move/Move.lock @@ -0,0 +1,34 @@ +# @generated by Move, please check-in and do not edit manually. + +[move] +version = 3 +manifest_digest = "52664DA431D121453DE4A63E2A2EEFD5594CFC5E814D55AE51888BE5A9230629" +deps_digest = "F8BBB0CCB2491CA29A3DF03D6F92277A4F3574266507ACD77214D37ECA3F3082" +dependencies = [ + { id = "Sui", name = "Sui" }, +] + +[[move.package]] +id = "MoveStdlib" +source = { git = "https://github.com/MystenLabs/sui.git", rev = "framework/testnet", subdir = "crates\\sui-framework\\packages\\move-stdlib" } + +[[move.package]] +id = "Sui" +source = { git = "https://github.com/MystenLabs/sui.git", rev = "framework/testnet", subdir = "crates/sui-framework/packages/sui-framework" } + +dependencies = [ + { id = "MoveStdlib", name = "MoveStdlib" }, +] + +[move.toolchain-version] +compiler-version = "1.39.3" +edition = "2024.beta" +flavor = "sui" + +[env] + +[env.testnet] +chain-id = "4c78adac" +original-published-id = "0x2a2faca7d88f7323b67b68055f575cccaa63f9c575467d36e63fd6fa2b7eee30" +latest-published-id = "0x2a2faca7d88f7323b67b68055f575cccaa63f9c575467d36e63fd6fa2b7eee30" +published-version = "1" diff --git a/mover/ToanTri/code/task1/Hello_Move/Move.toml b/mover/ToanTri/code/task1/Hello_Move/Move.toml new file mode 100644 index 00000000..4412776d --- /dev/null +++ b/mover/ToanTri/code/task1/Hello_Move/Move.toml @@ -0,0 +1,37 @@ +[package] +name = "Hello_Move" +edition = "2024.beta" # edition = "legacy" to use legacy (pre-2024) Move +# license = "" # e.g., "MIT", "GPL", "Apache 2.0" +# authors = ["..."] # e.g., ["Joe Smith (joesmith@noemail.com)", "John Snow (johnsnow@noemail.com)"] + +[dependencies] +Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "framework/testnet" } + +# For remote import, use the `{ git = "...", subdir = "...", rev = "..." }`. +# Revision can be a branch, a tag, and a commit hash. +# MyRemotePackage = { git = "https://some.remote/host.git", subdir = "remote/path", rev = "main" } + +# For local dependencies use `local = path`. Path is relative to the package root +# Local = { local = "../path/to" } + +# To resolve a version conflict and force a specific version for dependency +# override use `override = true` +# Override = { local = "../conflicting/version", override = true } + +[addresses] +hello_move = "0x0" + +# Named addresses will be accessible in Move as `@name`. They're also exported: +# for example, `std = "0x1"` is exported by the Standard Library. +# alice = "0xA11CE" + +[dev-dependencies] +# The dev-dependencies section allows overriding dependencies for `--test` and +# `--dev` modes. You can introduce test-only dependencies here. +# Local = { local = "../path/to/dev-build" } + +[dev-addresses] +# The dev-addresses section allows overwriting named addresses for the `--test` +# and `--dev` modes. +# alice = "0xB0B" + diff --git a/mover/ToanTri/code/task1/Hello_Move/sources/hello_move.move b/mover/ToanTri/code/task1/Hello_Move/sources/hello_move.move new file mode 100644 index 00000000..ee0b3d71 --- /dev/null +++ b/mover/ToanTri/code/task1/Hello_Move/sources/hello_move.move @@ -0,0 +1,27 @@ + + +module hello_move::hello { + + use sui::object::{Self, UID}; + + use std::string::{Self, String}; + + use sui::tx_context::{Self,TxContext}; + + public struct Hello_ToanTri has key { + id: UID, + name: String, + } + + public fun say_hello_ToanTri(ctx: &mut TxContext) { + let hello_world = Hello_ToanTri { + id: object::new(ctx), + name: string::utf8(b"Toan Tri") + }; + + transfer::transfer(hello_world, tx_context::sender(ctx)); + + } +} + + diff --git a/mover/ToanTri/code/task1/Hello_Move/tests/hello_move_tests.move b/mover/ToanTri/code/task1/Hello_Move/tests/hello_move_tests.move new file mode 100644 index 00000000..7798d8dd --- /dev/null +++ b/mover/ToanTri/code/task1/Hello_Move/tests/hello_move_tests.move @@ -0,0 +1,18 @@ +/* +#[test_only] +module hello_move::hello_move_tests; +// uncomment this line to import the module +// use hello_move::hello_move; + +const ENotImplemented: u64 = 0; + +#[test] +fun test_hello_move() { + // pass +} + +#[test, expected_failure(abort_code = ::hello_move::hello_move_tests::ENotImplemented)] +fun test_hello_move_fail() { + abort ENotImplemented +} +*/ diff --git a/mover/ToanTri/code/task1/README.md b/mover/ToanTri/code/task1/README.md new file mode 100644 index 00000000..e69de29b diff --git a/mover/ToanTri/code/task2/my_coin/.gitignore b/mover/ToanTri/code/task2/my_coin/.gitignore new file mode 100644 index 00000000..a007feab --- /dev/null +++ b/mover/ToanTri/code/task2/my_coin/.gitignore @@ -0,0 +1 @@ +build/* diff --git a/mover/ToanTri/code/task2/my_coin/Move.lock b/mover/ToanTri/code/task2/my_coin/Move.lock new file mode 100644 index 00000000..62b0e3c2 --- /dev/null +++ b/mover/ToanTri/code/task2/my_coin/Move.lock @@ -0,0 +1,34 @@ +# @generated by Move, please check-in and do not edit manually. + +[move] +version = 3 +manifest_digest = "0A4652D38CF3C3FDB79EC6C1C98FCFF7B2E933E12B84A1DA267DB28F66AFECE3" +deps_digest = "F8BBB0CCB2491CA29A3DF03D6F92277A4F3574266507ACD77214D37ECA3F3082" +dependencies = [ + { id = "Sui", name = "Sui" }, +] + +[[move.package]] +id = "MoveStdlib" +source = { git = "https://github.com/MystenLabs/sui.git", rev = "framework/testnet", subdir = "crates\\sui-framework\\packages\\move-stdlib" } + +[[move.package]] +id = "Sui" +source = { git = "https://github.com/MystenLabs/sui.git", rev = "framework/testnet", subdir = "crates/sui-framework/packages/sui-framework" } + +dependencies = [ + { id = "MoveStdlib", name = "MoveStdlib" }, +] + +[move.toolchain-version] +compiler-version = "1.39.3" +edition = "2024.beta" +flavor = "sui" + +[env] + +[env.testnet] +chain-id = "4c78adac" +original-published-id = "0x7e698a6bfe1e3be5aeaa9fe84aa2869a6076f19ce85fcd85dc6a9fda503c67a0" +latest-published-id = "0x7e698a6bfe1e3be5aeaa9fe84aa2869a6076f19ce85fcd85dc6a9fda503c67a0" +published-version = "1" diff --git a/mover/ToanTri/code/task2/my_coin/Move.toml b/mover/ToanTri/code/task2/my_coin/Move.toml new file mode 100644 index 00000000..b9ca003f --- /dev/null +++ b/mover/ToanTri/code/task2/my_coin/Move.toml @@ -0,0 +1,37 @@ +[package] +name = "my_coin" +edition = "2024.beta" # edition = "legacy" to use legacy (pre-2024) Move +# license = "" # e.g., "MIT", "GPL", "Apache 2.0" +# authors = ["..."] # e.g., ["Joe Smith (joesmith@noemail.com)", "John Snow (johnsnow@noemail.com)"] + +[dependencies] +Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "framework/testnet" } + +# For remote import, use the `{ git = "...", subdir = "...", rev = "..." }`. +# Revision can be a branch, a tag, and a commit hash. +# MyRemotePackage = { git = "https://some.remote/host.git", subdir = "remote/path", rev = "main" } + +# For local dependencies use `local = path`. Path is relative to the package root +# Local = { local = "../path/to" } + +# To resolve a version conflict and force a specific version for dependency +# override use `override = true` +# Override = { local = "../conflicting/version", override = true } + +[addresses] +my_coin = "0x0" + +# Named addresses will be accessible in Move as `@name`. They're also exported: +# for example, `std = "0x1"` is exported by the Standard Library. +# alice = "0xA11CE" + +[dev-dependencies] +# The dev-dependencies section allows overriding dependencies for `--test` and +# `--dev` modes. You can introduce test-only dependencies here. +# Local = { local = "../path/to/dev-build" } + +[dev-addresses] +# The dev-addresses section allows overwriting named addresses for the `--test` +# and `--dev` modes. +# alice = "0xB0B" + diff --git a/mover/ToanTri/code/task2/my_coin/sources/my_coin.move b/mover/ToanTri/code/task2/my_coin/sources/my_coin.move new file mode 100644 index 00000000..15f5d370 --- /dev/null +++ b/mover/ToanTri/code/task2/my_coin/sources/my_coin.move @@ -0,0 +1,31 @@ +/* +/// Module: my_coin +module my_coin::my_coin; +*/ + +// For Move coding conventions, see +// https://docs.sui.io/concepts/sui-move-concepts/conventions + + +module 0x0::my_coin { + + use sui::coin::{Self, TreasuryCap}; + use sui::tx_context::{Self, TxContext}; + use sui::transfer; + + public struct MY_COIN has drop {} + + fun init(witness: MY_COIN, ctx: &mut TxContext) { + let (treasury, coinmetada) = coin::create_currency(witness, 5, b"ToanTri", b"Toan coin", b"My first coin", option::none(), ctx); + + transfer::public_freeze_object(coinmetada); + transfer::public_share_object(treasury); + + } + + public entry fun mint_token(treasury: &mut TreasuryCap, ctx: &mut TxContext) { + let coin_object = coin::mint(treasury, 35000, ctx); + transfer::public_transfer(coin_object, ctx.sender()); + } + +} \ No newline at end of file diff --git a/mover/ToanTri/code/task2/my_coin/tests/my_coin_tests.move b/mover/ToanTri/code/task2/my_coin/tests/my_coin_tests.move new file mode 100644 index 00000000..cd5b3606 --- /dev/null +++ b/mover/ToanTri/code/task2/my_coin/tests/my_coin_tests.move @@ -0,0 +1,18 @@ +/* +#[test_only] +module my_coin::my_coin_tests; +// uncomment this line to import the module +// use my_coin::my_coin; + +const ENotImplemented: u64 = 0; + +#[test] +fun test_my_coin() { + // pass +} + +#[test, expected_failure(abort_code = ::my_coin::my_coin_tests::ENotImplemented)] +fun test_my_coin_fail() { + abort ENotImplemented +} +*/ diff --git a/mover/ToanTri/images/Package_id_Explorer.png b/mover/ToanTri/images/Package_id_Explorer.png new file mode 100644 index 00000000..4b1895be Binary files /dev/null and b/mover/ToanTri/images/Package_id_Explorer.png differ diff --git a/mover/ToanTri/images/README.md b/mover/ToanTri/images/README.md new file mode 100644 index 00000000..e69de29b diff --git a/mover/ToanTri/images/ToanNFT.png b/mover/ToanTri/images/ToanNFT.png new file mode 100644 index 00000000..945f74cd Binary files /dev/null and b/mover/ToanTri/images/ToanNFT.png differ diff --git a/mover/ToanTri/images/sui_wallet.png b/mover/ToanTri/images/sui_wallet.png new file mode 100644 index 00000000..942cc47c Binary files /dev/null and b/mover/ToanTri/images/sui_wallet.png differ diff --git a/mover/ToanTri/notes/README.md b/mover/ToanTri/notes/README.md new file mode 100644 index 00000000..e69de29b