Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

task2 & task3 #1922

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
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
Empty file added mover/zhtkeepup/code/readme.md
Empty file.
34 changes: 34 additions & 0 deletions mover/zhtkeepup/code/task1/hellomove/Move.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# @generated by Move, please check-in and do not edit manually.

[move]
version = 3
manifest_digest = "11BAF94A33662E7D904523341D85F0402E2C1A82A85216775F5E05EC6ADE9D9C"
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.3"
edition = "2024.beta"
flavor = "sui"

[env]

[env.testnet]
chain-id = "4c78adac"
original-published-id = "0xc1b082a9e8660a90d221d986883fb328815555b42eebdf8f1c78a2a1426ff4c4"
latest-published-id = "0xc1b082a9e8660a90d221d986883fb328815555b42eebdf8f1c78a2a1426ff4c4"
published-version = "1"
37 changes: 37 additions & 0 deletions mover/zhtkeepup/code/task1/hellomove/Move.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[package]
name = "hellomove"
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]
hellomove = "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"

17 changes: 17 additions & 0 deletions mover/zhtkeepup/code/task1/hellomove/sources/hellomove.move
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module hellomove::hello ;

use std::ascii::{String, string};
use sui::transfer::transfer;

public struct Hello has key {
id: UID,
say: String
}

fun init(ctx: &mut TxContext) {
let hello_move = Hello {
id: object::new(ctx),
say: string(b"zhtkeepup"),
};
transfer(hello_move, ctx.sender());
}
18 changes: 18 additions & 0 deletions mover/zhtkeepup/code/task1/hellomove/tests/hellomove_tests.move
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
#[test_only]
module hellomove::hellomove_tests;
// uncomment this line to import the module
// use hellomove::hellomove;

const ENotImplemented: u64 = 0;

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

#[test, expected_failure(abort_code = ::hellomove::hellomove_tests::ENotImplemented)]
fun test_hellomove_fail() {
abort ENotImplemented
}
*/
40 changes: 40 additions & 0 deletions mover/zhtkeepup/code/task2/my_coin/Move.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# @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.3"
edition = "2024.beta"
flavor = "sui"

[env]

[env.devnet]
chain-id = "0fc07bbe"
original-published-id = "0x3d9b75db063ad1b584ac0a67a19923b78214da867bbf9bd80a43df0273509376"
latest-published-id = "0x3d9b75db063ad1b584ac0a67a19923b78214da867bbf9bd80a43df0273509376"
published-version = "1"

[env.mainnet]
chain-id = "35834a8a"
original-published-id = "0x0b0b06cc47146f8d4f0db905dc1492354169ae416c78d371e14f0d13c8876836"
latest-published-id = "0x0b0b06cc47146f8d4f0db905dc1492354169ae416c78d371e14f0d13c8876836"
published-version = "1"
37 changes: 37 additions & 0 deletions mover/zhtkeepup/code/task2/my_coin/Move.toml
Original file line number Diff line number Diff line change
@@ -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"

7 changes: 7 additions & 0 deletions mover/zhtkeepup/code/task2/my_coin/call.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
sui client call --package 0x2 \
--module coin \
--function mint_and_transfer \
--type-args 0x63b706b16338bc592a5c784a650dbe9c74a4c0572ed6e95f6a9c6b7a76df6dff::my_coin::MY_COIN \
--args 0xa49accfcbac4a6b9ffb5678d5704ff50219f6462a0068bd449645045030b661e \
10000000000 \
0x264742e5020aafcb51f214513f1b7d5ce7eb2d6473c9b47f1343aa89402fa621
27 changes: 27 additions & 0 deletions mover/zhtkeepup/code/task2/my_coin/shell.history
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
sui client publish
sui client envs; sui client addresses;
sui client switch --address funny-crocidolite

sui client faucet

sui client new-address ed25519

sui client switch --env devnet

sui client balance 0x111111111



/*
c: &mut TreasuryCap<T>,
amount: u64,
recipient: address,
// ctx: &mut TxContext,
*/

sui client call --package 0x2 --module coin --function mint_and_transfer --type-args 0x0b0b06cc47146f8d4f0db905dc1492354169ae416c78d371e14f0d13c8876836::my_coin::MY_COIN --args 0x2bb3e8fba75d462bb0081ec46c62107692d2814cf028ec3264129b17d381c69e 10000000000 0x7b8e0864967427679b4e129f79dc332a885c6087ec9e187b53451a9006ee15f2 --gas-budget 5000000

