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 #1235

Merged
merged 5 commits into from
Jul 22, 2024
Merged
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
34 changes: 34 additions & 0 deletions mover/404ll/code/task2/FaucetCoin/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 = 2
manifest_digest = "A3A4289005858BB5EC8B7DFB1830EFFBF1A44FCC005156E36FA379507A61F1BD"
deps_digest = "F8BBB0CCB2491CA29A3DF03D6F92277A4F3574266507ACD77214D37ECA3F3082"
dependencies = [
{ name = "Sui" },
]

[[move.package]]
name = "MoveStdlib"
source = { git = "https://github.com/MystenLabs/sui.git", rev = "framework/testnet", subdir = "crates\\sui-framework\\packages\\move-stdlib" }

[[move.package]]
name = "Sui"
source = { git = "https://github.com/MystenLabs/sui.git", rev = "framework/testnet", subdir = "crates/sui-framework/packages/sui-framework" }

dependencies = [
{ name = "MoveStdlib" },
]

[move.toolchain-version]
compiler-version = "1.28.4"
edition = "2024.beta"
flavor = "sui"

[env]

[env.testnet]
chain-id = "4c78adac"
original-published-id = "0x796fe22eb9df4f8d926e111c888d8ef4447d4348c3131f2cb4a82f1ec09c5e63"
latest-published-id = "0x796fe22eb9df4f8d926e111c888d8ef4447d4348c3131f2cb4a82f1ec09c5e63"
published-version = "1"
37 changes: 37 additions & 0 deletions mover/404ll/code/task2/FaucetCoin/Move.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[package]
name = "FaucetCoin"
edition = "2024.beta" # edition = "legacy" to use legacy (pre-2024) Move
# license = "" # e.g., "MIT", "GPL", "Apache 2.0"
# authors = ["..."] # e.g., ["Joe Smith ([email protected])", "John Snow ([email protected])"]

[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]
faucetcoin = "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"

24 changes: 24 additions & 0 deletions mover/404ll/code/task2/FaucetCoin/sources/faucetcoin.move
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
module faucetcoin::FaucetCoin {
use std::option;
use sui::transfer;
use sui::tx_context::{Self, TxContext};
use sui::coin::{Self, Coin, TreasuryCap};

public struct FAUCETCOIN has drop {}

fun init( witness:FAUCETCOIN,ctx: &mut TxContext) {
let (treasury, metadata) = coin::create_currency(witness, 7, b"404ll_FaucetCoin", b"404ll_FaucetCoin", b"FaucetCoin", option::none(), ctx);
transfer::public_freeze_object(metadata);
transfer::public_share_object(treasury)
}
public entry fun mint_and_transfer(
treasury: &mut TreasuryCap<FAUCETCOIN>,
amount: u64,
recipient: address,
ctx: &mut TxContext,
) {
let faucet = coin::mint(treasury, amount, ctx);
transfer::public_transfer(faucet, tx_context::sender(ctx) )

}
}
19 changes: 19 additions & 0 deletions mover/404ll/code/task2/FaucetCoin/tests/faucetcoin_tests.move
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
#[test_only]
module faucetcoin::faucetcoin_tests {
// uncomment this line to import the module
// use faucetcoin::faucetcoin;

const ENotImplemented: u64 = 0;

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

#[test, expected_failure(abort_code = ::faucetcoin::faucetcoin_tests::ENotImplemented)]
fun test_faucetcoin_fail() {
abort ENotImplemented
}
}
*/
34 changes: 34 additions & 0 deletions mover/404ll/code/task2/mycoin/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 = 2
manifest_digest = "6C40FE3B1765CDEAB5314EF7C5C5BB46962606BA7C4CDC2111E8A61DB77690AD"
deps_digest = "F8BBB0CCB2491CA29A3DF03D6F92277A4F3574266507ACD77214D37ECA3F3082"
dependencies = [
{ name = "Sui" },
]

