Skip to content

Commit

Permalink
commit task5
Browse files Browse the repository at this point in the history
  • Loading branch information
poshitou committed Dec 5, 2024
1 parent 2bc596f commit 4f984d8
Show file tree
Hide file tree
Showing 13 changed files with 1,545 additions and 3 deletions.
43 changes: 43 additions & 0 deletions mover/poshitou/code/task5/poshitou/Move.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# @generated by Move, please check-in and do not edit manually.

[move]
version = 3
manifest_digest = "CC65AC05941F0A9C03541FE25A770AB77B6A2DAE7202D6D418C30A5561CE4D40"
deps_digest = "3C4103934B1E040BB6B23F1D610B4EF9F2F1166A50A104EADCF77467C004C600"
dependencies = [
{ id = "Sui", name = "Sui" },
{ id = "my_coin", name = "my_coin" },
]

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

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

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

[[move.package]]
id = "my_coin"
source = { local = "..\\..\\task2\\my_coin" }

dependencies = [
{ id = "Sui", name = "Sui" },
]

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

[env]

[env.mainnet]
chain-id = "35834a8a"
original-published-id = "0xe31d7e17f01f89b34459b467547d2febadf672f4c809742a10b08e267b3f1dad"
latest-published-id = "0xe31d7e17f01f89b34459b467547d2febadf672f4c809742a10b08e267b3f1dad"
published-version = "1"
40 changes: 40 additions & 0 deletions mover/poshitou/code/task5/poshitou/Move.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
[package]
name = "poshitou"
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])"]
published-at = "0xe31d7e17f01f89b34459b467547d2febadf672f4c809742a10b08e267b3f1dad"


[dependencies]
Sui = { git = "https://gitee.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "framework/testnet" }
my_coin = {local = "../../task2/my_coin"}

# 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]
poshitou = "0xe31d7e17f01f89b34459b467547d2febadf672f4c809742a10b08e267b3f1dad"

# 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"

49 changes: 49 additions & 0 deletions mover/poshitou/code/task5/poshitou/call.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# build
sui move build --skip-fetch-latest-git-deps

# publish
sui client publish --skip-fetch-latest-git-deps

sui client call `
--package 0x2 `
--module coin `
--function mint_and_transfer `
--type-args '0x388ecc0ef7261e40f7be055c723e4bf275d3eeb33eae3525e4b7096065b19b73::faucet_coin::FAUCET_COIN' `
--args 0xc1ecb008f20a5c4504545de9107057c2ce0674ca34ebf614ebed8e5a77772ccb 100 0xd842b07687548bef8605dab499624f8aacd2c6108b7909db433a6394b435f57c
# mint and transfer
sui client call `
--package 0x2 `
--module coin `
--function mint_and_transfer `
--type-args '0x388ecc0ef7261e40f7be055c723e4bf275d3eeb33eae3525e4b7096065b19b73::my_coin::MY_COIN' `
--args 0x9a7542f2b37e3217cbfdb3ed748f6017664fd1653a0fc36f695c6f7bfc20f49d 100 0xd842b07687548bef8605dab499624f8aacd2c6108b7909db433a6394b435f57c


sui client call `
--package 0xe31d7e17f01f89b34459b467547d2febadf672f4c809742a10b08e267b3f1dad `
--module poshitou_swap `
--function deposit_faucet_coin `
--args 0x2255714f3e6872921ff1f9c0c742c74230fee49c3f2eea5c6d5f095f52a34ff3 0x6e7af64e816d7c9c143591ddfabf1f156b62e4d273c2b7e6479e1aec19884882


sui client call `
--package 0xe31d7e17f01f89b34459b467547d2febadf672f4c809742a10b08e267b3f1dad `
--module poshitou_swap `
--function deposit_my_coin `
--args 0x2255714f3e6872921ff1f9c0c742c74230fee49c3f2eea5c6d5f095f52a34ff3 0xf67236272ffee5eb128b3e900fbc0dc620f03f7df2690ddca7fca527d2e07d8c


sui client call `
--package 0xe31d7e17f01f89b34459b467547d2febadf672f4c809742a10b08e267b3f1dad `
--module poshitou_swap `
--function swap_faucet_coin_to_my_coin `
--args 0x2255714f3e6872921ff1f9c0c742c74230fee49c3f2eea5c6d5f095f52a34ff3 0xb9385eabb1083466c0833a10b9c3c705ccd183a7adf20998ef9494fcbf843249


sui client call `
--package 0xe31d7e17f01f89b34459b467547d2febadf672f4c809742a10b08e267b3f1dad `
--module poshitou_swap `
--function swap_mycoin_to_faucet_coin `
--args 0x2255714f3e6872921ff1f9c0c742c74230fee49c3f2eea5c6d5f095f52a34ff3 0xb08529c699ee47bf530f8d38aefd12232371fe26cc3517b2b89a7c51b92bea5e
Loading

0 comments on commit 4f984d8

Please sign in to comment.