sui client call --package 0x2 --module coin --function mint_and_transfer --type-args 0x0b0b06cc47146f8d4f0db905dc1492354169ae416c78d371e14f0d13c8876836::faucet_coin::FAUCET_COIN --args 0xac408f565c41f605e72824eacb498721669330650f0a5d5558913e1bff7620a5 10000000000 0x264742e5020aafcb51f214513f1b7d5ce7eb2d6473c9b47f1343aa89402fa621 --gas-budget 5000000



28 changes: 28 additions & 0 deletions mover/zhtkeepup/code/task2/my_coin/sources/faucet_coin.move
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

/// Module: my_coin
module my_coin::faucet_coin;

use std::option::{none, some};
use sui::coin;
use sui::coin::create_currency;
use sui::transfer::{public_freeze_object, public_transfer, public_share_object};
use sui::url;
use sui::url::Url;

public struct FAUCET_COIN has drop {

}

fun init(faucet_coin:FAUCET_COIN, ctx: &mut TxContext) {

let no:Option<Url> = none<Url>();
let url = url::new_unsafe_from_bytes(b"https://etherscan.io/token/images/centre-usdc_28.png");
let yes = some<Url>(url);

let (treasury, coin_metadata) = create_currency(faucet_coin,8,b"FaucetCoin",b"FaucetCoin",b"faucet coin.",no,ctx);

public_freeze_object(coin_metadata);

public_share_object(treasury);
// public_transfer(treasury, ctx.sender());
}
28 changes: 28 additions & 0 deletions mover/zhtkeepup/code/task2/my_coin/sources/my_coin.move
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

/// Module: my_coin
module my_coin::my_coin;

use std::option::{none, some};
use sui::coin;
use sui::coin::create_currency;
use sui::transfer::{public_freeze_object, public_transfer, public_share_object};
use sui::url;
use sui::url::Url;

public struct MY_COIN has drop {

}

fun init(my_coin:MY_COIN, ctx: &mut TxContext) {

let no:Option<Url> = none<Url>();
let url = url::new_unsafe_from_bytes(b"https://etherscan.io/token/images/centre-usdc_28.png");
let yes = some<Url>(url);

let (treasury, coin_metadata) = create_currency(my_coin,8,b"MyCoin",b"MyCoin",b"my coin.",no,ctx);

public_freeze_object(coin_metadata);

// public_share_object(treasury);
public_transfer(treasury, ctx.sender());
}
18 changes: 18 additions & 0 deletions mover/zhtkeepup/code/task2/my_coin/tests/my_coin_tests.move
Original file line number Diff line number Diff line change
@@ -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
}
*/
46 changes: 46 additions & 0 deletions mover/zhtkeepup/code/task3/my_nft/Move.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# @generated by Move, please check-in and do not edit manually.

[move]
version = 3
manifest_digest = "4C9B47E7441289AA0D50D87EEB9836BD01CE3604E3B249490E7F2046EAEE3400"
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.3"
edition = "2024.beta"
flavor = "sui"

[env]

[env.testnet]
chain-id = "4c78adac"
original-published-id = "0x020ede4d61aab752af4f703633b8b4efbf05897b903feb0471cd31ebae70f09b"
latest-published-id = "0x020ede4d61aab752af4f703633b8b4efbf05897b903feb0471cd31ebae70f09b"
published-version = "1"

[env.devnet]
chain-id = "0fc07bbe"
original-published-id = "0x4fa6978a5bcb02b11030b911caacf183dbb2b611d78debe6b24e4fbb4fd10c26"
latest-published-id = "0x4fa6978a5bcb02b11030b911caacf183dbb2b611d78debe6b24e4fbb4fd10c26"
published-version = "1"

[env.mainnet]
chain-id = "35834a8a"
original-published-id = "0x76c65ad4cbf1a0fac148ba88e15b2d542b5c151a970601a81f889faa09bc336e"
latest-published-id = "0x76c65ad4cbf1a0fac148ba88e15b2d542b5c151a970601a81f889faa09bc336e"
published-version = "1"
37 changes: 37 additions & 0 deletions mover/zhtkeepup/code/task3/my_nft/Move.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[package]
name = "my_nft"
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_nft = "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"

Loading