Skip to content

Commit 44bc734

Browse files
ebmaCopilot
andauthored
Enable teleport of native token to Assethub (#553)
* Adjust xcm_config.rs for Pendulum and allow teleport of PEN to assethub * Implement xcm-teleport pallet * Add xcm-teleport pallet to pendulum runtime * Adjust xcm-teleport pallet to deposit leftover DOT back into sovereign account * Adjust config in pendulum runtime * Implement teleport check-in and check-out logic in custom transactor * Implement teleport destination validation in custom transactor * Rename variables * Address review comments: remove unused deps, fix imbalance handling, update comments (#554) * Initial plan * Address review comments: remove unused deps, fix comment, handle imbalance properly Co-authored-by: ebma <6690623+ebma@users.noreply.github.com> * Clarify comment about refund limitations Co-authored-by: ebma <6690623+ebma@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: ebma <6690623+ebma@users.noreply.github.com> * Revert UnitWeightCost change * Add minimum teleport amount to prevent griefing attacks * Add logic to convert between PEN and DOT price using onchain prices * Fix `vec!` missing * Deposit leftover DOT to beneficiary * Reduce MaxDotFeeAmount to 0.5 * Adjust stale code --------- Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: ebma <6690623+ebma@users.noreply.github.com>
1 parent 5904510 commit 44bc734

9 files changed

Lines changed: 736 additions & 11 deletions

File tree

Cargo.lock

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ members = [
1313
"pallets/orml-currencies-allowance-extension",
1414
"pallets/orml-tokens-management-extension",
1515
"pallets/treasury-buyout-extension",
16+
"pallets/xcm-teleport",
1617
"runtime/common",
1718
"runtime/amplitude",
1819
"runtime/foucoco",

pallets/xcm-teleport/Cargo.toml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
[package]
2+
authors = ["Pendulum"]
3+
description = "A pallet to teleport native PEN to AssetHub with correct XCM message ordering"
4+
edition = "2021"
5+
name = "pallet-xcm-teleport"
6+
version = "1.6.0-d"
7+
8+
[dependencies]
9+
log = { workspace = true }
10+
parity-scale-codec = { workspace = true, features = ["derive"] }
11+
scale-info = { workspace = true, features = ["derive"] }
12+
13+
frame-support = { workspace = true }
14+
frame-system = { workspace = true }
15+
sp-runtime = { workspace = true }
16+
sp-std = { workspace = true }
17+
18+
xcm = { workspace = true }
19+
20+
# benchmarking
21+
frame-benchmarking = { workspace = true, optional = true }
22+
23+
[features]
24+
default = ["std"]
25+
runtime-benchmarks = [
26+
"frame-benchmarking",
27+
"frame-benchmarking/runtime-benchmarks",
28+
"frame-support/runtime-benchmarks",
29+
"frame-system/runtime-benchmarks",
30+
"sp-runtime/runtime-benchmarks",
31+
]
32+
std = [
33+
"frame-support/std",
34+
"frame-system/std",
35+
"log/std",
36+
"parity-scale-codec/std",
37+
"scale-info/std",
38+
"sp-runtime/std",
39+
"sp-std/std",
40+
"xcm/std",
41+
"frame-benchmarking?/std",
42+
]
43+
try-runtime = [
44+
"frame-support/try-runtime",
45+
"frame-system/try-runtime",
46+
"sp-runtime/try-runtime",
47+
]

0 commit comments

Comments
 (0)