git.delta.rocks / unique-network / refs/commits / 538e9236a6e0

difftreelog

wip checkpoint. Opal builds.

Ilja Khabarov2022-08-19parent: #83658e7.patch.diff
in: master

8 files changed

modifiedCargo.lockdiffbeforeafterboth
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -5190,7 +5190,10 @@
  "frame-try-runtime",
  "hex-literal",
  "log",
+ "orml-tokens",
+ "orml-traits",
  "orml-vesting",
+ "orml-xtokens",
  "pallet-aura",
  "pallet-balances",
  "pallet-base-fee",
@@ -5202,6 +5205,7 @@
  "pallet-evm-contract-helpers",
  "pallet-evm-migration",
  "pallet-evm-transaction-payment",
+ "pallet-foreing-assets",
  "pallet-fungible",
  "pallet-inflation",
  "pallet-nonfungible",
@@ -5307,6 +5311,53 @@
 ]
 
 [[package]]
+name = "orml-tokens"
+version = "0.4.1-dev"
+source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.27#377213f750755cc48e80a3131eaae63b5eda8362"
+dependencies = [
+ "frame-support",
+ "frame-system",
+ "orml-traits",
+ "parity-scale-codec 3.1.5",
+ "scale-info",
+ "serde",
+ "sp-runtime",
+ "sp-std",
+]
+
+[[package]]
+name = "orml-traits"
+version = "0.4.1-dev"
+source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.27#377213f750755cc48e80a3131eaae63b5eda8362"
+dependencies = [
+ "frame-support",
+ "impl-trait-for-tuples",
+ "num-traits",
+ "orml-utilities",
+ "parity-scale-codec 3.1.5",
+ "scale-info",
+ "serde",
+ "sp-io",
+ "sp-runtime",
+ "sp-std",
+ "xcm",
+]
+
+[[package]]
+name = "orml-utilities"
+version = "0.4.1-dev"
+source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.27#377213f750755cc48e80a3131eaae63b5eda8362"
+dependencies = [
+ "frame-support",
+ "parity-scale-codec 3.1.5",
+ "scale-info",
+ "serde",
+ "sp-io",
+ "sp-runtime",
+ "sp-std",
+]
+
+[[package]]
 name = "orml-vesting"
 version = "0.4.1-dev"
 source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.27#377213f750755cc48e80a3131eaae63b5eda8362"
@@ -5322,6 +5373,41 @@
 ]
 
 [[package]]
+name = "orml-xcm-support"
+version = "0.4.1-dev"
+source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.27#377213f750755cc48e80a3131eaae63b5eda8362"
+dependencies = [
+ "frame-support",
+ "orml-traits",
+ "parity-scale-codec 3.1.5",
+ "sp-runtime",
+ "sp-std",
+ "xcm",
+ "xcm-executor",
+]
+
+[[package]]
+name = "orml-xtokens"
+version = "0.4.1-dev"
+source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.27#377213f750755cc48e80a3131eaae63b5eda8362"
+dependencies = [
+ "cumulus-primitives-core",
+ "frame-support",
+ "frame-system",
+ "orml-traits",
+ "orml-xcm-support",
+ "pallet-xcm",
+ "parity-scale-codec 3.1.5",
+ "scale-info",
+ "serde",
+ "sp-io",
+ "sp-runtime",
+ "sp-std",
+ "xcm",
+ "xcm-executor",
+]
+
+[[package]]
 name = "os_str_bytes"
 version = "6.3.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -5789,6 +5875,33 @@
 ]
 
 [[package]]
