Skip to content

Commit

Permalink
Merge branch 'task/task2' into task/task3
Browse files Browse the repository at this point in the history
  • Loading branch information
linqining committed Nov 18, 2024
2 parents 3974af4 + 52f89c5 commit d7f97f5
Show file tree
Hide file tree
Showing 9 changed files with 110 additions and 9 deletions.
34 changes: 34 additions & 0 deletions mover/linqining/code/task2/faucet_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 = "F8CFCF256E2F1BB7CD401C27799A09C40777C5C100F0DFA253E86DD7F0D4ED1B"
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 = "0xf855a34f6870634a444260ec3a7ad5581334849d8388f63d67e703b06428edc4"
latest-published-id = "0xf855a34f6870634a444260ec3a7ad5581334849d8388f63d67e703b06428edc4"
published-version = "1"
37 changes: 37 additions & 0 deletions mover/linqining/code/task2/faucet_coin/Move.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[package]
name = "faucet_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]
faucet_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"

3 changes: 3 additions & 0 deletions mover/linqining/code/task2/faucet_coin/gen.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
sui client call --package 0x2 --module coin --function mint_and_transfer \
--type-args 0xf855a34f6870634a444260ec3a7ad5581334849d8388f63d67e703b06428edc4::eig::EIG \
--args 0x500fdab62d80e0e75fd09fe6e9cb463cf017cfb4171e25a70c9f9d387a01d187 10000000000000 0xc1f4704452819f75c258fe3a01e54d6561899e3478f818625ee8be716fbdd007 --gas-budget 3000000
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module my_coin::eig;
module faucet_coin::eig;
use std::option::none;
use sui::coin::create_currency;
use sui::transfer::{public_freeze_object, public_share_object};
Expand All @@ -12,3 +12,4 @@ fun init(eig:EIG,ctx: &mut TxContext){
public_freeze_object(metadata);
public_share_object(treasury);
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
#[test_only]
module faucet_coin::faucet_coin_tests;
// uncomment this line to import the module
// use faucet_coin::faucet_coin;
const ENotImplemented: u64 = 0;
#[test]
fun test_faucet_coin() {
// pass
}
#[test, expected_failure(abort_code = ::faucet_coin::faucet_coin_tests::ENotImplemented)]
fun test_faucet_coin_fail() {
abort ENotImplemented
}
*/
6 changes: 6 additions & 0 deletions mover/linqining/code/task2/my_coin/Move.lock
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,9 @@ chain-id = "4c78adac"
original-published-id = "0x23728ec5d011eaf7a8bca55811edf283d83a3ffe105b1bfd067ebb16a475cb1d"
latest-published-id = "0x23728ec5d011eaf7a8bca55811edf283d83a3ffe105b1bfd067ebb16a475cb1d"
published-version = "1"

[env.mainnet]
chain-id = "35834a8a"
original-published-id = "0xff6c887f84778d86304dab92b31fed7ea25fec1bdc783c9f7c9a2bfa0546f4a3"
latest-published-id = "0xff6c887f84778d86304dab92b31fed7ea25fec1bdc783c9f7c9a2bfa0546f4a3"
published-version = "1"
3 changes: 3 additions & 0 deletions mover/linqining/code/task2/my_coin/gen.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
sui client call --package 0x2 --module coin --function mint_and_transfer \
--type-args 0xff6c887f84778d86304dab92b31fed7ea25fec1bdc783c9f7c9a2bfa0546f4a3::usd::USD \
--args 0x3e29fd3385f060829514eba6e0aabcdca7e7de0c6b689f4a25a5484b9fa86a0c 10000000000000 0x7b8e0864967427679b4e129f79dc332a885c6087ec9e187b53451a9006ee15f2 --gas-budget 3000000
5 changes: 2 additions & 3 deletions mover/linqining/code/task2/my_coin/sources/my_coin.move
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
module my_coin::usd;
use std::option::some;
use std::option::none;
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 usd_img = none<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());
Expand Down
10 changes: 5 additions & 5 deletions mover/linqining/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
- [x] package id 在 scan上的查看截图:![Scan截图](./images/img.png)

## 02 move coin
- [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
- [x] My Coin package id : 0xff6c887f84778d86304dab92b31fed7ea25fec1bdc783c9f7c9a2bfa0546f4a3
- [x] Faucet package id : 0xf855a34f6870634a444260ec3a7ad5581334849d8388f63d67e703b06428edc4
- [x] 转账 `My Coin` hash: zMbWbMhgKgaWxJBwYswUJpqHR4ZmUCVu8856P2jjz2p
- [x] `Faucet Coin` address1(0x7caaf3d123266f92398b3b642682133098afa7017b3a74b7fd0442d0368ae595) mint hash: 5XY6xTNBYmSYN4zGGf7WRUV3pB7Q4Tn8fm1WFjqktQZc
- [x] `Faucet Coin` address2(0xc1f4704452819f75c258fe3a01e54d6561899e3478f818625ee8be716fbdd007) mint hash: HYr5URs9WbfP4sEUxQJtbfPg16U33XCmNnGwv7MPyVVM

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

0 comments on commit d7f97f5

Please sign in to comment.