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

task1 and task2 #2194

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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
1 change: 1 addition & 0 deletions mover/makayalu/coLearn2411/images/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions mover/makayalu/coLearn2411/project/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

53 changes: 53 additions & 0 deletions mover/makayalu/coLearn2411/readme.md
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/你的图片地址)

Empty file added mover/makayalu/code/readme.md
Empty file.
1 change: 1 addition & 0 deletions mover/makayalu/code/task1/hello_world/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build/*
40 changes: 40 additions & 0 deletions mover/makayalu/code/task1/hello_world/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 = "CE144AD3B23935EA6BE3ABC61C88782DE61946631FFB401BB14DAAB199318032"
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.40.0"
edition = "2024"
flavor = "sui"

[env]

[env.devnet]
chain-id = "19012592"
original-published-id = "0xfa8153d85afb05753c156eaf0641886ae7c4bf5ac99a6f2616bacc9d064bb420"
latest-published-id = "0xfa8153d85afb05753c156eaf0641886ae7c4bf5ac99a6f2616bacc9d064bb420"
published-version = "1"

[env.testnet]
chain-id = "4c78adac"
original-published-id = "0x2cdad01066941e23b842df944cccaa1c1e7232d7bc61c3a33ead46b960b5ad46"
latest-published-id = "0x2cdad01066941e23b842df944cccaa1c1e7232d7bc61c3a33ead46b960b5ad46"
published-version = "1"
16 changes: 16 additions & 0 deletions mover/makayalu/code/task1/hello_world/Move.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[package]
name = "hello_world"
version = "0.1.0"
edition = "2024"


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


[addresses]
hello_world = "0x0"
Std = "0x00000000000000000000000000000002"



33 changes: 33 additions & 0 deletions mover/makayalu/code/task1/hello_world/sources/hello_world.move
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
/// Module: hello_world
module hello_world::hello_world;
*/

// For Move coding conventions, see
// https://docs.sui.io/concepts/sui-move-concepts/conventions


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

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

//function
fun init(ctx: &mut TxContext){
let hello_move = Hello {
id: object::new(ctx),
say: string(b"makayalu")
};
transfer::transfer(hello_move, ctx.sender());
}
}



Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#[test_only]
module hello_world::hello_world_tests {
use hello_world::hello_world;
#[test]
fun test_hello_world() {
assert!(hello_world::hello_world() == b"makayalu".to_string(), 0);
}
}
1 change: 1 addition & 0 deletions mover/makayalu/code/task2/coinfacet/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build/*
34 changes: 34 additions & 0 deletions mover/makayalu/code/task2/coinfacet/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 = "CB2C1B89FDD217A7F39235AF8A973C638FE27F14B1F262AF5A61F8DF4F7DBC8D"
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.40.0"
edition = "2024.beta"
flavor = "sui"

[env]

[env.testnet]
chain-id = "4c78adac"
original-published-id = "0x1c3941a80d4ee5000dbcc24f670ec5b61de4aaf2add96bdb637a0d0ac447d76c"
latest-published-id = "0x1c3941a80d4ee5000dbcc24f670ec5b61de4aaf2add96bdb637a0d0ac447d76c"
published-version = "1"
37 changes: 37 additions & 0 deletions mover/makayalu/code/task2/coinfacet/Move.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[package]
name = "coinfacet"
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]
coinfacet = "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/makayalu/code/task2/coinfacet/sources/rmb.move
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
/// Module: coinfacet
module coinfacet::coinfacet;
*/

// For Move coding conventions, see
// https://docs.sui.io/concepts/sui-move-concepts/conventions


module coinfacet::rmb;

use sui::coin::create_currency;
use std::option;
use std::option::{none, some};
use sui::transfer::{public_freeze_object,public_transfer,public_share_object};
use sui::url::Url;
use sui::coin::{Self, Coin, TreasuryCap};

public struct RMB has drop{}

fun init(rmb: RMB, ctx: &mut TxContext){

let no : Option<Url> = none<Url>();

let (treasury, coin_metadata) = create_currency(
rmb,
8,
b"RMB",
b"RMB",
b"this is makayalu's RMB",
no,
ctx
);

public_freeze_object(coin_metadata);

public_share_object(treasury);



}

public fun mint(treasury: &mut TreasuryCap<RMB> , amount: u64 , recipient: address , ctx: &mut TxContext){
coin::mint_and_transfer(treasury, amount, recipient, ctx)
}
18 changes: 18 additions & 0 deletions mover/makayalu/code/task2/coinfacet/tests/coinfacet_tests.move
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
#[test_only]
module coinfacet::coinfacet_tests;
// uncomment this line to import the module
// use coinfacet::coinfacet;

const ENotImplemented: u64 = 0;

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

#[test, expected_failure(abort_code = ::coinfacet::coinfacet_tests::ENotImplemented)]
fun test_coinfacet_fail() {
abort ENotImplemented
}
*/
1 change: 1 addition & 0 deletions mover/makayalu/code/task2/my_coin/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build/*
34 changes: 34 additions & 0 deletions mover/makayalu/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.40.0"
edition = "2024.beta"
flavor = "sui"

[env]

[env.testnet]
chain-id = "4c78adac"
original-published-id = "0x91449e189d23c055dda08e2ce0673ffef2c271c7ca19de361130b4eba49c393b"
latest-published-id = "0x91449e189d23c055dda08e2ce0673ffef2c271c7ca19de361130b4eba49c393b"
published-version = "1"
37 changes: 37 additions & 0 deletions mover/makayalu/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 ([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]
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"

Loading
Loading