+name = "pallet-foreing-assets"
+version = "0.1.0"
+dependencies = [
+ "frame-support",
+ "frame-system",
+ "hex",
+ "log",
+ "orml-tokens",
+ "pallet-balances",
+ "pallet-common",
+ "pallet-fungible",
+ "pallet-timestamp",
+ "parity-scale-codec 3.1.5",
+ "scale-info",
+ "serde",
+ "serde_json",
+ "sp-core",
+ "sp-io",
+ "sp-runtime",
+ "sp-std",
+ "up-data-structs",
+ "xcm",
+ "xcm-builder",
+ "xcm-executor",
+]
+
+[[package]]
 name = "pallet-fungible"
 version = "0.1.3"
 dependencies = [
@@ -12130,7 +12243,7 @@
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675"
 dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if 0.1.10",
  "digest 0.10.3",
  "rand 0.8.5",
  "static_assertions",
@@ -12473,7 +12586,7 @@
 
 [[package]]
 name = "up-common"
-version = "0.9.25"
+version = "0.9.27"
 dependencies = [
  "fp-rpc",
  "frame-support",
modifiedpallets/foreing-assets/Cargo.tomldiffbeforeafterboth
--- a/pallets/foreing-assets/Cargo.toml
+++ b/pallets/foreing-assets/Cargo.toml
@@ -9,26 +9,29 @@
 serde = { version = "1.0.136", optional = true }
 scale-info = { version = "2.0.1", default-features = false, features = ["derive"] }
 codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false }
-sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false }
-sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false  }
-frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false }
-frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false }
+sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27", default-features = false }
+sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27", default-features = false  }
+frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27", default-features = false }
+frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27", default-features = false }
 up-data-structs = { default-features = false, path = '../../primitives/data-structs' }
-pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false }
+pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27", default-features = false }
 pallet-common = { default-features = false, path = '../common' }
 pallet-fungible = { default-features = false, path = '../fungible' }
-xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.24", default-features = false }
-xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.24", default-features = false }
-xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.24", default-features = false }
-orml-tokens = { git = 'https://github.com/UniqueNetwork/open-runtime-module-library', branch = 'unique-polkadot-v0.9.24', version = "0.4.1-dev", default-features = false }
+xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.27", default-features = false }
+xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.27", default-features = false }
+xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.27", default-features = false }
+#orml-tokens = { git = 'https://github.com/UniqueNetwork/open-runtime-module-library', branch = 'unique-polkadot-v0.9.24', version = "0.4.1-dev", default-features = false }
+orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.27", version = "0.4.1-dev", default-features = false }
+#git = "https://github.com/open-web3-stack/open-runtime-module-library"
+#branch = "polkadot-v0.9.27"
 
 [dev-dependencies]
 serde_json = "1.0.68"
 hex = { version = "0.4" }
-sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" }
-sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" }
-pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" }
-pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" }
+sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
+sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
+pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
+pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
 
 [features]
 default = ["std"]
modifiedpallets/fungible/src/lib.rsdiffbeforeafterboth
--- a/pallets/fungible/src/lib.rs
+++ b/pallets/fungible/src/lib.rs
@@ -167,8 +167,14 @@
 		Value = u128,
 		QueryKind = ValueQuery,
 	>;
+
+	/// Foreign collection flag
+	#[pallet::storage]
+	pub type ForeignCollection<T: Config> =
+	StorageMap<Hasher = Twox64Concat, Key = CollectionId, Value = bool, QueryKind = ValueQuery>;
 }
 
+
 /// Wrapper around untyped collection handle, asserting inner collection is of fungible type.
 /// Required for interaction with Fungible collections, type safety and implementation [`solidity_interface`][`evm_coder::solidity_interface`].
 pub struct FungibleHandle<T: Config>(pallet_common::CollectionHandle<T>);
@@ -215,6 +221,16 @@
 		<PalletCommon<T>>::init_collection(owner, data, false)
 	}
 
+	/// Initializes the collection with ForeignCollection flag. Returns [CollectionId] on success, [DispatchError] otherwise.
+	pub fn init_foreign_collection(
+		owner: T::CrossAccountId,
+		data: CreateCollectionData<T::AccountId>,
+	) -> Result<CollectionId, DispatchError> {
+		let id = <PalletCommon<T>>::init_collection(owner, data, false)?;
+		<ForeignCollection<T>>::insert(id, true);
+		Ok(id)
+	}
+
 	/// Destroys a collection.
 	pub fn destroy_collection(
 		collection: FungibleHandle<T>,
@@ -230,6 +246,7 @@
 
 		PalletCommon::destroy_collection(collection.0, sender)?;
 
+		<ForeignCollection<T>>::remove(id);
 		<TotalSupply<T>>::remove(id);
 		let _ = <Balance<T>>::clear_prefix((id,), u32::MAX, None);
 		let _ = <Allowance<T>>::clear_prefix((id,), u32::MAX, None);
@@ -257,6 +274,12 @@
 			.checked_sub(amount)
 			.ok_or(<CommonError<T>>::TokenValueTooLow)?;
 
+		// Foreign collection check
+		ensure!(
+			!<ForeignCollection<T>>::get(collection.id),
+			<CommonError<T>>::NoPermission
+		);
+
 		if collection.permissions.access() == AccessMode::AllowList {
 			collection.check_allowlist(owner)?;
 		}
@@ -288,6 +311,46 @@
 		Ok(())
 	}
 
