diff --git a/mover/DYJJ/code/task1/hello_move/Move.lock b/mover/DYJJ/code/task1/hello_move/Move.lock new file mode 100644 index 000000000..5f2ce4ae0 --- /dev/null +++ b/mover/DYJJ/code/task1/hello_move/Move.lock @@ -0,0 +1,40 @@ +# @generated by Move, please check-in and do not edit manually. + +[move] +version = 3 +manifest_digest = "DC24100B500088544405AC31A41101CCED2A8F27DD593AA63ACCE809282B414A" +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.35.0" +edition = "2024.beta" +flavor = "sui" + +[env] + +[env.testnet] +chain-id = "4c78adac" +original-published-id = "0x26bc718fb0cfd4897b7d7ca321814eca33215afc54ddffed7ebe1c981bf6f918" +latest-published-id = "0x26bc718fb0cfd4897b7d7ca321814eca33215afc54ddffed7ebe1c981bf6f918" +published-version = "1" + +[env.ed25519] +chain-id = "4c78adac" +original-published-id = "0x4bf0828d07971f5419cf94580034a1db089d2d1a9adb2194c084fbcbc5f68f6a" +latest-published-id = "0x4bf0828d07971f5419cf94580034a1db089d2d1a9adb2194c084fbcbc5f68f6a" +published-version = "1" diff --git a/mover/DYJJ/code/task1/hello_move/Move.toml b/mover/DYJJ/code/task1/hello_move/Move.toml new file mode 100644 index 000000000..d022a9699 --- /dev/null +++ b/mover/DYJJ/code/task1/hello_move/Move.toml @@ -0,0 +1,36 @@ +[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" \ No newline at end of file diff --git a/mover/DYJJ/code/task1/hello_move/sources/hello_move.move b/mover/DYJJ/code/task1/hello_move/sources/hello_move.move new file mode 100644 index 000000000..8f3ffd541 --- /dev/null +++ b/mover/DYJJ/code/task1/hello_move/sources/hello_move.move @@ -0,0 +1,43 @@ +module 0x0::hello_move { + use std::string; + use sui::object::{UID, Self as Object}; + use sui::transfer; + use sui::tx_context::{Self as TxContext, sender}; + + // 定义 HelloObj 结构体,包含 ID、消息和 GitHub ID + public struct HelloObj has key, store { + id: UID, + message: string::String, + github_id: string::String, + } + + // 创建新的 HelloObj 对象并进行转移 + public fun create_hello_object(ctx: &mut TxContext) { + let id = Object::new(ctx); + let hello_message = string::utf8(b"Hello DYJJ!"); + let github_id = string::utf8(b"DYJJ"); + + let new_object = HelloObj { + id, + message: hello_message, + github_id, + }; + + transfer::public_transfer(new_object, sender(ctx)); + } + + // 修改 HelloObj 的消息 + public fun update_message(obj: &mut HelloObj, new_message: string::String) { + obj.message = new_message; + } + + // 获取 HelloObj 的消息 + public fun get_message(obj: &HelloObj): string::String { + obj.message + } + + // 获取 HelloObj 的 GitHub ID + public fun get_github_id(obj: &HelloObj): string::String { + obj.github_id + } +} diff --git a/mover/DYJJ/code/task1/hello_move/test/hello_move_tests.move b/mover/DYJJ/code/task1/hello_move/test/hello_move_tests.move new file mode 100644 index 000000000..d9b2155c9 --- /dev/null +++ b/mover/DYJJ/code/task1/hello_move/test/hello_move_tests.move @@ -0,0 +1,47 @@ +// #[test_only] +module 0x0::hello_move_tests { + use std::assert; + use sui::object::{UID}; + use sui::tx_context::{TxContext}; + use 0x0::hello_move::{HelloObj, create_hello_object, update_message, get_message, get_github_id}; + + const E_NOT_IMPLEMENTED: u64 = 0; + + #[test] + public fun test_create_hello_object() { + let mut ctx = TxContext::new(/* 添加所需的初始化参数 */); + + // 创建 HelloObj + create_hello_object(&mut ctx); + + // 获取转移的对象 + let object = ctx.get_transferred_object::(); + assert(object.is_some(), 1); + + let hello_obj = object.unwrap(); + assert(hello_obj.id != UID::zero(), 2); + assert(get_message(&hello_obj) == string::utf8(b"Hello DYJJ!"), 3); + assert(get_github_id(&hello_obj) == string::utf8(b"DYJJ"), 4); + } + + #[test] + public fun test_update_message() { + let mut ctx = TxContext::new(/* 添加所需的初始化参数 */); + + // 创建 HelloObj + create_hello_object(&mut ctx); + let object = ctx.get_transferred_object::().unwrap(); + + // 更新消息 + let new_message = string::utf8(b"Updated Message"); + update_message(&mut object, new_message); + + // 验证消息更新 + assert(get_message(&object) == new_message, 5); + } + + #[test, expected_failure(abort_code = E_NOT_IMPLEMENTED)] + public fun test_update_message_fail() { + abort E_NOT_IMPLEMENTED; + } +} diff --git a/mover/DYJJ/images/task1/Task1-suiscan.png b/mover/DYJJ/images/task1/Task1-suiscan.png new file mode 100644 index 000000000..caa900e57 Binary files /dev/null and b/mover/DYJJ/images/task1/Task1-suiscan.png differ diff --git a/mover/DYJJ/images/task1/suiwallet.png b/mover/DYJJ/images/task1/suiwallet.png new file mode 100644 index 000000000..1a6fdb60a Binary files /dev/null and b/mover/DYJJ/images/task1/suiwallet.png differ diff --git a/mover/DYJJ/notes/readme.md b/mover/DYJJ/notes/readme.md new file mode 100644 index 000000000..e69de29bb diff --git a/mover/DYJJ/readme.md b/mover/DYJJ/readme.md new file mode 100644 index 000000000..54f0d8f96 --- /dev/null +++ b/mover/DYJJ/readme.md @@ -0,0 +1,54 @@ +## 基本信息 +- Sui钱包地址: `0xeeb1048598abe3f587fd3fcc7cd247391458060c67e2230130ad0a759543622d` +> 首次参与需要完成第一个任务注册好钱包地址才被合并,并且后续学习奖励会打入这个地址 +- github: `DYJJ` + +## 个人简介 +- 工作经验: 1年 +- 技术栈: `react` +> 重要提示 请认真写自己的简介 +- 多年web2开发经验,对Move特别感兴趣,想通过Move入门区块链 +- 联系方式: wechat: `Dyj1242958255` + +## 任务 + +## 01 hello move +- [] Sui cli version: sui 1.35.0-40d9ec7ecd5d +- [] Sui钱包截图: ![Sui钱包截图](./images/suiwallet.png) +- [] package id: 0xc9b4e1a5845d2074035bc844fb20c49d937955456f3148e4273dcef356f4fddd +- [] package id 在 scan上的查看截图:![Scan截图](./images/Task1-suiscan.png) + +## 02 move coin +- [] My Coin package id : +- [] Faucet package id : +- [] 转账 `My Coin` hash: +- [] `Faucet Coin` address1 mint hash: +- [] `Faucet Coin` address2 mint hash: + +## 03 move NFT +- [] nft package id : +- [] nft object id : +- [] 转账 nft hash: +- [] scan上的NFT截图:![Scan截图](./images/你的图片地址) + +## 04 Move Game +- [] game package id : +- [] deposit Coin hash: +- [] withdraw `Coin` hash: +- [] play game hash: + +## 05 Move Swap +- [] swap package id : +- [] call swap CoinA-> CoinB hash : +- [] call swap CoinB-> CoinA hash : + +## 06 Dapp-kit SDK PTB +- [] save hash : + +## 07 Move CTF Check In +- [] CLI call 截图 : ![截图](./images/你的图片地址) +- [] flag hash : + +## 08 Move CTF Lets Move +- [] proof : +- [] flag hash :