Token-swap-over-bridge pallet (#944)

* token swap pallet

* token swap type (replay protection)

* post-merge fixes

* post-merge fix

* Update modules/token-swap/src/lib.rs

Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>

* Update modules/token-swap/src/lib.rs

Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>

* add missing comment part

* Update modules/token-swap/src/lib.rs

Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>

* starting claim after lock period is over is forbidden

* move spec_version and weight to arguments

Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
This commit is contained in:
Svyatoslav Nikolsky
2021-08-02 14:42:14 +03:00
committed by Bastian Köcher
parent f86d101d7c
commit eba80f42a9
6 changed files with 1356 additions and 0 deletions
+51
View File
@@ -0,0 +1,51 @@
[package]
name = "pallet-bridge-token-swap"
description = "An Substrate pallet that allows parties on different chains (bridged using messages pallet) to swap their tokens"
version = "0.1.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
[dependencies]
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false }
log = { version = "0.4.14", default-features = false }
serde = { version = "1.0", optional = true }
# Bridge dependencies
bp-message-dispatch = { path = "../../primitives/message-dispatch", default-features = false }
bp-messages = { path = "../../primitives/messages", default-features = false }
bp-runtime = { path = "../../primitives/runtime", default-features = false }
bp-token-swap = { path = "../../primitives/token-swap", default-features = false }
pallet-bridge-dispatch = { path = "../dispatch", default-features = false }
# Substrate Dependencies
frame-support = { git = "https://github.com/paritytech/substrate", branch = "master" , default-features = false }
frame-system = { git = "https://github.com/paritytech/substrate", branch = "master" , default-features = false }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" , default-features = false }
sp-io = { git = "https://github.com/paritytech/substrate", branch = "master" , default-features = false }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master" , default-features = false }
sp-std = { git = "https://github.com/paritytech/substrate", branch = "master" , default-features = false, optional = true }
[dev-dependencies]
pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "master" }
[features]
default = ["std"]
std = [
"codec/std",
"bp-message-dispatch/std",
"bp-messages/std",
"bp-runtime/std",
"bp-token-swap/std",
"frame-support/std",
"frame-system/std",
"log/std",
"pallet-bridge-dispatch/std",
"serde",
"sp-core/std",
"sp-io/std",
"sp-runtime/std",
"sp-std/std",
]