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/hai/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
## Basic Information
- Sui Wallet Address: `0xa1fcefa6d704434d6e1b5f68a13024ea8ea7df347413564b1a8e170e5f9e6fd4`
> 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: `tranvanhai0504`

## Personal Introduction
- Work Experience: `1 years`
- Tech Stack: `REACT` `NEXTJS`, `NODEJS`, `MONGODB`, `Kotlin`, etc.
> Important: Please take your personal introduction seriously.
- 1 Year of experience in web2 development, particularly interested in Move, aiming to use Move as an entry point into blockchain.
- Contact: telegram ``

## Tasks

### 01 hello move
- [x] Sui CLI Version: 1.39.1
- [x] Sui Wallet Screenshot: ![](images/sui_wallet.png)
- [x] Package ID: 0xf325a049c6a91db19a12231835da1e8abc4f6c427c2bb94dfc1e592d872203ab
- [x] Package ID's Screenshot from Explorer: ![](images/sui_explorer.png)

### 02 move coin
- [x] `My Coin` Package ID: 0xd43e32829240189cea70cacf8363e089e372e44f77f97e56359663e850243bfe
- [x] `Faucet Coin` Package ID: 0x537540423a252ec5687dd347390af56adf7bc1790b46cf02e72d066a3b30dcc2
- [x] Transfer `My Coin` hash: FJ9yvX4Zpb5tWuxZU5TTVEFGUKXgUKF3hKEWTPMj2jK4
- [x] `Faucet Coin` address 1 mint hash: 1z7JqBrnK4EqLYuJEHjJqgSWTJik1EieJQ1x7ZPKg8k
- [x] `Faucet Coin` address 2 mint hash: DcnSW8QH111WjtpNUiDUvX2KmBsffFhRJRAtr8iAqJNA

### 03 move nft
- [x] NFT Package ID: 0xd15d593a2410c89003b4c0825014bb867efbc9dca5015a38ac229a71b47db64b
- [x] NFT Object ID: 0x9c753b3b69610148da979b6419b0122f2a051971f7f066a28b30a71ccee416ef
- [x] Transfer NFT hash: F1sazvKDoMheSjpWEgrX1mYpzCmZ5tkrCNgW5JUy5DZG
- [x] NFT's Screenshot from Explorer: ![](images/NFT.png)

### 04 move game
- [x] Game Package ID: 0x24cfdc5e0b9917929d3bbfbcf98c445207c9e98db123bbcea8e488893245b5a4
- [x] Deposit Coin Hash: 3D3XDhtM9hYKLJ3HUZSGk99WU83kartFiu2yKfkoLbJX
- [x] Withdraw Coin Hash: rV2G239CqcdCgD8NRKFkXcJsSwETrMB5PLMjJq55SbD
- [x] Play Game Hash: HGXsR3Zk2DgXFFN2YQLXHnxMCVRSAuTyxKpNbkM8Tmnc

