Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonRUAN committed Dec 7, 2024
1 parent 3934583 commit 949054a
Show file tree
Hide file tree
Showing 5 changed files with 432 additions and 0 deletions.
44 changes: 44 additions & 0 deletions mover/JasonRUAN/code/task5/js_swap/Move.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# @generated by Move, please check-in and do not edit manually.

[move]
version = 3
manifest_digest = "D40BE8607C30E07AC5B66E8961834715A1F79B63116A1993C7C3C57185C4F610"
deps_digest = "060AD7E57DFB13104F21BE5F5C3759D03F0553FC3229247D9A7A6B45F50D03A3"
dependencies = [
{ id = "Sui", name = "Sui" },
{ id = "js_coin", name = "js_coin" },
{ id = "js_faucet_coin", name = "js_faucet_coin" },
]

[[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.package]]
id = "js_coin"
source = { local = "../../task2/js_coin" }

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

[[move.package]]
id = "js_faucet_coin"
source = { local = "../../task2/js_faucet_coin" }

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

[move.toolchain-version]
compiler-version = "1.39.0"
edition = "2024.beta"
flavor = "sui"
39 changes: 39 additions & 0 deletions mover/JasonRUAN/code/task5/js_swap/Move.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
[package]
name = "js_swap"
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" }
js_coin = { local = "../../task2/js_coin" }
js_faucet_coin = { local = "../../task2/js_faucet_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]
js_swap = "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"

20 changes: 20 additions & 0 deletions mover/JasonRUAN/code/task5/js_swap/sources/js_pool.move
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module js_swap::js_pool {
use sui::coin::Coin;
use js_coin::js_coin::JS_COIN;
use js_coin::js_faucet_coin::JS_FAUCET_COIN;

public struct JS has drop {}

entry fun create_pool(
coin_a: Coin<JS_COIN>,
coin_b: Coin<JS_FAUCET_COIN>,
fee_percent: u64,
ctx: &mut TxContext
) {

transfer::public_transfer(
js_swap::js_swap::create_pool(JS{}, coin_a, coin_b, fee_percent, ctx),
ctx.sender()
)
}
}
Loading

0 comments on commit 949054a

Please sign in to comment.