-
Notifications
You must be signed in to change notification settings - Fork 897
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'move-cn:main' into main
- Loading branch information
Showing
937 changed files
with
45,098 additions
and
486 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
|
||
|
||
## b站,推特关注 | ||
|
||
- [] b站,推特关注截图: ![关注截图](./images/你的图片地址) | ||
|
||
## 为共学营宣传(在朋友圈或者群聊中转发海报/文章) | ||
|
||
- [] 宣传截图:![宣传截图](./images/你的图片地址) | ||
|
||
## 每周课程学习 | ||
|
||
- [] 第一周:![学习记录截图](./images/你的图片地址) | ||
- [] 第二周:![学习记录截图](./images/你的图片地址) | ||
- [] 第三周:![学习记录截图](./images/你的图片地址) | ||
- [] 第四周:![学习记录截图](./images/你的图片地址) | ||
|
||
## 参加直播答疑 | ||
|
||
- [] 第一周:![学习记录截图](./images/你的图片地址) | ||
- [] 第二周:![学习记录截图](./images/你的图片地址) | ||
- [] 第三周:![学习记录截图](./images/你的图片地址) | ||
- [] 第四周:![学习记录截图](./images/你的图片地址) | ||
|
||
## 群里分享学习笔记 | ||
|
||
- [] 第一篇笔记 | ||
- [] 第二篇笔记 | ||
- [] 第三篇笔记 | ||
- [] 第四篇笔记 | ||
|
||
## 对外输出学习笔记 | ||
|
||
- [] 第一篇笔记【学习笔记链接】 | ||
- [] 第二篇笔记【学习笔记链接】 | ||
- [] 第三篇笔记【学习笔记链接】 | ||
- [] 第四篇笔记【学习笔记链接】 | ||
|
||
## 在HOH社区公众号发布自己的技术文章 | ||
|
||
- [] 第一篇笔记【公众号文章链接】 | ||
- [] 第二篇笔记【公众号文章链接】 | ||
- [] 第三篇笔记【公众号文章链接】 | ||
- [] 第四篇笔记【公众号文章链接】 | ||
|
||
## 直播分享学习技巧/工具推荐 | ||
|
||
- [] 会议截图:![会议记录截图](./images/你的图片地址) | ||
|
||
## 提交项目 | ||
|
||
- [] 项目提交![项目截图](./images/你的图片地址) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
[package] | ||
name = "hellomove" | ||
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] | ||
hellomove = "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" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
module hellomove::hello ; | ||
|
||
use std::ascii::{String, string}; | ||
use sui::object::{Self, UID}; | ||
use sui::transfer::transfer; | ||
use sui::tx_context::{TxContext}; | ||
|
||
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"hoh"), | ||
}; | ||
transfer(hello_move, ctx.sender()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
#[test_only] | ||
module hellomove::hellomove_tests; | ||
// uncomment this line to import the module | ||
// use hellomove::hellomove; | ||
const ENotImplemented: u64 = 0; | ||
#[test] | ||
fun test_hellomove() { | ||
// pass | ||
} | ||
#[test, expected_failure(abort_code = ::hellomove::hellomove_tests::ENotImplemented)] | ||
fun test_hellomove_fail() { | ||
abort ENotImplemented | ||
} | ||
*/ |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# 这个模板是2024年11月份的共学营才需要的 | ||
|
||
## b站,推特关注 | ||
|
||
- [✅] 推特关注截图: ![关注截图](./images/twitter.png) | ||
- [✅] B站关注截图: ![关注截图](./images/bilibili.png) | ||
## 为共学营宣传(在朋友圈或者群聊中转发海报/文章) | ||
|
||
- [✅] 宣传截图:![宣传截图](./images/broadcast.jpeg) | ||
|
||
## 每周课程学习 | ||
|
||
- [✅] 第一周:![学习记录截图](./images/week1learn.png) | ||
- [] 第二周:![学习记录截图](./images/你的图片地址) | ||
- [] 第三周:![学习记录截图](./images/你的图片地址) | ||
- [] 第四周:![学习记录截图](./images/你的图片地址) | ||
|
||
## 参加直播答疑 | ||
|
||
- [✅] 第一周:![学习记录截图](./images/week1answer.jpeg) | ||
- [] 第二周:![学习记录截图](./images/你的图片地址) | ||
- [] 第三周:![学习记录截图](./images/你的图片地址) | ||
- [] 第四周:![学习记录截图](./images/你的图片地址) | ||
|
||
## 群里分享学习笔记 | ||
|
||
- [] 第一篇笔记 | ||
- [] 第二篇笔记 | ||
- [] 第三篇笔记 | ||
- [] 第四篇笔记 | ||
|
||
## 对外输出学习笔记 | ||
|
||
- [] 第一篇笔记【学习笔记链接】 | ||
- [] 第二篇笔记【学习笔记链接】 | ||
- [] 第三篇笔记【学习笔记链接】 | ||
- [] 第四篇笔记【学习笔记链接】 | ||
|
||
## 在HOH社区公众号发布自己的技术文章 | ||
|
||
- [] 第一篇笔记【公众号文章链接】 | ||
- [] 第二篇笔记【公众号文章链接】 | ||
- [] 第三篇笔记【公众号文章链接】 | ||
- [] 第四篇笔记【公众号文章链接】 | ||
|
||
## 直播分享学习技巧/工具推荐 | ||
|
||
- [] 会议截图:![会议记录截图](./images/你的图片地址) | ||
|
||
## 提交项目 | ||
|
||
- [] 项目提交![项目截图](./images/你的图片地址) | ||
|
||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
module my_first_package::HelloAlexWaker { | ||
|
||
// use sui::object::{Self, UID}; | ||
// use sui::tx_context::{Self, TxContext}; | ||
|
||
/// 定义一个结构体 Greeting,用于存储问候信息 | ||
public struct Greeting has key, store { | ||
id: UID, | ||
message: vector<u8>, | ||
} | ||
|
||
/// 初始化函数,创建一个新的 Greeting 对象,并将 message 设置为 "Hello, Sui!" | ||
public fun create_greeting(ctx: &mut TxContext): Greeting { | ||
Greeting { | ||
id: object::new(ctx), | ||
message: b"Hello AlexWaker!" | ||
} | ||
} | ||
|
||
/// 更新 Greeting 对象中的 message | ||
public fun set_greeting(greeting: &mut Greeting, new_message: vector<u8>) { | ||
greeting.message = new_message; | ||
} | ||
|
||
/// 获取 Greeting 对象中的 message | ||
public fun get_greeting(greeting: &Greeting): vector<u8> { | ||
greeting.message | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
|
||
/// Module: my_coin | ||
module my_coin::alexwaker_coin { | ||
use sui::coin::{Self, Coin, TreasuryCap}; | ||
|
||
public struct ALEXWAKER_COIN has drop {} | ||
// 创建代币 | ||
// (TreasuryCap 代币的铸造权限 CoinMetadata 代币的参数) | ||
fun init(witness: ALEXWAKER_COIN, ctx: &mut TxContext) { | ||
let (treasury, metadata) = coin::create_currency( | ||
witness, | ||
9, | ||
b"AWC2", | ||
b"ALEXWAKER COIN NO2", | ||
b"Alexwaker Coin No2", | ||
option:: none(), | ||
ctx | ||
); | ||
|
||
transfer::public_freeze_object(metadata); | ||
transfer::public_transfer(treasury, tx_context::sender(ctx)); | ||
} | ||
|
||
// 阻止后续修改 | ||
public entry fun mint_in_my_module( | ||
treasury_cap: &mut TreasuryCap<ALEXWAKER_COIN>, | ||
amount: u64, | ||
recipient: address, | ||
ctx: &mut TxContext | ||
) { | ||
let coin = coin::mint(treasury_cap, amount, ctx); | ||
transfer::public_transfer(coin, recipient); | ||
} | ||
|
||
// 用于销毁指定的 Coin,并减少相应的总供应量 | ||
public entry fun burn(treasury_cap: &mut TreasuryCap<ALEXWAKER_COIN>, c: Coin<ALEXWAKER_COIN>) { | ||
coin::burn(treasury_cap, c); | ||
} | ||
} | ||
|
||
|
||
//funnyyanne hash Transaction Digest: EQ2hzDxSdSH1KGdmqRi3fb6mStKnqzN4vgKAv2xqojXB | ||
// 调用指令 ,三个地址参数分别对应着 | ||
// PackageID 合约id 0x1f8d02082b92c84d74b4b524d5c425f5db43f2dd5268d22522920c94addbccbc | ||
// Object Changes 中 Created Objects 的 ObjectType 中为 TreasuryCap 的 0x795e281148c1b8a20f7ef13eac01b69918313522eaa7e9bcf43540de1d13692b | ||
// 接收者的地址 test2中的地址 0x7b8e0864967427679b4e129f79dc332a885c6087ec9e187b53451a9006ee15f2 | ||
// sui client call --package 0x1f8d02082b92c84d74b4b524d5c425f5db43f2dd5268d22522920c94addbccbc --module funnyyanne_coin --function mint_in_my_module --args 0x795e281148c1b8a20f7ef13eac01b69918313522eaa7e9bcf43540de1d13692b 20000 0x7b8e0864967427679b4e129f79dc332a885c6087ec9e187b53451a9006ee15f2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/// Module: faucet_coin | ||
module my_faucet_coin::alexwaker_faucet_coin { | ||
//use std::ascii; | ||
use sui::coin::{Self, TreasuryCap}; | ||
//use sui::url; | ||
|
||
public struct ALEXWAKER_FAUCET_COIN has drop {} | ||
|
||
#[allow(lint(share_owned))] | ||
fun init(witness: ALEXWAKER_FAUCET_COIN, ctx: &mut TxContext) { | ||
let (treasury, metadata) = coin::create_currency( | ||
witness, | ||
9, | ||
b"AWF", | ||
b"AlexWaker_FAUCET_COIN", | ||
b"alexwaker faucet coin. ", | ||
option::none(), | ||
ctx); | ||
|
||
transfer::public_freeze_object(metadata); | ||
transfer::public_share_object(treasury); | ||
} | ||
|
||
public entry fun mint_in_my_module( | ||
treasury_cap: &mut TreasuryCap<ALEXWAKER_FAUCET_COIN>, | ||
amount: u64, | ||
recipient: address, | ||
ctx: &mut TxContext | ||
) { | ||
let coin = coin::mint(treasury_cap, amount, ctx); | ||
transfer::public_transfer(coin, recipient); | ||
} | ||
//testnet: | ||
//packageid 0x0414a27f58e752e8659c5e86d3b563f39b9e9cd40e15df8eb2e4c8512b86f3ec | ||
//TreasuryCap objectid 0x72444a11f047f344a12770c1b65cf6ff7592b79a9d45e6b077b1180a6f118575 | ||
//sui client call --package <packageid> --module <modulename> --function mint_in_my_module --args <treasurycap objectid> <amount> <address to be send> | ||
|
||
//mainnet: | ||
//packageid 0x2adc11d7339def7528121fb6302719cc37e588e4ea2672851efa8180c29037e5 | ||
//TreasuryCap objectid 0xe0c3f2fe67dfb2e47be028a8b3f4e9999c5aaac30adbc2523048d93f3f322622 | ||
} |
Oops, something went wrong.