[[move.package]]
name = "MoveStdlib"
source = { git = "https://github.com/MystenLabs/sui.git", rev = "framework/testnet", subdir = "crates\\sui-framework\\packages\\move-stdlib" }

[[move.package]]
name = "Sui"
source = { git = "https://github.com/MystenLabs/sui.git", rev = "framework/testnet", subdir = "crates/sui-framework/packages/sui-framework" }

dependencies = [
{ name = "MoveStdlib" },
]

[move.toolchain-version]
compiler-version = "1.28.4"
edition = "2024.beta"
flavor = "sui"

[env]

[env.testnet]
chain-id = "4c78adac"
original-published-id = "0x6765b41dc00617512667e5d8623ecb0ea826874614c23c90bdd1ac461ac47b67"
latest-published-id = "0x6765b41dc00617512667e5d8623ecb0ea826874614c23c90bdd1ac461ac47b67"
published-version = "1"
37 changes: 37 additions & 0 deletions mover/404ll/code/task2/mycoin/Move.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[package]
name = "FireCoin"
edition = "2024.beta" # edition = "legacy" to use legacy (pre-2024) Move
# license = "" # e.g., "MIT", "GPL", "Apache 2.0"
# authors = ["..."] # e.g., ["Joe Smith ([email protected])", "John Snow ([email protected])"]

[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]
FireCoin = "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"

16 changes: 16 additions & 0 deletions mover/404ll/code/task2/mycoin/sources/mycoin.move
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module FireCoin::FireCoin {
use std::option;
use sui::transfer;
use sui::tx_context::{Self, TxContext};
use sui::coin::{Self, Coin, TreasuryCap};

public struct FIRECOIN has drop {}

fun init( witness:FIRECOIN , ctx: &mut TxContext) {
let (treasury, metadata) = coin::create_currency(witness, 7, b"404llcoin", b"FC", b"Full of idal a flame", option::none(), ctx);
transfer::public_freeze_object(metadata);
transfer::public_transfer(treasury, tx_context::sender(ctx))
}


}
19 changes: 19 additions & 0 deletions mover/404ll/code/task2/mycoin/tests/mycoin_tests.move
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
#[test_only]
module mycoin::mycoin_tests {
// uncomment this line to import the module
// use mycoin::mycoin;

const ENotImplemented: u64 = 0;

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

#[test, expected_failure(abort_code = ::mycoin::mycoin_tests::ENotImplemented)]
fun test_mycoin_fail() {
abort ENotImplemented
}
}
*/
File renamed without changes.
25 changes: 25 additions & 0 deletions mover/404ll/notes/task2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# task2-注意

