Skip to content

Commit

Permalink
Merge pull request #1894 from jdf12/main
Browse files Browse the repository at this point in the history
第二周参与直播&第二周学习_共学营
  • Loading branch information
uvd authored Dec 25, 2024
2 parents 36d7efd + 8f82d0a commit fcff9cd
Show file tree
Hide file tree
Showing 17 changed files with 163 additions and 33 deletions.
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.
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.
12 changes: 6 additions & 6 deletions mover/jdf12/co-learn-2411/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@
## 每周课程学习

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

## 参加直播答疑

- [] 第一周:![学习记录截图](./images/第一周参与直播答疑.jpg)
- [] 第二周:![学习记录截图](./images/你的图片地址)
- [] 第三周:![学习记录截图](./images/你的图片地址)
- [] 第四周:![学习记录截图](./images/你的图片地址)
- [] 第二周:![学习记录截图](./images/第二周参与直播.jpg)
- [] 第三周:![学习记录截图](./images/第三周参与直播.jpg)
- [] 第四周:![学习记录截图](./images/第四周参与直播.jpg)

## 群里分享学习笔记

Expand Down
18 changes: 0 additions & 18 deletions mover/jdf12/code/task1/hello_move/tests/hello_move_tests.move

This file was deleted.

34 changes: 34 additions & 0 deletions mover/jdf12/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.37.1"
edition = "2024.beta"
flavor = "sui"

[env]

[env.mainnet]
chain-id = "35834a8a"
original-published-id = "0xc3f979a4dc8fe5c0387ecd06cf5be44df4ddeaa635272b0f1456b3f706960705"
latest-published-id = "0xc3f979a4dc8fe5c0387ecd06cf5be44df4ddeaa635272b0f1456b3f706960705"
published-version = "1"
37 changes: 37 additions & 0 deletions mover/jdf12/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"

30 changes: 30 additions & 0 deletions mover/jdf12/code/task2/my_coin/sources/jdf12_coin.move
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
//包名my_coin 模块名jdf12_coin
module my_coin::jdf12_coin;
use std::option::{Option, none, some};
use sui::coin::create_currency;
use sui::transfer::{public_freeze_object, public_transfer};
use sui::url;
use sui::url::Url;

public struct JDF12_COIN has drop{}

fun init(jdf12Coin:JDF12_COIN, ctx: &mut TxContext){

let no:Option<Url> = none<Url>();
//为代币设置图片连接
let url = url::new_unsafe_from_bytes(b"https://img0.baidu.com/it/u=1023821093,4105519612&fm=253&fmt=auto&app=138&f=JPEG?w=359&h=499");
let yes:Option<Url> = some<Url>(url);
//创建一个代币
/*
treasuryCap : 货币的铸造权限
coinMetadata : 代币的元数据信息
*/
let (treasuryCap, coinMetadata) = create_currency(jdf12Coin,8,b"jdf12",b"jdf12",b"this is jdf12_coin",yes,ctx);
//冻结对象,该对象不能被修改
public_freeze_object(coinMetadata);
//转移铸造权限,将铸造权限转移到发送此交易的账户上
//现在是将铸币的权限发送给我们自己
public_transfer(treasuryCap,ctx.sender())
}


