diff --git a/mover/YXZ252426/code/task2/YXZ252426/sources/yxz252426.move b/mover/YXZ252426/code/task2/YXZ252426/sources/yxz252426.move new file mode 100644 index 000000000..f20974463 --- /dev/null +++ b/mover/YXZ252426/code/task2/YXZ252426/sources/yxz252426.move @@ -0,0 +1,51 @@ +/* +/// Module: yxz252426 +module yxz252426::yxz252426; +*/ +module yxz252426::yxz252426 { + use sui::coin::{Self, Coin, TreasuryCap}; + use sui::url::{Self, Url}; + + public struct YXZ252426 has drop {} + + fun init( + witness: YXZ252426, + ctx: &mut TxContext + ) { + let (treasury_cap, metadata) = coin::create_currency( + witness, + 9, + b"YXZ", + b"YXZ252426", + b"YXZ Coin", + option::some( + url::new_unsafe_from_bytes( + b"https://avatars.githubusercontent.com/u/76983474" + ) + ), + ctx + ); + transfer::public_freeze_object(metadata); + transfer::public_transfer( + treasury_cap, + tx_context::sender(ctx) + ) + } + + public entry fun mint( + treasury_cap: &mut TreasuryCap, + amount: u64, + recipient: address, + ctx: &mut TxContext + ) { + coin::mint_and_transfer(treasury_cap, amount, recipient, ctx); + } + + public fun burn( + treasury_cap: &mut TreasuryCap, + coin: Coin + ) { + coin::burn(treasury_cap, coin); + + } +} diff --git a/mover/YXZ252426/code/task2/YXZ252426/tests/yxz252426_tests.move b/mover/YXZ252426/code/task2/YXZ252426/tests/yxz252426_tests.move new file mode 100644 index 000000000..faef0e308 --- /dev/null +++ b/mover/YXZ252426/code/task2/YXZ252426/tests/yxz252426_tests.move @@ -0,0 +1,18 @@ +/* +#[test_only] +module yxz252426::yxz252426_tests; +// uncomment this line to import the module +// use yxz252426::yxz252426; + +const ENotImplemented: u64 = 0; + +#[test] +fun test_yxz252426() { + // pass +} + +#[test, expected_failure(abort_code = ::yxz252426::yxz252426_tests::ENotImplemented)] +fun test_yxz252426_fail() { + abort ENotImplemented +} +*/ diff --git a/mover/YXZ252426/code/task2/YXZ252426_faucet/sources/yxz252426_faucet.move b/mover/YXZ252426/code/task2/YXZ252426_faucet/sources/yxz252426_faucet.move new file mode 100644 index 000000000..15fad3caa --- /dev/null +++ b/mover/YXZ252426/code/task2/YXZ252426_faucet/sources/yxz252426_faucet.move @@ -0,0 +1,50 @@ +/* +/// Module: yxz252426_faucet +module yxz252426_faucet::yxz252426_faucet; +*/ +module yxz252426_faucet::yxz252426_faucet { + use sui::coin::{Self, Coin, TreasuryCap}; + use sui::url::{Self, Url}; + + public struct YXZ252426_FAUCET has drop {} + + fun init( + witness: YXZ252426_FAUCET, + ctx: &mut TxContext + ) { + let (treasury_cap, metadata) = coin::create_currency( + witness, + 9, + b"YXZ", + b"YXZ252426_FAUCET", + b"YXZ252426 Faucet Coin", + option::some( + url::new_unsafe_from_bytes( + b"https://avatars.githubusercontent.com/u/76983474" + ) + ), + ctx + ); + transfer::public_freeze_object(metadata); + transfer::public_share_object(treasury_cap) + } + + public entry fun mint( + treasury_cap: &mut TreasuryCap, + amount: u64, + recipient: address, + ctx: &mut TxContext + ) { + coin::mint_and_transfer(treasury_cap, amount, recipient, ctx); + } + + public fun burn( + treasury_cap: &mut TreasuryCap, + coin: Coin + ) { + coin::burn(treasury_cap, coin); + + } +} + + diff --git a/mover/YXZ252426/code/task2/YXZ252426_faucet/tests/yxz252426_faucet_tests.move b/mover/YXZ252426/code/task2/YXZ252426_faucet/tests/yxz252426_faucet_tests.move new file mode 100644 index 000000000..6e22cad5d --- /dev/null +++ b/mover/YXZ252426/code/task2/YXZ252426_faucet/tests/yxz252426_faucet_tests.move @@ -0,0 +1,18 @@ +/* +#[test_only] +module yxz252426_faucet::yxz252426_faucet_tests; +// uncomment this line to import the module +// use yxz252426_faucet::yxz252426_faucet; + +const ENotImplemented: u64 = 0; + +#[test] +fun test_yxz252426_faucet() { + // pass +} + +#[test, expected_failure(abort_code = ::yxz252426_faucet::yxz252426_faucet_tests::ENotImplemented)] +fun test_yxz252426_faucet_fail() { + abort ENotImplemented +} +*/ diff --git a/mover/YXZ252426/readme.md b/mover/YXZ252426/readme.md index 02f8e106b..88aa07970 100644 --- a/mover/YXZ252426/readme.md +++ b/mover/YXZ252426/readme.md @@ -20,11 +20,11 @@ - [x] package id 在 scan上的查看截图:![Scan截图](./image/img_1.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 : 0x4a84cee52be28b15ccaf679692aa8324dbc057e626843f18ea5533fa9efad9a6 +- [x] Faucet package id : 0xca91323681336a5b81bd8405ae740ebf25109d664ffdd1b5a25368e4ce53ce17 +- [x] 转账 `My Coin` hash:3jZ43YJi2HJ4SZdeVjoJXp2UAuCXhpS43Kh8tnkszj7R +- [x] `Faucet Coin` address1 mint hash:4Rgjn5nZoj4Ra3x48GMQnZnJxf5HhcFhWk8u96FsUGg4 +- [x] `Faucet Coin` address2 mint hash:3tMK1VuaUdT2X5KUxLnpVqsFLio419qQkyk9LkT4Q1T6 ## 03 move NFT - [] nft package id :