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: 0 additions & 46 deletions mover/001/README.md

This file was deleted.

49 changes: 49 additions & 0 deletions mover/tung-lee/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
## Basic Information
- Sui Wallet Address: `0xb4b291607e91da4654cab88e5e35ba2921ef68f1b43725ef2faeae045bf5915d`
> 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: `tung-lee`

## Personal Introduction
- Work Experience: `1 years`
- Tech Stack: `Rust`, `JavaScript`, `TypeScript`, `React`, `Node.js`, `Docker`
> 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 `@tunglee2410`

## Tasks

### 01 hello move
- [x] Sui CLI Version: sui 1.38.3-homebrew
- [x] Sui Wallet Screenshot: Link to image uploaded to `images` folder.
![Sui Wallet](./images/task1/sui-wallet.png)
- [x] Package ID: 0x8c2dd46a3a7e91d882495a2eca03926dd08b14969b677c7d1deeab5169e9e850
- [x] Package ID's Screenshot from Explorer: Link to image uploaded to `images` folder.
![Package ID](./images/task1/package-id-explorer.png)

### 02 move coin
- [x] `My Coin` Package ID: 0x8bfe3c76dfc8a1e65a25224cac75d3ec26e243c45e48a72fefa2d2576ecc1263
- [x] `Faucet Coin` Package ID: 0xf8d69746f4142542458b36bf9f92bb0b01284b24413872aaacd4e265bf9fe5f6
- [x] Transfer `My Coin` hash: C3aGxykkgpA4sV2FqeYktDvfLpkSnX3twnm8yfbygEV2
- [x] `Faucet Coin` address 1 mint hash: Ghmb8H97sDxxsRSP7vUD2bmHsDiMY3iUBR9RGajh1odX
- [x] `Faucet Coin` address 2 mint hash: 3soCfRkcrhjV7RMo4vQC2rsnEGtrG57JhNXLh3X6xYgL

### 03 move nft
- [x] NFT Package ID: 0x814b604ff40f3cabff7879877b13925b87be14ef6d52e182511fe703c2af3179
- [x] NFT Object ID: 0xef091babdde82844a3e369fd0cba34e04c05dd4600f74ca66da4781a1d4c8640
- [x] Transfer NFT hash: CbAeZq97zTJvxBqKU9Zq2GjpSD9PQtr5tWQ64oYQSCsS
- [x] NFT's Screenshot from Explorer: Link to image uploaded to `images` folder.
![NFT](./images/task3/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:
File renamed without changes.
File renamed without changes.
34 changes: 34 additions & 0 deletions mover/tung-lee/code/task1/hello_world/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 = "60F2000F4D6DAD240EF371DB3BC521F7BD4C8B814BC59CA473B852B77FDBE53C"
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.38.3"
edition = "2024.beta"
flavor = "sui"

[env]

[env.testnet]
chain-id = "4c78adac"
original-published-id = "0x8c2dd46a3a7e91d882495a2eca03926dd08b14969b677c7d1deeab5169e9e850"
latest-published-id = "0x8c2dd46a3a7e91d882495a2eca03926dd08b14969b677c7d1deeab5169e9e850"
published-version = "1"
37 changes: 37 additions & 0 deletions mover/tung-lee/code/task1/hello_world/Move.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[package]
name = "hello_world"
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_world = "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/tung-lee/code/task1/hello_world/sources/hello_world.move
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module hello_world::hello_world {
use std::string;
use sui::object;
use sui::transfer;
use sui::tx_context;

public struct HelloWorldObject has key, store {
id: UID,
github_id: string::String
}

#[lint_allow(self_transfer)]
public entry fun hello_world(ctx: &mut TxContext) {
let object = HelloWorldObject {
id: object::new(ctx),
github_id: string::utf8(b"tung-lee")
};
transfer::public_transfer(object, tx_context::sender(ctx));
}
}
18 changes: 18 additions & 0 deletions mover/tung-lee/code/task1/hello_world/tests/hello_world_tests.move
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
#[test_only]
module hello_world::hello_world_tests;
// uncomment this line to import the module
// use hello_world::hello_world;

const ENotImplemented: u64 = 0;

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

#[test, expected_failure(abort_code = ::hello_world::hello_world_tests::ENotImplemented)]
fun test_hello_world_fail() {
abort ENotImplemented
}
*/
19 changes: 19 additions & 0 deletions mover/tung-lee/code/task2/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Mint token `My Coin`
```
sui client call --package 0x8bfe3c76dfc8a1e65a25224cac75d3ec26e243c45e48a72fefa2d2576ecc1263 --module my_coin --function mint_token --args 0xe1b921c5ad1aa3feb31fe499ef396eaf310834b710f4956e626088b58574746f
```

# Mint and Transfer token `My Coin`
```
sui client call --package 0x2 --module coin --function mint_and_transfer --args 0xe1b921c5ad1aa3feb31fe499ef396eaf310834b710f4956e626088b58574746f 10000000 0x3b042837d6ea719c6a4e6da7feb34e33ea098cdfb0fe10cc3172151edacbdd21 --type-args 0x8bfe3c76dfc8a1e65a25224cac75d3ec26e243c45e48a72fefa2d2576ecc1263::my_coin::MY_COIN
```

# Transfer token `My Coin`
```
sui client transfer --to 0xa9ddd77d41119bdcbab0f5c4d18bf15e65034607afc5a296865f640e0d33d958 --object-id 0x7f363acb1e460d8b1c19790e66e7f99f94c0991600ff47ea9abf2dca7c17815c
```

# Mint token `Faucet Coin`
```
sui client call --package 0xf8d69746f4142542458b36bf9f92bb0b01284b24413872aaacd4e265bf9fe5f6 --module faucet_coin --function mint_token --args 0x3790f889232d5d8bda1ea32a4842a0727d7a9ed115f2a32284509429dbfd1d85
```
34 changes: 34 additions & 0 deletions mover/tung-lee/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.38.3"
edition = "2024.beta"
flavor = "sui"

[env]

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

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

module 0x0::faucet_coin {
use sui::coin::{Self, TreasuryCap};
use sui::tx_context::{Self, TxContext};
use sui::transfer;

// One time witness
public struct FAUCET_COIN has drop {}


fun init(witness: FAUCET_COIN, ctx: &mut TxContext) {
let (treasury_cap, coin_metadata) = coin::create_currency(
witness,
5,
b"FC",
b"faucet coin",
b"My faucet coin",
option::none(),
ctx
);

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

public entry fun mint_token(treasury_cap: &mut TreasuryCap<FAUCET_COIN>, ctx: &mut TxContext) {
let coin_obj = coin::mint(treasury_cap, 100000, ctx);
transfer::public_transfer(coin_obj, ctx.sender());
}
}
18 changes: 18 additions & 0 deletions mover/tung-lee/code/task2/faucet_coin/tests/faucet_coin_tests.move
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
#[test_only]
module faucet_coin::faucet_coin_tests;
// uncomment this line to import the module
// use faucet_coin::faucet_coin;

const ENotImplemented: u64 = 0;

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

#[test, expected_failure(abort_code = ::faucet_coin::faucet_coin_tests::ENotImplemented)]
fun test_faucet_coin_fail() {
abort ENotImplemented
}
*/
34 changes: 34 additions & 0 deletions mover/tung-lee/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.38.3"
edition = "2024.beta"
flavor = "sui"

[env]

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