Skip to content
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
46 changes: 46 additions & 0 deletions mover/longphu25/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
## Basic Information
- Sui Wallet Address: `0xde03f5aa56efbf3765da3b92425e1403f0820f574933073c13c47070fd56128b`
> First-time participants must complete the registration of the wallet address through the first task to have it merged. You should use this address for subsequent tasks. We will also use this address to credit the learning rewards.
- Github: `longphu25`

## Personal Introduction
- Work Experience: `13 years`
- Tech Stack: `PHP` `Golang` `Rust` `C#` `Python` `Javascript` `Typescript`
> Important: Please take your personal introduction seriously.
- Years of experience in web2 development, particularly interested in Move, aiming to use Move as an entry point into blockchain. (This is just an example, please write your own introduction and feel free to add more details.)
- Contact: telegram `longphu`

## Tasks

### 01 hello move
- [x] Sui CLI Version: `sui 1.40.0-75a20fa8c1fa`
- [x] Sui Wallet Screenshot: ![](./images/sui-wallet.png)
- [x] Package ID: 0x145a559fe7127f1d908a91a2eca93efdb865849ca6e86afefbf62a6c453fa76c
- [x] Package ID's Screenshot from Explorer: ![](./images/sui-package.png)

### 02 move coin
- [x] `My Coin` Package ID: 0xcb3af9597bca8d4cfd1f9995cce3fec8ffed9ed3d589526096ce441de5b6efb7
- [x] `Faucet Coin` Package ID: 0x224f8dc5ce2b50aa05b1a2f7f3bc837c6488303482ac521ac0bbbe821277870b
- [x] Transfer `My Coin` hash: 3Jt2fLrktHcU7PjdirW2irXUU3QnoUAf81dio5E2AR1Q
- [x] `Faucet Coin` address 1 mint hash: BVNJ1ccTFc6M2Z1sUyWw6a2EeogNt3ZWY97J4Sr8UEtu
- [x] `Faucet Coin` address 2 mint hash: 9ETYyrpcJPuc9ceM493eQ5iHmypVYqk2mmwY597gVmPZ

### 03 move nft
- [x] NFT Package ID: 0x064f81806b60a0ba739fcaaef8055ba46bdbffda8b83e1be1679196d331f761a
- [x] NFT Object ID: 0xacce2199f0944c053348f2ad7bb25effbf07bd8ae57786cfd01b078d20d69e0d
- [x] Transfer NFT hash: 2G6dRiBJGcr3ktCNCSY86Dm4rQdU24TwY5criAhtwgaE
- [x] NFT's Screenshot from Explorer: ![](./images/my-nft.png)

### 04 move game
- [ ] Game Package ID:
- [ ] Deposit Coin Hash:
- [ ] Withdraw Coin Hash:
- [ ] Play Game Hash:

### 05 move swap
- [ ] Swap Package ID:
- [ ] Call Swap Coin A -> Coin B hash:
- [ ] Call Swap Coin B -> Coin A hash:

### 06 dapp-kit SDK PTB
- [ ] Save Hash:
Empty file added mover/longphu25/code/README.md
Empty file.
1 change: 1 addition & 0 deletions mover/longphu25/code/task1/Hello_Move/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build/*
60 changes: 60 additions & 0 deletions mover/longphu25/code/task1/Hello_Move/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# https://docs.sui.io/references/cli/client
network:
sui client envs
version:
sui --version
address: # https://docs.sui.io/references/cli/cheatsheet
sui client address
new-address:
sui client new-address ed25519
balance:
sui client balance
move-build:
sui move build
test:
sui move test
client-objects:
sui client objects
faucet:
sui client faucet
# https://docs.sui.io/guides/developer/first-app/publish
publish:
sui client publish

# https://docs.sui.io/references/cli/cheatsheet#executing-transactions
# │ Published Objects: │
# │ ┌── │
# │ │ PackageID: 0x145a559fe7127f1d908a91a2eca93efdb865849ca6e86afefbf62a6c453fa76c │
# │ │ Version: 1 │
# │ │ Digest: GuKLuED88MVxgyhGfsa46cqo2LZPvaozJ5FhYTzU69Rj │
# │ │ Modules: longphu │
# │ └── │
# ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
call-package:
sui client call --package 0x145a559fe7127f1d908a91a2eca93efdb865849ca6e86afefbf62a6c453fa76c --module longphu --function say_hello

view-object:
sui client object 0x61a19ec0244dacd834e0dbeab725b4d014962c879b2db69393050be549002591

keytool:
sui keytool list

export-private-key:
sui keytool export --key-identity naughty-idocrase

mint-my-coin:
sui client call --package 0xcb3af9597bca8d4cfd1f9995cce3fec8ffed9ed3d589526096ce441de5b6efb7 --module my_coin --function mint --args 0x01e060aca9d96cb9a710ae5c76be193b5b7d79968d7bebb7cb9a8c6838b5fbed 1000000000 0x052f5a900488ef4a6c130e395ea6c10d1b0d73e12adb7da43dfd5ef47ecd5a6e

# ObjectType: 0x2::coin::TreasuryCap<0xcb3af9597bca8d4cfd1f9995cce3fec8ffed9ed3d589526096ce441de5b6efb7::my_coin::MY_COIN>

mint-faucet-coin:
sui client call --package 0x224f8dc5ce2b50aa05b1a2f7f3bc837c6488303482ac521ac0bbbe821277870b --module faucet_coin --function mint --args 0xe986705f1fc23a91ec33f829899b930d376179a424c5771488d9337553d434b9 1000000000 0x052f5a900488ef4a6c130e395ea6c10d1b0d73e12adb7da43dfd5ef47ecd5a6e

# ObjectID:0xe986705f1fc23a91ec33f829899b930d376179a424c5771488d9337553d434b9
# ObjectType: 0x224f8dc5ce2b50aa05b1a2f7f3bc837c6488303482ac521ac0bbbe821277870b::faucet_coin::TreasuryCapKeeper

call-package-nft:
sui client call --package 0x064f81806b60a0ba739fcaaef8055ba46bdbffda8b83e1be1679196d331f761a --module move_nft --function mint --args '' '' 0x052f5a900488ef4a6c130e395ea6c10d1b0d73e12adb7da43dfd5ef47ecd5a6e

transfer-nft:
sui client transfer --to 0xa9ddd77d41119bdcbab0f5c4d18bf15e65034607afc5a296865f640e0d33d958 --object-id 0x9a12a04ef2c2f417bd62cf9702683afd2611e7d4ace1a23f3ade85c2cef9c27d
34 changes: 34 additions & 0 deletions mover/longphu25/code/task1/Hello_Move/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 = "52664DA431D121453DE4A63E2A2EEFD5594CFC5E814D55AE51888BE5A9230629"
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.40.0"
edition = "2024.beta"
flavor = "sui"

[env]

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

31 changes: 31 additions & 0 deletions mover/longphu25/code/task1/Hello_Move/sources/hello_move.move
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
/// Module: hello_move
module hello_move::hello_move;
*/

