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

krypton_pr #1743

Merged
merged 5 commits into from
Nov 20, 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
Binary file added mover/krypton/co-learn-2411/images/01learn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mover/krypton/co-learn-2411/images/01zhibo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mover/krypton/co-learn-2411/images/02learn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mover/krypton/co-learn-2411/images/02zhibo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mover/krypton/co-learn-2411/images/bilibili.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mover/krypton/co-learn-2411/images/github1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mover/krypton/co-learn-2411/images/github2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
Binary file added mover/krypton/co-learn-2411/images/wechat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions mover/krypton/co-learn-2411/project/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

54 changes: 54 additions & 0 deletions mover/krypton/co-learn-2411/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# 这个模板是2024年11月份的共学营才需要的

## b站,推特关注

- [X] b站,推特关注截图: ![关注截图](./images/bilibili.png)

## 为共学营宣传(在朋友圈或者群聊中转发海报/文章)

- [X] 宣传截图:![宣传截图](./images/wechat.png)

## 每周课程学习

- [X] 第一周:![学习记录截图](./images/01learn.png)
- [x] 第二周:![学习记录截图](./images/02learn.png)
- [] 第三周:![学习记录截图](./images/你的图片地址)
- [] 第四周:![学习记录截图](./images/你的图片地址)

## 参加直播答疑

- [X] 第一周:![学习记录截图](./images/01zhibo.png)
- [x] 第二周:![学习记录截图](./images/02zhibo.png)
- [] 第三周:![学习记录截图](./images/你的图片地址)
- [] 第四周:![学习记录截图](./images/你的图片地址)

## 群里分享学习笔记

