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

## Personal Introduction
- Work Experience: `0 year`
- Tech Stack: None
> Important: Please take your personal introduction seriously.
- 2 years of experience in blockchain industry as community manager and research analyst, particularly interested in Move, aiming to use Move as an entry point into blockchain development.
- Contact: telegram `@Knavecrypto`

## Tasks

### 01 hello move
- [x] Sui CLI Version: sui 1.38.3-44dc210152dd
- [x] Sui Wallet Screenshot:
![Wallet](./images/suiwallet.png)
- [x] Package ID: 0x72c2f9dba87c2772f850f4fe53e982fb5115d9c8ca92744185cd87596cee6736
- [x] Package ID's Screenshot from Explorer:
![ID](./images/explorer.png)

### 02 move coin
- [x] `My Coin` Package ID: 0x63baaed530083f79d619fb2960fb927b4aab02ce21df56295f665f57dd1986a9
- [x] `Faucet Coin` Package ID: 0xf9d30bf9f7f731cf55d50c24acf258bc7e0707241222e217e9c939d30c442347
- [x] Transfer `My Coin` hash: 6QNKB64o3BSRWh3Zc7aZGALRDVqZNLSUb1wmr3UMNiXh
- [x] `Faucet Coin` address 1 mint hash: D8QDUduYpGwwh2eTNBctfc4wC6Nk1zZUpY4HLVnyX49T
- [x] `Faucet Coin` address 2 mint hash: F4ASQB6KrqFJxUdFSjC5BLnznjtwUAhdDxCXg4MMKnhu

### 03 move nft
- [x] NFT Package ID: 0x8e94f0375bf868ce13483df4a87e95e35aef3f35e3b3ff986b75bde0ca85b986
- [x] NFT Object ID: 0x50b991e8d8262063f4be0a78b17c6e236c7821cf0b0a59de14095d0a8a8333aa
- [x] Transfer NFT hash: CbVtiKCK27ywBq2e8boV4Bv4oU4YHaN3v8g5EqkvKr7r
- [x] NFT's Screenshot from Explorer: Link to image uploaded to `images` folder.
![NFT](images/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.
Empty file.
34 changes: 34 additions & 0 deletions mover/knavecrypto/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 = "0x72c2f9dba87c2772f850f4fe53e982fb5115d9c8ca92744185cd87596cee6736"
latest-published-id = "0x72c2f9dba87c2772f850f4fe53e982fb5115d9c8ca92744185cd87596cee6736"
published-version = "1"
37 changes: 37 additions & 0 deletions mover/knavecrypto/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"

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

use std::string;

/// An object that contains an arbitrary string
public struct HelloWorldObject has key, store {
id: UID,
/// A string contained in the object
text: string::String
}

#[lint_allow(self_transfer)]
public entry fun hello_world(ctx: &mut TxContext) {
let object = HelloWorldObject {
id: object::new(ctx),
text: string::utf8(b"knavecrypto")
};
transfer::public_transfer(object, tx_context::sender(ctx));
}

}
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
}
*/
34 changes: 34 additions & 0 deletions mover/knavecrypto/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 = "0xf9d30bf9f7f731cf55d50c24acf258bc7e0707241222e217e9c939d30c442347"
latest-published-id = "0xf9d30bf9f7f731cf55d50c24acf258bc7e0707241222e217e9c939d30c442347"
published-version = "1"
37 changes: 37 additions & 0 deletions mover/knavecrypto/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"

31 changes: 31 additions & 0 deletions mover/knavecrypto/code/task2/faucet_coin/sources/faucet_coin.move
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
/// Module: faucet_coin
module faucet_coin::faucet_coin;
*/
module faucet_coin::knave {
use sui::coin::{Self, TreasuryCap};
public struct KNAVE has drop {}

fun init(witness: KNAVE, ctx: &mut TxContext) {
let (treasury, metadata) = coin::create_currency(
witness,
6,
b"KCC",
b"KnaveCrypto Coin",
b"Ai cung~ mint coin nay` duoc het",
option::none(),
ctx,
);
transfer::public_freeze_object(metadata);
transfer::public_share_object(treasury)
}
public fun mint(
treasury_cap: &mut TreasuryCap<KNAVE>,
amount: u64,
recipient: address,
ctx: &mut TxContext,
) {
let coin = coin::mint(treasury_cap, amount, ctx);
transfer::public_transfer(coin, recipient)
}
}
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/knavecrypto/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 = "0x63baaed530083f79d619fb2960fb927b4aab02ce21df56295f665f57dd1986a9"
latest-published-id = "0x63baaed530083f79d619fb2960fb927b4aab02ce21df56295f665f57dd1986a9"
published-version = "1"
37 changes: 37 additions & 0 deletions mover/knavecrypto/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"

31 changes: 31 additions & 0 deletions mover/knavecrypto/code/task2/my_coin/sources/my_coin.move
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
/// Module: my_coin
module my_coin::my_coin;
*/
module my_coin::knave {
use sui::coin::{Self, TreasuryCap};
public struct KNAVE has drop {}

fun init(witness: KNAVE, ctx: &mut TxContext) {
let (treasury, metadata) = coin::create_currency(
witness,
6,
b"KCC",
b"KnaveCrypto Coin",
b"Khong phai ai cung~ mint duoc",
option::none(),
ctx,
);
transfer::public_freeze_object(metadata);
transfer::public_transfer(treasury, ctx.sender())
}
public fun mint(
treasury_cap: &mut TreasuryCap<KNAVE>,
amount: u64,
recipient: address,
ctx: &mut TxContext,
) {
let coin = coin::mint(treasury_cap, amount, ctx);
transfer::public_transfer(coin, recipient)
}
}
Loading