diff --git a/mover/linqining/code/task2/my_coin/Move.lock b/mover/linqining/code/task2/my_coin/Move.lock new file mode 100644 index 000000000..d879f00ae --- /dev/null +++ b/mover/linqining/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.37.1" +edition = "2024.beta" +flavor = "sui" + +[env] + +[env.testnet] +chain-id = "4c78adac" +original-published-id = "0x23728ec5d011eaf7a8bca55811edf283d83a3ffe105b1bfd067ebb16a475cb1d" +latest-published-id = "0x23728ec5d011eaf7a8bca55811edf283d83a3ffe105b1bfd067ebb16a475cb1d" +published-version = "1" diff --git a/mover/linqining/code/task2/my_coin/Move.toml b/mover/linqining/code/task2/my_coin/Move.toml new file mode 100644 index 000000000..b9ca003f8 --- /dev/null +++ b/mover/linqining/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/linqining/code/task2/my_coin/sources/eig.move b/mover/linqining/code/task2/my_coin/sources/eig.move new file mode 100644 index 000000000..0183aa75b --- /dev/null +++ b/mover/linqining/code/task2/my_coin/sources/eig.move @@ -0,0 +1,14 @@ +module my_coin::eig; +use std::option::none; +use sui::coin::create_currency; +use sui::transfer::{public_freeze_object, public_share_object}; +use sui::url::Url; + +public struct EIG has drop{} + +fun init(eig:EIG,ctx: &mut TxContext){ + let eig_img = none(); + let (treasury,metadata) = create_currency(eig,8,b"EIG",b"EIG",b"eig coin",eig_img,ctx); + public_freeze_object(metadata); + public_share_object(treasury); +} diff --git a/mover/linqining/code/task2/my_coin/sources/my_coin.move b/mover/linqining/code/task2/my_coin/sources/my_coin.move new file mode 100644 index 000000000..6fc6e67b4 --- /dev/null +++ b/mover/linqining/code/task2/my_coin/sources/my_coin.move @@ -0,0 +1,15 @@ +module my_coin::usd; +use std::option::some; +use sui::coin::create_currency; +use sui::transfer::{public_freeze_object, public_transfer}; +use sui::url::Url; + +public struct USD has drop{} + +fun init(usd:USD,ctx: &mut TxContext){ + let url = sui::url::new_unsafe_from_bytes(b"https://bkimg.cdn.bcebos.com/pic/503d269759ee3d6d55fbb529575d7a224f4a21a470b4?x-bce-process=image/format,f_auto/watermark,image_d2F0ZXIvYmFpa2UyNzI,g_7,xp_5,yp_5,P_20/resize,m_lfit,limit_1,h_1080"); + let usd_img = some(url); + let (treasury,metadata) = create_currency(usd,8,b"USD",b"USD",b"world currency",usd_img,ctx); + public_freeze_object(metadata); + public_transfer(treasury,ctx.sender()); +} diff --git a/mover/linqining/code/task2/my_coin/tests/my_coin_tests.move b/mover/linqining/code/task2/my_coin/tests/my_coin_tests.move new file mode 100644 index 000000000..cd5b36060 --- /dev/null +++ b/mover/linqining/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/linqining/readme.md b/mover/linqining/readme.md index e1b1e7872..25daaeb0a 100644 --- a/mover/linqining/readme.md +++ b/mover/linqining/readme.md @@ -16,17 +16,17 @@ ## 任务 ## 01 hello move -- [✓] Sui cli version: sui 1.37.1-homebrew -- [✓] Sui钱包截图: ![Sui钱包截图](./images/IMG_3635.PNG) -- [✓] package id: 0x2fee616afb84d0252eddbcd75c7b5b5bebade95ba2683e3f2600d6437f7b74e2 -- [✓] package id 在 scan上的查看截图:![Scan截图](./images/img.png) +- [x] Sui cli version: sui 1.37.1-homebrew +- [x] Sui钱包截图: ![Sui钱包截图](./images/IMG_3635.PNG) +- [x] package id: 0x2fee616afb84d0252eddbcd75c7b5b5bebade95ba2683e3f2600d6437f7b74e2 +- [x] package id 在 scan上的查看截图:![Scan截图](./images/img.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 : 0x1771f9d52f5e59f43bdc544fedf0246eac2bbf616f551f6aa15da0866512a475 +- [x] Faucet package id : 0x23728ec5d011eaf7a8bca55811edf283d83a3ffe105b1bfd067ebb16a475cb1d +- [x] 转账 `My Coin` hash: DeDhmvv5gHzuGGfNrQhqeDt7kUaqwd2Cn3gK1ue3DdHZ +- [x] `Faucet Coin` address1(0xc1f4704452819f75c258fe3a01e54d6561899e3478f818625ee8be716fbdd007) mint hash: ACrvHycdyRWC8wAK8DXNcdE4xJKK1b3nDz6oKeuS5kGy +- [x] `Faucet Coin` address2(0x7caaf3d123266f92398b3b642682133098afa7017b3a74b7fd0442d0368ae595) mint hash: 6tQHzfmfhk4d9sbeSVfoSBkfmhkwEEr1huqmudixFDJa ## 03 move NFT - [] nft package id :