- [x] 第一篇笔记(https://learnblockchain.cn/article/9924)
- [x] 第二篇笔记(https://learnblockchain.cn/article/9965)
- [] 第三篇笔记
- [] 第四篇笔记

## 对外输出学习笔记

- [x] 第一篇笔记[学习笔记链接](https://learnblockchain.cn/article/9827)
- [x] 第二篇笔记[学习笔记链接](https://learnblockchain.cn/article/9924)
- [x] 第三篇笔记[学习笔记链接](https://learnblockchain.cn/article/9965)
- [] 第四篇笔记[学习笔记链接]

## 在HOH社区公众号发布自己的技术文章

- [] 第一篇笔记[公众号文章链接]
- [] 第二篇笔记[公众号文章链接]
- [] 第三篇笔记[公众号文章链接]
- [] 第四篇笔记[公众号文章链接]

## 直播分享学习技巧/工具推荐

- [] 会议截图:![会议记录截图](./images/你的图片地址)

## 提交项目

- [] 项目提交![项目截图](./images/你的图片地址)


Empty file added mover/krypton/code/readme.md
Empty file.
34 changes: 34 additions & 0 deletions mover/krypton/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 = "15C92DB7143AE506431E8FE14625189CE312456B12D01A47D7711D0BFBD6A124"
deps_digest = "F8BBB0CCB2491CA29A3DF03D6F92277A4F3574266507ACD77214D37ECA3F3082"
dependencies = [
{ id = "Sui", name = "Sui" },
]

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

[[move.package]]
id = "Sui"
source = { git = "https://gitee.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.37.1"
edition = "2024.beta"
flavor = "sui"

[env]

[env.testnet]
chain-id = "4c78adac"
original-published-id = "0x96f25a337f1fc39433059e81834f9721293b8fad906f5019ff6e7efc06f72c31"
latest-published-id = "0x96f25a337f1fc39433059e81834f9721293b8fad906f5019ff6e7efc06f72c31"
published-version = "1"
37 changes: 37 additions & 0 deletions mover/krypton/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 ([email protected])", "John Snow ([email protected])"]

[dependencies]
Sui = { git = "https://gitee.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"

19 changes: 19 additions & 0 deletions mover/krypton/code/task1/hello_move/sources/hello_move.move
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module hello_move::hello ;

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

public struct Hello has key {
id: UID,
say: String
}

fun init(ctx: &mut TxContext) {
let hello_move = Hello {
id: object::new(ctx),
say: string(b"krypton"),
};
transfer(hello_move, sender(ctx));
}
18 changes: 18 additions & 0 deletions mover/krypton/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
}
*/
40 changes: 40 additions & 0 deletions mover/krypton/code/task3/krypton_nft/Move.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# @generated by Move, please check-in and do not edit manually.

[move]
version = 3
manifest_digest = "A4FE5925AD51ABA6C4C0E33157834BFC87DB60AAF5EF7BC9F85DC823752FD904"
deps_digest = "F8BBB0CCB2491CA29A3DF03D6F92277A4F3574266507ACD77214D37ECA3F3082"
dependencies = [
{ id = "Sui", name = "Sui" },
]

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

[[move.package]]
id = "Sui"
source = { git = "https://gitee.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.37.1"
edition = "2024.beta"
flavor = "sui"

[env]

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

[env.mainnet]
chain-id = "35834a8a"
original-published-id = "0xea7b1c3aee1d00449f3612f493832de21a55b96d9c73627377eb5fb7c7c26774"
latest-published-id = "0xea7b1c3aee1d00449f3612f493832de21a55b96d9c73627377eb5fb7c7c26774"
published-version = "1"
37 changes: 37 additions & 0 deletions mover/krypton/code/task3/krypton_nft/Move.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[package]
name = "krypton_nft"
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://gitee.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]
krypton_nft = "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"

45 changes: 45 additions & 0 deletions mover/krypton/code/task3/krypton_nft/sources/krypton_nft.move
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
module krypton_nft::krypton_nft;

use std::string;
use std::string::String;
use sui::transfer::transfer;
use sui::tx_context::sender;
use sui::object::UID; // 引入 UID 类型

// MyNFT 结构体,包含 creator 字段
public struct MyNFT has key {
id: UID,
name: String,
image_url: String,
creator: address, // 添加 creator 字段,用于存储创建者地址
}

// 初始化功能:创建并转移 NFT 到发送者
fun init(ctx: &mut TxContext) {
let my_nft = MyNFT {
id: object::new(ctx),
name: string::utf8(b"Kry NFT"),
image_url: string::utf8(b"https://avatars.githubusercontent.com/u/154910746?v=4"),
creator: ctx.sender(), // 设置 creator 字段
};
transfer(my_nft, sender(ctx));
}

// 铸造 NFT 并转移给发送者
public entry fun mint(url: String, ctx: &mut TxContext) {
let my_nft = MyNFT {
id: object::new(ctx),
name: string::utf8(b"Kry NFT"),
image_url: url,
creator: ctx.sender(), // 设置 creator 字段
};
transfer(my_nft, sender(ctx));
}

// 转移 NFT 到另一个地址
public entry fun transfer_nft(nft: MyNFT, to_address: address, ctx: &mut TxContext) {
// 确保转移 NFT 的地址与发送者一致
assert!(nft.creator == sender(ctx));

transfer(nft, to_address); // 将 NFT 转移到目标地址
}
18 changes: 18 additions & 0 deletions mover/krypton/code/task3/krypton_nft/tests/krypton_nft_tests.move
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
#[test_only]
module krypton_nft::krypton_nft_tests;
// uncomment this line to import the module
// use krypton_nft::krypton_nft;

const ENotImplemented: u64 = 0;

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

#[test, expected_failure(abort_code = ::krypton_nft::krypton_nft_tests::ENotImplemented)]
fun test_krypton_nft_fail() {
abort ENotImplemented
}
*/
Binary file added mover/krypton/images/K.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mover/krypton/images/NFT.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mover/krypton/images/l.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions mover/krypton/notes/02.md

Large diffs are not rendered by default.

Empty file added mover/krypton/notes/readme.md
Empty file.
1 change: 1 addition & 0 deletions mover/krypton/notes/task1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<section style="margin-bottom: 0px; padding-left: 10px; padding-right: 10px; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; width: auto; font-family: &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, sans-serif; font-size: 16px; color: rgb(0, 0, 0); line-height: 1.5em; word-spacing: 0em; letter-spacing: 0em; word-break: break-all; text-align: left;"><p style="text-align: center; margin-bottom: 15px;"><img src="https://img.learnblockchain.cn/attachments/2024/10/wz7LBXXA6710cabbd635f.gif" alt="登链社区" style="width: 100%; height: auto;"></p><p style="color: rgb(89, 89, 89); line-height: 1.8em; letter-spacing: 0.02em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;">choco install sui 用chocolatey安装sui环境<br>创建项目 sui move new hello_move</p><p style="color: rgb(89, 89, 89); line-height: 1.8em; letter-spacing: 0.02em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;">查看地址 sui client addresses </p><p style="color: rgb(89, 89, 89); line-height: 1.8em; letter-spacing: 0.02em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;">领取testgas sui client faucet </p><p style="color: rgb(89, 89, 89); line-height: 1.8em; letter-spacing: 0.02em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;">发布上链 sui client publish </p><ul style="margin-top: 8px; margin-bottom: 8px; padding-left: 25px;"><li><section style="margin-top: 5px; margin-bottom: 5px; color: rgb(89, 89, 89); line-height: 1.8em; letter-spacing: 0.02em;">sui client publish报错解决方法</section></li></ul><pre style="border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px; margin-top: 10px; margin-bottom: 10px;"><span style="display: block; background: url(https://img.learnblockchain.cn/attachments/2024/10/bQcrGt4Z670e121cad669.svg) 10px 10px / 40px no-repeat rgb(40, 44, 52); height: 30px; width: 100%; margin-bottom: -7px; border-radius: 5px;"></span><code class="hljs plaintext" style="overflow-x: auto; padding: 16px; color: #abb2bf; padding-top: 15px; background: #282c34; border-radius: 5px; display: -webkit-box; font-family: Consolas, Monaco, Menlo, monospace; font-size: 12px;">报错:<br>Failed&nbsp;to&nbsp;build&nbsp;Move&nbsp;modules:&nbsp;Failed&nbsp;to&nbsp;resolve&nbsp;dependencies&nbsp;for&nbsp;package&nbsp;'hellomove'<br><br>Caused&nbsp;by:<br>&nbsp;&nbsp;&nbsp;&nbsp;0:&nbsp;Fetching&nbsp;'Sui'<br>&nbsp;&nbsp;&nbsp;&nbsp;1:&nbsp;Failed&nbsp;to&nbsp;reset&nbsp;to&nbsp;latest&nbsp;Git&nbsp;state&nbsp;'framework/testnet'&nbsp;for&nbsp;package&nbsp;'Sui',&nbsp;to&nbsp;skip&nbsp;set&nbsp;--skip-fetch-latest-git-deps&nbsp;|&nbsp;Exit&nbsp;status:&nbsp;exit&nbsp;code:&nbsp;128.</code></pre><p style="color: rgb(89, 89, 89); line-height: 1.8em; letter-spacing: 0.02em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;">方法是跳过 运行sui move build --skip-fetch-latest-git-deps 或者换系统,因为windows就是可能会连接不上github<br>Overall 一定要好好看报错 很感谢社区里的前辈们细心解答我的问题</p><p style="color: rgb(89, 89, 89); line-height: 1.8em; letter-spacing: 0.02em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;">24/11/10 0.19</p><hr style="border-style: solid;border-width: 1px 0 0;border-color: rgba(0,0,0,0.1);-webkit-transform-origin: 0 0;-webkit-transform: scale(1, 0.5);transform-origin: 0 0;transform: scale(1, 0.5);margin-block: 38px 30px;"><p style="color: rgb(89, 89, 89); line-height: 1.8em; letter-spacing: 0.02em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;">登链社区是一个 Web3 开发者社区,通过构建高质量技术内容平台和线下空间,助力开发者成为更好的 Web3 Builder。</p><p style="margin-block: 15px 30px;box-shadow: 0 1px 5px rgba(0, 0, 0, 0.15), 0 3px 5px rgba(0, 0, 0, 0.1);"><img src="https://img.learnblockchain.cn/attachments/2024/10/dTDMlrh36715bda943518.gif" alt="登链社区" style="width: 100%;" class="rich_pages wxw-img" data-ratio="0.5555555555555556" data-w="900" data-imgqrcoded="1" data-type="gif" data-imgfileid="100037615"></p><ul style="list-style: none; padding-left: 10px;"><li style="color: rgb(89, 89, 89); line-height: 1.8em; letter-spacing: 0.02em;"><span style="display: inline-block; width: 5px; height: 5px; background-color: #62BEFE; margin-right: 10px;margin-bottom: 2px;"></span> 登链社区网站 : learnblockchain.cn</li><li style="color: rgb(89, 89, 89); line-height: 1.8em; letter-spacing: 0.02em;"><span style="display: inline-block; width: 5px; height: 5px; background-color: #62BEFE; margin-right: 10px;margin-bottom: 2px;"></span> 开发者技能认证 : decert.me</li><li style="color: rgb(89, 89, 89); line-height: 1.8em; letter-spacing: 0.02em;"><span style="display: inline-block; width: 5px; height: 5px; background-color: #62BEFE; margin-right: 10px;margin-bottom: 2px;"></span> B站 : space.bilibili.com/581611011</li><li style="color: rgb(89, 89, 89); line-height: 1.8em; letter-spacing: 0.02em;"><span style="display: inline-block; width: 5px; height: 5px; background-color: #62BEFE; margin-right: 10px;margin-bottom: 2px;"></span> YouTube : www.youtube.com/@upchain</li></ul><p style="margin-top: 10px;"><img src="https://img.learnblockchain.cn/attachments/2024/10/gE5BAFGU6710cb77572a5.gif" alt="登链社区" style="width: 70%; height: auto;"></p></section>
1 change: 1 addition & 0 deletions mover/krypton/notes/task3.md

Large diffs are not rendered by default.

54 changes: 54 additions & 0 deletions mover/krypton/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
## 基本信息
- Sui钱包地址: `0xddfa241c39ba6085ae6e1d179dce779d88779165d43d1d14a876297bd9eda6a8`
> 首次参与需要完成第一个任务注册好钱包地址才被合并,并且后续学习奖励会打入这个地址
- github: `krypt0n123`

## 个人简介
- 工作经验: 0年
- 技术栈: `c` `python`
> 重要提示 请认真写自己的简介
- 本科院校大一在读生,主打一个尝鲜
- 联系方式: tg: `@kiko_kry`

## 任务

## 01 hello move
- [x] Sui cli version: sui 1.37.1-homebrew
- [x] Sui钱包截图: ![Sui钱包截图](./images/K.png)
- [x] package id: 0xf54f02036244432d8462f5122fe8d7141efce900accfe987187caff17130624d
- [X] package id 在 scan上的查看截图:![Scan截图](./images/l.png)

## 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
- [x] nft package id :0xea7b1c3aee1d00449f3612f493832de21a55b96d9c73627377eb5fb7c7c26774
- [x] nft object id : 0x3239bd6dc00d8a991bd85a05ffa029773ef0c5c1f3eaaf9cd33e27a32c2731da
- [x] 转账 nft hash:7qpuh7jzWznXTsXyYamqQ4fBohRya1XF4euZdjyAzxYW
- [x] scan上的NFT截图:![Scan截图](./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 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 :
1 change: 1 addition & 0 deletions mover/krypton/scan/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@