git.delta.rocks / unique-network / refs/commits / 22251a0f47f9

difftreelog

CORE-300 Move CrossAccountId to frontier

Trubnikov Sergey2022-03-14parent: #3ab9e10.patch.diff
in: master

27 files changed

modifiedCargo.lockdiffbeforeafterboth
2554 "fc-db",2554 "fc-db",
2555 "fc-rpc-core",2555 "fc-rpc-core",
2556 "fp-consensus",2556 "fp-consensus",
2557 "fp-evm",2557 "fp-evm 3.0.0-dev (git+https://github.com/uniquenetwork/frontier.git?branch=unique-polkadot-v0.9.17)",
2558 "fp-rpc",2558 "fp-rpc",
2559 "fp-storage",2559 "fp-storage",
2560 "futures 0.3.21",2560 "futures 0.3.21",
2565 "log",2565 "log",
2566 "lru 0.6.6",2566 "lru 0.6.6",
2567 "pallet-ethereum",2567 "pallet-ethereum",
2568 "pallet-evm",2568 "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier.git?branch=unique-polkadot-v0.9.17)",
2569 "parity-scale-codec",2569 "parity-scale-codec",
2570 "parking_lot 0.11.2",2570 "parking_lot 0.11.2",
2571 "rand 0.7.3",2571 "rand 0.7.3",
2757dependencies = [2757dependencies = [
2758 "ethereum",2758 "ethereum",
2759 "ethereum-types",2759 "ethereum-types",
2760 "fp-evm",2760 "fp-evm 3.0.0-dev (git+https://github.com/uniquenetwork/frontier.git?branch=unique-polkadot-v0.9.17)",
2761 "parity-scale-codec",2761 "parity-scale-codec",
2762 "scale-info",2762 "scale-info",
2763 "sp-api",2763 "sp-api",
2852 "sp-trie",2852 "sp-trie",
2853]2853]
2854
2855[[package]]
2856name = "frame-common"
2857version = "0.1.0"
2858source = "git+https://github.com/uniquenetwork/frontier.git?branch=feature/300#0a1dc4086cbe971ddf57edf82a61cfce52c8c20b"
2859dependencies = [
2860 "frame-system",
2861 "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier.git?branch=feature/300)",
2862 "parity-scale-codec",
2863 "scale-info",
2864 "serde",
2865 "sp-core",
2866 "sp-std",
2867 "up-evm-mapping",
2868]
28542869
2855[[package]]2870[[package]]
2856name = "frame-election-provider-support"2871name = "frame-election-provider-support"
5835dependencies = [5850dependencies = [
5836 "frame-support",5851 "frame-support",
5837 "frame-system",5852 "frame-system",
5838 "pallet-evm",5853 "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier.git?branch=unique-polkadot-v0.9.17)",
5839 "parity-scale-codec",5854 "parity-scale-codec",
5840 "scale-info",5855 "scale-info",
5841 "serde",5856 "serde",
5984version = "0.1.0"5999version = "0.1.0"
5985dependencies = [6000dependencies = [
5986 "evm-coder",6001 "evm-coder",
6002 "frame-common",
5987 "frame-support",6003 "frame-support",
5988 "frame-system",6004 "frame-system",
5989 "pallet-evm",6005 "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier.git?branch=unique-polkadot-v0.9.17)",
5990 "pallet-evm-coder-substrate",6006 "pallet-evm-coder-substrate",
5991 "parity-scale-codec",6007 "parity-scale-codec",
5992 "scale-info",6008 "scale-info",
6064 "ethereum-types",6080 "ethereum-types",
6065 "evm",6081 "evm",
6066 "fp-consensus",6082 "fp-consensus",
6067 "fp-evm",6083 "fp-evm 3.0.0-dev (git+https://github.com/uniquenetwork/frontier.git?branch=unique-polkadot-v0.9.17)",
6068 "fp-rpc",6084 "fp-rpc",
6069 "fp-self-contained",6085 "fp-self-contained",
6070 "fp-storage",6086 "fp-storage",
6071 "frame-support",6087 "frame-support",
6072 "frame-system",6088 "frame-system",
6073 "log",6089 "log",
6074 "pallet-balances",6090 "pallet-balances",
6075 "pallet-evm",6091 "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier.git?branch=unique-polkadot-v0.9.17)",
6076 "pallet-timestamp",6092 "pallet-timestamp",
6077 "parity-scale-codec",6093 "parity-scale-codec",
6078 "rlp",6094 "rlp",
6093 "evm",6109 "evm",
6094 "evm-gasometer",6110 "evm-gasometer",
6095 "evm-runtime",6111 "evm-runtime",
6096 "fp-evm",6112 "fp-evm 3.0.0-dev (git+https://github.com/uniquenetwork/frontier.git?branch=unique-polkadot-v0.9.17)",
6097 "frame-benchmarking",6113 "frame-benchmarking",
6098 "frame-support",6114 "frame-support",
6099 "frame-system",6115 "frame-system",
6124 "frame-support",6140 "frame-support",
6125 "frame-system",6141 "frame-system",
6126 "pallet-ethereum",6142 "pallet-ethereum",
6127 "pallet-evm",6143 "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier.git?branch=unique-polkadot-v0.9.17)",
6128 "parity-scale-codec",6144 "parity-scale-codec",
6129 "scale-info",6145 "scale-info",
6130 "sp-core",6146 "sp-core",
6139 "frame-support",6155 "frame-support",
6140 "frame-system",6156 "frame-system",
6141 "log",6157 "log",
6142 "pallet-evm",6158 "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier.git?branch=unique-polkadot-v0.9.17)",
6143 "pallet-evm-coder-substrate",6159 "pallet-evm-coder-substrate",
6144 "parity-scale-codec",6160 "parity-scale-codec",
6145 "scale-info",6161 "scale-info",
6154name = "pallet-evm-migration"6170name = "pallet-evm-migration"
6155version = "0.1.0"6171version = "0.1.0"
6156dependencies = [6172dependencies = [
6157 "fp-evm",6173 "fp-evm 3.0.0-dev (git+https://github.com/uniquenetwork/frontier.git?branch=unique-polkadot-v0.9.17)",
6158 "frame-benchmarking",6174 "frame-benchmarking",
6159 "frame-support",6175 "frame-support",
6160 "frame-system",6176 "frame-system",
6161 "pallet-evm",6177 "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier.git?branch=unique-polkadot-v0.9.17)",
6162 "parity-scale-codec",6178 "parity-scale-codec",
6163 "scale-info",6179 "scale-info",
6164 "sp-core",6180 "sp-core",
6171name = "pallet-evm-transaction-payment"6187name = "pallet-evm-transaction-payment"
6172version = "0.1.0"6188version = "0.1.0"
6173dependencies = [6189dependencies = [
6174 "fp-evm",6190 "fp-evm 3.0.0-dev (git+https://github.com/uniquenetwork/frontier.git?branch=unique-polkadot-v0.9.17)",
6175 "frame-support",6191 "frame-support",
6176 "frame-system",6192 "frame-system",
6177 "pallet-ethereum",6193 "pallet-ethereum",
6178 "pallet-evm",6194 "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier.git?branch=unique-polkadot-v0.9.17)",
6179 "parity-scale-codec",6195 "parity-scale-codec",
6180 "scale-info",6196 "scale-info",
6181 "sp-core",6197 "sp-core",
6193 "ethereum",6209 "ethereum",
6194 "evm-coder",6210 "evm-coder",
6195 "frame-benchmarking",6211 "frame-benchmarking",
6212 "frame-common",
6196 "frame-support",6213 "frame-support",
6197 "frame-system",6214 "frame-system",
6198 "pallet-common",6215 "pallet-common",
6419 "ethereum",6436 "ethereum",
6420 "evm-coder",6437 "evm-coder",
6421 "frame-benchmarking",6438 "frame-benchmarking",
6439 "frame-common",
6422 "frame-support",6440 "frame-support",
6423 "frame-system",6441 "frame-system",
6424 "pallet-common",6442 "pallet-common",
6535version = "0.1.0"6553version = "0.1.0"
6536dependencies = [6554dependencies = [
6537 "frame-benchmarking",6555 "frame-benchmarking",
6556 "frame-common",
6538 "frame-support",6557 "frame-support",
6539 "frame-system",6558 "frame-system",
6540 "pallet-common",6559 "pallet-common",
6795dependencies = [6814dependencies = [
6796 "ethereum",6815 "ethereum",
6797 "evm-coder",6816 "evm-coder",
6798 "fp-evm",6817 "fp-evm 3.0.0-dev (git+https://github.com/uniquenetwork/frontier.git?branch=unique-polkadot-v0.9.17)",
6799 "frame-benchmarking",6818 "frame-benchmarking",
6819 "frame-common",
6800 "frame-support",6820 "frame-support",
6801 "frame-system",6821 "frame-system",
6802 "hex-literal",6822 "hex-literal",
6803 "pallet-balances",6823 "pallet-balances",
6804 "pallet-common",6824 "pallet-common",
6805 "pallet-ethereum",6825 "pallet-ethereum",
6806 "pallet-evm",6826 "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier.git?branch=unique-polkadot-v0.9.17)",
6807 "pallet-evm-coder-substrate",6827 "pallet-evm-coder-substrate",
6808 "pallet-fungible",6828 "pallet-fungible",
6809 "pallet-nonfungible",6829 "pallet-nonfungible",
12186 "chrono",12206 "chrono",
12187 "lazy_static",12207 "lazy_static",
12188 "matchers",12208 "matchers",
12189 "parking_lot 0.11.2",12209 "parking_lot 0.10.2",
12190 "regex",12210 "regex",
12191 "serde",12211 "serde",
12192 "serde_json",12212 "serde_json",
12333name = "uc-rpc"12353name = "uc-rpc"
12334version = "0.1.0"12354version = "0.1.0"
12335dependencies = [12355dependencies = [
12356 "frame-common",
12336 "jsonrpc-core",12357 "jsonrpc-core",
12337 "jsonrpc-core-client",12358 "jsonrpc-core-client",
12338 "jsonrpc-derive",12359 "jsonrpc-derive",
12549 "fp-rpc",12570 "fp-rpc",
12550 "fp-self-contained",12571 "fp-self-contained",
12551 "frame-benchmarking",12572 "frame-benchmarking",
12573 "frame-common",
12552 "frame-executive",12574 "frame-executive",
12553 "frame-support",12575 "frame-support",
12554 "frame-system",12576 "frame-system",
12561 "pallet-base-fee",12583 "pallet-base-fee",
12562 "pallet-common",12584 "pallet-common",
12563 "pallet-ethereum",12585 "pallet-ethereum",
12564 "pallet-evm",12586 "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier.git?branch=unique-polkadot-v0.9.17)",
12565 "pallet-evm-coder-substrate",12587 "pallet-evm-coder-substrate",
12566 "pallet-evm-contract-helpers",12588 "pallet-evm-contract-helpers",
12567 "pallet-evm-migration",12589 "pallet-evm-migration",
12688[[package]]12710[[package]]
12689name = "up-evm-mapping"12711name = "up-evm-mapping"
12690version = "0.1.0"12712version = "0.1.0"
12713source = "git+https://github.com/uniquenetwork/frontier.git?branch=feature/300#0a1dc4086cbe971ddf57edf82a61cfce52c8c20b"
12691dependencies = [12714dependencies = [
12692 "frame-support",12715 "frame-support",
12693 "sp-core",12716 "sp-core",
12697name = "up-rpc"12720name = "up-rpc"
12698version = "0.1.0"12721version = "0.1.0"
12699dependencies = [12722dependencies = [
12723 "frame-common",
12700 "pallet-common",12724 "pallet-common",
12701 "parity-scale-codec",12725 "parity-scale-codec",
12702 "sp-api",12726 "sp-api",
modifiedclient/rpc/Cargo.tomldiffbeforeafterboth
--- a/client/rpc/Cargo.toml
+++ b/client/rpc/Cargo.toml
@@ -18,3 +18,4 @@
 sp-core = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.18" }
 sp-rpc = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.18" }
 sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.18" }
+frame-common = { default-features = false, git = "https://github.com/uniquenetwork/frontier.git", branch = "feature/300" }
modifiedclient/rpc/src/lib.rsdiffbeforeafterboth
--- a/client/rpc/src/lib.rs
+++ b/client/rpc/src/lib.rs
@@ -201,7 +201,7 @@
 	AccountId: Decode,
 	C: 'static + ProvideRuntimeApi<Block> + HeaderBackend<Block>,
 	C::Api: UniqueRuntimeApi<Block, CrossAccountId, AccountId>,
-	CrossAccountId: pallet_common::account::CrossAccountId<AccountId>,
+	CrossAccountId: frame_common::account::CrossAccountId<AccountId>,
 {
 	pass_method!(account_tokens(collection: CollectionId, account: CrossAccountId) -> Vec<TokenId>);
 	pass_method!(token_exists(collection: CollectionId, token: TokenId) -> bool);
modifiedpallets/common/Cargo.tomldiffbeforeafterboth
--- a/pallets/common/Cargo.toml
+++ b/pallets/common/Cargo.toml
@@ -16,11 +16,12 @@
 sp-runtime = { default-features = false, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.18' }
 sp-std = { default-features = false, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.18' }
 sp-core = { default-features = false, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.18' }
-up-evm-mapping = { default-features = false, path = '../../primitives/evm-mapping' }
 up-data-structs = { default-features = false, path = '../../primitives/data-structs' }
 pallet-evm-coder-substrate = { default-features = false, path = '../../pallets/evm-coder-substrate' }
 evm-coder = { default-features = false, path = '../../crates/evm-coder' }
 pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier.git", branch = "unique-polkadot-v0.9.18" }
+frame-common = { default-features = false, git = "https://github.com/uniquenetwork/frontier.git", branch = "feature/300" }
+up-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier.git", branch = "feature/300" }
 serde = { version = "1.0.130", default-features = false }
 scale-info = { version = "2.0.1", default-features = false, features = [
     "derive",
deletedpallets/common/src/account.rsdiffbeforeafterboth
--- a/pallets/common/src/account.rs
+++ /dev/null
@@ -1,195 +0,0 @@
-// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
-// This file is part of Unique Network.
-
-// Unique Network is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Unique Network is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
-
-use crate::Config;
-use codec::{Encode, EncodeLike, Decode, MaxEncodedLen};
-use sp_core::H160;
-use scale_info::{Type, TypeInfo};
-use core::cmp::Ordering;
-use serde::{Serialize, Deserialize};
-use pallet_evm::AddressMapping;
-use sp_std::vec::Vec;
-use sp_std::clone::Clone;
-
-pub use up_evm_mapping::EvmBackwardsAddressMapping;
-
-pub trait CrossAccountId<AccountId>:
-	Encode + EncodeLike + Decode + TypeInfo + MaxEncodedLen + Clone + PartialEq + Ord + core::fmt::Debug
-// +
-// Serialize + Deserialize<'static>
-{
-	fn as_sub(&self) -> &AccountId;
-	fn as_eth(&self) -> &H160;
-
-	fn from_sub(account: AccountId) -> Self;
-	fn from_eth(account: H160) -> Self;
-
-	fn conv_eq(&self, other: &Self) -> bool;
-}
-
-#[derive(Encode, Decode, Serialize, Deserialize, TypeInfo, MaxEncodedLen)]
-#[serde(rename_all = "camelCase")]
-enum BasicCrossAccountIdRepr<AccountId> {
-	Substrate(AccountId),
-	Ethereum(H160),
-}
-
-#[derive(PartialEq, Eq)]
-pub struct BasicCrossAccountId<T: Config> {
-	/// If true - then ethereum is canonical encoding
-	from_ethereum: bool,
-	substrate: T::AccountId,
-	ethereum: H160,
-}
-
-impl<T: Config> MaxEncodedLen for BasicCrossAccountId<T> {
-	fn max_encoded_len() -> usize {
-		<BasicCrossAccountIdRepr<T::AccountId>>::max_encoded_len()
-	}
-}
-
-impl<T: Config> TypeInfo for BasicCrossAccountId<T> {
-	type Identity = Self;
-
-	fn type_info() -> Type {
-		<BasicCrossAccountIdRepr<T::AccountId>>::type_info()
-	}
-}
-
-impl<T: Config> core::fmt::Debug for BasicCrossAccountId<T> {
-	fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
-		if self.from_ethereum {
-			fmt.debug_tuple("CrossAccountId::Ethereum")
-				.field(&self.ethereum)
-				.finish()
-		} else {
-			fmt.debug_tuple("CrossAccountId::Substrate")
-				.field(&self.substrate)
-				.finish()
-		}
-	}
-}
-
-impl<T: Config> PartialOrd for BasicCrossAccountId<T> {
-	fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
-		Some(self.substrate.cmp(&other.substrate))
-	}
-}
-
-impl<T: Config> Ord for BasicCrossAccountId<T> {
-	fn cmp(&self, other: &Self) -> Ordering {
-		self.partial_cmp(other)
-			.expect("substrate account is total ordered")
-	}
-}
-
-impl<T: Config> Clone for BasicCrossAccountId<T> {
-	fn clone(&self) -> Self {
-		Self {
-			from_ethereum: self.from_ethereum,
-			substrate: self.substrate.clone(),
-			ethereum: self.ethereum,
-		}
-	}
-}
-impl<T: Config> Encode for BasicCrossAccountId<T> {
-	fn encode(&self) -> Vec<u8> {
-		BasicCrossAccountIdRepr::from(self.clone()).encode()
-	}
-}
-impl<T: Config> EncodeLike for BasicCrossAccountId<T> {}
-impl<T: Config> Decode for BasicCrossAccountId<T> {
-	fn decode<I>(input: &mut I) -> Result<Self, codec::Error>
-	where
-		I: codec::Input,
-	{
-		Ok(BasicCrossAccountIdRepr::decode(input)?.into())
-	}
-}
-impl<T> Serialize for BasicCrossAccountId<T>
-where
-	T: Config,
-	T::AccountId: Serialize,
-{
-	fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
-	where
-		S: serde::Serializer,
-	{
-		let repr = BasicCrossAccountIdRepr::from(self.clone());
-		(&repr).serialize(serializer)
-	}
-}
-impl<'de, T> Deserialize<'de> for BasicCrossAccountId<T>
-where
-	T: Config,
-	T::AccountId: Deserialize<'de>,
-{
-	fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
-	where
-		D: serde::Deserializer<'de>,
-	{
-		Ok(BasicCrossAccountIdRepr::deserialize(deserializer)?.into())
-	}
-}
-impl<T: Config> CrossAccountId<T::AccountId> for BasicCrossAccountId<T> {
-	fn as_sub(&self) -> &T::AccountId {
-		&self.substrate
-	}
-	fn as_eth(&self) -> &H160 {
-		&self.ethereum
-	}
-	fn from_sub(substrate: T::AccountId) -> Self {
-		Self {
-			ethereum: T::EvmBackwardsAddressMapping::from_account_id(substrate.clone()),
-			substrate,
-			from_ethereum: false,
-		}
-	}
-	fn from_eth(ethereum: H160) -> Self {
-		Self {
-			ethereum,
-			substrate: T::EvmAddressMapping::into_account_id(ethereum),
-			from_ethereum: true,
-		}
-	}
-	fn conv_eq(&self, other: &Self) -> bool {
-		if self.from_ethereum == other.from_ethereum {
-			self.substrate == other.substrate && self.ethereum == other.ethereum
-		} else if self.from_ethereum {
-			// ethereum is canonical encoding, but we need to compare derived address
-			self.substrate == other.substrate
-		} else {
-			self.ethereum == other.ethereum
-		}
-	}
-}
-impl<T: Config> From<BasicCrossAccountIdRepr<T::AccountId>> for BasicCrossAccountId<T> {
-	fn from(repr: BasicCrossAccountIdRepr<T::AccountId>) -> Self {
-		match repr {
-			BasicCrossAccountIdRepr::Substrate(s) => Self::from_sub(s),
-			BasicCrossAccountIdRepr::Ethereum(e) => Self::from_eth(e),
-		}
-	}
-}
-impl<T: Config> From<BasicCrossAccountId<T>> for BasicCrossAccountIdRepr<T::AccountId> {
-	fn from(v: BasicCrossAccountId<T>) -> Self {
-		if v.from_ethereum {
-			BasicCrossAccountIdRepr::Ethereum(*v.as_eth())
-		} else {
-			BasicCrossAccountIdRepr::Substrate(v.as_sub().clone())
-		}
-	}
-}
modifiedpallets/common/src/lib.rsdiffbeforeafterboth
--- a/pallets/common/src/lib.rs
+++ b/pallets/common/src/lib.rs
@@ -19,7 +19,7 @@
 use core::ops::{Deref, DerefMut};
 use pallet_evm_coder_substrate::{SubstrateRecorder, WithRecorder};
 use sp_std::vec::Vec;
-use account::CrossAccountId;
+use frame_common::account::CrossAccountId;
 use frame_support::{
 	dispatch::{DispatchErrorWithPostInfo, DispatchResultWithPostInfo},
 	ensure, fail,
@@ -38,7 +38,6 @@
 pub use pallet::*;
 use sp_core::H160;
 use sp_runtime::{ArithmeticError, DispatchError, DispatchResult};
-pub mod account;
 #[cfg(feature = "runtime-benchmarks")]
 pub mod benchmarking;
 pub mod erc;
@@ -163,7 +162,7 @@
 pub mod pallet {
 	use super::*;
 	use frame_support::{Blake2_128Concat, pallet_prelude::*, storage::Key};
-	use account::CrossAccountId;
+	use frame_common::account::CrossAccountId;
 	use frame_support::traits::Currency;
 	use up_data_structs::TokenId;
 	use scale_info::TypeInfo;
modifiedpallets/evm-contract-helpers/Cargo.tomldiffbeforeafterboth
--- a/pallets/evm-contract-helpers/Cargo.toml
+++ b/pallets/evm-contract-helpers/Cargo.toml
@@ -17,7 +17,7 @@
 pallet-evm-coder-substrate = { default-features = false, path = '../../pallets/evm-coder-substrate' }
 pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier.git", branch = "unique-polkadot-v0.9.18" }
 up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/UniqueNetwork/pallet-sponsoring", branch = 'polkadot-v0.9.18' }
-up-evm-mapping = { default-features = false, path = "../../primitives/evm-mapping" }
+up-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier.git", branch = "feature/300" }
 log = "0.4.14"
 
 [dependencies.codec]
modifiedpallets/evm-transaction-payment/Cargo.tomldiffbeforeafterboth
--- a/pallets/evm-transaction-payment/Cargo.toml
+++ b/pallets/evm-transaction-payment/Cargo.toml
@@ -18,7 +18,7 @@
 fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier.git", branch = "unique-polkadot-v0.9.18" }
 pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier.git", branch = "unique-polkadot-v0.9.18" }
 up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/UniqueNetwork/pallet-sponsoring", branch = 'polkadot-v0.9.18' }
-up-evm-mapping = { default-features = false, path = "../../primitives/evm-mapping" }
+up-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier.git", branch = "feature/300" }
 
 [dependencies.codec]
 default-features = false
modifiedpallets/fungible/Cargo.tomldiffbeforeafterboth
--- a/pallets/fungible/Cargo.toml
+++ b/pallets/fungible/Cargo.toml
@@ -25,6 +25,7 @@
 scale-info = { version = "2.0.1", default-features = false, features = [
     "derive",
 ] }
+frame-common = { default-features = false, git = "https://github.com/uniquenetwork/frontier.git", branch = "feature/300" }
 
 [features]
 default = ["std"]
modifiedpallets/fungible/src/erc.rsdiffbeforeafterboth
--- a/pallets/fungible/src/erc.rs
+++ b/pallets/fungible/src/erc.rs
@@ -21,7 +21,7 @@
 use pallet_common::erc::{CommonEvmHandler, PrecompileResult};
 use sp_core::{H160, U256};
 use sp_std::vec::Vec;
-use pallet_common::account::CrossAccountId;
+use frame_common::account::CrossAccountId;
 use pallet_evm_coder_substrate::{call, dispatch_to_evm};
 
 use crate::{
modifiedpallets/fungible/src/lib.rsdiffbeforeafterboth
--- a/pallets/fungible/src/lib.rs
+++ b/pallets/fungible/src/lib.rs
@@ -20,8 +20,9 @@
 use frame_support::{ensure};
 use up_data_structs::{AccessMode, CollectionId, TokenId, CreateCollectionData};
 use pallet_common::{
-	Error as CommonError, Event as CommonEvent, Pallet as PalletCommon, account::CrossAccountId,
+	Error as CommonError, Event as CommonEvent, Pallet as PalletCommon,
 };
+use frame_common::account::CrossAccountId;
 use pallet_evm_coder_substrate::WithRecorder;
 use sp_core::H160;
 use sp_runtime::{ArithmeticError, DispatchError, DispatchResult};
modifiedpallets/nonfungible/Cargo.tomldiffbeforeafterboth
--- a/pallets/nonfungible/Cargo.toml
+++ b/pallets/nonfungible/Cargo.toml
@@ -25,6 +25,7 @@
 scale-info = { version = "2.0.1", default-features = false, features = [
     "derive",
 ] }
+frame-common = { default-features = false, git = "https://github.com/uniquenetwork/frontier.git", branch = "feature/300" }
 
 [features]
 default = ["std"]
modifiedpallets/nonfungible/src/erc.rsdiffbeforeafterboth
--- a/pallets/nonfungible/src/erc.rs
+++ b/pallets/nonfungible/src/erc.rs
@@ -25,9 +25,9 @@
 use sp_core::{H160, U256};
 use sp_std::{vec::Vec, vec};
 use pallet_common::{
-	account::CrossAccountId,
 	erc::{CommonEvmHandler, PrecompileResult},
 };
+use frame_common::account::CrossAccountId;
 use pallet_evm_coder_substrate::call;
 
 use crate::{
modifiedpallets/nonfungible/src/lib.rsdiffbeforeafterboth
--- a/pallets/nonfungible/src/lib.rs
+++ b/pallets/nonfungible/src/lib.rs
@@ -22,8 +22,9 @@
 	AccessMode, CollectionId, CustomDataLimit, TokenId, CreateCollectionData, CreateNftExData,
 };
 use pallet_common::{
-	Error as CommonError, Pallet as PalletCommon, Event as CommonEvent, account::CrossAccountId,
+	Error as CommonError, Pallet as PalletCommon, Event as CommonEvent,
 };
+use frame_common::account::CrossAccountId;
 use pallet_evm_coder_substrate::{SubstrateRecorder, WithRecorder};
 use sp_core::H160;
 use sp_runtime::{ArithmeticError, DispatchError, DispatchResult};
modifiedpallets/refungible/Cargo.tomldiffbeforeafterboth
--- a/pallets/refungible/Cargo.toml
+++ b/pallets/refungible/Cargo.toml
@@ -22,6 +22,7 @@
 scale-info = { version = "2.0.1", default-features = false, features = [
     "derive",
 ] }
+frame-common = { default-features = false, git = "https://github.com/uniquenetwork/frontier.git", branch = "feature/300" }
 
 [features]
 default = ["std"]
modifiedpallets/refungible/src/lib.rsdiffbeforeafterboth
--- a/pallets/refungible/src/lib.rs
+++ b/pallets/refungible/src/lib.rs
@@ -22,8 +22,9 @@
 	CreateCollectionData, CreateRefungibleExData,
 };
 use pallet_common::{
-	Error as CommonError, Event as CommonEvent, Pallet as PalletCommon, account::CrossAccountId,
+	Error as CommonError, Event as CommonEvent, Pallet as PalletCommon,
 };
+use frame_common::account::CrossAccountId;
 use sp_runtime::{ArithmeticError, DispatchError, DispatchResult};
 use sp_std::{vec::Vec, vec, collections::btree_map::BTreeMap};
 use core::ops::Deref;
modifiedpallets/unique/Cargo.tomldiffbeforeafterboth
--- a/pallets/unique/Cargo.toml
+++ b/pallets/unique/Cargo.toml
@@ -132,7 +132,8 @@
 sp-api = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.18" }
 
 up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/UniqueNetwork/pallet-sponsoring", branch = 'polkadot-v0.9.18' }
-up-evm-mapping = { default-features = false, path = "../../primitives/evm-mapping" }
+up-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier.git", branch = "feature/300" }
+frame-common = { default-features = false, git = "https://github.com/uniquenetwork/frontier.git", branch = "feature/300" }
 evm-coder = { default-features = false, path = "../../crates/evm-coder" }
 pallet-evm-coder-substrate = { default-features = false, path = "../../pallets/evm-coder-substrate" }
 primitive-types = { version = "0.11.1", default-features = false, features = [
modifiedpallets/unique/src/eth/sponsoring.rsdiffbeforeafterboth
--- a/pallets/unique/src/eth/sponsoring.rs
+++ b/pallets/unique/src/eth/sponsoring.rs
@@ -25,8 +25,7 @@
 use core::marker::PhantomData;
 use core::convert::TryInto;
 use up_data_structs::TokenId;
-use up_evm_mapping::EvmBackwardsAddressMapping;
-use pallet_common::account::CrossAccountId;
+use frame_common::account::CrossAccountId;
 
 use pallet_nonfungible::erc::{UniqueNFTCall, ERC721UniqueExtensionsCall, ERC721Call};
 use pallet_fungible::erc::{UniqueFungibleCall, ERC20Call};
modifiedpallets/unique/src/lib.rsdiffbeforeafterboth
--- a/pallets/unique/src/lib.rs
+++ b/pallets/unique/src/lib.rs
@@ -54,9 +54,10 @@
 	CreateCollectionData, CustomDataLimit, CreateItemExData,
 };
 use pallet_common::{
-	account::CrossAccountId, CollectionHandle, Pallet as PalletCommon, Error as CommonError,
+	CollectionHandle, Pallet as PalletCommon, Error as CommonError,
 	CommonWeightInfo,
 };
+use frame_common::account::CrossAccountId;
 use pallet_refungible::{Pallet as PalletRefungible, RefungibleHandle};
 use pallet_fungible::{Pallet as PalletFungible, FungibleHandle};
 use pallet_nonfungible::{Pallet as PalletNonfungible, NonfungibleHandle};
modifiedpallets/unique/src/mock.rsdiffbeforeafterboth
--- a/pallets/unique/src/mock.rs
+++ b/pallets/unique/src/mock.rs
@@ -26,7 +26,8 @@
 use pallet_transaction_payment::{CurrencyAdapter};
 use frame_system as system;
 use pallet_evm::{AddressMapping, runner::stack::MaybeMirroredLog};
-use pallet_common::account::{EvmBackwardsAddressMapping, CrossAccountId};
+use up_evm_mapping::EvmBackwardsAddressMapping;
+use frame_common::account::CrossAccountId;
 use codec::{Encode, Decode, MaxEncodedLen};
 use scale_info::TypeInfo;
 use up_data_structs::ConstU32;
modifiedpallets/unique/src/sponsorship.rsdiffbeforeafterboth
--- a/pallets/unique/src/sponsorship.rs
+++ b/pallets/unique/src/sponsorship.rs
@@ -30,7 +30,7 @@
 	NFT_SPONSOR_TRANSFER_TIMEOUT, REFUNGIBLE_SPONSOR_TRANSFER_TIMEOUT, TokenId,
 };
 use pallet_common::{CollectionHandle};
-use pallet_common::account::CrossAccountId;
+use frame_common::account::CrossAccountId;
 
 pub fn withdraw_transfer<T: Config>(
 	collection: &CollectionHandle<T>,
deletedprimitives/evm-mapping/Cargo.tomldiffbeforeafterboth
--- a/primitives/evm-mapping/Cargo.toml
+++ /dev/null
@@ -1,13 +0,0 @@
-[package]
-name = "up-evm-mapping"
-version = "0.1.0"
-license = "GPLv3"
-edition = "2021"
-
-[dependencies]
-sp-core = { default-features = false, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.18' }
-frame-support = { default-features = false, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.18' }
-
-[features]
-default = ["std"]
-std = ["sp-core/std", "frame-support/std"]
deletedprimitives/evm-mapping/src/lib.rsdiffbeforeafterboth
--- a/primitives/evm-mapping/src/lib.rs
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
-// This file is part of Unique Network.
-
-// Unique Network is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Unique Network is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
-
-#![cfg_attr(not(feature = "std"), no_std)]
-
-use frame_support::sp_runtime::AccountId32;
-use sp_core::H160;
-
-/// Transforms substrate addresses to ethereum (Reverse of `EvmAddressMapping`)
-/// pallet_evm doesn't have this, as it only checks if eth address
-/// is owned by substrate via `EnsureAddressOrigin` trait
-///
-/// This trait implementations shouldn't conflict with used `EnsureAddressOrigin`
-pub trait EvmBackwardsAddressMapping<AccountId> {
-	fn from_account_id(account_id: AccountId) -> H160;
-}
-
-/// Should have same mapping as EnsureAddressTruncated
-pub struct MapBackwardsAddressTruncated;
-impl EvmBackwardsAddressMapping<AccountId32> for MapBackwardsAddressTruncated {
-	fn from_account_id(account_id: AccountId32) -> H160 {
-		let mut out = [0; 20];
-		out.copy_from_slice(&(account_id.as_ref() as &[u8])[0..20]);
-		H160(out)
-	}
-}
modifiedprimitives/rpc/Cargo.tomldiffbeforeafterboth
--- a/primitives/rpc/Cargo.toml
+++ b/primitives/rpc/Cargo.toml
@@ -14,6 +14,7 @@
 sp-std = { default-features = false, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.18' }
 sp-api = { default-features = false, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.18' }
 sp-runtime = { default-features = false, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.18' }
+frame-common = { default-features = false, git = "https://github.com/uniquenetwork/frontier.git", branch = "feature/300" }
 
 [features]
 default = ["std"]
modifiedprimitives/rpc/src/lib.rsdiffbeforeafterboth
--- a/primitives/rpc/src/lib.rs
+++ b/primitives/rpc/src/lib.rs
@@ -28,7 +28,7 @@
 	#[api_version(2)]
 	pub trait UniqueApi<CrossAccountId, AccountId> where
 		AccountId: Decode,
-		CrossAccountId: pallet_common::account::CrossAccountId<AccountId>,
+		CrossAccountId: frame_common::account::CrossAccountId<AccountId>,
 	{
 		#[changed_in(2)]
 		fn token_owner(collection: CollectionId, token: TokenId) -> Result<CrossAccountId>;
modifiedruntime/opal/src/lib.rsdiffbeforeafterboth
--- a/runtime/opal/src/lib.rs
+++ b/runtime/opal/src/lib.rs
@@ -116,11 +116,10 @@
 
 pub const RUNTIME_NAME: &str = "Opal";
 
-type CrossAccountId = pallet_common::account::BasicCrossAccountId<Runtime>;
+type CrossAccountId = frame_common::account::BasicCrossAccountId<Runtime>;
 
 impl RuntimeInstance for Runtime {
 	type CrossAccountId = self::CrossAccountId;
-
 	type TransactionConverter = self::TransactionConverter;
 
 	fn get_transaction_converter() -> TransactionConverter {
@@ -286,6 +285,11 @@
 	type WeightInfo = pallet_evm_migration::weights::SubstrateWeight<Self>;
 }
 
+impl frame_common::account::Config for Runtime {
+	type EvmAddressMapping = pallet_evm::HashedAddressMapping<Self::Hashing>;
+	type EvmBackwardsAddressMapping = up_evm_mapping::MapBackwardsAddressTruncated;
+}
+
 pub struct EthereumFindAuthor<F>(core::marker::PhantomData<F>);
 impl<F: FindAuthor<u32>> FindAuthor<H160> for EthereumFindAuthor<F> {
 	fn find_author<'a, I>(digests: I) -> Option<H160>
@@ -846,7 +850,7 @@
 	type Event = Event;
 	type EvmBackwardsAddressMapping = up_evm_mapping::MapBackwardsAddressTruncated;
 	type EvmAddressMapping = HashedAddressMapping<Self::Hashing>;
-	type CrossAccountId = pallet_common::account::BasicCrossAccountId<Self>;
+	type CrossAccountId = frame_common::account::BasicCrossAccountId<Self>;
 
 	type Currency = Balances;
 	type CollectionCreationPrice = CollectionCreationPrice;
modifiedruntime/unique/Cargo.tomldiffbeforeafterboth
--- a/runtime/unique/Cargo.toml
+++ b/runtime/unique/Cargo.toml
@@ -382,7 +382,6 @@
 derivative = "2.2.0"
 pallet-unique = { path = '../../pallets/unique', default-features = false }
 up-rpc = { path = "../../primitives/rpc", default-features = false }
-up-evm-mapping = { path = "../../primitives/evm-mapping", default-features = false }
 pallet-inflation = { path = '../../pallets/inflation', default-features = false }
 up-data-structs = { path = '../../primitives/data-structs', default-features = false }
 pallet-common = { default-features = false, path = "../../pallets/common" }
@@ -401,6 +400,8 @@
 pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier.git", branch = "unique-polkadot-v0.9.18" }
 fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier.git", branch = "unique-polkadot-v0.9.18" }
 fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier.git", branch = "unique-polkadot-v0.9.18" }
+up-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier.git", branch = "feature/300" }
+frame-common = { default-features = false, git = "https://github.com/uniquenetwork/frontier.git", branch = "feature/300" }
 
 ################################################################################
 # Build Dependencies