29 changes: 29 additions & 0 deletions mover/jdf12/code/task2/my_coin/sources/jdf12_faucet_coin.move
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
module my_coin::jdf12_faucet_coin {

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

//水龙头coin
public struct JDF12_FAUCET_COIN has drop{}

fun init(jdf12FaucetCoin:JDF12_FAUCET_COIN, ctx: &mut TxContext){

let no:Option<Url> = none<Url>();
//为代币设置图片连接
let url = url::new_unsafe_from_bytes(b"https://img0.baidu.com/it/u=1023821093,4105519612&fm=253&fmt=auto&app=138&f=JPEG?w=359&h=499");
let yes:Option<Url> = some<Url>(url);
//创建一个代币
/*
treasuryCap : 货币的铸造权限
coinMetadata : 代币的元数据信息
*/
let (treasuryCap, coinMetadata) = create_currency(jdf12FaucetCoin,8,b"jdf12_faucet_coin",b"jdf12_faucet_coin",b"this is jdf12_faucet_coin",yes,ctx);
//冻结对象,该对象不能被修改
public_freeze_object(coinMetadata);
//转移铸造权限,将铸造权限共享出去,任何人都可以使用
public_share_object(treasuryCap)
}
}
18 changes: 18 additions & 0 deletions mover/jdf12/code/task2/my_coin/tests/my_coin_tests.move
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
#[test_only]
module my_coin::my_coin_tests;
// uncomment this line to import the module
// use my_coin::my_coin;
const ENotImplemented: u64 = 0;
#[test]
fun test_my_coin() {
// pass
}
#[test, expected_failure(abort_code = ::my_coin::my_coin_tests::ENotImplemented)]
fun test_my_coin_fail() {
abort ENotImplemented
}
*/
Binary file removed mover/jdf12/images/l.png
Binary file not shown.
Binary file removed mover/jdf12/images/qb.png
Binary file not shown.
Binary file added mover/jdf12/images/scan.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 9 additions & 9 deletions mover/jdf12/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@
- [] package id 在 scan上的查看截图:![Scan截图](./images/sui_task1.png)

## 02 move coin
- [] My Coin package id :
- [] Faucet package id :
- [] 转账 `My Coin` hash:
- [] `Faucet Coin` address1 mint hash:
- [] `Faucet Coin` address2 mint hash:
- [] My Coin package id : [0xc3f979a4dc8fe5c0387ecd06cf5be44df4ddeaa635272b0f1456b3f706960705](https://suivision.xyz/package/0xc3f979a4dc8fe5c0387ecd06cf5be44df4ddeaa635272b0f1456b3f706960705)
- [] Faucet package id : [0xc3f979a4dc8fe5c0387ecd06cf5be44df4ddeaa635272b0f1456b3f706960705](https://suivision.xyz/package/0xc3f979a4dc8fe5c0387ecd06cf5be44df4ddeaa635272b0f1456b3f706960705)
- [] 转账 `My Coin` hash: [9AztZt6Ptm7jvd9eaJGcLqY1NTrUZJ3WrnvEzL6f4q6f](https://suivision.xyz/txblock/9AztZt6Ptm7jvd9eaJGcLqY1NTrUZJ3WrnvEzL6f4q6f?tab=Changes)
- [] `Faucet Coin` address1 mint hash: [6bKoLJ1EgxyjXGBHQU88PdSMKzb8SiNve9ux5RqmaxUr](https://suivision.xyz/txblock/6bKoLJ1EgxyjXGBHQU88PdSMKzb8SiNve9ux5RqmaxUr?tab=Changes)
- [] `Faucet Coin` address2 mint hash: [Bumpx5G8j4KPDTguntjP8VYTcUarWQzq1u5LEE3VEiUD](https://suivision.xyz/txblock/Bumpx5G8j4KPDTguntjP8VYTcUarWQzq1u5LEE3VEiUD?tab=Changes)

## 03 move NFT
- [] nft package id :
- [] nft object id :
- [] 转账 nft hash:
- [] scan上的NFT截图:![Scan截图](./images/你的图片地址)
- [] nft package id : [0xef27d52dbaf002d61b037193532fdc590773c069b1c05074fa2544be3d9ed10a](https://suivision.xyz/package/0xef27d52dbaf002d61b037193532fdc590773c069b1c05074fa2544be3d9ed10a)
- [] nft object id : [0x0f4f14f517755416002474cab193c79c26388652fe469d87f354be97a841684d](https://suiscan.xyz/mainnet/object/0x0f4f14f517755416002474cab193c79c26388652fe469d87f354be97a841684d)
- [] 转账 nft hash:
- [] scan上的NFT截图:![Scan截图](./images/scan.png)

## 04 Move Game
- [] game package id :
Expand Down

0 comments on commit fcff9cd

Please sign in to comment.