diff --git a/mover/Sucbusman/code/task02/faucet_coin/.gitignore b/mover/Sucbusman/code/task02/faucet_coin/.gitignore new file mode 100644 index 000000000..a007feab0 --- /dev/null +++ b/mover/Sucbusman/code/task02/faucet_coin/.gitignore @@ -0,0 +1 @@ +build/* diff --git a/mover/Sucbusman/code/task02/faucet_coin/Move.lock b/mover/Sucbusman/code/task02/faucet_coin/Move.lock new file mode 100644 index 000000000..3dfef7496 --- /dev/null +++ b/mover/Sucbusman/code/task02/faucet_coin/Move.lock @@ -0,0 +1,62 @@ +# @generated by Move, please check-in and do not edit manually. + +[move] +version = 3 +manifest_digest = "434FF74A9C33093F72ED1C50C686D86010665583F34431C719ED4ECAA5A5AD17" +deps_digest = "F9B494B64F0615AED0E98FC12A85B85ECD2BC5185C22D30E7F67786BB52E507C" +dependencies = [ + { id = "Bridge", name = "Bridge" }, + { id = "MoveStdlib", name = "MoveStdlib" }, + { id = "Sui", name = "Sui" }, + { id = "SuiSystem", name = "SuiSystem" }, +] + +[[move.package]] +id = "Bridge" +source = { git = "https://github.com/MystenLabs/sui.git", rev = "79918a3f1357", subdir = "crates/sui-framework/packages/bridge" } + +dependencies = [ + { id = "MoveStdlib", name = "MoveStdlib" }, + { id = "Sui", name = "Sui" }, + { id = "SuiSystem", name = "SuiSystem" }, +] + +[[move.package]] +id = "MoveStdlib" +source = { git = "https://github.com/MystenLabs/sui.git", rev = "79918a3f1357", subdir = "crates/sui-framework/packages/move-stdlib" } + +[[move.package]] +id = "Sui" +source = { git = "https://github.com/MystenLabs/sui.git", rev = "79918a3f1357", subdir = "crates/sui-framework/packages/sui-framework" } + +dependencies = [ + { id = "MoveStdlib", name = "MoveStdlib" }, +] + +[[move.package]] +id = "SuiSystem" +source = { git = "https://github.com/MystenLabs/sui.git", rev = "79918a3f1357", subdir = "crates/sui-framework/packages/sui-system" } + +dependencies = [ + { id = "MoveStdlib", name = "MoveStdlib" }, + { id = "Sui", name = "Sui" }, +] + +[move.toolchain-version] +compiler-version = "1.52.3" +edition = "2024.beta" +flavor = "sui" + +[env] + +[env.testnet] +chain-id = "4c78adac" +original-published-id = "0x3449c34c857d1436e5cffb95c4fa48b20b49b17d14961a14a8375b6a0ec5827a" +latest-published-id = "0x3449c34c857d1436e5cffb95c4fa48b20b49b17d14961a14a8375b6a0ec5827a" +published-version = "1" + +[env.mainnet] +chain-id = "35834a8a" +original-published-id = "0x92c4d6224e9638b7aeae3077c4a253a157635cacc7a22db8ab67ea7e727c71c3" +latest-published-id = "0x92c4d6224e9638b7aeae3077c4a253a157635cacc7a22db8ab67ea7e727c71c3" +published-version = "1" diff --git a/mover/Sucbusman/code/task02/faucet_coin/Move.toml b/mover/Sucbusman/code/task02/faucet_coin/Move.toml new file mode 100644 index 000000000..4af82893a --- /dev/null +++ b/mover/Sucbusman/code/task02/faucet_coin/Move.toml @@ -0,0 +1,36 @@ +[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] + +# 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/Sucbusman/code/task02/faucet_coin/sources/faucet.sh b/mover/Sucbusman/code/task02/faucet_coin/sources/faucet.sh new file mode 100755 index 000000000..1c64987a1 --- /dev/null +++ b/mover/Sucbusman/code/task02/faucet_coin/sources/faucet.sh @@ -0,0 +1,2 @@ +#!/bin/bash +sui client call --package 0x2 --module coin --function mint_and_transfer --type-args 0x92c4d6224e9638b7aeae3077c4a253a157635cacc7a22db8ab67ea7e727c71c3::faucet_coin::FAUCET_COIN --args 0x45ef74abb23ec6ea5cdcc1bf5fc2d51dad0f35a0e4a278917366ebb39947fb40 10000000 0xe1737aebeba598a19136f89859b9a4cd9b50e9ecd74e4fb1893033f78187d3b8 diff --git a/mover/Sucbusman/code/task02/faucet_coin/sources/faucet_coin.move b/mover/Sucbusman/code/task02/faucet_coin/sources/faucet_coin.move new file mode 100644 index 000000000..4044ce7b1 --- /dev/null +++ b/mover/Sucbusman/code/task02/faucet_coin/sources/faucet_coin.move @@ -0,0 +1,12 @@ +module faucet_coin::faucet_coin; +use sui::coin::create_currency; +use sui::transfer::{public_freeze_object,public_share_object}; + +public struct FAUCET_COIN has drop{} + +fun init(c:FAUCET_COIN, ctx:&mut TxContext){ + let (treasury,meta) = create_currency(c, 8, b"FHKD", b"Free Hong Kong Dollar", b"Test description", option::none(), ctx); + public_freeze_object(meta); + public_share_object(treasury); +} + diff --git a/mover/Sucbusman/code/task02/faucet_coin/tests/faucet_coin_tests.move b/mover/Sucbusman/code/task02/faucet_coin/tests/faucet_coin_tests.move new file mode 100644 index 000000000..74b01751a --- /dev/null +++ b/mover/Sucbusman/code/task02/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/Sucbusman/code/task02/my_coin/.gitignore b/mover/Sucbusman/code/task02/my_coin/.gitignore new file mode 100644 index 000000000..a007feab0 --- /dev/null +++ b/mover/Sucbusman/code/task02/my_coin/.gitignore @@ -0,0 +1 @@ +build/* diff --git a/mover/Sucbusman/code/task02/my_coin/Move.lock b/mover/Sucbusman/code/task02/my_coin/Move.lock new file mode 100644 index 000000000..7a0a9803e --- /dev/null +++ b/mover/Sucbusman/code/task02/my_coin/Move.lock @@ -0,0 +1,62 @@ +# @generated by Move, please check-in and do not edit manually. + +[move] +version = 3 +manifest_digest = "6A9EA0C7B2B1375E2F2C241BAE6B953FCD018775846DEDBA226EFBFB2FB6E003" +deps_digest = "F9B494B64F0615AED0E98FC12A85B85ECD2BC5185C22D30E7F67786BB52E507C" +dependencies = [ + { id = "Bridge", name = "Bridge" }, + { id = "MoveStdlib", name = "MoveStdlib" }, + { id = "Sui", name = "Sui" }, + { id = "SuiSystem", name = "SuiSystem" }, +] + +[[move.package]] +id = "Bridge" +source = { git = "https://github.com/MystenLabs/sui.git", rev = "79918a3f1357", subdir = "crates/sui-framework/packages/bridge" } + +dependencies = [ + { id = "MoveStdlib", name = "MoveStdlib" }, + { id = "Sui", name = "Sui" }, + { id = "SuiSystem", name = "SuiSystem" }, +] + +[[move.package]] +id = "MoveStdlib" +source = { git = "https://github.com/MystenLabs/sui.git", rev = "79918a3f1357", subdir = "crates/sui-framework/packages/move-stdlib" } + +[[move.package]] +id = "Sui" +source = { git = "https://github.com/MystenLabs/sui.git", rev = "79918a3f1357", subdir = "crates/sui-framework/packages/sui-framework" } + +dependencies = [ + { id = "MoveStdlib", name = "MoveStdlib" }, +] + +[[move.package]] +id = "SuiSystem" +source = { git = "https://github.com/MystenLabs/sui.git", rev = "79918a3f1357", subdir = "crates/sui-framework/packages/sui-system" } + +dependencies = [ + { id = "MoveStdlib", name = "MoveStdlib" }, + { id = "Sui", name = "Sui" }, +] + +[move.toolchain-version] +compiler-version = "1.52.3" +edition = "2024.beta" +flavor = "sui" + +[env] + +[env.testnet] +chain-id = "4c78adac" +original-published-id = "0x67224c61835d34d06c44e170190dbfe1d6e1053f1add0d71b87a262be5ed0a1c" +latest-published-id = "0x67224c61835d34d06c44e170190dbfe1d6e1053f1add0d71b87a262be5ed0a1c" +published-version = "1" + +[env.mainnet] +chain-id = "35834a8a" +original-published-id = "0x59a1d86e148649d9cc99e7b051c2b2a75d4c38c72091608d4f9c4a751ce4f327" +latest-published-id = "0x59a1d86e148649d9cc99e7b051c2b2a75d4c38c72091608d4f9c4a751ce4f327" +published-version = "1" diff --git a/mover/Sucbusman/code/task02/my_coin/Move.toml b/mover/Sucbusman/code/task02/my_coin/Move.toml new file mode 100644 index 000000000..e265bf763 --- /dev/null +++ b/mover/Sucbusman/code/task02/my_coin/Move.toml @@ -0,0 +1,36 @@ +[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] + +# 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/Sucbusman/code/task02/my_coin/sources/mint.sh b/mover/Sucbusman/code/task02/my_coin/sources/mint.sh new file mode 100755 index 000000000..94aa47edc --- /dev/null +++ b/mover/Sucbusman/code/task02/my_coin/sources/mint.sh @@ -0,0 +1,2 @@ +#!/bin/bash +sui client call --package 0x2 --module coin --function mint_and_transfer --type-args 0x59a1d86e148649d9cc99e7b051c2b2a75d4c38c72091608d4f9c4a751ce4f327::my_coin::MY_COIN --args 0x7be53a569bbb1650b4785d8ec6cc7ab02b815d4ba8c476a82b3caf2f27792da8 10000000 0x9b45b2c6a3869f0b4c6128847b421fafc1325538e42741ce10291df8bf997b72 diff --git a/mover/Sucbusman/code/task02/my_coin/sources/my_coin.move b/mover/Sucbusman/code/task02/my_coin/sources/my_coin.move new file mode 100644 index 000000000..52ba8c574 --- /dev/null +++ b/mover/Sucbusman/code/task02/my_coin/sources/my_coin.move @@ -0,0 +1,12 @@ +module my_coin::my_coin; +use sui::coin::create_currency; +use sui::transfer::{public_freeze_object,public_transfer}; + +public struct MY_COIN has drop{} + +fun init(c:MY_COIN, ctx:&mut TxContext){ + let (treasury,meta) = create_currency(c, 8, b"HKD", b"Hong Kong Dollar", b"Test description", option::none(), ctx); + public_freeze_object(meta); + public_transfer(treasury,ctx.sender()); +} + diff --git a/mover/Sucbusman/code/task02/my_coin/tests/my_coin_tests.move b/mover/Sucbusman/code/task02/my_coin/tests/my_coin_tests.move new file mode 100644 index 000000000..cd5b36060 --- /dev/null +++ b/mover/Sucbusman/code/task02/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/Sucbusman/code/task03/my_nft/.gitignore b/mover/Sucbusman/code/task03/my_nft/.gitignore new file mode 100644 index 000000000..a007feab0 --- /dev/null +++ b/mover/Sucbusman/code/task03/my_nft/.gitignore @@ -0,0 +1 @@ +build/* diff --git a/mover/Sucbusman/code/task03/my_nft/Move.lock b/mover/Sucbusman/code/task03/my_nft/Move.lock new file mode 100644 index 000000000..8d1aef757 --- /dev/null +++ b/mover/Sucbusman/code/task03/my_nft/Move.lock @@ -0,0 +1,68 @@ +# @generated by Move, please check-in and do not edit manually. + +[move] +version = 3 +manifest_digest = "198F8D2C6C9494D80E47F5DA94532E105BCDFC1DFC3B4C6E03849FBF9803D9BE" +deps_digest = "F9B494B64F0615AED0E98FC12A85B85ECD2BC5185C22D30E7F67786BB52E507C" +dependencies = [ + { id = "Bridge", name = "Bridge" }, + { id = "MoveStdlib", name = "MoveStdlib" }, + { id = "Sui", name = "Sui" }, + { id = "SuiSystem", name = "SuiSystem" }, +] + +[[move.package]] +id = "Bridge" +source = { git = "https://github.com/MystenLabs/sui.git", rev = "79918a3f1357", subdir = "crates/sui-framework/packages/bridge" } + +dependencies = [ + { id = "MoveStdlib", name = "MoveStdlib" }, + { id = "Sui", name = "Sui" }, + { id = "SuiSystem", name = "SuiSystem" }, +] + +[[move.package]] +id = "MoveStdlib" +source = { git = "https://github.com/MystenLabs/sui.git", rev = "79918a3f1357", subdir = "crates/sui-framework/packages/move-stdlib" } + +[[move.package]] +id = "Sui" +source = { git = "https://github.com/MystenLabs/sui.git", rev = "79918a3f1357", subdir = "crates/sui-framework/packages/sui-framework" } + +dependencies = [ + { id = "MoveStdlib", name = "MoveStdlib" }, +] + +[[move.package]] +id = "SuiSystem" +source = { git = "https://github.com/MystenLabs/sui.git", rev = "79918a3f1357", subdir = "crates/sui-framework/packages/sui-system" } + +dependencies = [ + { id = "MoveStdlib", name = "MoveStdlib" }, + { id = "Sui", name = "Sui" }, +] + +[move.toolchain-version] +compiler-version = "1.52.3" +edition = "2024.beta" +flavor = "sui" + +[env] + +[env.local] +chain-id = "b2791071" +original-published-id = "0x471ffb842d91567c2da27fa371027f5f4fbb97814696ae2568084a6193d67e50" +latest-published-id = "0x471ffb842d91567c2da27fa371027f5f4fbb97814696ae2568084a6193d67e50" +published-version = "1" + +[env.testnet] +chain-id = "4c78adac" +original-published-id = "0x20c220a003214fa03d5569766bc081b50746884b530e77bd8830eda234f534d9" +latest-published-id = "0x20c220a003214fa03d5569766bc081b50746884b530e77bd8830eda234f534d9" +published-version = "1" + +[env.mainnet] +chain-id = "35834a8a" +original-published-id = "0xe847bdadab781e87f566ecffae050c26772f6ceb1976f4dbdc6020c2351e1ea7" +latest-published-id = "0xe847bdadab781e87f566ecffae050c26772f6ceb1976f4dbdc6020c2351e1ea7" +published-version = "1" diff --git a/mover/Sucbusman/code/task03/my_nft/Move.toml b/mover/Sucbusman/code/task03/my_nft/Move.toml new file mode 100644 index 000000000..a6d501608 --- /dev/null +++ b/mover/Sucbusman/code/task03/my_nft/Move.toml @@ -0,0 +1,36 @@ +[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] + +# 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/Sucbusman/code/task03/my_nft/sources/my_nft.move b/mover/Sucbusman/code/task03/my_nft/sources/my_nft.move new file mode 100644 index 000000000..d80ff6dda --- /dev/null +++ b/mover/Sucbusman/code/task03/my_nft/sources/my_nft.move @@ -0,0 +1,70 @@ +module my_nft::my_nft; + +use std::string::String; +// The creator bundle: these two packages often go together. +use sui::package; +use sui::display; + +public struct NFT has key, store { + id: UID, + name: String, + image_url: String, +} + +public struct MY_NFT has drop {} + +/// Claim the `Publisher` object in the module initializer +/// to then create a `Display`. The `Display` is initialized with +/// a set of fields (but can be modified later) and published via +/// the `update_version` call. +/// +/// Keys and values are set in the initializer but could also be +/// set after publishing if a `Publisher` object was created. +fun init(otw: MY_NFT, ctx: &mut TxContext) { + let keys = vector[ + b"name".to_string(), + b"link".to_string(), + b"image_url".to_string(), + b"description".to_string(), + b"project_url".to_string(), + b"creator".to_string(), + ]; + + let values = vector[ + // For `name` one can use the `Hero.name` property + b"{name}".to_string(), + // For `link` one can build a URL using an `id` property + b"https://test-link.io/{id}".to_string(), + // For `image_url` `image_url` property. + b"{image_url}".to_string(), + // Description is static for all `Hero` objects. + b"test description".to_string(), + // Project URL is usually static + b"https://test-project.io".to_string(), + // Creator field can be any + b"Sucbusman".to_string(), + ]; + + // Claim the `Publisher` for the package! + let publisher = package::claim(otw, ctx); + + // Get a new `Display` object for the `Hero` type. + let mut display = display::new_with_fields( + &publisher, keys, values, ctx + ); + + // Commit first version of `Display` to apply changes. + display.update_version(); + + transfer::public_transfer(publisher, ctx.sender()); + transfer::public_transfer(display, ctx.sender()); +} + +public entry fun mint(image_url: String, ctx: &mut TxContext) { + let nft = NFT { + id: object::new(ctx), + name: b"minted_nft".to_string(), + image_url + }; + transfer::transfer(nft,ctx.sender()); +} diff --git a/mover/Sucbusman/code/task03/my_nft/tests/my_nft_tests.move b/mover/Sucbusman/code/task03/my_nft/tests/my_nft_tests.move new file mode 100644 index 000000000..4f30419a2 --- /dev/null +++ b/mover/Sucbusman/code/task03/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/Sucbusman/code/task07/check_in/.gitignore b/mover/Sucbusman/code/task07/check_in/.gitignore new file mode 100644 index 000000000..a007feab0 --- /dev/null +++ b/mover/Sucbusman/code/task07/check_in/.gitignore @@ -0,0 +1 @@ +build/* diff --git a/mover/Sucbusman/code/task07/check_in/Move.lock b/mover/Sucbusman/code/task07/check_in/Move.lock new file mode 100644 index 000000000..9cffa1ae5 --- /dev/null +++ b/mover/Sucbusman/code/task07/check_in/Move.lock @@ -0,0 +1,56 @@ +# @generated by Move, please check-in and do not edit manually. + +[move] +version = 3 +manifest_digest = "2824813C70C20B9EC3C57CC223751D4C8FA3F1FD02248F556988EDC742307BE9" +deps_digest = "F9B494B64F0615AED0E98FC12A85B85ECD2BC5185C22D30E7F67786BB52E507C" +dependencies = [ + { id = "Bridge", name = "Bridge" }, + { id = "MoveStdlib", name = "MoveStdlib" }, + { id = "Sui", name = "Sui" }, + { id = "SuiSystem", name = "SuiSystem" }, +] + +[[move.package]] +id = "Bridge" +source = { git = "https://github.com/MystenLabs/sui.git", rev = "79918a3f1357", subdir = "crates/sui-framework/packages/bridge" } + +dependencies = [ + { id = "MoveStdlib", name = "MoveStdlib" }, + { id = "Sui", name = "Sui" }, + { id = "SuiSystem", name = "SuiSystem" }, +] + +[[move.package]] +id = "MoveStdlib" +source = { git = "https://github.com/MystenLabs/sui.git", rev = "79918a3f1357", subdir = "crates/sui-framework/packages/move-stdlib" } + +[[move.package]] +id = "Sui" +source = { git = "https://github.com/MystenLabs/sui.git", rev = "79918a3f1357", subdir = "crates/sui-framework/packages/sui-framework" } + +dependencies = [ + { id = "MoveStdlib", name = "MoveStdlib" }, +] + +[[move.package]] +id = "SuiSystem" +source = { git = "https://github.com/MystenLabs/sui.git", rev = "79918a3f1357", subdir = "crates/sui-framework/packages/sui-system" } + +dependencies = [ + { id = "MoveStdlib", name = "MoveStdlib" }, + { id = "Sui", name = "Sui" }, +] + +[move.toolchain-version] +compiler-version = "1.52.3" +edition = "2024.beta" +flavor = "sui" + +[env] + +[env.local] +chain-id = "9e1647da" +original-published-id = "0x1fb741b7a7887958f8566ee87ffe1af73fa0e0294f6ca4ff79fe6b9b9f651196" +latest-published-id = "0x1fb741b7a7887958f8566ee87ffe1af73fa0e0294f6ca4ff79fe6b9b9f651196" +published-version = "1" diff --git a/mover/Sucbusman/code/task07/check_in/Move.toml b/mover/Sucbusman/code/task07/check_in/Move.toml new file mode 100644 index 000000000..1ab196b7c --- /dev/null +++ b/mover/Sucbusman/code/task07/check_in/Move.toml @@ -0,0 +1,36 @@ +[package] +name = "check_in" +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] + +# 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] +check_in = "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/Sucbusman/code/task07/check_in/convert.py b/mover/Sucbusman/code/task07/check_in/convert.py new file mode 100644 index 000000000..1e93ddf47 --- /dev/null +++ b/mover/Sucbusman/code/task07/check_in/convert.py @@ -0,0 +1,7 @@ +#!/bin/python3 +a = '2f50fecb0e4832e844ef2aa72e8add9a7f44a7ef2e0b3bb37ede69f843648cc4' +ba = bytearray.fromhex(a) +l = [] +for b in ba: + l.append(b) +print(l) diff --git a/mover/Sucbusman/code/task07/check_in/sources/check_in.move b/mover/Sucbusman/code/task07/check_in/sources/check_in.move new file mode 100644 index 000000000..8983a50b9 --- /dev/null +++ b/mover/Sucbusman/code/task07/check_in/sources/check_in.move @@ -0,0 +1,96 @@ +module check_in::check_in { + use std::ascii::{String, string}; + use std::bcs; + use std::hash::sha3_256; + use std::vector; + use sui::event; + use sui::object; + use sui::random; + use sui::random::Random; + use sui::transfer::share_object; + use sui::tx_context::{Self, TxContext}; + //add + use std::debug::print; + + const ESTRING: u64 = 0; + + public struct Flag has copy, drop { + sender: address, + flag: bool, + ture_num: u64, + github_id: String + } + + public struct FlagString has key { + id: UID, + str: String, + ture_num: u64 + } + public struct Log has copy,drop{ + bcs_flag: vector, + sha: vector, + } + fun init(ctx: &mut TxContext) { + let flag_str = FlagString { + id: object::new(ctx), + str: string(b"LetsMoveCTF"), + ture_num: 0 + }; + share_object(flag_str); + } + + + entry fun get_flag( + flag: vector, + github_id: String, + flag_str: &mut FlagString, + rand: &Random, + ctx: &mut TxContext + ) { + let mut bcs_flag = bcs::to_bytes(&flag_str.str); + vector::append(&mut bcs_flag, *github_id.as_bytes()); + + //test insert + event::emit(Log{bcs_flag: bcs_flag, sha: sha3_256(bcs_flag)}); + // + if(flag == sha3_256(bcs_flag)){ + flag_str.str = getRandomString(rand, ctx); + + flag_str.ture_num = flag_str.ture_num + 1; + + event::emit(Flag { + sender: tx_context::sender(ctx), + flag: true, + ture_num: flag_str.ture_num, + github_id + }); + } + } + + + fun getRandomString(rand: &Random, ctx: &mut TxContext): String { + let mut gen = random::new_generator(rand, ctx); + + let mut str_len = random::generate_u8_in_range(&mut gen, 4, 30); + + let mut rand: vector = b""; + while (str_len != 0) { + let rand_num = random::generate_u8_in_range(&mut gen, 34, 126); + vector::push_back(&mut rand, rand_num); + str_len = str_len - 1; + }; + + string(rand) + } +#[test] + fun test(){ + let flags = string(b"bFen>krLm(}E"); + //let flags = string(b"LetsMoveCTF"); + let github_id = string(b"Sucbusman"); + let mut flagb = bcs::to_bytes(&flags); + vector::append(&mut flagb, *github_id.as_bytes()); + let sha:vector = sha3_256(flagb); + print(&flagb); + print(&sha); + } +} diff --git a/mover/Sucbusman/code/task07/check_in/tests/check_in_tests.move b/mover/Sucbusman/code/task07/check_in/tests/check_in_tests.move new file mode 100644 index 000000000..89157d0a1 --- /dev/null +++ b/mover/Sucbusman/code/task07/check_in/tests/check_in_tests.move @@ -0,0 +1,18 @@ +/* +#[test_only] +module check_in::check_in_tests; +// uncomment this line to import the module +// use check_in::check_in; + +const ENotImplemented: u64 = 0; + +#[test] +fun test_check_in() { + // pass +} + +#[test, expected_failure(abort_code = ::check_in::check_in_tests::ENotImplemented)] +fun test_check_in_fail() { + abort ENotImplemented +} +*/ diff --git a/mover/Sucbusman/code/task08/solve.py b/mover/Sucbusman/code/task08/solve.py new file mode 100644 index 000000000..3627b2c3a --- /dev/null +++ b/mover/Sucbusman/code/task08/solve.py @@ -0,0 +1,75 @@ +#!/bin/python3 +import hashlib +import os +import pickle + +sender = bytearray.fromhex('f2fb3e17f0ec9e585c08d1f762e9671abd3af955c5325a7747c308bde2b80fdf') +challenge = bytearray.fromhex('19e76ca504c5a5fa5e214a45fca6c058171ba333f6da897b82731094504d5ab90d7b3e7a404e40336b773557593403000000000000009500000000000000') + +def sha3_256(data:bytearray): + H = hashlib.sha3_256() + H.update(data) + return H.digest() + +def generate_all_bytearrays(start_from: bytearray = None): + if start_from is not None: + start_value = int.from_bytes(start_from, 'big') + length = len(start_from) + else: + start_value = 0 + length = 1 + + while True: + max_value = 256 ** length + i = start_value if start_value < max_value else 0 + while i < max_value: + yield bytearray(i.to_bytes(length, 'big')) + i += 1 + length += 1 + start_value = 0 # Only use custom start_value once + +def ba2vector(ba:bytearray): + l = [] + for b in ba: + l.append(b) + return l + +def solve(): + proof = bytearray() + t = 0 + logf = 'log.pkl' + if os.path.exists(logf): + with open(logf,'rb') as f: + proof = pickle.load(f) + # t = ipt['t'] + # proof = ipt['proof'] + print('[+] Start with proof',proof) + if proof: + gen = generate_all_bytearrays(proof) + else: + gen = generate_all_bytearrays() + try: + while True: + proof = next(gen) + full_proof = bytearray() + full_proof += proof + full_proof += sender + full_proof += challenge + h = sha3_256(full_proof) + #print(h) + #input() + if h[0] +h[1] + h[2] == 0: + #if h[0] == 0: + print('[+] Found! proof:',proof) + print('[+] hash!',h) + print(ba2vector(proof)) + break + + except KeyboardInterrupt as e: + print('[-] Stop at',proof) + with open(logf,'wb') as f: + pickle.dump(proof,f) + +if __name__ == '__main__': + #print(sha3_256(bytearray([0,0]))) + solve() diff --git a/mover/Sucbusman/images/task3.png b/mover/Sucbusman/images/task3.png new file mode 100644 index 000000000..917c3de93 Binary files /dev/null and b/mover/Sucbusman/images/task3.png differ diff --git a/mover/Sucbusman/images/task7.png b/mover/Sucbusman/images/task7.png new file mode 100644 index 000000000..29edfa97c Binary files /dev/null and b/mover/Sucbusman/images/task7.png differ diff --git a/mover/Sucbusman/readme.md b/mover/Sucbusman/readme.md index 5f3b241d2..f915ca2b0 100644 --- a/mover/Sucbusman/readme.md +++ b/mover/Sucbusman/readme.md @@ -18,17 +18,17 @@ - [x] package id 在 scan上的查看截图:![Scan截图](./images/task1-2.png) ## 02 move coin -- [] My Coin package id : -- [] Faucet package id : -- [] 转账 `My Coin` hash: -- [] `Faucet Coin` address1 mint hash: -- [] `Faucet Coin` address2 mint hash: +- [x] My Coin package id : 0x59a1d86e148649d9cc99e7b051c2b2a75d4c38c72091608d4f9c4a751ce4f327 +- [x] Faucet package id : 0x92c4d6224e9638b7aeae3077c4a253a157635cacc7a22db8ab67ea7e727c71c3 +- [x] 转账 `My Coin` hash: 6XvM2dWgqbKUCwaSF1LmEUGtGiT4u4RdpyTEcE7WxJqd +- [x] `Faucet Coin` address1 mint hash: HHWJuhHN2WiFXy3qYQn381FAHUeBKqdHTwZVfKr9VheC +- [x] `Faucet Coin` address2 mint hash: CfsiRNpEWr2rXCcurApuGA5kMd3nEepGufGm9Tp9piU8 ## 03 move NFT -- [] nft package id : -- [] nft object id : -- [] 转账 nft hash: -- [] scan上的NFT截图:![Scan截图](./images/你的图片地址) +- [x] nft package id : 0xe847bdadab781e87f566ecffae050c26772f6ceb1976f4dbdc6020c2351e1ea7 +- [x] nft object id : 0x2ca48395a29a3dab8486d0f21b37b56776cafd639cddbf1d310ff86ecb48e0eb +- [x] 转账 nft hash: 3vm5H4kJcCvXwUZV5Br1LGF3MrTB5eqwH5WdKXWNxUmC +- [x] scan上的NFT截图:![Scan截图](./images/task3.png) ## 04 Move Game - [] game package id : @@ -45,10 +45,10 @@ - [] save hash : ## 07 Move CTF Check In -- [] CLI call 截图 : ![截图](./images/你的图片地址) -- [] flag hash : +- [x] CLI call 截图 : ![截图](./images/task7.png) +- [x] flag hash : DdLf8jwFQNP1B5NRNxEfZCNTMVJ5aMxRmY4ZmrSMQDPB ## 08 Move CTF Lets Move -- [] proof : -- [] flag hash : +- [x] proof : vector[86, 69, 44] +- [x] flag hash :F8ohBajhcthBGRR1fHMnwfKnDxXu3W1x5VKxFqjfZczW