Skip to content

Commit

Permalink
task2
Browse files Browse the repository at this point in the history
  • Loading branch information
404ll committed Jul 18, 2024
1 parent c619e91 commit d2eb01a
Show file tree
Hide file tree
Showing 9 changed files with 225 additions and 5 deletions.
34 changes: 34 additions & 0 deletions mover/404ll/code/task2/FaucetCoin/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 = 2
manifest_digest = "A3A4289005858BB5EC8B7DFB1830EFFBF1A44FCC005156E36FA379507A61F1BD"
deps_digest = "F8BBB0CCB2491CA29A3DF03D6F92277A4F3574266507ACD77214D37ECA3F3082"
dependencies = [
{ name = "Sui" },
]

[[move.package]]
name = "MoveStdlib"
source = { git = "https://github.com/MystenLabs/sui.git", rev = "framework/testnet", subdir = "crates\\sui-framework\\packages\\move-stdlib" }

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

dependencies = [
{ name = "MoveStdlib" },
]

[move.toolchain-version]
compiler-version = "1.28.4"
edition = "2024.beta"
flavor = "sui"

[env]

[env.testnet]
chain-id = "4c78adac"
original-published-id = "0x796fe22eb9df4f8d926e111c888d8ef4447d4348c3131f2cb4a82f1ec09c5e63"
latest-published-id = "0x796fe22eb9df4f8d926e111c888d8ef4447d4348c3131f2cb4a82f1ec09c5e63"
published-version = "1"
37 changes: 37 additions & 0 deletions mover/404ll/code/task2/FaucetCoin/Move.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[package]
name = "FaucetCoin"
edition = "2024.beta" # edition = "legacy" to use legacy (pre-2024) Move
# license = "" # e.g., "MIT", "GPL", "Apache 2.0"
# authors = ["..."] # e.g., ["Joe Smith (joesmith@noemail.com)", "John Snow (johnsnow@noemail.com)"]

[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]
faucetcoin = "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"

24 changes: 24 additions & 0 deletions mover/404ll/code/task2/FaucetCoin/sources/faucetcoin.move
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
module faucetcoin::FaucetCoin {
use std::option;
use sui::transfer;
use sui::tx_context::{Self, TxContext};
use sui::coin::{Self, Coin, TreasuryCap};

public struct FAUCETCOIN has drop {}

fun init( witness:FAUCETCOIN,ctx: &mut TxContext) {
let (treasury, metadata) = coin::create_currency(witness, 7, b"404ll_FaucetCoin", b"404ll_FaucetCoin", b"FaucetCoin", option::none(), ctx);
transfer::public_freeze_object(metadata);
transfer::public_share_object(treasury)
}
public entry fun mint_and_transfer(
treasury: &mut TreasuryCap<FAUCETCOIN>,
amount: u64,
recipient: address,
ctx: &mut TxContext,
) {
let faucet = coin::mint(treasury, amount, ctx);
transfer::public_transfer(faucet, tx_context::sender(ctx) )

}
}
19 changes: 19 additions & 0 deletions mover/404ll/code/task2/FaucetCoin/tests/faucetcoin_tests.move
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
#[test_only]
module faucetcoin::faucetcoin_tests {
// uncomment this line to import the module
// use faucetcoin::faucetcoin;
const ENotImplemented: u64 = 0;
#[test]
fun test_faucetcoin() {
// pass
}
#[test, expected_failure(abort_code = ::faucetcoin::faucetcoin_tests::ENotImplemented)]
fun test_faucetcoin_fail() {
abort ENotImplemented
}
}
*/
34 changes: 34 additions & 0 deletions mover/404ll/code/task2/mycoin/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 = 2
manifest_digest = "6C40FE3B1765CDEAB5314EF7C5C5BB46962606BA7C4CDC2111E8A61DB77690AD"
deps_digest = "F8BBB0CCB2491CA29A3DF03D6F92277A4F3574266507ACD77214D37ECA3F3082"
dependencies = [
{ name = "Sui" },
]

[[move.package]]
name = "MoveStdlib"
source = { git = "https://github.com/MystenLabs/sui.git", rev = "framework/testnet", subdir = "crates\\sui-framework\\packages\\move-stdlib" }

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