### 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/hai/code/README.md
Empty file.
1 change: 1 addition & 0 deletions mover/hai/code/task1/Hello_Move/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build/*
34 changes: 34 additions & 0 deletions mover/hai/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.39.1"
edition = "2024.beta"
flavor = "sui"

[env]

[env.testnet]
chain-id = "4c78adac"
original-published-id = "0xf325a049c6a91db19a12231835da1e8abc4f6c427c2bb94dfc1e592d872203ab"
latest-published-id = "0xf325a049c6a91db19a12231835da1e8abc4f6c427c2bb94dfc1e592d872203ab"
published-version = "1"
37 changes: 37 additions & 0 deletions mover/hai/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"

21 changes: 21 additions & 0 deletions mover/hai/code/task1/Hello_Move/sources/hello_move.move
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module hello_move::hello{

use sui::object::{Self, UID};
use std::string::{Self, String};
use sui::tx_context::{Self, TxContext};

public struct Hello_tranvanhai0504 has key{
id: UID,
name: String,
}

public entry fun say_hello_haitran(ctx: &mut TxContext){

let hello_world = Hello_tranvanhai0504 {
id: object::new(ctx),
name: b"Hello hai".to_string()
};

transfer::transfer(hello_world, tx_context::sender(ctx));
}
}
18 changes: 18 additions & 0 deletions mover/hai/code/task1/Hello_Move/tests/hello_move_tests.move
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
#[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
}
*/
Empty file added mover/hai/code/task1/README.md
Empty file.
1 change: 1 addition & 0 deletions mover/hai/code/task2/my_another_coin/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build/*
34 changes: 34 additions & 0 deletions mover/hai/code/task2/my_another_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 = "09266C18DE7CBB6343FECA359C45986E63E84C7C70D52C0B7C58474648B15725"
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.39.1"
edition = "2024.beta"
flavor = "sui"

[env]

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

37 changes: 37 additions & 0 deletions mover/hai/code/task2/my_another_coin/sources/my_another_coin.move
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
module 0x0::my_another_coin{
use sui::tx_context::{sender};
use sui::coin::{Self, Coin, TreasuryCap};
use sui::url::{Self};

// === define struct
public struct MY_ANOTHER_COIN has drop{}

#[allow(lint(share_owned))]
fun init (witness: MY_ANOTHER_COIN, ctx: &mut TxContext){
let (treasuryCap, coinMetadata) = coin::create_currency(
witness,
8,
b"HAI",
b"tranvanhai0504 Coin",
b"coder binh thanh!",
option::some(url::new_unsafe_from_bytes(b"https://aggregator.walrus-testnet.walrus.space/v1/X7KET_iwogbmrgD7ITJE-ZUE6k01TrK8d8AtV4l2FfI")),
ctx
);
transfer::public_share_object(treasuryCap);
transfer::public_share_object(coinMetadata);
}

/// create coin and update total supply
public entry fun mint(
cap: &mut TreasuryCap<MY_ANOTHER_COIN>,
value: u64,
receiver: address,
ctx: &mut TxContext){
let mint_coin = coin::mint(
cap,
value,
ctx,
);
transfer::public_transfer(mint_coin, receiver);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
#[test_only]
module my_another_coin::my_another_coin_tests;
// uncomment this line to import the module
// use my_another_coin::my_another_coin;

const ENotImplemented: u64 = 0;

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

#[test, expected_failure(abort_code = ::my_another_coin::my_another_coin_tests::ENotImplemented)]
fun test_my_another_coin_fail() {
abort ENotImplemented
}
*/
1 change: 1 addition & 0 deletions mover/hai/code/task2/my_coin/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build/*
34 changes: 34 additions & 0 deletions mover/hai/code/task2/my_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 = "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.40.1"
edition = "2024.beta"
flavor = "sui"

[env]

[env.testnet]
chain-id = "4c78adac"
original-published-id = "0x537540423a252ec5687dd347390af56adf7bc1790b46cf02e72d066a3b30dcc2"
latest-published-id = "0x537540423a252ec5687dd347390af56adf7bc1790b46cf02e72d066a3b30dcc2"
published-version = "1"
37 changes: 37 additions & 0 deletions mover/hai/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"

20 changes: 20 additions & 0 deletions mover/hai/code/task2/my_coin/sources/my_coin.move
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module 0x0::my_coin {

use sui::coin::{Self, TreasuryCap};
use sui::tx_context::{Self, TxContext};
use sui::transfer;

public struct MY_COIN has drop {}

fun init(witness: MY_COIN, ctx: &mut TxContext) {
let (treasury, coin_metadata) = coin::create_currency(witness, 5, b"HIGHCOIN", b"High Coin", b"my super coin", option::none(), ctx);

transfer::public_freeze_object(coin_metadata);
transfer::public_share_object(treasury);
}

public entry fun mint_token(treasury: &mut TreasuryCap<MY_COIN>, ctx: &mut TxContext) {
let coin_object = coin::mint(treasury, 1000000, ctx);
transfer::public_transfer(coin_object, ctx.sender());
}
}
Loading