diff --git a/Cargo.lock b/Cargo.lock
index a420dcd050..fb9485a98e 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -6234,9 +6234,6 @@ dependencies = [
"moonbeam-xcm-benchmarks",
"nimbus-primitives",
"num_enum 0.5.11",
- "orml-traits",
- "orml-xcm-support",
- "orml-xtokens",
"pallet-asset-manager",
"pallet-assets",
"pallet-async-backing",
@@ -6751,9 +6748,6 @@ dependencies = [
"moonbeam-xcm-benchmarks",
"nimbus-primitives",
"num_enum 0.5.11",
- "orml-traits",
- "orml-xcm-support",
- "orml-xtokens",
"pallet-asset-manager",
"pallet-assets",
"pallet-async-backing",
@@ -7184,9 +7178,6 @@ dependencies = [
"moonbeam-xcm-benchmarks",
"nimbus-primitives",
"num_enum 0.5.11",
- "orml-traits",
- "orml-xcm-support",
- "orml-xtokens",
"pallet-asset-manager",
"pallet-assets",
"pallet-async-backing",
@@ -8029,76 +8020,6 @@ dependencies = [
"num-traits",
]
-[[package]]
-name = "orml-traits"
-version = "1.0.0"
-source = "git+https://github.com/moonbeam-foundation/open-runtime-module-library?branch=moonbeam-polkadot-stable2407#61df2a403c5e4f28ad780fdf3136a1fd9e8c3166"
-dependencies = [
- "frame-support",
- "impl-trait-for-tuples",
- "num-traits",
- "orml-utilities",
- "parity-scale-codec",
- "paste",
- "scale-info",
- "serde",
- "sp-core",
- "sp-io",
- "sp-runtime",
- "sp-std",
- "staging-xcm",
-]
-
-[[package]]
-name = "orml-utilities"
-version = "1.0.0"
-source = "git+https://github.com/moonbeam-foundation/open-runtime-module-library?branch=moonbeam-polkadot-stable2407#61df2a403c5e4f28ad780fdf3136a1fd9e8c3166"
-dependencies = [
- "frame-support",
- "parity-scale-codec",
- "scale-info",
- "serde",
- "sp-core",
- "sp-io",
- "sp-runtime",
- "sp-std",
-]
-
-[[package]]
-name = "orml-xcm-support"
-version = "1.0.0"
-source = "git+https://github.com/moonbeam-foundation/open-runtime-module-library?branch=moonbeam-polkadot-stable2407#61df2a403c5e4f28ad780fdf3136a1fd9e8c3166"
-dependencies = [
- "frame-support",
- "orml-traits",
- "parity-scale-codec",
- "sp-runtime",
- "sp-std",
- "staging-xcm",
- "staging-xcm-executor",
-]
-
-[[package]]
-name = "orml-xtokens"
-version = "1.0.0"
-source = "git+https://github.com/moonbeam-foundation/open-runtime-module-library?branch=moonbeam-polkadot-stable2407#61df2a403c5e4f28ad780fdf3136a1fd9e8c3166"
-dependencies = [
- "frame-support",
- "frame-system",
- "log",
- "orml-traits",
- "orml-xcm-support",
- "pallet-xcm",
- "parity-scale-codec",
- "scale-info",
- "serde",
- "sp-io",
- "sp-runtime",
- "sp-std",
- "staging-xcm",
- "staging-xcm-executor",
-]
-
[[package]]
name = "overload"
version = "0.1.1"
@@ -9001,12 +8922,11 @@ dependencies = [
"hex-literal 0.4.1",
"log",
"num_enum 0.5.11",
- "orml-traits",
- "orml-xtokens",
"pallet-balances",
"pallet-evm",
"pallet-timestamp",
"pallet-xcm",
+ "pallet-xcm-transactor",
"parity-scale-codec",
"paste",
"precompile-utils",
@@ -9248,7 +9168,6 @@ dependencies = [
"hex-literal 0.4.1",
"log",
"num_enum 0.5.11",
- "orml-traits",
"pallet-balances",
"pallet-evm",
"pallet-message-queue",
@@ -9369,7 +9288,6 @@ dependencies = [
"frame-system",
"log",
"num_enum 0.5.11",
- "orml-traits",
"pallet-balances",
"pallet-evm",
"pallet-timestamp",
@@ -9402,7 +9320,6 @@ dependencies = [
"frame-support",
"frame-system",
"num_enum 0.5.11",
- "orml-traits",
"pallet-balances",
"pallet-evm",
"pallet-timestamp",
@@ -9436,12 +9353,11 @@ dependencies = [
"frame-system",
"log",
"num_enum 0.5.11",
- "orml-traits",
- "orml-xtokens",
"pallet-balances",
"pallet-evm",
"pallet-timestamp",
"pallet-xcm",
+ "pallet-xcm-transactor",
"parity-scale-codec",
"precompile-utils",
"rustc-hex",
@@ -10418,7 +10334,6 @@ dependencies = [
"frame-support",
"frame-system",
"log",
- "orml-traits",
"pallet-balances",
"pallet-timestamp",
"pallet-xcm",
@@ -18579,7 +18494,6 @@ dependencies = [
"hex",
"impl-trait-for-tuples",
"log",
- "orml-traits",
"pallet-staking",
"parity-scale-codec",
"polkadot-runtime-common",
diff --git a/Cargo.toml b/Cargo.toml
index 761621cf37..9ff6678e5b 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -312,9 +312,6 @@ cumulus-relay-chain-minimal-node = { git = "https://github.com/moonbeam-foundati
cumulus-relay-chain-rpc-interface = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-stable2407" }
# Polkadot / XCM (wasm)
-orml-traits = { git = "https://github.com/moonbeam-foundation/open-runtime-module-library", branch = "moonbeam-polkadot-stable2407", default-features = false }
-orml-xcm-support = { git = "https://github.com/moonbeam-foundation/open-runtime-module-library", branch = "moonbeam-polkadot-stable2407", default-features = false }
-orml-xtokens = { git = "https://github.com/moonbeam-foundation/open-runtime-module-library", branch = "moonbeam-polkadot-stable2407", default-features = false }
pallet-xcm = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-stable2407", default-features = false }
pallet-xcm-benchmarks = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-stable2407", default-features = false }
polkadot-core-primitives = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-stable2407", default-features = false }
@@ -442,7 +439,6 @@ crossbeam-deque = { opt-level = 3 }
crypto-mac = { opt-level = 3 }
curve25519-dalek = { opt-level = 3 }
ed25519-zebra = { opt-level = 3 }
-flate2 = { opt-level = 3 }
futures-channel = { opt-level = 3 }
hash-db = { opt-level = 3 }
hashbrown = { opt-level = 3 }
diff --git a/pallets/parachain-staking/src/set.rs b/pallets/parachain-staking/src/set.rs
index 2fb15ffadf..9db24f4724 100644
--- a/pallets/parachain-staking/src/set.rs
+++ b/pallets/parachain-staking/src/set.rs
@@ -14,8 +14,6 @@
// You should have received a copy of the GNU General Public License
// along with Moonbeam. If not, see .
-/* TODO: use orml_utilities::OrderedSet without leaking substrate v2.0 dependencies*/
-
use frame_support::traits::Get;
use parity_scale_codec::{Decode, Encode};
use scale_info::TypeInfo;
diff --git a/pallets/xcm-transactor/Cargo.toml b/pallets/xcm-transactor/Cargo.toml
index db390ca17e..b2a54ecd14 100644
--- a/pallets/xcm-transactor/Cargo.toml
+++ b/pallets/xcm-transactor/Cargo.toml
@@ -24,7 +24,6 @@ sp-std = { workspace = true }
cumulus-primitives-core = { workspace = true }
# Polkadot / XCM
-orml-traits = { workspace = true }
xcm = { workspace = true }
xcm-builder = { workspace = true }
xcm-executor = { workspace = true }
@@ -47,7 +46,6 @@ std = [
"frame-benchmarking/std",
"frame-support/std",
"frame-system/std",
- "orml-traits/std",
"parity-scale-codec/std",
"sp-io/std",
"sp-runtime/std",
diff --git a/pallets/xcm-transactor/src/encode.rs b/pallets/xcm-transactor/src/encode.rs
index 6d5f3c9113..11e587e2fb 100644
--- a/pallets/xcm-transactor/src/encode.rs
+++ b/pallets/xcm-transactor/src/encode.rs
@@ -21,7 +21,6 @@
//! Module to provide `StakeEncodeCall`, `HrmpEncodeCall` and `UtilityEncodeCall` implementations
//! for the Xcm Transactor pallet
-#![cfg_attr(not(feature = "std"), no_std)]
use frame_support::pallet_prelude::*;
use sp_runtime::traits::{AccountIdLookup, StaticLookup};
use sp_std::prelude::*;
diff --git a/pallets/xcm-transactor/src/lib.rs b/pallets/xcm-transactor/src/lib.rs
index a6ba5b2024..59a3d8fc53 100644
--- a/pallets/xcm-transactor/src/lib.rs
+++ b/pallets/xcm-transactor/src/lib.rs
@@ -100,7 +100,6 @@ pub mod pallet {
dispatch::DispatchResult, pallet_prelude::*, weights::constants::WEIGHT_REF_TIME_PER_SECOND,
};
use frame_system::{ensure_signed, pallet_prelude::*};
- use orml_traits::location::{Parse, Reserve};
use sp_runtime::traits::{AtLeast32BitUnsigned, Bounded, Convert};
use sp_std::boxed::Box;
use sp_std::convert::TryFrom;
@@ -109,7 +108,7 @@ pub mod pallet {
use xcm::{latest::prelude::*, VersionedLocation};
use xcm_executor::traits::{TransactAsset, WeightBounds};
use xcm_primitives::{
- FilterMaxAssetFee, HrmpAvailableCalls, HrmpEncodeCall, UtilityAvailableCalls,
+ FilterMaxAssetFee, HrmpAvailableCalls, HrmpEncodeCall, Reserve, UtilityAvailableCalls,
UtilityEncodeCall, XcmTransact,
};
@@ -180,7 +179,7 @@ pub mod pallet {
/// The way to retrieve the reserve of a Asset. This can be
/// configured to accept absolute or relative paths for self tokens
- type ReserveProvider: Reserve;
+ type ReserveProvider: xcm_primitives::Reserve;
/// The way to filter the max fee to use for HRMP management operations
type MaxHrmpFee: FilterMaxAssetFee;
@@ -1167,8 +1166,9 @@ pub mod pallet {
/// Ensure `dest` has chain part and none recipient part.
fn ensure_valid_dest(dest: &Location) -> Result {
- if let (Some(dest), None) = (dest.chain_part(), dest.non_chain_part()) {
- Ok(dest)
+ let chain_location = dest.chain_location();
+ if *dest == chain_location {
+ Ok(chain_location)
} else {
Err(Error::::InvalidDest.into())
}
diff --git a/pallets/xcm-transactor/src/mock.rs b/pallets/xcm-transactor/src/mock.rs
index f641d187cb..a6576dcccc 100644
--- a/pallets/xcm-transactor/src/mock.rs
+++ b/pallets/xcm-transactor/src/mock.rs
@@ -380,6 +380,10 @@ impl SendXcm for TestSendXcm {
parameter_types! {
pub MaxFee: Asset = (Location::parent(), 1_000_000_000_000u128).into();
+ pub SelfLocationAbsolute: Location = Location {
+ parents: 1,
+ interior: [Parachain(ParachainId::get().into())].into(),
+ };
}
pub type MaxHrmpRelayFee = xcm_builder::Case;
@@ -398,7 +402,7 @@ impl Config for Test {
type UniversalLocation = UniversalLocation;
type BaseXcmWeight = BaseXcmWeight;
type XcmSender = TestSendXcm;
- type ReserveProvider = orml_traits::location::RelativeReserveProvider;
+ type ReserveProvider = xcm_primitives::AbsoluteAndRelativeReserve;
type WeightInfo = ();
type HrmpManipulatorOrigin = EnsureRoot;
type HrmpOpenOrigin = EnsureRoot;
diff --git a/precompiles/gmp/Cargo.toml b/precompiles/gmp/Cargo.toml
index f2ad365014..e46ab48c12 100644
--- a/precompiles/gmp/Cargo.toml
+++ b/precompiles/gmp/Cargo.toml
@@ -13,6 +13,7 @@ slices = { workspace = true }
# Moonbeam
account = { workspace = true }
+pallet-xcm-transactor = { workspace = true }
# Substrate
frame-support = { workspace = true }
@@ -30,8 +31,6 @@ pallet-evm = { workspace = true, features = ["forbid-evm-reentrancy"] }
precompile-utils = { workspace = true }
# Polkadot / XCM
-orml-traits = { workspace = true }
-orml-xtokens = { workspace = true }
pallet-xcm = { workspace = true }
xcm = { workspace = true }
xcm-builder = { workspace = true }
diff --git a/precompiles/gmp/src/lib.rs b/precompiles/gmp/src/lib.rs
index ccd14d0956..6e13b3501d 100644
--- a/precompiles/gmp/src/lib.rs
+++ b/precompiles/gmp/src/lib.rs
@@ -23,19 +23,20 @@ use evm::ExitReason;
use fp_evm::{Context, ExitRevert, PrecompileFailure, PrecompileHandle};
use frame_support::{
dispatch::{GetDispatchInfo, PostDispatchInfo},
- sp_runtime::{traits::Zero, Saturating},
+ sp_runtime::traits::Zero,
traits::ConstU32,
};
use pallet_evm::AddressMapping;
use parity_scale_codec::{Decode, DecodeLimit};
use precompile_utils::{prelude::*, solidity::revert::revert_as_bytes};
use sp_core::{H160, U256};
-use sp_runtime::traits::Dispatchable;
+use sp_runtime::traits::{Convert, Dispatchable};
use sp_std::boxed::Box;
use sp_std::{marker::PhantomData, vec::Vec};
use types::*;
-use xcm::opaque::latest::WeightLimit;
-use xcm_primitives::AccountIdToCurrencyId;
+use xcm::opaque::latest::{Asset, AssetId, Fungibility, WeightLimit};
+use xcm::{VersionedAssets, VersionedLocation};
+use xcm_primitives::{split_location_into_chain_part_and_beneficiary, AccountIdToCurrencyId};
#[cfg(test)]
mod mock;
@@ -45,8 +46,10 @@ mod tests;
pub mod types;
pub type SystemCallOf = ::RuntimeCall;
-pub type CurrencyIdOf = ::CurrencyId;
-pub type XBalanceOf = ::Balance;
+pub type CurrencyIdOf = ::CurrencyId;
+pub type CurrencyIdToLocationOf =
+ ::CurrencyIdToLocation;
+
pub const CALL_DATA_LIMIT: u32 = 2u32.pow(16);
type GetCallDataLimit = ConstU32;
@@ -66,13 +69,15 @@ pub struct GmpPrecompile(PhantomData);
#[precompile_utils::precompile]
impl GmpPrecompile
where
- Runtime: pallet_evm::Config + frame_system::Config + pallet_xcm::Config + orml_xtokens::Config,
+ Runtime: pallet_evm::Config
+ + frame_system::Config
+ + pallet_xcm::Config
+ + pallet_xcm_transactor::Config,
SystemCallOf: Dispatchable + Decode + GetDispatchInfo,
<::RuntimeCall as Dispatchable>::RuntimeOrigin:
From