+	/// Burns the specified amount of the token.
+	pub fn burn_foreign(
+		collection: &FungibleHandle<T>,
+		owner: &T::CrossAccountId,
+		amount: u128,
+	) -> DispatchResult {
+		let total_supply = <TotalSupply<T>>::get(collection.id)
+			.checked_sub(amount)
+			.ok_or(<CommonError<T>>::TokenValueTooLow)?;
+
+		let balance = <Balance<T>>::get((collection.id, owner))
+			.checked_sub(amount)
+			.ok_or(<CommonError<T>>::TokenValueTooLow)?;
+		// =========
+
+		if balance == 0 {
+			<Balance<T>>::remove((collection.id, owner));
+			<PalletStructure<T>>::unnest_if_nested(owner, collection.id, TokenId::default());
+		} else {
+			<Balance<T>>::insert((collection.id, owner), balance);
+		}
+		<TotalSupply<T>>::insert(collection.id, total_supply);
+
+		<PalletEvm<T>>::deposit_log(
+			ERC20Events::Transfer {
+				from: *owner.as_eth(),
+				to: H160::default(),
+				value: amount.into(),
+			}
+				.to_log(collection_id_to_address(collection.id)),
+		);
+		<PalletCommon<T>>::deposit_event(CommonEvent::ItemDestroyed(
+			collection.id,
+			TokenId::default(),
+			owner.clone(),
+			amount,
+		));
+		Ok(())
+	}
+
 	/// Transfers the specified amount of tokens. Will check that
 	/// the transfer is allowed for the token.
 	///
