diff --git a/mover/001/README.md b/mover/001/README.md deleted file mode 100644 index 6aebbd8b..00000000 --- a/mover/001/README.md +++ /dev/null @@ -1,46 +0,0 @@ -## Basic Information -- Sui Wallet Address: `0x0000xxx` -> 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: `your_github_id` - -## Personal Introduction -- Work Experience: `X years` -- Tech Stack: `Rust` `C++` , 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 -- [ ] Sui CLI Version: -- [ ] Sui Wallet Screenshot: Link to image uploaded to `images` folder. -- [ ] Package ID: -- [ ] Package ID's Screenshot from Explorer: Link to image uploaded to `images` folder. - -### 02 move coin -- [ ] `My Coin` Package ID: -- [ ] `Faucet Coin` Package ID: -- [ ] Transfer `My Coin` hash: -- [ ] `Faucet Coin` address 1 mint hash: -- [ ] `Faucet Coin` address 2 mint hash: - -### 03 move nft -- [ ] NFT Package ID: -- [ ] NFT Object ID: -- [ ] Transfer NFT hash: -- [ ] NFT's Screenshot from Explorer: Link to image uploaded to `images` folder. - -### 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/tung-lee/README.md b/mover/tung-lee/README.md new file mode 100644 index 00000000..c9405cc4 --- /dev/null +++ b/mover/tung-lee/README.md @@ -0,0 +1,49 @@ +## Basic Information +- Sui Wallet Address: `0xb4b291607e91da4654cab88e5e35ba2921ef68f1b43725ef2faeae045bf5915d` +> 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: `tung-lee` + +## Personal Introduction +- Work Experience: `1 years` +- Tech Stack: `Rust`, `JavaScript`, `TypeScript`, `React`, `Node.js`, `Docker` +> 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 `@tunglee2410` + +## Tasks + +### 01 hello move +- [x] Sui CLI Version: sui 1.38.3-homebrew +- [x] Sui Wallet Screenshot: Link to image uploaded to `images` folder. +![Sui Wallet](./images/task1/sui-wallet.png) +- [x] Package ID: 0x8c2dd46a3a7e91d882495a2eca03926dd08b14969b677c7d1deeab5169e9e850 +- [x] Package ID's Screenshot from Explorer: Link to image uploaded to `images` folder. +![Package ID](./images/task1/package-id-explorer.png) + +### 02 move coin +- [x] `My Coin` Package ID: 0x8bfe3c76dfc8a1e65a25224cac75d3ec26e243c45e48a72fefa2d2576ecc1263 +- [x] `Faucet Coin` Package ID: 0xf8d69746f4142542458b36bf9f92bb0b01284b24413872aaacd4e265bf9fe5f6 +- [x] Transfer `My Coin` hash: C3aGxykkgpA4sV2FqeYktDvfLpkSnX3twnm8yfbygEV2 +- [x] `Faucet Coin` address 1 mint hash: Ghmb8H97sDxxsRSP7vUD2bmHsDiMY3iUBR9RGajh1odX +- [x] `Faucet Coin` address 2 mint hash: 3soCfRkcrhjV7RMo4vQC2rsnEGtrG57JhNXLh3X6xYgL + +### 03 move nft +- [x] NFT Package ID: 0x814b604ff40f3cabff7879877b13925b87be14ef6d52e182511fe703c2af3179 +- [x] NFT Object ID: 0xef091babdde82844a3e369fd0cba34e04c05dd4600f74ca66da4781a1d4c8640 +- [x] Transfer NFT hash: CbAeZq97zTJvxBqKU9Zq2GjpSD9PQtr5tWQ64oYQSCsS +- [x] NFT's Screenshot from Explorer: Link to image uploaded to `images` folder. +![NFT](./images/task3/nft.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/001/code/README.md b/mover/tung-lee/code/README.md similarity index 100% rename from mover/001/code/README.md rename to mover/tung-lee/code/README.md diff --git a/mover/001/code/task1/README.md b/mover/tung-lee/code/task1/README.md similarity index 100% rename from mover/001/code/task1/README.md rename to mover/tung-lee/code/task1/README.md diff --git a/mover/tung-lee/code/task1/hello_world/Move.lock b/mover/tung-lee/code/task1/hello_world/Move.lock new file mode 100644 index 00000000..a7b3a2af --- /dev/null +++ b/mover/tung-lee/code/task1/hello_world/Move.lock @@ -0,0 +1,34 @@ +# @generated by Move, please check-in and do not edit manually. + +[move] +version = 3 +manifest_digest = "60F2000F4D6DAD240EF371DB3BC521F7BD4C8B814BC59CA473B852B77FDBE53C" +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 = "0x8c2dd46a3a7e91d882495a2eca03926dd08b14969b677c7d1deeab5169e9e850" +latest-published-id = "0x8c2dd46a3a7e91d882495a2eca03926dd08b14969b677c7d1deeab5169e9e850" +published-version = "1" diff --git a/mover/tung-lee/code/task1/hello_world/Move.toml b/mover/tung-lee/code/task1/hello_world/Move.toml new file mode 100644 index 00000000..201de173 --- /dev/null +++ b/mover/tung-lee/code/task1/hello_world/Move.toml @@ -0,0 +1,37 @@ +[package] +name = "hello_world" +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_world = "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/tung-lee/code/task1/hello_world/sources/hello_world.move b/mover/tung-lee/code/task1/hello_world/sources/hello_world.move new file mode 100644 index 00000000..8423b318 --- /dev/null +++ b/mover/tung-lee/code/task1/hello_world/sources/hello_world.move @@ -0,0 +1,20 @@ +module hello_world::hello_world { + use std::string; + use sui::object; + use sui::transfer; + use sui::tx_context; + + public struct HelloWorldObject has key, store { + id: UID, + github_id: string::String + } + + #[lint_allow(self_transfer)] + public entry fun hello_world(ctx: &mut TxContext) { + let object = HelloWorldObject { + id: object::new(ctx), + github_id: string::utf8(b"tung-lee") + }; + transfer::public_transfer(object, tx_context::sender(ctx)); + } +} \ No newline at end of file diff --git a/mover/tung-lee/code/task1/hello_world/tests/hello_world_tests.move b/mover/tung-lee/code/task1/hello_world/tests/hello_world_tests.move new file mode 100644 index 00000000..4cd0dfbb --- /dev/null +++ b/mover/tung-lee/code/task1/hello_world/tests/hello_world_tests.move @@ -0,0 +1,18 @@ +/* +#[test_only] +module hello_world::hello_world_tests; +// uncomment this line to import the module +// use hello_world::hello_world; + +const ENotImplemented: u64 = 0; + +#[test] +fun test_hello_world() { + // pass +} + +#[test, expected_failure(abort_code = ::hello_world::hello_world_tests::ENotImplemented)] +fun test_hello_world_fail() { + abort ENotImplemented +} +*/ diff --git a/mover/tung-lee/code/task2/README.md b/mover/tung-lee/code/task2/README.md new file mode 100644 index 00000000..c9226340 --- /dev/null +++ b/mover/tung-lee/code/task2/README.md @@ -0,0 +1,19 @@ +# Mint token `My Coin` +``` +sui client call --package 0x8bfe3c76dfc8a1e65a25224cac75d3ec26e243c45e48a72fefa2d2576ecc1263 --module my_coin --function mint_token --args 0xe1b921c5ad1aa3feb31fe499ef396eaf310834b710f4956e626088b58574746f +``` + +# Mint and Transfer token `My Coin` +``` +sui client call --package 0x2 --module coin --function mint_and_transfer --args 0xe1b921c5ad1aa3feb31fe499ef396eaf310834b710f4956e626088b58574746f 10000000 0x3b042837d6ea719c6a4e6da7feb34e33ea098cdfb0fe10cc3172151edacbdd21 --type-args 0x8bfe3c76dfc8a1e65a25224cac75d3ec26e243c45e48a72fefa2d2576ecc1263::my_coin::MY_COIN +``` + +# Transfer token `My Coin` +``` +sui client transfer --to 0xa9ddd77d41119bdcbab0f5c4d18bf15e65034607afc5a296865f640e0d33d958 --object-id 0x7f363acb1e460d8b1c19790e66e7f99f94c0991600ff47ea9abf2dca7c17815c +``` + +# Mint token `Faucet Coin` +``` +sui client call --package 0xf8d69746f4142542458b36bf9f92bb0b01284b24413872aaacd4e265bf9fe5f6 --module faucet_coin --function mint_token --args 0x3790f889232d5d8bda1ea32a4842a0727d7a9ed115f2a32284509429dbfd1d85 +``` diff --git a/mover/tung-lee/code/task2/faucet_coin/Move.lock b/mover/tung-lee/code/task2/faucet_coin/Move.lock new file mode 100644 index 00000000..dcf1bd32 --- /dev/null +++ b/mover/tung-lee/code/task2/faucet_coin/Move.lock @@ -0,0 +1,34 @@ +# @generated by Move, please check-in and do not edit manually. + +[move] +version = 3 +manifest_digest = "F8CFCF256E2F1BB7CD401C27799A09C40777C5C100F0DFA253E86DD7F0D4ED1B" +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 = "0xf8d69746f4142542458b36bf9f92bb0b01284b24413872aaacd4e265bf9fe5f6" +latest-published-id = "0xf8d69746f4142542458b36bf9f92bb0b01284b24413872aaacd4e265bf9fe5f6" +published-version = "1" diff --git a/mover/tung-lee/code/task2/faucet_coin/Move.toml b/mover/tung-lee/code/task2/faucet_coin/Move.toml new file mode 100644 index 00000000..1b517a2b --- /dev/null +++ b/mover/tung-lee/code/task2/faucet_coin/Move.toml @@ -0,0 +1,37 @@ +[package] +name = "faucet_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] +faucet_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/tung-lee/code/task2/faucet_coin/sources/faucet_coin.move b/mover/tung-lee/code/task2/faucet_coin/sources/faucet_coin.move new file mode 100644 index 00000000..1a7dc207 --- /dev/null +++ b/mover/tung-lee/code/task2/faucet_coin/sources/faucet_coin.move @@ -0,0 +1,34 @@ +/* +/// Module: faucet_coin +module faucet_coin::faucet_coin; +*/ + +module 0x0::faucet_coin { + use sui::coin::{Self, TreasuryCap}; + use sui::tx_context::{Self, TxContext}; + use sui::transfer; + + // One time witness + public struct FAUCET_COIN has drop {} + + + fun init(witness: FAUCET_COIN, ctx: &mut TxContext) { + let (treasury_cap, coin_metadata) = coin::create_currency( + witness, + 5, + b"FC", + b"faucet coin", + b"My faucet coin", + option::none(), + ctx + ); + + transfer::public_freeze_object(coin_metadata); + transfer::public_share_object(treasury_cap); + } + + public entry fun mint_token(treasury_cap: &mut TreasuryCap, ctx: &mut TxContext) { + let coin_obj = coin::mint(treasury_cap, 100000, ctx); + transfer::public_transfer(coin_obj, ctx.sender()); + } +} \ No newline at end of file diff --git a/mover/tung-lee/code/task2/faucet_coin/tests/faucet_coin_tests.move b/mover/tung-lee/code/task2/faucet_coin/tests/faucet_coin_tests.move new file mode 100644 index 00000000..74b01751 --- /dev/null +++ b/mover/tung-lee/code/task2/faucet_coin/tests/faucet_coin_tests.move @@ -0,0 +1,18 @@ +/* +#[test_only] +module faucet_coin::faucet_coin_tests; +// uncomment this line to import the module +// use faucet_coin::faucet_coin; + +const ENotImplemented: u64 = 0; + +#[test] +fun test_faucet_coin() { + // pass +} + +#[test, expected_failure(abort_code = ::faucet_coin::faucet_coin_tests::ENotImplemented)] +fun test_faucet_coin_fail() { + abort ENotImplemented +} +*/ diff --git a/mover/tung-lee/code/task2/my_coin/Move.lock b/mover/tung-lee/code/task2/my_coin/Move.lock new file mode 100644 index 00000000..680c63a0 --- /dev/null +++ b/mover/tung-lee/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.38.3" +edition = "2024.beta" +flavor = "sui" + +[env] + +[env.testnet] +chain-id = "4c78adac" +original-published-id = "0x8bfe3c76dfc8a1e65a25224cac75d3ec26e243c45e48a72fefa2d2576ecc1263" +latest-published-id = "0x8bfe3c76dfc8a1e65a25224cac75d3ec26e243c45e48a72fefa2d2576ecc1263" +published-version = "1" diff --git a/mover/tung-lee/code/task2/my_coin/Move.toml b/mover/tung-lee/code/task2/my_coin/Move.toml new file mode 100644 index 00000000..b9ca003f --- /dev/null +++ b/mover/tung-lee/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/tung-lee/code/task2/my_coin/sources/my_coin.move b/mover/tung-lee/code/task2/my_coin/sources/my_coin.move new file mode 100644 index 00000000..155735de --- /dev/null +++ b/mover/tung-lee/code/task2/my_coin/sources/my_coin.move @@ -0,0 +1,34 @@ +/* +/// Module: my_coin +module my_coin::my_coin; +*/ + +module 0x0::my_coin { + use sui::coin::{Self, TreasuryCap}; + use sui::tx_context::{Self, TxContext}; + use sui::transfer; + + // One time witness + public struct MY_COIN has drop {} + + + fun init(witness: MY_COIN, ctx: &mut TxContext) { + let (treasury_cap, coin_metadata) = coin::create_currency( + witness, + 5, + b"TL", + b"tung-lee coin", + b"My fungible token", + option::none(), + ctx + ); + + transfer::public_freeze_object(coin_metadata); + transfer::public_transfer(treasury_cap, ctx.sender()); + } + + public fun mint_token(treasury_cap: &mut TreasuryCap, ctx: &mut TxContext) { + let coin_obj = coin::mint(treasury_cap, 100000, ctx); + transfer::public_transfer(coin_obj, ctx.sender()); + } +} \ No newline at end of file diff --git a/mover/tung-lee/code/task2/my_coin/tests/my_coin_tests.move b/mover/tung-lee/code/task2/my_coin/tests/my_coin_tests.move new file mode 100644 index 00000000..cd5b3606 --- /dev/null +++ b/mover/tung-lee/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/tung-lee/code/task3/README.md b/mover/tung-lee/code/task3/README.md new file mode 100644 index 00000000..06fe10a1 --- /dev/null +++ b/mover/tung-lee/code/task3/README.md @@ -0,0 +1,4 @@ +# Transfer token `My Coin` +``` +sui client transfer --to 0xa9ddd77d41119bdcbab0f5c4d18bf15e65034607afc5a296865f640e0d33d958 --object-id 0xef091babdde82844a3e369fd0cba34e04c05dd4600f74ca66da4781a1d4c8640 +``` diff --git a/mover/tung-lee/code/task3/my_nft/Move.lock b/mover/tung-lee/code/task3/my_nft/Move.lock new file mode 100644 index 00000000..bca5f0ad --- /dev/null +++ b/mover/tung-lee/code/task3/my_nft/Move.lock @@ -0,0 +1,34 @@ +# @generated by Move, please check-in and do not edit manually. + +[move] +version = 3 +manifest_digest = "4C9B47E7441289AA0D50D87EEB9836BD01CE3604E3B249490E7F2046EAEE3400" +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 = "0x814b604ff40f3cabff7879877b13925b87be14ef6d52e182511fe703c2af3179" +latest-published-id = "0x814b604ff40f3cabff7879877b13925b87be14ef6d52e182511fe703c2af3179" +published-version = "1" diff --git a/mover/tung-lee/code/task3/my_nft/Move.toml b/mover/tung-lee/code/task3/my_nft/Move.toml new file mode 100644 index 00000000..d40d13d2 --- /dev/null +++ b/mover/tung-lee/code/task3/my_nft/Move.toml @@ -0,0 +1,37 @@ +[package] +name = "my_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] +my_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/tung-lee/code/task3/my_nft/sources/my_nft.move b/mover/tung-lee/code/task3/my_nft/sources/my_nft.move new file mode 100644 index 00000000..9c8a1f5f --- /dev/null +++ b/mover/tung-lee/code/task3/my_nft/sources/my_nft.move @@ -0,0 +1,39 @@ +/* +/// Module: my_nft +module my_nft::my_nft; +*/ + +module 0x0::my_nft { + + use std::string::{Self, String}; + use sui::url::{Self, Url}; + use sui::tx_context::{TxContext}; + + public struct GitNFT has key, store { + id: UID, + name: String, + image_url: Url, + creator: address + } + + + fun init(ctx: &mut TxContext) { + let nft = GitNFT { + id: object::new(ctx), + name: b"tung-lee".to_string(), + image_url: url::new_unsafe_from_bytes(b"https://avatars.githubusercontent.com/u/87592549?v=4"), + creator: ctx.sender() + }; + + transfer::transfer(nft, ctx.sender()); + } + + public entry fun mint(ctx: &mut TxContext) { + transfer::transfer(GitNFT { + id: object::new(ctx), + name: b"tung-lee".to_string(), + image_url: url::new_unsafe_from_bytes(b"https://avatars.githubusercontent.com/u/87592549?v=4"), + creator: ctx.sender() + }, ctx.sender()); + } +} diff --git a/mover/tung-lee/code/task3/my_nft/tests/my_nft_tests.move b/mover/tung-lee/code/task3/my_nft/tests/my_nft_tests.move new file mode 100644 index 00000000..4f30419a --- /dev/null +++ b/mover/tung-lee/code/task3/my_nft/tests/my_nft_tests.move @@ -0,0 +1,18 @@ +/* +#[test_only] +module my_nft::my_nft_tests; +// uncomment this line to import the module +// use my_nft::my_nft; + +const ENotImplemented: u64 = 0; + +#[test] +fun test_my_nft() { + // pass +} + +#[test, expected_failure(abort_code = ::my_nft::my_nft_tests::ENotImplemented)] +fun test_my_nft_fail() { + abort ENotImplemented +} +*/ diff --git a/mover/001/images/README.md b/mover/tung-lee/images/README.md similarity index 100% rename from mover/001/images/README.md rename to mover/tung-lee/images/README.md diff --git a/mover/tung-lee/images/task1/package-id-explorer.png b/mover/tung-lee/images/task1/package-id-explorer.png new file mode 100644 index 00000000..bcd5eb9e Binary files /dev/null and b/mover/tung-lee/images/task1/package-id-explorer.png differ diff --git a/mover/tung-lee/images/task1/sui-wallet.png b/mover/tung-lee/images/task1/sui-wallet.png new file mode 100644 index 00000000..4ac5737f Binary files /dev/null and b/mover/tung-lee/images/task1/sui-wallet.png differ diff --git a/mover/tung-lee/images/task3/nft.png b/mover/tung-lee/images/task3/nft.png new file mode 100644 index 00000000..a2f2bb73 Binary files /dev/null and b/mover/tung-lee/images/task3/nft.png differ diff --git a/mover/001/notes/README.md b/mover/tung-lee/notes/README.md similarity index 100% rename from mover/001/notes/README.md rename to mover/tung-lee/notes/README.md