diff --git a/mover/phuclam/README.md b/mover/phuclam/README.md new file mode 100644 index 00000000..703cbe0c --- /dev/null +++ b/mover/phuclam/README.md @@ -0,0 +1,46 @@ +## Basic Information +- Sui Wallet Address: `0x83c1cf7f43e1796c8a1d36faec580d72d7d91d91fcff4b9acde7ff9179cb7202` +> 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: `PhucLam202`[https://github.com/PhucLam202] + +## Personal Introduction +- Work Experience: `1 years` +- Tech Stack: `Rust` `Typescript` `Nodejs` , etc. +> Important: Please take your personal introduction seriously. +- Half year of experience in web2 back-end development,got a litter bit of experience in blockchain research, particularly interested in Move and rust, aiming to use Move as an entry point into blockchain. +- Contact: telegram `AlexLamZ9`[https://t.me/AlexLamZ9] + +## Tasks + +### 01 hello move +- [x] `Sui CLI Version`: 1.38.3 +- [x] `Sui Wallet Screenshot`: Link to image uploaded to `images` folder [link](./images/task1_wallet_address.png) +- [x] `Package ID`: 0xc90e0bc5dd0dda8637ea78e52d940b179f51e4893a285d474b626d4d9507eafd +- [x] `Package ID's Screenshot from Explorer: Link to image uploaded to `images` folder [link](./images/task1_packageId.png) + +### 02 move coin +- [x] `My Coin Package ID`: 0x6494ddac93e81801903de414722b3641efa61dc83859603e67e6d2bfa833e8e4 +- [x] `Faucet Coin Package ID`:0xbb6414aea77149258beb7b490b9bdc74f2827e14304a19a726da8cc8bb3c5f25 +- [x] `Transfer My Coin hash`: CRD7KUBMLXWCTZ3LcAHgLXCCAs1FBCUbfSphpeDDS54z +- [x] `Faucet Coin address 1 mint hash`: 0xbb6414aea77149258beb7b490b9bdc74f2827e14304a19a726da8cc8bb3c5f25 +- [x] `Faucet Coin address 2 mint hash`: 0xbb6414aea77149258beb7b490b9bdc74f2827e14304a19a726da8cc8bb3c5f25 + +### 03 move nft +- [x] `NFT Package ID`:0xcb779f2f2b5887e6d926369d8244e02273b96de8968784e9c2d9f62a931ee4ef +- [x] `NFT Object ID`: 0xda514abcb71ec99f27a635059d318886747fae3fb4466f2d9c3b4ad47429ca56 +- [x] `Transfer NFT hash`: 4RjtJHXvHPcz8JVx7uEJq1DHqcBDYp8QeXmXAML1x7aa +- [x] `NFT's Screenshot from Explorer`: Link to image uploaded to `images` folder [link](./images/task3_NFT.png) + +### 04 move game +- [x] `Game Package ID`: 0x375e73614b265a38abbc8797c2112f6f46554c4f91e46a38cc6a52ea4833bb05 +- [x] `Deposit Coin Hash`: GHLgW4Ax1zSDUZ8WZNLVjqkMWExwGAj34axiPywLGt6S +- [x] `Withdraw Coin Hash`: HDbkgFmX2KgMMReWVLXo23VAAnb6BBTbkyv2RDRFLytn +- [x] `Play Game Hash`: DPnN4RgurAfVn8HaqEFGpRgmG1aPPhTZXGw8MVaJQtGY + +### 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/phuclam/code/task_1_hello_word/Move.lock b/mover/phuclam/code/task_1_hello_word/Move.lock new file mode 100644 index 00000000..1609f918 --- /dev/null +++ b/mover/phuclam/code/task_1_hello_word/Move.lock @@ -0,0 +1,40 @@ +# @generated by Move, please check-in and do not edit manually. + +[move] +version = 3 +manifest_digest = "C5320A3324AE6D30249ECB86B243B0ECAE981F0FA7468EA5FF67D4090E264AAD" +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.38.3" +edition = "2024.beta" +flavor = "sui" + +[env] + +[env.devnet] +chain-id = "663dca31" +original-published-id = "0x77e1400464dd231b612a6b9d480a90ad794fd3259f721164f63244c051c809e0" +latest-published-id = "0x77e1400464dd231b612a6b9d480a90ad794fd3259f721164f63244c051c809e0" +published-version = "1" + +[env.testnet] +chain-id = "4c78adac" +original-published-id = "0xc90e0bc5dd0dda8637ea78e52d940b179f51e4893a285d474b626d4d9507eafd" +latest-published-id = "0xc90e0bc5dd0dda8637ea78e52d940b179f51e4893a285d474b626d4d9507eafd" +published-version = "1" diff --git a/mover/phuclam/code/task_1_hello_word/Move.toml b/mover/phuclam/code/task_1_hello_word/Move.toml new file mode 100644 index 00000000..7660ecff --- /dev/null +++ b/mover/phuclam/code/task_1_hello_word/Move.toml @@ -0,0 +1,37 @@ +[package] +name = "task_1_hello_word" +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] +task_1_hello_word = "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/phuclam/code/task_1_hello_word/sources/task_1_hello_word.move b/mover/phuclam/code/task_1_hello_word/sources/task_1_hello_word.move new file mode 100644 index 00000000..4c103092 --- /dev/null +++ b/mover/phuclam/code/task_1_hello_word/sources/task_1_hello_word.move @@ -0,0 +1,21 @@ +/* +/// Module: task_1_hello_word +module task_1_hello_word::task_1_hello_word; +*/ +module task_1_hello_word::task_1_hello_word{ + + use std::string; + + public struct HelloWordObj has key, store{ + id:UID, + text: string::String, + } + #[lint_allow(self_transfer)] + public entry fun hello_word(ctx: &mut TxContext){ + let object = HelloWordObj{ + id: object::new(ctx), + text: string::utf8(b"Hello, World!"), + }; + transfer::public_transfer(object,tx_context::sender(ctx)); + } +} \ No newline at end of file diff --git a/mover/phuclam/code/task_1_hello_word/tests/task_1_hello_word_tests.move b/mover/phuclam/code/task_1_hello_word/tests/task_1_hello_word_tests.move new file mode 100644 index 00000000..6ddb9585 --- /dev/null +++ b/mover/phuclam/code/task_1_hello_word/tests/task_1_hello_word_tests.move @@ -0,0 +1,18 @@ +/* +#[test_only] +module task_1_hello_word::task_1_hello_word_tests; +// uncomment this line to import the module +// use task_1_hello_word::task_1_hello_word; + +const ENotImplemented: u64 = 0; + +#[test] +fun test_task_1_hello_word() { + // pass +} + +#[test, expected_failure(abort_code = ::task_1_hello_word::task_1_hello_word_tests::ENotImplemented)] +fun test_task_1_hello_word_fail() { + abort ENotImplemented +} +*/ diff --git a/mover/phuclam/code/task_2_move_coin/faucet_token/Move.lock b/mover/phuclam/code/task_2_move_coin/faucet_token/Move.lock new file mode 100644 index 00000000..733eee85 --- /dev/null +++ b/mover/phuclam/code/task_2_move_coin/faucet_token/Move.lock @@ -0,0 +1,34 @@ +# @generated by Move, please check-in and do not edit manually. + +[move] +version = 3 +manifest_digest = "BA7BB5EE93CA7B3D2E7B1C2456BB0DD2B68B215A705269343E29E17FE9D195F0" +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.38.3" +edition = "2024.beta" +flavor = "sui" + +[env] + +[env.testnet] +chain-id = "4c78adac" +original-published-id = "0xbbffb7150d83e1f6adc1109efbd1db064dfc0313516d9146423299957db5ac37" +latest-published-id = "0xbbffb7150d83e1f6adc1109efbd1db064dfc0313516d9146423299957db5ac37" +published-version = "1" diff --git a/mover/phuclam/code/task_2_move_coin/faucet_token/Move.toml b/mover/phuclam/code/task_2_move_coin/faucet_token/Move.toml new file mode 100644 index 00000000..598d2e8a --- /dev/null +++ b/mover/phuclam/code/task_2_move_coin/faucet_token/Move.toml @@ -0,0 +1,37 @@ +[package] +name = "faucet_token" +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] +faucet_token = "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/phuclam/code/task_2_move_coin/faucet_token/sources/faucet_token.move b/mover/phuclam/code/task_2_move_coin/faucet_token/sources/faucet_token.move new file mode 100644 index 00000000..fbc2dc95 --- /dev/null +++ b/mover/phuclam/code/task_2_move_coin/faucet_token/sources/faucet_token.move @@ -0,0 +1,34 @@ +module faucet_token::faucet_token { + use sui::coin::{Self, create_currency, TreasuryCap}; + use sui::url::{Self}; + use sui::transfer; + use sui::tx_context::{Self, TxContext, sender}; + use std::option::{Self, some}; + + + // Define the one-time witness struct + public struct FAUCET_TOKEN has drop {} + + fun init(witness: FAUCET_TOKEN, ctx: &mut TxContext) { + let (treasury, metadata) = create_currency( + witness, + 8, + b"FAUCET_TOKEN", + b"PhucLam Coin", + b"This is PhucLam's test coin on Sui", + some(url::new_unsafe_from_bytes(b"https://drive.google.com/file/d/11dgb-60066S4IIKgI5tDR4RKueZ-5vWZ/view?usp=sharing")), // icon url + + ctx + ); + transfer::public_freeze_object(metadata); + transfer::public_share_object(treasury); + } + + public entry fun mint( + treasury: &mut TreasuryCap, + ctx: &mut TxContext + ) { + let mint_coin = coin::mint(treasury, 1000000000000000000, ctx); + transfer::public_transfer(mint_coin, ctx.sender()); + } +} diff --git a/mover/phuclam/code/task_2_move_coin/faucet_token/tests/phuclam_faucet_token_tests.move b/mover/phuclam/code/task_2_move_coin/faucet_token/tests/phuclam_faucet_token_tests.move new file mode 100644 index 00000000..c44e488b --- /dev/null +++ b/mover/phuclam/code/task_2_move_coin/faucet_token/tests/phuclam_faucet_token_tests.move @@ -0,0 +1,18 @@ +/* +#[test_only] +module phuclam_faucet_token::phuclam_faucet_token_tests; +// uncomment this line to import the module +// use phuclam_faucet_token::phuclam_faucet_token; + +const ENotImplemented: u64 = 0; + +#[test] +fun test_phuclam_faucet_token() { + // pass +} + +#[test, expected_failure(abort_code = ::phuclam_faucet_token::phuclam_faucet_token_tests::ENotImplemented)] +fun test_phuclam_faucet_token_fail() { + abort ENotImplemented +} +*/ diff --git a/mover/phuclam/code/task_2_move_coin/token/Move.lock b/mover/phuclam/code/task_2_move_coin/token/Move.lock new file mode 100644 index 00000000..6ede7e42 --- /dev/null +++ b/mover/phuclam/code/task_2_move_coin/token/Move.lock @@ -0,0 +1,34 @@ +# @generated by Move, please check-in and do not edit manually. + +[move] +version = 3 +manifest_digest = "5920A43A7D93AA3110BBCF36C427CB46D38596A6EDE0B17E5678C9851F7B401D" +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.38.3" +edition = "2024.beta" +flavor = "sui" + +[env] + +[env.testnet] +chain-id = "4c78adac" +original-published-id = "0x6494ddac93e81801903de414722b3641efa61dc83859603e67e6d2bfa833e8e4" +latest-published-id = "0x6494ddac93e81801903de414722b3641efa61dc83859603e67e6d2bfa833e8e4" +published-version = "1" diff --git a/mover/phuclam/code/task_2_move_coin/token/Move.toml b/mover/phuclam/code/task_2_move_coin/token/Move.toml new file mode 100644 index 00000000..5b8b46ea --- /dev/null +++ b/mover/phuclam/code/task_2_move_coin/token/Move.toml @@ -0,0 +1,37 @@ +[package] +name = "token" +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] +token = "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/phuclam/code/task_2_move_coin/token/sources/token.move b/mover/phuclam/code/task_2_move_coin/token/sources/token.move new file mode 100644 index 00000000..2c973a7e --- /dev/null +++ b/mover/phuclam/code/task_2_move_coin/token/sources/token.move @@ -0,0 +1,32 @@ +module token::token { + use sui::coin::{Self, create_currency, TreasuryCap}; + use sui::url::{Self}; + use sui::transfer; + use sui::tx_context::{Self, TxContext, sender}; + use std::option::{Self, some}; + + // Define the one-time witness struct + public struct TOKEN has drop {} + + fun init(witness: TOKEN, ctx: &mut TxContext) { + let (treasury, metadata) = create_currency( + witness, + 8, + b"PHUCLAM", + b"PhucLam Coin", + b"This is PhucLam's test coin on Sui", + option::none(), + ctx + ); + transfer::public_freeze_object(metadata); + transfer::public_transfer(treasury, sender(ctx)); + } + + public fun mint( + treasury: &mut TreasuryCap, + ctx: &mut TxContext + ) { + let mint_coin = coin::mint(treasury, 1000000000000000000, ctx); + transfer::public_transfer(mint_coin, sender(ctx)); + } +} \ No newline at end of file diff --git a/mover/phuclam/code/task_2_move_coin/token/tests/token_tests.move b/mover/phuclam/code/task_2_move_coin/token/tests/token_tests.move new file mode 100644 index 00000000..821ffca7 --- /dev/null +++ b/mover/phuclam/code/task_2_move_coin/token/tests/token_tests.move @@ -0,0 +1,18 @@ +/* +#[test_only] +module token::token_tests; +// uncomment this line to import the module +// use token::token; + +const ENotImplemented: u64 = 0; + +#[test] +fun test_token() { + // pass +} + +#[test, expected_failure(abort_code = ::token::token_tests::ENotImplemented)] +fun test_token_fail() { + abort ENotImplemented +} +*/ diff --git a/mover/phuclam/code/task_3_move_nft/Move.lock b/mover/phuclam/code/task_3_move_nft/Move.lock new file mode 100644 index 00000000..644fd5f8 --- /dev/null +++ b/mover/phuclam/code/task_3_move_nft/Move.lock @@ -0,0 +1,34 @@ +# @generated by Move, please check-in and do not edit manually. + +[move] +version = 3 +manifest_digest = "8C135C028FCD7C2F86884B78D4A877F335AE0D866E4C47ADE360FCE529AF1EE1" +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.38.3" +edition = "2024.beta" +flavor = "sui" + +[env] + +[env.testnet] +chain-id = "4c78adac" +original-published-id = "0xcb779f2f2b5887e6d926369d8244e02273b96de8968784e9c2d9f62a931ee4ef" +latest-published-id = "0xcb779f2f2b5887e6d926369d8244e02273b96de8968784e9c2d9f62a931ee4ef" +published-version = "1" diff --git a/mover/phuclam/code/task_3_move_nft/Move.toml b/mover/phuclam/code/task_3_move_nft/Move.toml new file mode 100644 index 00000000..7369d6b1 --- /dev/null +++ b/mover/phuclam/code/task_3_move_nft/Move.toml @@ -0,0 +1,37 @@ +[package] +name = "task_3_move_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] +task_3_move_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/phuclam/code/task_3_move_nft/sources/task_3_move_nft.move b/mover/phuclam/code/task_3_move_nft/sources/task_3_move_nft.move new file mode 100644 index 00000000..35f41b6d --- /dev/null +++ b/mover/phuclam/code/task_3_move_nft/sources/task_3_move_nft.move @@ -0,0 +1,24 @@ +module task_3_move_nft::task_3_move_nft{ + + use std::string::{String}; + + public struct PLNFT has key, store{ + id: UID, + name: String, + image_url: String, + creator:address + } + + fun init(ctx: &mut TxContext){ + + let ntf = PLNFT{ + id:object::new(ctx), + name:b"PhucLam NFT".to_string(), + image_url: b"https://tapchibitcoin.io/wp-content/uploads/2023/04/Kucoin-tri-hoan-lich-ban-token-SUI-tapchibitcoin.jpg".to_string(), + creator:ctx.sender() + }; + transfer::transfer(ntf, ctx.sender()); + } + + +} diff --git a/mover/phuclam/code/task_3_move_nft/tests/task_3_move_nft_tests.move b/mover/phuclam/code/task_3_move_nft/tests/task_3_move_nft_tests.move new file mode 100644 index 00000000..ed7a70e9 --- /dev/null +++ b/mover/phuclam/code/task_3_move_nft/tests/task_3_move_nft_tests.move @@ -0,0 +1,18 @@ +/* +#[test_only] +module task_3_move_nft::task_3_move_nft_tests; +// uncomment this line to import the module +// use task_3_move_nft::task_3_move_nft; + +const ENotImplemented: u64 = 0; + +#[test] +fun test_task_3_move_nft() { + // pass +} + +#[test, expected_failure(abort_code = ::task_3_move_nft::task_3_move_nft_tests::ENotImplemented)] +fun test_task_3_move_nft_fail() { + abort ENotImplemented +} +*/ diff --git a/mover/phuclam/code/task_4_game/Move.lock b/mover/phuclam/code/task_4_game/Move.lock new file mode 100644 index 00000000..ea404abf --- /dev/null +++ b/mover/phuclam/code/task_4_game/Move.lock @@ -0,0 +1,43 @@ +# @generated by Move, please check-in and do not edit manually. + +[move] +version = 3 +manifest_digest = "297E7351605813ECFD734C60A86DA771933F61DE6F892C7F1F8AFE03DE9729D7" +deps_digest = "3C4103934B1E040BB6B23F1D610B4EF9F2F1166A50A104EADCF77467C004C600" +dependencies = [ + { id = "Sui", name = "Sui" }, + { id = "faucet_token", name = "faucet_token" }, +] + +[[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.package]] +id = "faucet_token" +source = { local = "../task_2_move_coin/faucet_token" } + +dependencies = [ + { id = "Sui", name = "Sui" }, +] + +[move.toolchain-version] +compiler-version = "1.38.3" +edition = "2024.beta" +flavor = "sui" + +[env] + +[env.testnet] +chain-id = "4c78adac" +original-published-id = "0x375e73614b265a38abbc8797c2112f6f46554c4f91e46a38cc6a52ea4833bb05" +latest-published-id = "0x375e73614b265a38abbc8797c2112f6f46554c4f91e46a38cc6a52ea4833bb05" +published-version = "1" diff --git a/mover/phuclam/code/task_4_game/Move.toml b/mover/phuclam/code/task_4_game/Move.toml new file mode 100644 index 00000000..f000de09 --- /dev/null +++ b/mover/phuclam/code/task_4_game/Move.toml @@ -0,0 +1,37 @@ +[package] +name = "task_4_game" +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" } +faucet_token = {local = "../task_2_move_coin/faucet_token"} + +# To resolve a version conflict and force a specific version for dependency +# override use `override = true` +# Override = { local = "../conflicting/version", override = true } + +[addresses] +task_4_game = "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/phuclam/code/task_4_game/sources/task_4_game.move b/mover/phuclam/code/task_4_game/sources/task_4_game.move new file mode 100644 index 00000000..c0ef9431 --- /dev/null +++ b/mover/phuclam/code/task_4_game/sources/task_4_game.move @@ -0,0 +1,68 @@ +module task_4_game::task_4_game{ + use sui::balance::{Self, Balance}; + use sui::coin::{Self, Coin}; + use faucet_token::faucet_token::FAUCET_TOKEN; + use sui::random::{Self, Random}; + + public struct Game has key { + id: UID, + balance: Balance + } + + public struct Admin has key { + id: UID, + } + + fun init (ctx: &mut TxContext){ + + transfer::share_object(Game{ + id: object::new(ctx), + balance: balance::zero() + }); + + transfer::transfer(Admin{ + id: object::new(ctx) + }, ctx.sender()); + } + + entry fun deposit(game: &mut Game, coin: &mut Coin, amount : u64){ + let spli_balance = balance::split(coin::balance_mut(coin), amount); + balance::join( &mut game.balance, spli_balance); + } + + entry fun withdraw(game: &mut Game,_: &Admin, amount : u64 ,ctx: &mut TxContext){ + let cash = coin::take(&mut game.balance, amount, ctx); + transfer::public_transfer(cash, ctx.sender()); + } + + entry fun play( + game: &mut Game, + random: &Random, + guess: bool, + coin: &mut Coin, + ctx: &mut TxContext + ){ + let mut newRandom = random::new_generator(random, ctx); + let flag = random::generate_bool( &mut newRandom ); + + if(flag == guess){ + let reward = coin::take(&mut game.balance, 100000000, ctx); + coin::join(coin, reward); + } + else{ + deposit(game, coin, 100000000); + } + } + + + + + + + + + + +} + + diff --git a/mover/phuclam/code/task_4_game/tests/task_4_game_tests.move b/mover/phuclam/code/task_4_game/tests/task_4_game_tests.move new file mode 100644 index 00000000..7f0a6cd8 --- /dev/null +++ b/mover/phuclam/code/task_4_game/tests/task_4_game_tests.move @@ -0,0 +1,18 @@ +/* +#[test_only] +module task_4_game::task_4_game_tests; +// uncomment this line to import the module +// use task_4_game::task_4_game; + +const ENotImplemented: u64 = 0; + +#[test] +fun test_task_4_game() { + // pass +} + +#[test, expected_failure(abort_code = ::task_4_game::task_4_game_tests::ENotImplemented)] +fun test_task_4_game_fail() { + abort ENotImplemented +} +*/ diff --git a/mover/phuclam/images/task1_packageId.png b/mover/phuclam/images/task1_packageId.png new file mode 100644 index 00000000..73925686 Binary files /dev/null and b/mover/phuclam/images/task1_packageId.png differ diff --git a/mover/phuclam/images/task1_packages.png b/mover/phuclam/images/task1_packages.png new file mode 100644 index 00000000..8dff41a1 Binary files /dev/null and b/mover/phuclam/images/task1_packages.png differ diff --git a/mover/phuclam/images/task1_wallet_address.png b/mover/phuclam/images/task1_wallet_address.png new file mode 100644 index 00000000..cb37be02 Binary files /dev/null and b/mover/phuclam/images/task1_wallet_address.png differ diff --git a/mover/phuclam/images/task3_NFT.png b/mover/phuclam/images/task3_NFT.png new file mode 100644 index 00000000..b2ebd7f9 Binary files /dev/null and b/mover/phuclam/images/task3_NFT.png differ