// For Move coding conventions, see
// https://docs.sui.io/concepts/sui-move-concepts/conventions


module hello_move::longphu {
use std::string::{Self, String};

// Struct to store the GitHub ID
public struct GitHubStruct has key, store {
id: UID,
github_id: String,
}

public entry fun say_hello(ctx: &mut TxContext) {
let hello_world = GitHubStruct {
id: object::new(ctx),
github_id: string::utf8(b"Long Phu"),
};

transfer::transfer(hello_world, tx_context::sender(ctx));
}

public fun github_id(github_object: &GitHubStruct): String {
github_object.github_id
}
}
48 changes: 48 additions & 0 deletions mover/longphu25/code/task1/Hello_Move/tests/hello_move_tests.move
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
#[test_only]
module hello_move::hello_move_tests;
// uncomment this line to import the module
// use hello_move::hello_move;

const ENotImplemented: u64 = 0;

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

#[test, expected_failure(abort_code = ::hello_move::hello_move_tests::ENotImplemented)]
fun test_hello_move_fail() {
abort ENotImplemented
}
*/
#[test_only]
module hello_move::longphu_tests;
// uncomment this line to import the module
use hello_move::longphu::{GitHubStruct, say_hello, github_id};
use sui::test_scenario;
use std::string;
use sui::test_utils::assert_eq;

#[test]
fun test_call_say_hello_longphu() {

let sender = @0x1e0;

let mut scenario = test_scenario::begin(sender);
{
say_hello(test_scenario::ctx(&mut scenario))
};

test_scenario::next_tx(&mut scenario, sender);
{
let received_object = test_scenario::take_from_sender<GitHubStruct>(&scenario);
assert_eq(github_id(&received_object), string::utf8(b"Long Phu"));

scenario.return_to_sender(received_object);
};


test_scenario::end(scenario);
}

Empty file.
1 change: 1 addition & 0 deletions mover/longphu25/code/task2/faucet_coin/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build/*
34 changes: 34 additions & 0 deletions mover/longphu25/code/task2/faucet_coin/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 = "F8CFCF256E2F1BB7CD401C27799A09C40777C5C100F0DFA253E86DD7F0D4ED1B"
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.40.0"
edition = "2024.beta"
flavor = "sui"

[env]

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

55 changes: 55 additions & 0 deletions mover/longphu25/code/task2/faucet_coin/sources/faucet_coin.move
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
/// Module: faucet_coin
module faucet_coin::faucet_coin;

A Coin that anyone can mint.
*/

// For Move coding conventions, see
// https://docs.sui.io/concepts/sui-move-concepts/conventions

module faucet_coin::faucet_coin {
use sui::coin::{Self, TreasuryCap};
use sui::url;

public struct FAUCET_COIN has drop {}

public struct TreasuryCapKeeper has key, store {
id: UID,
cap: TreasuryCap<FAUCET_COIN>
}

fun init(otw: FAUCET_COIN, ctx: &mut TxContext) {
let (treasury_cap, metadata) = coin::create_currency(
otw,
6,
b"LPFC",
b"LongPhu Faucet Coin",
b"The Faucet Coin is a coin that anyone can mint.",
option::some(url::new_unsafe_from_bytes(b"https://raw.githubusercontent.com/longphu25/lets-move/refs/heads/task2/mover/longphu25/images/faucet-coin.png")),
ctx
);

transfer::public_freeze_object(metadata);
transfer::public_share_object(TreasuryCapKeeper {
id: object::new(ctx),
cap: treasury_cap
});
}

public entry fun mint(keeper: &mut TreasuryCapKeeper, amount: u64, recipient: address, ctx: &mut TxContext) {
coin::mint_and_transfer(&mut keeper.cap, amount, recipient, ctx);
}

public fun get_cap(keeper: &TreasuryCapKeeper): &TreasuryCap<FAUCET_COIN> {
&keeper.cap
}

#[test_only]
public fun init_for_testing(ctx: &mut TxContext) {
init(FAUCET_COIN{}, ctx);
}

}


Loading