windows 使用call命令时,可以将`\`删去,只在前几条语句的最后留下 空格 即可

### **注意1**:

创造代币采用了one-time-witness 见证者模式,因此需要满足它的要求,否则会报错,要求如下:

名称必须与包的名字完全相同,并且全部大写;没有字段,只有drop(销毁)能力;通过`fun init (witness: Struct, ctx: &mut TxContext) {}` 传入

### 注意2:

对于call函数中地址的区分:

sui client call --gas-budget 100000000

--package 0x2

--module coin

--function mint_and_transfer

--type-args '<TreasuryCap>'

--args Object id mint_coin_number coin的接受地址
113 changes: 57 additions & 56 deletions mover/404ll/readme.md
Original file line number Diff line number Diff line change
@@ -1,56 +1,57 @@
## 基本信息
- Sui钱包地址: `0x1aa50d1de8de613816f4e3061bfc71dc8a3a5a5bf475041e29adf16fee2808a5`

- github: `404ll`

## 个人简介
- 工作经验: 0
- 技术栈: C, solidity



- 区块链专业大一在读,All in Web3,非常热爱加密,正在不断学习中,热爱建设,如果有需要帮忙的地方随叫随到!
- 联系方式: tg: '77'

## 任务

## 01 hello move
- [sui 1.28.3] Sui cli version:
- [] Sui钱包截图: <img src="./images/钱包截图.png" alt="Sui钱包截图" style="zoom:25%;" />
- [0x1a852fe63cdf97456f142a042e499e2766fef8f7579c2bb8c10fc7cb2a17904d] package id:
- [] package id 在 scan上的查看截图:<img src="./images/浏览器截图.png" alt="Scan截图" style="zoom:25%;" />

## 02 move coin
- [] My Coin package id :
- [] Faucet package id :
- [] 转账 `My Coin` hash:
- [] `Faucet Coin` address1 mint hash:
- [] `Faucet Coin` address2 mint hash:

## 03 move NFT
- [] nft package id :
- [] nft object id :
- [] 转账 nft hash:
- [] scan上的NFT截图:![Scan截图](./images/你的图片地址)

## 04 Move Game
- [] game package id :
- [] deposit Coin hash:
- [] withdraw `Coin` hash:
- [] play game hash:

## 05 Move Swap
- [] swap package id :
- [] call swap CoinA-> CoinB hash :
- [] call swap CoinB-> CoinA hash :

## 06 Dapp-kit SDK PTB
- [] save hash :

## 07 Move CTF Check In
- [] CLI call 截图 : ![截图](./images/你的图片地址)
- [] flag hash :

## 08 Move CTF Lets Move
- [] proof :
- [] flag hash :
- 基本信息

- Sui钱包地址: `0x1aa50d1de8de613816f4e3061bfc71dc8a3a5a5bf475041e29adf16fee2808a5`

- github: `404ll`

## 个人简介
- 工作经验: 0
- 技术栈: C, solidity



- 区块链专业大一在读,All in Web3,非常热爱加密,正在不断学习中,热爱建设,如果有需要帮忙的地方随叫随到!
- 联系方式: tg: '77'

## 任务

## 01 hello move
- [sui 1.28.3] Sui cli version:
- [] Sui钱包截图: <img src="./images/钱包截图.png" alt="Sui钱包截图" style="zoom:25%;" />
- [0x1a852fe63cdf97456f142a042e499e2766fef8f7579c2bb8c10fc7cb2a17904d] package id:
- [] package id 在 scan上的查看截图:<img src="./images/浏览器截图.png" alt="Scan截图" style="zoom:25%;" />

## 02 move coin
- [0x6765b41dc00617512667e5d8623ecb0ea826874614c23c90bdd1ac461ac47b67] My Coin package id :
- [0x796fe22eb9df4f8d926e111c888d8ef4447d4348c3131f2cb4a82f1ec09c5e63] Faucet package id :
- [0xed3f44cfe2b4c9e7e0de2deaefd47457fdf206a763a235bb99d391bba31313b4] 转账 `My Coin` hash:
- [0x42bd0305cafd782e8cd5f3b8f92e108c1bd66b0ea8838d040ccc6bb945b35c8b] `Faucet Coin` address1 mint hash:
- [0x9b8b1f4ece3c93c75f3abc1cd14b50d0aa7135fc4ba8a6ffe5f2929dca1f78ce] `Faucet Coin` address2 mint hash:

## 03 move NFT
- [] nft package id :
- [] nft object id :
- [] 转账 nft hash:
- [] scan上的NFT截图:![Scan截图](./images/你的图片地址)

## 04 Move Game
- [] game package id :
- [] deposit Coin hash:
- [] withdraw `Coin` hash:
- [] play game hash:

## 05 Move Swap
- [] swap package id :
- [] call swap CoinA-> CoinB hash :
- [] call swap CoinB-> CoinA hash :

## 06 Dapp-kit SDK PTB
- [] save hash :

## 07 Move CTF Check In
- [] CLI call 截图 : ![截图](./images/你的图片地址)
- [] flag hash :

## 08 Move CTF Lets Move
- [] proof :
- [] flag hash :