-
Notifications
You must be signed in to change notification settings - Fork 891
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
127 additions
and
9 deletions.
There are no files selected for viewing
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,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" |
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 = "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" | ||
|
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,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); | ||
} |
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,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
18
mover/linqining/code/task2/my_coin/tests/my_coin_tests.move
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 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 | ||
} | ||
*/ |
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