@@ -373,6 +436,12 @@
 		data: BTreeMap<T::CrossAccountId, u128>,
 		nesting_budget: &dyn Budget,
 	) -> DispatchResult {
+		// Foreign collection check
+		ensure!(
+			!<ForeignCollection<T>>::get(collection.id),
+			<CommonError<T>>::NoPermission
+		);
+
 		if !collection.is_owner_or_admin(sender) {
 			ensure!(
 				collection.permissions.mint_mode(),
@@ -442,6 +511,68 @@
 		Ok(())
 	}
 
+	/// Minting tokens for multiple IDs.
+	/// See [`create_item_foreign`][`Pallet::create_item_foreign`] for more details.
+	pub fn create_multiple_items_foreign(
+		collection: &FungibleHandle<T>,
+		sender: &T::CrossAccountId,
+		data: BTreeMap<T::CrossAccountId, u128>,
+		nesting_budget: &dyn Budget,
+	) -> DispatchResult {
+		let total_supply = data
+			.iter()
+			.map(|(_, v)| *v)
+			.try_fold(<TotalSupply<T>>::get(collection.id), |acc, v| {
+				acc.checked_add(v)
+			})
+			.ok_or(ArithmeticError::Overflow)?;
+
+		let mut balances = data;
+		for (k, v) in balances.iter_mut() {
+			*v = <Balance<T>>::get((collection.id, &k))
+				.checked_add(*v)
+				.ok_or(ArithmeticError::Overflow)?;
+		}
+
+		for (to, _) in balances.iter() {
+			<PalletStructure<T>>::check_nesting(
+				sender.clone(),
+				to,
+				collection.id,
+				TokenId::default(),
+				nesting_budget,
+			)?;
+		}
+
+		// =========
+
+		<TotalSupply<T>>::insert(collection.id, total_supply);
+		for (user, amount) in balances {
+			<Balance<T>>::insert((collection.id, &user), amount);
+			<PalletStructure<T>>::nest_if_sent_to_token_unchecked(
+				&user,
+				collection.id,
+				TokenId::default(),
+			);
+			<PalletEvm<T>>::deposit_log(
+				ERC20Events::Transfer {
+					from: H160::default(),
+					to: *user.as_eth(),
+					value: amount.into(),
+				}
+					.to_log(collection_id_to_address(collection.id)),
+			);
+			<PalletCommon<T>>::deposit_event(CommonEvent::ItemCreated(
+				collection.id,
+				TokenId::default(),
+				user.clone(),
+				amount,
+			));
+		}
+
+		Ok(())
+	}
+
 	fn set_allowance_unchecked(
 		collection: &FungibleHandle<T>,
 		owner: &T::CrossAccountId,
@@ -615,6 +746,24 @@
 		)
 	}
 
+	///	Creates fungible token.
+	///
+	/// - `data`: Contains user who will become the owners of the tokens and amount
+	///   of tokens he will receive.
+	pub fn create_item_foreign(
+		collection: &FungibleHandle<T>,
+		sender: &T::CrossAccountId,
+		data: CreateItemData<T>,
+		nesting_budget: &dyn Budget,
+	) -> DispatchResult {
+		Self::create_multiple_items_foreign(
+			collection,
+			sender,
+			[(data.0, data.1)].into_iter().collect(),
+			nesting_budget,
+		)
+	}
+
 	/// Returns 10 tokens owners in no particular order
 	///
 	/// There is no direct way to get token holders in ascending order,
addedruntime/common/config/pallets/foreign_asset.rsdiffbeforeafterboth
--- /dev/null
+++ b/runtime/common/config/pallets/foreign_asset.rs
@@ -0,0 +1,9 @@
+use crate::{Runtime, Event, Balances};
+use up_common::types::AccountId;
+
+impl pallet_foreing_assets::Config for Runtime {
+    type Event = Event;
+    type Currency = Balances;
+    type RegisterOrigin = frame_system::EnsureRoot<AccountId>;
+    type WeightInfo = ();
+}
modifiedruntime/common/config/pallets/mod.rsdiffbeforeafterboth
--- a/runtime/common/config/pallets/mod.rs
+++ b/runtime/common/config/pallets/mod.rs
@@ -40,6 +40,9 @@
 #[cfg(feature = "scheduler")]
 pub mod scheduler;
 
+#[cfg(feature = "foreign-asset")]
+pub mod foreign_asset;
+
 parameter_types! {
 	pub TreasuryAccountId: AccountId = TreasuryModuleId::get().into_account_truncating();
 	pub const CollectionCreationPrice: Balance = 2 * UNIQUE;
modifiedruntime/common/construct_runtime/mod.rsdiffbeforeafterboth
before · runtime/common/construct_runtime/mod.rs
1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617mod util;1819#[macro_export]20macro_rules! construct_runtime {21    ($select_runtime:ident) => {22        $crate::construct_runtime_impl! {23            select_runtime($select_runtime);2425            pub enum Runtime where26                Block = Block,27                NodeBlock = opaque::Block,28                UncheckedExtrinsic = UncheckedExtrinsic29            {30                System: frame_system = 0,3132                ParachainSystem: cumulus_pallet_parachain_system::{Pallet, Call, Config, Storage, Inherent, Event<T>, ValidateUnsigned} = 20,33                ParachainInfo: parachain_info::{Pallet, Storage, Config} = 21,3435                Aura: pallet_aura::{Pallet, Config<T>} = 22,36                AuraExt: cumulus_pallet_aura_ext::{Pallet, Config} = 23,3738                Balances: pallet_balances::{Pallet, Call, Storage, Config<T>, Event<T>} = 30,39                RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Pallet, Storage} = 31,40                Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 32,41                TransactionPayment: pallet_transaction_payment::{Pallet, Storage, Event<T>} = 33,42                Treasury: pallet_treasury::{Pallet, Call, Storage, Config, Event<T>} = 34,43                Sudo: pallet_sudo::{Pallet, Call, Storage, Config<T>, Event<T>} = 35,44                Vesting: orml_vesting::{Pallet, Storage, Call, Event<T>, Config<T>} = 37,45                // Vesting: pallet_vesting::{Pallet, Call, Config<T>, Storage, Event<T>} = 37,46                // Contracts: pallet_contracts::{Pallet, Call, Storage, Event<T>} = 38,4748                // XCM helpers.49                XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event<T>} = 50,50                PolkadotXcm: pallet_xcm::{Pallet, Call, Event<T>, Origin} = 51,51                CumulusXcm: cumulus_pallet_xcm::{Pallet, Call, Event<T>, Origin} = 52,52                DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event<T>} = 53,5354                // Unique Pallets55                Inflation: pallet_inflation::{Pallet, Call, Storage} = 60,56                Unique: pallet_unique::{Pallet, Call, Storage, Event<T>} = 61,5758                #[runtimes(opal)]59                Scheduler: pallet_unique_scheduler::{Pallet, Call, Storage, Event<T>} = 62,6061                Configuration: pallet_configuration::{Pallet, Call, Storage} = 63,6263                Charging: pallet_charge_transaction::{Pallet, Call, Storage } = 64,64                // ContractHelpers: pallet_contract_helpers::{Pallet, Call, Storage} = 65,65                Common: pallet_common::{Pallet, Storage, Event<T>} = 66,66                Fungible: pallet_fungible::{Pallet, Storage} = 67,6768                #[runtimes(opal)]69                Refungible: pallet_refungible::{Pallet, Storage} = 68,7071                Nonfungible: pallet_nonfungible::{Pallet, Storage} = 69,72                Structure: pallet_structure::{Pallet, Call, Storage, Event<T>} = 70,7374                #[runtimes(opal)]75                RmrkCore: pallet_proxy_rmrk_core::{Pallet, Call, Storage, Event<T>} = 71,7677                #[runtimes(opal)]78                RmrkEquip: pallet_proxy_rmrk_equip::{Pallet, Call, Storage, Event<T>} = 72,7980                #[runtimes(opal)]81                ForeingAssets: pallet_foreing_assets::{Pallet, Call, Storage, Event<T>} = 80,8283                // Frontier84                EVM: pallet_evm::{Pallet, Config, Call, Storage, Event<T>} = 100,85                Ethereum: pallet_ethereum::{Pallet, Config, Call, Storage, Event, Origin} = 101,8687                EvmCoderSubstrate: pallet_evm_coder_substrate::{Pallet, Storage} = 150,88                EvmContractHelpers: pallet_evm_contract_helpers::{Pallet, Storage} = 151,89                EvmTransactionPayment: pallet_evm_transaction_payment::{Pallet} = 152,90                EvmMigration: pallet_evm_migration::{Pallet, Call, Storage} = 153,91            }92        }93    }94}
after · runtime/common/construct_runtime/mod.rs
1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617mod util;1819#[macro_export]20macro_rules! construct_runtime {21    ($select_runtime:ident) => {22        $crate::construct_runtime_impl! {23            select_runtime($select_runtime);2425            pub enum Runtime where26                Block = Block,27                NodeBlock = opaque::Block,28                UncheckedExtrinsic = UncheckedExtrinsic29            {30                System: frame_system = 0,3132                ParachainSystem: cumulus_pallet_parachain_system::{Pallet, Call, Config, Storage, Inherent, Event<T>, ValidateUnsigned} = 20,33                ParachainInfo: parachain_info::{Pallet, Storage, Config} = 21,3435                Aura: pallet_aura::{Pallet, Config<T>} = 22,36                AuraExt: cumulus_pallet_aura_ext::{Pallet, Config} = 23,3738                Balances: pallet_balances::{Pallet, Call, Storage, Config<T>, Event<T>} = 30,39                RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Pallet, Storage} = 31,40                Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 32,41                TransactionPayment: pallet_transaction_payment::{Pallet, Storage, Event<T>} = 33,42                Treasury: pallet_treasury::{Pallet, Call, Storage, Config, Event<T>} = 34,43                Sudo: pallet_sudo::{Pallet, Call, Storage, Config<T>, Event<T>} = 35,44                Vesting: orml_vesting::{Pallet, Storage, Call, Event<T>, Config<T>} = 37,45                XTokens: orml_xtokens = 38,46                Tokens: orml_tokens = 39,47                // Vesting: pallet_vesting::{Pallet, Call, Config<T>, Storage, Event<T>} = 37,48                // Contracts: pallet_contracts::{Pallet, Call, Storage, Event<T>} = 38,4950                // XCM helpers.51                XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event<T>} = 50,52                PolkadotXcm: pallet_xcm::{Pallet, Call, Event<T>, Origin} = 51,53                CumulusXcm: cumulus_pallet_xcm::{Pallet, Call, Event<T>, Origin} = 52,54                DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event<T>} = 53,5556                // Unique Pallets57                Inflation: pallet_inflation::{Pallet, Call, Storage} = 60,58                Unique: pallet_unique::{Pallet, Call, Storage, Event<T>} = 61,5960                #[runtimes(opal)]61                Scheduler: pallet_unique_scheduler::{Pallet, Call, Storage, Event<T>} = 62,6263                Configuration: pallet_configuration::{Pallet, Call, Storage} = 63,6465                Charging: pallet_charge_transaction::{Pallet, Call, Storage } = 64,66                // ContractHelpers: pallet_contract_helpers::{Pallet, Call, Storage} = 65,67                Common: pallet_common::{Pallet, Storage, Event<T>} = 66,68                Fungible: pallet_fungible::{Pallet, Storage} = 67,6970                #[runtimes(opal)]71                Refungible: pallet_refungible::{Pallet, Storage} = 68,7273                Nonfungible: pallet_nonfungible::{Pallet, Storage} = 69,74                Structure: pallet_structure::{Pallet, Call, Storage, Event<T>} = 70,7576                #[runtimes(opal)]77                RmrkCore: pallet_proxy_rmrk_core::{Pallet, Call, Storage, Event<T>} = 71,7879                #[runtimes(opal)]80                RmrkEquip: pallet_proxy_rmrk_equip::{Pallet, Call, Storage, Event<T>} = 72,8182                #[runtimes(opal)]83                ForeingAssets: pallet_foreing_assets::{Pallet, Call, Storage, Event<T>} = 80,8485                // Frontier86                EVM: pallet_evm::{Pallet, Config, Call, Storage, Event<T>} = 100,87                Ethereum: pallet_ethereum::{Pallet, Config, Call, Storage, Event, Origin} = 101,8889                EvmCoderSubstrate: pallet_evm_coder_substrate::{Pallet, Storage} = 150,90                EvmContractHelpers: pallet_evm_contract_helpers::{Pallet, Storage} = 151,91                EvmTransactionPayment: pallet_evm_transaction_payment::{Pallet} = 152,92                EvmMigration: pallet_evm_migration::{Pallet, Call, Storage} = 153,93            }94        }95    }96}
modifiedruntime/opal/Cargo.tomldiffbeforeafterboth
--- a/runtime/opal/Cargo.toml
+++ b/runtime/opal/Cargo.toml
@@ -120,13 +120,18 @@
     'up-sponsorship/std',
 
     "orml-vesting/std",
+    "orml-tokens/std",
+    "orml-xtokens/std",
+    "orml-traits/std",
+    "pallet-foreing-assets/std"
 ]
 limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing']
-opal-runtime = ['refungible', 'scheduler', 'rmrk']
+opal-runtime = ['refungible', 'scheduler', 'rmrk', 'foreign-asset']
 
 refungible = []
 scheduler = []
 rmrk = []
+foreign-asset = []
 
 ################################################################################
 # Substrate Dependencies
@@ -399,6 +404,24 @@
 version = "0.4.1-dev"
 default-features = false
 
+[dependencies.orml-xtokens]
+git = "https://github.com/open-web3-stack/open-runtime-module-library"
+branch = "polkadot-v0.9.27"
+version = "0.4.1-dev"
+default-features = false
+
+[dependencies.orml-tokens]
+git = "https://github.com/open-web3-stack/open-runtime-module-library"
+branch = "polkadot-v0.9.27"
+version = "0.4.1-dev"
+default-features = false
+
+[dependencies.orml-traits]
+git = "https://github.com/open-web3-stack/open-runtime-module-library"
+branch = "polkadot-v0.9.27"
+version = "0.4.1-dev"
+default-features = false
+
 ################################################################################
 # local dependencies
 
@@ -437,6 +460,7 @@
 fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
 evm-coder = { default-features = false, path = '../../crates/evm-coder' }
 up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.27' }
+pallet-foreing-assets = { default-features = false, path = "../../pallets/foreing-assets" }
 
 ################################################################################
 # Build Dependencies
modifiedruntime/opal/src/lib.rsdiffbeforeafterboth
--- a/runtime/opal/src/lib.rs
+++ b/runtime/opal/src/lib.rs
@@ -35,6 +35,8 @@
 #[path = "../../common/mod.rs"]
 mod runtime_common;
 
+pub mod xcm_config;
+
 pub use runtime_common::*;
 
 pub const RUNTIME_NAME: &str = "opal";