Skip to content

Commit

Permalink
task/task2
Browse files Browse the repository at this point in the history
  • Loading branch information
linqining committed Nov 18, 2024
1 parent 45badfb commit e9933f9
Show file tree
Hide file tree
Showing 6 changed files with 127 additions and 9 deletions.
34 changes: 34 additions & 0 deletions mover/linqining/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.testnet]
chain-id = "4c78adac"
original-published-id = "0x23728ec5d011eaf7a8bca55811edf283d83a3ffe105b1bfd067ebb16a475cb1d"
latest-published-id = "0x23728ec5d011eaf7a8bca55811edf283d83a3ffe105b1bfd067ebb16a475cb1d"
published-version = "1"
37 changes: 37 additions & 0 deletions mover/linqining/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"

14 changes: 14 additions & 0 deletions mover/linqining/code/task2/my_coin/sources/eig.move
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module my_coin::eig;
use std::option::none;
use sui::coin::create_currency;
use sui::transfer::{public_freeze_object, public_share_object};
use sui::url::Url;

public struct EIG has drop{}

fun init(eig:EIG,ctx: &mut TxContext){
let eig_img = none<Url>();
let (treasury,metadata) = create_currency(eig,8,b"EIG",b"EIG",b"eig coin",eig_img,ctx);
public_freeze_object(metadata);
public_share_object(treasury);
}
15 changes: 15 additions & 0 deletions mover/linqining/code/task2/my_coin/sources/my_coin.move
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module my_coin::usd;
use std::option::some;
use sui::coin::create_currency;
use sui::transfer::{public_freeze_object, public_transfer};
use sui::url::Url;

public struct USD has drop{}

fun init(usd:USD,ctx: &mut TxContext){
let url = sui::url::new_unsafe_from_bytes(b"https://bkimg.cdn.bcebos.com/pic/503d269759ee3d6d55fbb529575d7a224f4a21a470b4?x-bce-process=image/format,f_auto/watermark,image_d2F0ZXIvYmFpa2UyNzI,g_7,xp_5,yp_5,P_20/resize,m_lfit,limit_1,h_1080");
let usd_img = some<Url>(url);
let (treasury,metadata) = create_currency(usd,8,b"USD",b"USD",b"world currency",usd_img,ctx);
public_freeze_object(metadata);
public_transfer(treasury,ctx.sender());
}
18 changes: 18 additions & 0 deletions mover/linqining/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
}
*/
18 changes: 9 additions & 9 deletions mover/linqining/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@
## 任务

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

## 02 move coin
- [] My Coin package id :
- [] Faucet package id :
- [] 转账 `My Coin` hash:
- [] `Faucet Coin` address1 mint hash:
- [] `Faucet Coin` address2 mint hash:
- [x] My Coin package id : 0x1771f9d52f5e59f43bdc544fedf0246eac2bbf616f551f6aa15da0866512a475
- [x] Faucet package id : 0x23728ec5d011eaf7a8bca55811edf283d83a3ffe105b1bfd067ebb16a475cb1d
- [x] 转账 `My Coin` hash: DeDhmvv5gHzuGGfNrQhqeDt7kUaqwd2Cn3gK1ue3DdHZ
- [x] `Faucet Coin` address1(0xc1f4704452819f75c258fe3a01e54d6561899e3478f818625ee8be716fbdd007) mint hash: ACrvHycdyRWC8wAK8DXNcdE4xJKK1b3nDz6oKeuS5kGy
- [x] `Faucet Coin` address2(0x7caaf3d123266f92398b3b642682133098afa7017b3a74b7fd0442d0368ae595) mint hash: 6tQHzfmfhk4d9sbeSVfoSBkfmhkwEEr1huqmudixFDJa

## 03 move NFT
- [] nft package id :
Expand Down

0 comments on commit e9933f9

Please sign in to comment.