Skip to content

Commit

Permalink
Merge pull request #1941 from YXZ252426/main
Browse files Browse the repository at this point in the history
yxz252426的提交
  • Loading branch information
Sifotd authored Nov 20, 2024
2 parents 0d2cb2d + fc375bc commit 8c8473a
Show file tree
Hide file tree
Showing 5 changed files with 142 additions and 5 deletions.
51 changes: 51 additions & 0 deletions mover/YXZ252426/code/task2/YXZ252426/sources/yxz252426.move
Original file line number Diff line number Diff line change
@@ -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<YXZ252426>(
witness,
9,
b"YXZ",
b"YXZ252426",
b"YXZ Coin",
option::some<Url>(
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<YXZ252426>,
amount: u64,
recipient: address,
ctx: &mut TxContext
) {
coin::mint_and_transfer(treasury_cap, amount, recipient, ctx);
}

public fun burn(
treasury_cap: &mut TreasuryCap<YXZ252426>,
coin: Coin<YXZ252426>
) {
coin::burn(treasury_cap, coin);

}
}
18 changes: 18 additions & 0 deletions mover/YXZ252426/code/task2/YXZ252426/tests/yxz252426_tests.move
Original file line number Diff line number Diff line change
@@ -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
}
*/
Original file line number Diff line number Diff line change
@@ -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<YXZ252426_FAUCET>(
witness,
9,
b"YXZ",
b"YXZ252426_FAUCET",
b"YXZ252426 Faucet Coin",
option::some<Url>(
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<YXZ252426_FAUCET>,
amount: u64,
recipient: address,
ctx: &mut TxContext
) {
coin::mint_and_transfer(treasury_cap, amount, recipient, ctx);
}

public fun burn(
treasury_cap: &mut TreasuryCap<YXZ252426_FAUCET>,
coin: Coin<YXZ252426_FAUCET>
) {
coin::burn(treasury_cap, coin);

}
}


Original file line number Diff line number Diff line change
@@ -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
}
*/
10 changes: 5 additions & 5 deletions mover/YXZ252426/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 :
Expand Down

0 comments on commit 8c8473a

Please sign in to comment.