Skip to content
Merged

task2 #2601

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions mover/hellogaod/code/task2/hellogaod_coin/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build/*
56 changes: 56 additions & 0 deletions mover/hellogaod/code/task2/hellogaod_coin/Move.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# @generated by Move, please check-in and do not edit manually.

[move]
version = 3
manifest_digest = "58B363077D05278E2192F870E54F1AA871967EDB1B946215DC34A926C8A2E5EF"
deps_digest = "F9B494B64F0615AED0E98FC12A85B85ECD2BC5185C22D30E7F67786BB52E507C"
dependencies = [
{ id = "Bridge", name = "Bridge" },
{ id = "MoveStdlib", name = "MoveStdlib" },
{ id = "Sui", name = "Sui" },
{ id = "SuiSystem", name = "SuiSystem" },
]

[[move.package]]
id = "Bridge"
source = { git = "https://github.com/MystenLabs/sui.git", rev = "3802482bd4e3", subdir = "crates/sui-framework/packages/bridge" }

dependencies = [
{ id = "MoveStdlib", name = "MoveStdlib" },
{ id = "Sui", name = "Sui" },
{ id = "SuiSystem", name = "SuiSystem" },
]

[[move.package]]
id = "MoveStdlib"
source = { git = "https://github.com/MystenLabs/sui.git", rev = "3802482bd4e3", subdir = "crates/sui-framework/packages/move-stdlib" }

[[move.package]]
id = "Sui"
source = { git = "https://github.com/MystenLabs/sui.git", rev = "3802482bd4e3", subdir = "crates/sui-framework/packages/sui-framework" }

dependencies = [
{ id = "MoveStdlib", name = "MoveStdlib" },
]

[[move.package]]
id = "SuiSystem"
source = { git = "https://github.com/MystenLabs/sui.git", rev = "3802482bd4e3", subdir = "crates/sui-framework/packages/sui-system" }

dependencies = [
{ id = "MoveStdlib", name = "MoveStdlib" },
{ id = "Sui", name = "Sui" },
]

[move.toolchain-version]
compiler-version = "1.48.2"
edition = "2024.beta"
flavor = "sui"

[env]

[env.mainnet]
chain-id = "35834a8a"
original-published-id = "0x990153cb1e640274ee78eb7b36afcf57d98274eea039b5ae3278451645066c91"
latest-published-id = "0x990153cb1e640274ee78eb7b36afcf57d98274eea039b5ae3278451645066c91"
published-version = "1"
36 changes: 36 additions & 0 deletions mover/hellogaod/code/task2/hellogaod_coin/Move.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
[package]
name = "hellogaod_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]

# 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]
hellogaod_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"

Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
module hellogaod_coin::hellogaod_coin {
use sui::coin::{Self, Coin, TreasuryCap};
use sui::url::{Self, Url};

public struct HELLOGAOD_COIN has drop {}

fun init(
witness: HELLOGAOD_COIN,
ctx: &mut TxContext
) {
let (treasury_cap, metadata) = coin::create_currency<HELLOGAOD_COIN>(
witness,
9,
b"HELLOGAOD",
b"HELLOGAOD_COIN",
b"HelloGaod Coin",
option::some<Url>(
url::new_unsafe_from_bytes(
b"https://q3.itc.cn/images01/20250220/bd7183642f8a4f6285c9defb7f6bd409.jpeg"
)
),
ctx
);
transfer::public_freeze_object(metadata);
transfer::public_transfer(
treasury_cap,
tx_context::sender(ctx)
)
}

public entry fun mint(
treasury_cap: &mut TreasuryCap<HELLOGAOD_COIN>,
amount: u64,
recipient: address,
ctx: &mut TxContext
) {
coin::mint_and_transfer(treasury_cap, amount, recipient, ctx);
}

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

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
#[test_only]
module hellogaod_coin::hellogaod_coin_tests;
// uncomment this line to import the module
// use hellogaod_coin::hellogaod_coin;

const ENotImplemented: u64 = 0;

#[test]
fun test_hellogaod_coin() {
// pass
}

#[test, expected_failure(abort_code = ::hellogaod_coin::hellogaod_coin_tests::ENotImplemented)]
fun test_hellogaod_coin_fail() {
abort ENotImplemented
}
*/
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build/*
56 changes: 56 additions & 0 deletions mover/hellogaod/code/task2/hellogaod_faucet_coin/Move.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# @generated by Move, please check-in and do not edit manually.

[move]
version = 3
manifest_digest = "00A3110B81EDB2EDC9B0E35ECD26C3A35FA6ED3673180D25C3BEF9B32BA1FE03"
deps_digest = "F9B494B64F0615AED0E98FC12A85B85ECD2BC5185C22D30E7F67786BB52E507C"
dependencies = [
{ id = "Bridge", name = "Bridge" },
{ id = "MoveStdlib", name = "MoveStdlib" },
{ id = "Sui", name = "Sui" },
{ id = "SuiSystem", name = "SuiSystem" },
]

[[move.package]]
id = "Bridge"
source = { git = "https://github.com/MystenLabs/sui.git", rev = "3802482bd4e3", subdir = "crates/sui-framework/packages/bridge" }

dependencies = [
{ id = "MoveStdlib", name = "MoveStdlib" },
{ id = "Sui", name = "Sui" },
{ id = "SuiSystem", name = "SuiSystem" },
]

[[move.package]]
id = "MoveStdlib"
source = { git = "https://github.com/MystenLabs/sui.git", rev = "3802482bd4e3", subdir = "crates/sui-framework/packages/move-stdlib" }

[[move.package]]
id = "Sui"
source = { git = "https://github.com/MystenLabs/sui.git", rev = "3802482bd4e3", subdir = "crates/sui-framework/packages/sui-framework" }

dependencies = [
{ id = "MoveStdlib", name = "MoveStdlib" },
]

[[move.package]]
id = "SuiSystem"
source = { git = "https://github.com/MystenLabs/sui.git", rev = "3802482bd4e3", subdir = "crates/sui-framework/packages/sui-system" }

dependencies = [
{ id = "MoveStdlib", name = "MoveStdlib" },
{ id = "Sui", name = "Sui" },
]

[move.toolchain-version]
compiler-version = "1.48.2"
edition = "2024.beta"
flavor = "sui"

[env]

[env.mainnet]
chain-id = "35834a8a"
original-published-id = "0x0f70c1a4c9098d2d9430da35032ecaeab7e0381e5e0a3bd40d9da595f7093048"
latest-published-id = "0x0f70c1a4c9098d2d9430da35032ecaeab7e0381e5e0a3bd40d9da595f7093048"
published-version = "1"
36 changes: 36 additions & 0 deletions mover/hellogaod/code/task2/hellogaod_faucet_coin/Move.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
[package]
name = "hellogaod_faucet_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]

# 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]
hellogaod_faucet_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"

Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
module hellogaod_faucet_coin::hellogaod_faucet_coin {
use sui::coin::{Self, Coin, TreasuryCap};
use sui::url::{Self, Url};

public struct HELLOGAOD_FAUCET_COIN has drop {}

fun init(
witness: HELLOGAOD_FAUCET_COIN,
ctx: &mut TxContext
) {
let (treasury_cap, metadata) = coin::create_currency<HELLOGAOD_FAUCET_COIN>(
witness,
9,
b"HGF",
b"HELLOGAOD_FAUCET_COIN",
b"HelloGaod Faucet Coin",
option::some<Url>(
url::new_unsafe_from_bytes(
b"https://q3.itc.cn/images01/20250220/bd7183642f8a4f6285c9defb7f6bd409.jpeg"
)
),
ctx
);
transfer::public_freeze_object(metadata);
transfer::public_share_object(treasury_cap)
}

public entry fun mint(
treasury_cap: &mut TreasuryCap<HELLOGAOD_FAUCET_COIN>,
amount: u64,
recipient: address,
ctx: &mut TxContext
) {
coin::mint_and_transfer(treasury_cap, amount, recipient, ctx);
}

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

}
}


Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
#[test_only]
module hellogaod_faucet_coin::hellogaod_faucet_coin_tests;
// uncomment this line to import the module
// use hellogaod_faucet_coin::hellogaod_faucet_coin;

const ENotImplemented: u64 = 0;

#[test]
fun test_hellogaod_faucet_coin() {
// pass
}

#[test, expected_failure(abort_code = ::hellogaod_faucet_coin::hellogaod_faucet_coin_tests::ENotImplemented)]
fun test_hellogaod_faucet_coin_fail() {
abort ENotImplemented
}
*/
10 changes: 5 additions & 5 deletions mover/hellogaod/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
- [x] package id 在 scan上的查看截图:![Scan截图](./images/scan1.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 : 0x990153cb1e640274ee78eb7b36afcf57d98274eea039b5ae3278451645066c91
- [] Faucet package id : 0x0f70c1a4c9098d2d9430da35032ecaeab7e0381e5e0a3bd40d9da595f7093048
- [x] 转账 `My Coin` hash: 4eM7PRgnRvLKYgUXL4dwyDYKxu8uzDQThbrrmec3G2kS
- [] `Faucet Coin` address1 mint hash:GTdHw31bvRAEDthPxxENdZGBD9HJRCmyDgkj6aZwCF8d
- [] `Faucet Coin` address2 mint hash:7FQLiY396DHmoxfSsX6F9sSWhYFWeQa3w8LxzS8giTbn

## 03 move NFT
- [] nft package id :
Expand Down