diff --git a/mover/zipdata1/code/task2/Move.toml b/mover/zipdata1/code/task2/Move.toml new file mode 100644 index 000000000..7dd83b5d2 --- /dev/null +++ b/mover/zipdata1/code/task2/Move.toml @@ -0,0 +1,6 @@ +[package] +name = "zipdata1_task2" +edition = "2024" + +[addresses] +zipdata1 = "0x0" diff --git a/mover/zipdata1/code/task2/sources/zipdata1_coin.move b/mover/zipdata1/code/task2/sources/zipdata1_coin.move new file mode 100644 index 000000000..7dedbfc5b --- /dev/null +++ b/mover/zipdata1/code/task2/sources/zipdata1_coin.move @@ -0,0 +1,15 @@ +module zipdata1::zipdata1_coin { + public struct ZIPDATA1_COIN has drop {} + fun init(w: ZIPDATA1_COIN, ctx: &mut sui::tx_context::TxContext) { + let (treasury, metadata): (sui::coin::TreasuryCap, sui::coin::CoinMetadata) = + sui::coin::create_currency(w, 9, b"ZIPDATA1", b"ZIPDATA1_COIN", b"ZIPDATA1 Coin", std::option::some(sui::url::new_unsafe_from_bytes(b"https://avatars.githubusercontent.com/u/0")), ctx); + sui::transfer::public_freeze_object(metadata); + sui::transfer::public_transfer(treasury, sui::tx_context::sender(ctx)); + } + public fun mint(treasury: &mut sui::coin::TreasuryCap, amount: u64, recipient: address, ctx: &mut sui::tx_context::TxContext) { + sui::coin::mint_and_transfer(treasury, amount, recipient, ctx); + } + public fun burn(treasury: &mut sui::coin::TreasuryCap, c: sui::coin::Coin) { + sui::coin::burn(treasury, c); + } +} diff --git a/mover/zipdata1/code/task2/sources/zipdata1_faucet_coin.move b/mover/zipdata1/code/task2/sources/zipdata1_faucet_coin.move new file mode 100644 index 000000000..917ca0623 --- /dev/null +++ b/mover/zipdata1/code/task2/sources/zipdata1_faucet_coin.move @@ -0,0 +1,19 @@ +module zipdata1::zipdata1_faucet_coin { + public struct ZIPDATA1_FAUCET_COIN has drop {} + public struct Faucet has key, store { + id: sui::object::UID, + cap: sui::coin::TreasuryCap, + per_tx_limit: u64 + } + fun init(w: ZIPDATA1_FAUCET_COIN, ctx: &mut sui::tx_context::TxContext) { + let (cap, metadata): (sui::coin::TreasuryCap, sui::coin::CoinMetadata) = + sui::coin::create_currency(w, 9, b"Z1F", b"ZIPDATA1_FAUCET_COIN", b"ZIPDATA1 Faucet Coin", std::option::none(), ctx); + let faucet = Faucet { id: sui::object::new(ctx), cap: cap, per_tx_limit: 1_000_000_000 }; + sui::transfer::public_share_object(faucet); + sui::transfer::public_freeze_object(metadata); + } + public fun claim(f: &mut Faucet, amount: u64, ctx: &mut sui::tx_context::TxContext) { + assert!(amount <= f.per_tx_limit, 1); + sui::coin::mint_and_transfer(&mut f.cap, amount, sui::tx_context::sender(ctx), ctx); + } +} diff --git a/mover/zipdata1/code/task3/Move.toml b/mover/zipdata1/code/task3/Move.toml new file mode 100644 index 000000000..2aaebb1ed --- /dev/null +++ b/mover/zipdata1/code/task3/Move.toml @@ -0,0 +1,6 @@ +[package] +name = "zipdata_task3" +edition = "2024" + +[addresses] +zipdata_task3 = "0x0" diff --git a/mover/zipdata1/code/task3/sources/nft.move b/mover/zipdata1/code/task3/sources/nft.move new file mode 100644 index 000000000..c62175167 --- /dev/null +++ b/mover/zipdata1/code/task3/sources/nft.move @@ -0,0 +1,28 @@ +module zipdata_task3::zipdata1_nft { + use std::string; + + public struct MyNFT has key, store { + id: sui::object::UID, + name: string::String, + image_url: string::String, + } + + fun init(ctx: &mut sui::tx_context::TxContext) { + let my_nft = MyNFT { + id: sui::object::new(ctx), + name: string::utf8(b"My NFT"), + image_url: string::utf8( + b"https://avatars.githubusercontent.com/u/107616568?v=4", + ), + }; + sui::transfer::public_transfer(my_nft, sui::tx_context::sender(ctx)); + } + public fun mint(url: string::String, ctx: &mut sui::tx_context::TxContext) { + let my_nft = MyNFT { + id: sui::object::new(ctx), + name: string::utf8(b"My NFT"), + image_url: url, + }; + sui::transfer::public_transfer(my_nft, sui::tx_context::sender(ctx)); + } +} diff --git a/mover/zipdata1/images/nft.png b/mover/zipdata1/images/nft.png new file mode 100644 index 000000000..1a37aca7f Binary files /dev/null and b/mover/zipdata1/images/nft.png differ diff --git a/mover/zipdata1/readme.md b/mover/zipdata1/readme.md index d12177472..7c64a1302 100644 --- a/mover/zipdata1/readme.md +++ b/mover/zipdata1/readme.md @@ -1,53 +1,53 @@ -## 基本信息 -- Sui钱包地址: `0x9620b4d45bf7f8e7d83dacea7b4bf226382e411b1b289c1d61d1eaa5f2442be6` -> 首次参与需要完成第一个任务注册好钱包地址才被合并,并且后续学习奖励会打入这个地址 -- github: `zipdata1` - -## 个人简介 -- 技术栈: `java` -> 重要提示 请认真写自己的简介 -- 一年java开发经验,对Move特别感兴趣,想通过Move入门区块链 -- 联系方式: qq: `2976003832` - -## 任务 - -## 01 hello move -- [x] Sui cli version:`sui 1.29.2-09db80adf1af` -- [x] Sui钱包截图: ![Sui钱包截图](./images/01.png) -- [x] package id: `0x569df0c06938c7e94ad7308505b9c473b2a09889815a8d74616ff26ee9a14901` -- [x] package id 在 scan上的查看截图:![Scan截图](./images/02.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 : +## 基本信息 +- Sui钱包地址: `0x9620b4d45bf7f8e7d83dacea7b4bf226382e411b1b289c1d61d1eaa5f2442be6` +> 首次参与需要完成第一个任务注册好钱包地址才被合并,并且后续学习奖励会打入这个地址 +- github: `zipdata1` + +## 个人简介 +- 技术栈: `java` +> 重要提示 请认真写自己的简介 +- 一年java开发经验,对Move特别感兴趣,想通过Move入门区块链 +- 联系方式: qq: `2976003832` + +## 任务 + +## 01 hello move +- [x] Sui cli version:`sui 1.29.2-09db80adf1af` +- [x] Sui钱包截图: ![Sui钱包截图](./images/01.png) +- [x] package id: `0x569df0c06938c7e94ad7308505b9c473b2a09889815a8d74616ff26ee9a14901` +- [x] package id 在 scan上的查看截图:![Scan截图](./images/02.png) + +## 02 move coin +- [x] My Coin package id :0x6dede1e0e16570bf3193b91e6c9124907ffe0d53e912e6ee5bda842c64129086 +- [x] Faucet package id : 0x6dede1e0e16570bf3193b91e6c9124907ffe0d53e912e6ee5bda842c64129086 +- [x] 转账 `My Coin` hash:4RpkTabhbDQPbaSFaZhaLPqDpJRUtTkB1q1Ak1GkQDt8 +- [x] `Faucet Coin` address1 mint hash:gGF6M7WrNMaVAKXVB1gzyuHBqERz4Thvg3oZL3hTYh2(0x644b811d97e1a4cf2cec9870cd8335de9f8492d1cd0a4f9f4965218a6aa5579a) +- [x] `Faucet Coin` address2 mint hash:3pW4bnYN8K4iqPmwZ1jbu9YPPEfeW2QnhLJMDnfa9Xjw(0xeae8fa3ee3de530e9be10b9fe41aee1946a984056068721fb0c3c946882626b7) + +## 03 move NFT +- [x] nft package id :0xe0430643481e0c5cdcc1f0c8b7d298232f4d50d070642fc3cb02faf57d4aca79 +- [x] nft object id : 0x461d8e17100db3c99cae9e0e7b1fc34fa0bf9a6bd2ff06d0956a2256b39a19e0 +- [x] 转账 nft hash:4htzLNsFDzsYYPHXkEmyAu569hzy7gQ1cLr7mZ49qTu8 +- [x] scan上的NFT截图:![Scan截图](./images/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 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 :