dependencies = [
{ name = "MoveStdlib" },
]

[move.toolchain-version]
compiler-version = "1.28.4"
edition = "2024.beta"
flavor = "sui"

[env]

[env.testnet]
chain-id = "4c78adac"
original-published-id = "0x6765b41dc00617512667e5d8623ecb0ea826874614c23c90bdd1ac461ac47b67"
latest-published-id = "0x6765b41dc00617512667e5d8623ecb0ea826874614c23c90bdd1ac461ac47b67"
published-version = "1"
37 changes: 37 additions & 0 deletions mover/404ll/code/task2/mycoin/Move.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[package]
name = "FireCoin"
edition = "2024.beta" # edition = "legacy" to use legacy (pre-2024) Move
# license = "" # e.g., "MIT", "GPL", "Apache 2.0"
# authors = ["..."] # e.g., ["Joe Smith (joesmith@noemail.com)", "John Snow (johnsnow@noemail.com)"]

[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]
FireCoin = "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"

16 changes: 16 additions & 0 deletions mover/404ll/code/task2/mycoin/sources/mycoin.move
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module FireCoin::FireCoin {
use std::option;
use sui::transfer;
use sui::tx_context::{Self, TxContext};
use sui::coin::{Self, Coin, TreasuryCap};

public struct FIRECOIN has drop {}

fun init( witness:FIRECOIN , ctx: &mut TxContext) {
let (treasury, metadata) = coin::create_currency(witness, 7, b"404llcoin", b"FC", b"Full of idal a flame", option::none(), ctx);
transfer::public_freeze_object(metadata);
transfer::public_transfer(treasury, tx_context::sender(ctx))
}


}
19 changes: 19 additions & 0 deletions mover/404ll/code/task2/mycoin/tests/mycoin_tests.move
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
#[test_only]
module mycoin::mycoin_tests {
// uncomment this line to import the module
// use mycoin::mycoin;
const ENotImplemented: u64 = 0;
#[test]
fun test_mycoin() {
// pass
}
#[test, expected_failure(abort_code = ::mycoin::mycoin_tests::ENotImplemented)]
fun test_mycoin_fail() {
abort ENotImplemented
}
}
*/
10 changes: 5 additions & 5 deletions mover/404ll/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
- [] package id 在 scan上的查看截图:<img src="./images/浏览器截图.png" alt="Scan截图" style="zoom:25%;" />

## 02 move coin
- [0xb29d13722b2f81858c9c48f8004d9021af226ff87a9c29071b8310a5bbb57dd5] My Coin package id :
- [0xb29d13722b2f81858c9c48f8004d9021af226ff87a9c29071b8310a5bbb57dd5] Faucet package id :
- [0x686e0ada089ef2dc22a31f5dd46312e39d9d8ded4c2092065add0702d6aa1e77] 转账 `My Coin` hash:
- [0xe0ec6805847c63838e4eae60ac9e15e761c310dabbf8b0eeca187e9174d17530] `Faucet Coin` address1 mint hash:
- [0xfcc52f9563bb7f3117aa271361d72232641a7f72d42a68755e82b39a8faf39f8] `Faucet Coin` address2 mint hash:
- [0x6765b41dc00617512667e5d8623ecb0ea826874614c23c90bdd1ac461ac47b67] My Coin package id :
- [0x796fe22eb9df4f8d926e111c888d8ef4447d4348c3131f2cb4a82f1ec09c5e63] Faucet package id :
- [0xed3f44cfe2b4c9e7e0de2deaefd47457fdf206a763a235bb99d391bba31313b4] 转账 `My Coin` hash:
- [0x42bd0305cafd782e8cd5f3b8f92e108c1bd66b0ea8838d040ccc6bb945b35c8b] `Faucet Coin` address1 mint hash:
- [0x9b8b1f4ece3c93c75f3abc1cd14b50d0aa7135fc4ba8a6ffe5f2929dca1f78ce] `Faucet Coin` address2 mint hash:

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

0 comments on commit d2eb01a

Please sign in to comment.