diff --git a/mover/krypton/co-learn-2411/images/01learn.png b/mover/krypton/co-learn-2411/images/01learn.png new file mode 100644 index 000000000..73ddd3404 Binary files /dev/null and b/mover/krypton/co-learn-2411/images/01learn.png differ diff --git a/mover/krypton/co-learn-2411/images/01zhibo.png b/mover/krypton/co-learn-2411/images/01zhibo.png new file mode 100644 index 000000000..aed5cbb49 Binary files /dev/null and b/mover/krypton/co-learn-2411/images/01zhibo.png differ diff --git a/mover/krypton/co-learn-2411/images/02learn.png b/mover/krypton/co-learn-2411/images/02learn.png new file mode 100644 index 000000000..e2645234f Binary files /dev/null and b/mover/krypton/co-learn-2411/images/02learn.png differ diff --git a/mover/krypton/co-learn-2411/images/02zhibo.png b/mover/krypton/co-learn-2411/images/02zhibo.png new file mode 100644 index 000000000..472af88fd Binary files /dev/null and b/mover/krypton/co-learn-2411/images/02zhibo.png differ diff --git a/mover/krypton/co-learn-2411/images/bilibili.png b/mover/krypton/co-learn-2411/images/bilibili.png new file mode 100644 index 000000000..e79f5841c Binary files /dev/null and b/mover/krypton/co-learn-2411/images/bilibili.png differ diff --git a/mover/krypton/co-learn-2411/images/github1.png b/mover/krypton/co-learn-2411/images/github1.png new file mode 100644 index 000000000..f9002c4f5 Binary files /dev/null and b/mover/krypton/co-learn-2411/images/github1.png differ diff --git a/mover/krypton/co-learn-2411/images/github2.png b/mover/krypton/co-learn-2411/images/github2.png new file mode 100644 index 000000000..ca4eb4e45 Binary files /dev/null and b/mover/krypton/co-learn-2411/images/github2.png differ diff --git a/mover/krypton/co-learn-2411/images/readme.md b/mover/krypton/co-learn-2411/images/readme.md new file mode 100644 index 000000000..e69de29bb diff --git a/mover/krypton/co-learn-2411/images/wechat.png b/mover/krypton/co-learn-2411/images/wechat.png new file mode 100644 index 000000000..d7c283dbf Binary files /dev/null and b/mover/krypton/co-learn-2411/images/wechat.png differ diff --git a/mover/krypton/co-learn-2411/project/readme.md b/mover/krypton/co-learn-2411/project/readme.md new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/mover/krypton/co-learn-2411/project/readme.md @@ -0,0 +1 @@ + diff --git a/mover/krypton/co-learn-2411/readme.md b/mover/krypton/co-learn-2411/readme.md new file mode 100644 index 000000000..773d89278 --- /dev/null +++ b/mover/krypton/co-learn-2411/readme.md @@ -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/你的图片地址) + + diff --git a/mover/krypton/code/readme.md b/mover/krypton/code/readme.md new file mode 100644 index 000000000..e69de29bb diff --git a/mover/krypton/code/task1/hello_move/Move.lock b/mover/krypton/code/task1/hello_move/Move.lock new file mode 100644 index 000000000..a2c85ef52 --- /dev/null +++ b/mover/krypton/code/task1/hello_move/Move.lock @@ -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" diff --git a/mover/krypton/code/task1/hello_move/Move.toml b/mover/krypton/code/task1/hello_move/Move.toml new file mode 100644 index 000000000..2fd3b0f2a --- /dev/null +++ b/mover/krypton/code/task1/hello_move/Move.toml @@ -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://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" + diff --git a/mover/krypton/code/task1/hello_move/sources/hello_move.move b/mover/krypton/code/task1/hello_move/sources/hello_move.move new file mode 100644 index 000000000..0bfa29f3b --- /dev/null +++ b/mover/krypton/code/task1/hello_move/sources/hello_move.move @@ -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)); +} \ No newline at end of file diff --git a/mover/krypton/code/task1/hello_move/tests/hello_move_tests.move b/mover/krypton/code/task1/hello_move/tests/hello_move_tests.move new file mode 100644 index 000000000..7798d8dda --- /dev/null +++ b/mover/krypton/code/task1/hello_move/tests/hello_move_tests.move @@ -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 +} +*/ diff --git a/mover/krypton/code/task3/krypton_nft/Move.lock b/mover/krypton/code/task3/krypton_nft/Move.lock new file mode 100644 index 000000000..cbb299a2c --- /dev/null +++ b/mover/krypton/code/task3/krypton_nft/Move.lock @@ -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" diff --git a/mover/krypton/code/task3/krypton_nft/Move.toml b/mover/krypton/code/task3/krypton_nft/Move.toml new file mode 100644 index 000000000..3c65e0e49 --- /dev/null +++ b/mover/krypton/code/task3/krypton_nft/Move.toml @@ -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 (joesmith@noemail.com)", "John Snow (johnsnow@noemail.com)"] + +[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" + diff --git a/mover/krypton/code/task3/krypton_nft/sources/krypton_nft.move b/mover/krypton/code/task3/krypton_nft/sources/krypton_nft.move new file mode 100644 index 000000000..3cac5bc76 --- /dev/null +++ b/mover/krypton/code/task3/krypton_nft/sources/krypton_nft.move @@ -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 转移到目标地址 +} diff --git a/mover/krypton/code/task3/krypton_nft/tests/krypton_nft_tests.move b/mover/krypton/code/task3/krypton_nft/tests/krypton_nft_tests.move new file mode 100644 index 000000000..f16189bd3 --- /dev/null +++ b/mover/krypton/code/task3/krypton_nft/tests/krypton_nft_tests.move @@ -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 +} +*/ diff --git a/mover/krypton/images/K.png b/mover/krypton/images/K.png new file mode 100644 index 000000000..366543be8 Binary files /dev/null and b/mover/krypton/images/K.png differ diff --git a/mover/krypton/images/NFT.png b/mover/krypton/images/NFT.png new file mode 100644 index 000000000..a0f03ba22 Binary files /dev/null and b/mover/krypton/images/NFT.png differ diff --git a/mover/krypton/images/l.png b/mover/krypton/images/l.png new file mode 100644 index 000000000..17635ea83 Binary files /dev/null and b/mover/krypton/images/l.png differ diff --git a/mover/krypton/notes/02.md b/mover/krypton/notes/02.md new file mode 100644 index 000000000..c20c12d69 --- /dev/null +++ b/mover/krypton/notes/02.md @@ -0,0 +1 @@ +

登链社区

基础数据类型

move 无小数无负数

image-20240930222847819.png

方法的定义

image-20240930222847819.png

image-20240930222847819.png

基础语法

image-20240930222847819.png

image-20240930222847819.png

image-20240930222847819.png

image-20240930222847819.png

image-20240930222847819.png


登链社区是一个 Web3 开发者社区,通过构建高质量技术内容平台和线下空间,助力开发者成为更好的 Web3 Builder。

登链社区

登链社区

\ No newline at end of file diff --git a/mover/krypton/notes/readme.md b/mover/krypton/notes/readme.md new file mode 100644 index 000000000..e69de29bb diff --git a/mover/krypton/notes/task1.md b/mover/krypton/notes/task1.md new file mode 100644 index 000000000..a31390551 --- /dev/null +++ b/mover/krypton/notes/task1.md @@ -0,0 +1 @@ +

登链社区

choco install sui 用chocolatey安装sui环境
创建项目 sui move new hello_move

查看地址 sui client addresses

领取testgas sui client faucet

发布上链 sui client publish

报错:
Failed to build Move modules: Failed to resolve dependencies for package 'hellomove'

Caused by:
    0: Fetching 'Sui'
    1: Failed to reset to latest Git state 'framework/testnet' for package 'Sui', to skip set --skip-fetch-latest-git-deps | Exit status: exit code: 128.

方法是跳过 运行sui move build --skip-fetch-latest-git-deps 或者换系统,因为windows就是可能会连接不上github
Overall 一定要好好看报错 很感谢社区里的前辈们细心解答我的问题

24/11/10 0.19


登链社区是一个 Web3 开发者社区,通过构建高质量技术内容平台和线下空间,助力开发者成为更好的 Web3 Builder。

登链社区

登链社区

\ No newline at end of file diff --git a/mover/krypton/notes/task3.md b/mover/krypton/notes/task3.md new file mode 100644 index 000000000..b6f9dcb2b --- /dev/null +++ b/mover/krypton/notes/task3.md @@ -0,0 +1 @@ +

登链社区

需求

1. 三个主要功能

2.初始化函数

2.1 给NFT赋值

2.2 将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"<url>"),
        creator: ctx.sender(), 
    };
    transfer(my_nft, sender(ctx));
}

3.合约交互

3.1合约部署

‘sui client publish ’将程序部署上链

3.2运行transfer_nft

‘ sui client call --gas-budget <flag> --package <package id> --module <module id> --function transfer_nft --args <NFT id> <recipient id>’将指定NFT 转移置指定接收者地址

4.完结

感谢hoh社区对小白的帮助


登链社区是一个 Web3 开发者社区,通过构建高质量技术内容平台和线下空间,助力开发者成为更好的 Web3 Builder。

登链社区

登链社区

\ No newline at end of file diff --git a/mover/krypton/readme.md b/mover/krypton/readme.md new file mode 100644 index 000000000..93e3e3f44 --- /dev/null +++ b/mover/krypton/readme.md @@ -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 : diff --git a/mover/krypton/scan/readme.md b/mover/krypton/scan/readme.md new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/mover/krypton/scan/readme.md @@ -0,0 +1 @@ +