git.delta.rocks / unique-network / refs/commits / 1062e172486e

difftreelog

Merge pull request #343 from UniqueNetwork/feature/CORE-302

bugrazoid2022-05-27parents: #459d9af #e5c2d12.patch.diff
in: master
Feature/core 302

49 files changed

added.maintain/scripts/generate_abi.shdiffbeforeafterboth
--- /dev/null
+++ b/.maintain/scripts/generate_abi.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+set -eu
+
+dir=$PWD
+
+tmp=$(mktemp -d)
+cd $tmp
+cp $dir/$INPUT input.sol
+solcjs --abi -p input.sol
+
+NAME=input_sol_$(basename $INPUT .sol)
+mv $NAME.abi $NAME.json
+prettier $NAME.json > $dir/$OUTPUT
deleted.maintain/scripts/generate_api.shdiffbeforeafterboth
--- a/.maintain/scripts/generate_api.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-set -eu
-
-tmp=$(mktemp)
-cargo test --package $PACKAGE -- $NAME --exact --nocapture --ignored | tee $tmp
-raw=$(mktemp --suffix .sol)
-sed -n '/=== SNIP START ===/, /=== SNIP END ===/{ /=== SNIP START ===/! { /=== SNIP END ===/! p } }' $tmp > $raw
-formatted=$(mktemp)
-prettier --use-tabs $raw > $formatted
-
-mv $formatted $OUTPUT
added.maintain/scripts/generate_sol.shdiffbeforeafterboth
--- /dev/null
+++ b/.maintain/scripts/generate_sol.sh
@@ -0,0 +1,11 @@
+#!/bin/sh
+set -eu
+
+tmp=$(mktemp)
+cargo test --package $PACKAGE -- $NAME --exact --nocapture --ignored | tee $tmp
+raw=$(mktemp --suffix .sol)
+sed -n '/=== SNIP START ===/, /=== SNIP END ===/{ /=== SNIP START ===/! { /=== SNIP END ===/! p } }' $tmp > $raw
+formatted=$(mktemp)
+prettier --use-tabs $raw > $formatted
+
+mv $formatted $OUTPUT
modifiedCargo.lockdiffbeforeafterboth
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -4290,6 +4290,9 @@
 version = "1.4.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
+dependencies = [
+ "spin",
+]
 
 [[package]]
 name = "lazycell"
@@ -5467,9 +5470,9 @@
 
 [[package]]
 name = "once_cell"
-version = "1.11.0"
+version = "1.12.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7b10983b38c53aebdf33f542c6275b0f58a238129d00c4ae0e6fb59738d783ca"
+checksum = "7709cef83f0c1f58f666e746a08b21e0085f7440fa6a29cc194d68aac97a4225"
 
 [[package]]
 name = "opal-runtime"
@@ -5917,6 +5920,7 @@
  "frame-benchmarking",
  "frame-support",
  "frame-system",
+ "lazy_static",
  "pallet-evm",
  "pallet-evm-coder-substrate",
  "parity-scale-codec 3.1.2",
@@ -6083,6 +6087,7 @@
  "frame-support",
  "frame-system",
  "log",
+ "pallet-common",
  "pallet-evm",
  "pallet-evm-coder-substrate",
  "parity-scale-codec 3.1.2",
@@ -6090,6 +6095,7 @@
  "sp-core",
  "sp-runtime",
  "sp-std",
+ "up-data-structs",
  "up-sponsorship",
 ]
 
@@ -6814,13 +6820,18 @@
 name = "pallet-unique"
 version = "0.1.0"
 dependencies = [
+ "ethereum",
+ "evm-coder",
  "frame-benchmarking",
  "frame-support",
  "frame-system",
  "pallet-common",
  "pallet-evm",
+ "pallet-evm-coder-substrate",
+ "pallet-nonfungible",
  "parity-scale-codec 3.1.2",
  "scale-info",
+ "serde",
  "sp-core",
  "sp-io",
  "sp-runtime",
@@ -12005,9 +12016,9 @@
 
 [[package]]
 name = "target-lexicon"
-version = "0.12.3"
+version = "0.12.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d7fa7e55043acb85fca6b3c01485a2eeb6b69c5d21002e273c79e465f43b7ac1"
+checksum = "c02424087780c9b71cc96799eaeddff35af2bc513278cda5c99fc1f5d026d3c1"
 
 [[package]]
 name = "tempfile"
modifiedMakefilediffbeforeafterboth
--- a/Makefile
+++ b/Makefile
@@ -1,33 +1,61 @@
 .PHONY: _help
 _help:
 	@echo "regenerate_solidity - generate stubs/interfaces for contracts defined in native (via evm-coder)"
-	@echo "evm_stubs - recompile contract stubs"
+	@echo "evm_stubs - recompile contract stubs and ABI"
 	@echo "bench - run frame-benchmarking"
 	@echo "  bench-evm-migration"
 	@echo "  bench-unique"
 
+FUNGIBLE_EVM_STUBS=./pallets/fungible/src/stubs
+FUNGIBLE_EVM_ABI=./tests/src/eth/fungibleAbi.json
+
+NONFUNGIBLE_EVM_STUBS=./pallets/nonfungible/src/stubs
+NONFUNGIBLE_EVM_ABI=./tests/src/eth/nonFungibleAbi.json
+
+CONTRACT_HELPERS_STUBS=./pallets/evm-contract-helpers/src/stubs/
+CONTRACT_HELPERS_ABI=./tests/src/eth/util/contractHelpersAbi.json
+
+COLLECTION_HELPER_STUBS=./pallets/unique/src/eth/stubs/
+COLLECTION_HELPER_ABI=./tests/src/eth/collectionHelperAbi.json
+
+TESTS_API=./tests/src/eth/api/
+
 .PHONY: regenerate_solidity
-regenerate_solidity:
-	PACKAGE=pallet-fungible NAME=erc::gen_iface OUTPUT=./tests/src/eth/api/UniqueFungible.sol ./.maintain/scripts/generate_api.sh
-	PACKAGE=pallet-nonfungible NAME=erc::gen_iface OUTPUT=./tests/src/eth/api/UniqueNFT.sol ./.maintain/scripts/generate_api.sh
-	PACKAGE=pallet-evm-contract-helpers NAME=eth::contract_helpers_iface OUTPUT=./tests/src/eth/api/ContractHelpers.sol ./.maintain/scripts/generate_api.sh
+regenerate_solidity: UniqueFungible.sol UniqueNFT.sol ContractHelpers.sol CollectionHelper.sol
+
+UniqueFungible.sol:
+	PACKAGE=pallet-fungible NAME=erc::gen_iface OUTPUT=$(TESTS_API)/$@ ./.maintain/scripts/generate_sol.sh
+	PACKAGE=pallet-fungible NAME=erc::gen_impl OUTPUT=$(FUNGIBLE_EVM_STUBS)/$@ ./.maintain/scripts/generate_sol.sh
+
+UniqueNFT.sol:
+	PACKAGE=pallet-nonfungible NAME=erc::gen_iface OUTPUT=$(TESTS_API)/$@ ./.maintain/scripts/generate_sol.sh
+	PACKAGE=pallet-nonfungible NAME=erc::gen_impl OUTPUT=$(NONFUNGIBLE_EVM_STUBS)/$@ ./.maintain/scripts/generate_sol.sh
+
+ContractHelpers.sol:
+	PACKAGE=pallet-evm-contract-helpers NAME=eth::contract_helpers_iface OUTPUT=$(TESTS_API)/$@ ./.maintain/scripts/generate_sol.sh
+	PACKAGE=pallet-evm-contract-helpers NAME=eth::contract_helpers_impl OUTPUT=$(CONTRACT_HELPERS_STUBS)/$@ ./.maintain/scripts/generate_sol.sh
+
+CollectionHelper.sol:
+	PACKAGE=pallet-unique NAME=eth::collection_helper_iface OUTPUT=$(TESTS_API)/$@ ./.maintain/scripts/generate_sol.sh
+	PACKAGE=pallet-unique NAME=eth::collection_helper_impl OUTPUT=$(COLLECTION_HELPER_STUBS)/$@ ./.maintain/scripts/generate_sol.sh
+
+UniqueFungible: UniqueFungible.sol
+	INPUT=$(FUNGIBLE_EVM_STUBS)/$< OUTPUT=$(FUNGIBLE_EVM_STUBS)/UniqueFungible.raw ./.maintain/scripts/compile_stub.sh
+	INPUT=$(FUNGIBLE_EVM_STUBS)/$< OUTPUT=$(FUNGIBLE_EVM_ABI) ./.maintain/scripts/generate_abi.sh
 
-	PACKAGE=pallet-fungible NAME=erc::gen_impl OUTPUT=./pallets/fungible/src/stubs/UniqueFungible.sol ./.maintain/scripts/generate_api.sh
-	PACKAGE=pallet-nonfungible NAME=erc::gen_impl OUTPUT=./pallets/nonfungible/src/stubs/UniqueNFT.sol ./.maintain/scripts/generate_api.sh
-	PACKAGE=pallet-evm-contract-helpers NAME=eth::contract_helpers_impl OUTPUT=./pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol ./.maintain/scripts/generate_api.sh
+UniqueNFT: UniqueNFT.sol
+	INPUT=$(NONFUNGIBLE_EVM_STUBS)/$< OUTPUT=$(NONFUNGIBLE_EVM_STUBS)/UniqueNFT.raw ./.maintain/scripts/compile_stub.sh
+	INPUT=$(NONFUNGIBLE_EVM_STUBS)/$< OUTPUT=$(NONFUNGIBLE_EVM_ABI) ./.maintain/scripts/generate_abi.sh
 
-FUNGIBLE_EVM_STUBS=./pallets/fungible/src/stubs
-NONFUNGIBLE_EVM_STUBS=./pallets/nonfungible/src/stubs
-CONTRACT_HELPERS_STUBS=./pallets/evm-contract-helpers/src/stubs/
+ContractHelpers: ContractHelpers.sol
+	INPUT=$(CONTRACT_HELPERS_STUBS)/$< OUTPUT=$(CONTRACT_HELPERS_STUBS)/ContractHelpers.raw ./.maintain/scripts/compile_stub.sh
+	INPUT=$(CONTRACT_HELPERS_STUBS)/$< OUTPUT=$(CONTRACT_HELPERS_ABI) ./.maintain/scripts/generate_abi.sh
 
-$(FUNGIBLE_EVM_STUBS)/UniqueFungible.raw: $(FUNGIBLE_EVM_STUBS)/UniqueFungible.sol
-	INPUT=$< OUTPUT=$@ ./.maintain/scripts/compile_stub.sh
-$(NONFUNGIBLE_EVM_STUBS)/UniqueNFT.raw: $(NONFUNGIBLE_EVM_STUBS)/UniqueNFT.sol
-	INPUT=$< OUTPUT=$@ ./.maintain/scripts/compile_stub.sh
-$(CONTRACT_HELPERS_STUBS)/ContractHelpers.raw: $(CONTRACT_HELPERS_STUBS)/ContractHelpers.sol
-	INPUT=$< OUTPUT=$@ ./.maintain/scripts/compile_stub.sh
+CollectionHelper: CollectionHelper.sol
+	INPUT=$(COLLECTION_HELPER_STUBS)/$< OUTPUT=$(COLLECTION_HELPER_STUBS)/CollectionHelper.raw ./.maintain/scripts/compile_stub.sh
+	INPUT=$(COLLECTION_HELPER_STUBS)/$< OUTPUT=$(COLLECTION_HELPER_ABI) ./.maintain/scripts/generate_abi.sh
 
-evm_stubs: $(FUNGIBLE_EVM_STUBS)/UniqueFungible.raw $(NONFUNGIBLE_EVM_STUBS)/UniqueNFT.raw $(CONTRACT_HELPERS_STUBS)/ContractHelpers.raw
+evm_stubs: UniqueFungible UniqueNFT ContractHelpers CollectionHelper
 
 .PHONY: _bench
 _bench:
modifiedcrates/evm-coder/src/solidity.rsdiffbeforeafterboth
--- a/crates/evm-coder/src/solidity.rs
+++ b/crates/evm-coder/src/solidity.rs
@@ -327,7 +327,7 @@
 	}
 }
 
-#[impl_for_tuples(1, 5)]
+#[impl_for_tuples(1, 12)]
 impl SolidityArguments for Tuple {
 	for_tuples!( where #( Tuple: SolidityArguments ),* );
 
modifiedpallets/common/Cargo.tomldiffbeforeafterboth
--- a/pallets/common/Cargo.toml
+++ b/pallets/common/Cargo.toml
@@ -16,16 +16,18 @@
 sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }
 sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }
 sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }
+frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }
 fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }
 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", branch = "unique-polkadot-v0.9.21-logs" }
+
 serde = { version = "1.0.130", default-features = false }
 scale-info = { version = "2.0.1", default-features = false, features = [
     "derive",
 ] }
-frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }
+lazy_static = { version = "1.4.0", default-features = false, features = ["spin_no_std"] }
 
 [features]
 default = ["std"]
modifiedpallets/common/src/erc.rsdiffbeforeafterboth
--- a/pallets/common/src/erc.rs
+++ b/pallets/common/src/erc.rs
@@ -14,12 +14,17 @@
 // 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 evm_coder::{solidity_interface, types::*, execution::Result};
+use evm_coder::{
+	solidity_interface,
+	types::*,
+	execution::{Result, Error},
+};
 pub use pallet_evm::{PrecompileOutput, PrecompileResult, account::CrossAccountId};
 use pallet_evm_coder_substrate::dispatch_to_evm;
 use sp_core::{H160, U256};
 use sp_std::vec::Vec;
-use up_data_structs::Property;
+use up_data_structs::{Property, SponsoringRateLimit};
+use alloc::format;
 
 use crate::{Pallet, CollectionHandle, Config, CollectionProperties};
 
@@ -31,7 +36,7 @@
 	fn call(self, source: &H160, input: &[u8], value: U256) -> Option<PrecompileResult>;
 }
 
-#[solidity_interface(name = "CollectionProperties")]
+#[solidity_interface(name = "Collection")]
 impl<T: Config> CollectionHandle<T> {
 	fn set_collection_property(&mut self, caller: caller, key: string, value: bytes) -> Result<()> {
 		let caller = T::CrossAccountId::from_eth(caller);
@@ -64,4 +69,93 @@
 
 		Ok(prop.to_vec())
 	}
+
+	fn eth_set_sponsor(&mut self, caller: caller, sponsor: address) -> Result<void> {
+		check_is_owner(caller, self)?;
+
+		let sponsor = T::CrossAccountId::from_eth(sponsor);
+		self.set_sponsor(sponsor.as_sub().clone());
+		save(self);
+		Ok(())
+	}
+
+	fn eth_confirm_sponsorship(&mut self, caller: caller) -> Result<void> {
+		let caller = T::CrossAccountId::from_eth(caller);
+		if !self.confirm_sponsorship(caller.as_sub()) {
+			return Err(Error::Revert("Caller is not set as sponsor".into()));
+		}
+		save(self);
+		Ok(())
+	}
+
+	fn set_limit(&mut self, caller: caller, limit: string, value: string) -> Result<void> {
+		check_is_owner(caller, self)?;
+		let mut limits = self.limits.clone();
+
+		match limit.as_str() {
+			"accountTokenOwnershipLimit" => {
+				limits.account_token_ownership_limit = parse_int(value)?;
+			}
+			"sponsoredDataSize" => {
+				limits.sponsored_data_size = parse_int(value)?;
+			}
+			"sponsoredDataRateLimit" => {
+				limits.sponsored_data_rate_limit =
+					Some(SponsoringRateLimit::Blocks(parse_int(value)?.unwrap()));
+			}
+			"tokenLimit" => {
+				limits.token_limit = parse_int(value)?;
+			}
+			"sponsorTransferTimeout" => {
+				limits.sponsor_transfer_timeout = parse_int(value)?;
+			}
+			"sponsorApproveTimeout" => {
+				limits.sponsor_approve_timeout = parse_int(value)?;
+			}
+			"ownerCanTransfer" => {
+				limits.owner_can_transfer = parse_bool(value)?;
+			}
+			"ownerCanDestroy" => {
+				limits.owner_can_destroy = parse_bool(value)?;
+			}
+			"transfersEnabled" => {
+				limits.transfers_enabled = parse_bool(value)?;
+			}
+			_ => return Err(Error::Revert(format!("Unknown limit \"{}\"", limit))),
+		}
+		self.limits = <Pallet<T>>::clamp_limits(self.mode.clone(), &self.limits, limits)
+			.map_err(dispatch_to_evm::<T>)?;
+		save(self);
+		Ok(())
+	}
+
+	fn contract_address(&self, _caller: caller) -> Result<address> {
+		Ok(crate::eth::collection_id_to_address(self.id))
+	}
+}
+
+fn check_is_owner<T: Config>(caller: caller, collection: &CollectionHandle<T>) -> Result<()> {
+	let caller = T::CrossAccountId::from_eth(caller);
+	collection
+		.check_is_owner(&caller)
+		.map_err(pallet_evm_coder_substrate::dispatch_to_evm::<T>)?;
+	Ok(())
+}
+
+fn save<T: Config>(collection: &CollectionHandle<T>) {
+	<crate::CollectionById<T>>::insert(collection.id, collection.collection.clone());
+}
+
+fn parse_int(value: string) -> Result<Option<u32>> {
+	value
+		.parse::<u32>()
+		.map_err(|e| Error::Revert(format!("Int value \"{}\" parse error: {}", value, e)))
+		.map(|value| Some(value))
+}
+
+fn parse_bool(value: string) -> Result<Option<bool>> {
+	value
+		.parse::<bool>()
+		.map_err(|e| Error::Revert(format!("Bool value \"{}\" parse error: {}", value, e)))
+		.map(|value| Some(value))
 }
modifiedpallets/common/src/eth.rsdiffbeforeafterboth
--- a/pallets/common/src/eth.rs
+++ b/pallets/common/src/eth.rs
@@ -17,6 +17,14 @@
 use up_data_structs::CollectionId;
 use sp_core::H160;
 
+lazy_static::lazy_static! {
+	pub static ref KEY_TOKEN_URI: up_data_structs::PropertyKey = {
+		let key: evm_coder::types::string = "tokenURI".into(); //TODO: make static
+		let key: up_data_structs::PropertyKey = key.into_bytes().try_into().expect("Can't create \"tokenURI\" key");
+		key
+	};
+}
+
 // 0x17c4e6453Cc49AAAaEACA894e6D9683e00000001 - collection 1
 // TODO: Unhardcode prefix
 const ETH_COLLECTION_PREFIX: [u8; 16] = [
@@ -37,3 +45,7 @@
 	out[16..20].copy_from_slice(&u32::to_be_bytes(id.0));
 	H160(out)
 }
+
+pub fn is_collection(address: &H160) -> bool {
+	address[0..16] == ETH_COLLECTION_PREFIX
+}
modifiedpallets/common/src/lib.rsdiffbeforeafterboth
--- a/pallets/common/src/lib.rs
+++ b/pallets/common/src/lib.rs
@@ -114,6 +114,15 @@
 			recorder: SubstrateRecorder::new(gas_limit),
 		})
 	}
+
+	pub fn new_with_recorder(id: CollectionId, recorder: SubstrateRecorder<T>) -> Option<Self> {
+		<CollectionById<T>>::get(id).map(|collection| Self {
+			id,
+			collection,
+			recorder,
+		})
+	}
+
 	pub fn new(id: CollectionId) -> Option<Self> {
 		Self::new_with_gas_limit(id, u64::MAX)
 	}
@@ -140,6 +149,19 @@
 		<CollectionById<T>>::insert(self.id, self.collection);
 		Ok(())
 	}
+
+	pub fn set_sponsor(&mut self, sponsor: T::AccountId) {
+		self.collection.sponsorship = SponsorshipState::Unconfirmed(sponsor);
+	}
+
+	pub fn confirm_sponsorship(&mut self, sender: &T::AccountId) -> bool {
+		if self.collection.sponsorship.pending_sponsor() != Some(sender) {
+			return false;
+		};
+
+		self.collection.sponsorship = SponsorshipState::Confirmed(sender.clone());
+		true
+	}
 }
 impl<T: Config> Deref for CollectionHandle<T> {
 	type Target = Collection<T::AccountId>;
modifiedpallets/evm-contract-helpers/Cargo.tomldiffbeforeafterboth
--- a/pallets/evm-contract-helpers/Cargo.toml
+++ b/pallets/evm-contract-helpers/Cargo.toml
@@ -8,18 +8,26 @@
 scale-info = { version = "2.0.1", default-features = false, features = [
     "derive",
 ] }
-frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }
-frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }
-sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }
-sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }
-sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }
-evm-coder = { default-features = false, path = '../../crates/evm-coder' }
-pallet-evm-coder-substrate = { default-features = false, path = '../../pallets/evm-coder-substrate' }
+log = { default-features = false, version = "0.4.14" }
+
+# Substrate
+frame-support = { default-features = false, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.21' }
+frame-system = { default-features = false, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.21' }
+sp-runtime = { default-features = false, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.21' }
+sp-std = { default-features = false, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.21' }
+sp-core = { default-features = false, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.21' }
+
+# Unique
 pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }
 fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }
 up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.21" }
-log = "0.4.14"
 
+# Locals
+evm-coder = { default-features = false, path = '../../crates/evm-coder' }
+pallet-common = { default-features = false, path = '../../pallets/common' }
+pallet-evm-coder-substrate = { default-features = false, path = '../../pallets/evm-coder-substrate' }
+up-data-structs = { default-features = false, path = '../../primitives/data-structs', features = ['serde1'] }
+
 [dependencies.codec]
 default-features = false
 features = ['derive']
modifiedpallets/fungible/src/erc.rsdiffbeforeafterboth
--- a/pallets/fungible/src/erc.rs
+++ b/pallets/fungible/src/erc.rs
@@ -24,7 +24,7 @@
 use pallet_evm::account::CrossAccountId;
 use pallet_evm_coder_substrate::{call, dispatch_to_evm};
 use pallet_structure::{SelfWeightOf as StructureWeight, weights::WeightInfo as _};
-use pallet_common::{CollectionHandle, erc::CollectionPropertiesCall};
+use pallet_common::{CollectionHandle, erc::CollectionCall};
 
 use crate::{
 	Allowance, Balance, Config, FungibleHandle, Pallet, SelfWeightOf, TotalSupply,
@@ -150,7 +150,7 @@
 	is(
 		ERC20,
 		ERC20UniqueExtensions,
-		via("CollectionHandle<T>", common_mut, CollectionProperties)
+		via("CollectionHandle<T>", common_mut, Collection)
 	)
 )]
 impl<T: Config> FungibleHandle<T> {}
modifiedpallets/fungible/src/lib.rsdiffbeforeafterboth
--- a/pallets/fungible/src/lib.rs
+++ b/pallets/fungible/src/lib.rs
@@ -33,7 +33,7 @@
 use pallet_evm_coder_substrate::WithRecorder;
 use sp_core::H160;
 use sp_runtime::{ArithmeticError, DispatchError, DispatchResult};
-use sp_std::collections::btree_map::BTreeMap;
+use sp_std::{collections::btree_map::BTreeMap};
 
 pub use pallet::*;
 
modifiedpallets/fungible/src/stubs/UniqueFungible.rawdiffbeforeafterboth

binary blob — no preview

modifiedpallets/fungible/src/stubs/UniqueFungible.soldiffbeforeafterboth
--- a/pallets/fungible/src/stubs/UniqueFungible.sol
+++ b/pallets/fungible/src/stubs/UniqueFungible.sol
@@ -127,8 +127,8 @@
 	}
 }
 
-// Selector: 9b5e29c5
-contract CollectionProperties is Dummy, ERC165 {
+// Selector: f5652829
+contract Collection is Dummy, ERC165 {
 	// Selector: setCollectionProperty(string,bytes) 2f073f66
 	function setCollectionProperty(string memory key, bytes memory value)
 		public
@@ -159,6 +159,34 @@
 		dummy;
 		return hex"";
 	}
+
+	// Selector: ethSetSponsor(address) 8f9af356
+	function ethSetSponsor(address sponsor) public {
+		require(false, stub_error);
+		sponsor;
+		dummy = 0;
+	}
+
+	// Selector: ethConfirmSponsorship() a8580d1a
+	function ethConfirmSponsorship() public {
+		require(false, stub_error);
+		dummy = 0;
+	}
+
+	// Selector: setLimit(string,string) bf4d2014
+	function setLimit(string memory limit, string memory value) public {
+		require(false, stub_error);
+		limit;
+		value;
+		dummy = 0;
+	}
+
+	// Selector: contractAddress() f6b4dfb4
+	function contractAddress() public view returns (address) {
+		require(false, stub_error);
+		dummy;
+		return 0x0000000000000000000000000000000000000000;
+	}
 }
 
 contract UniqueFungible is
@@ -166,5 +194,5 @@
 	ERC165,
 	ERC20,
 	ERC20UniqueExtensions,
-	CollectionProperties
+	Collection
 {}
modifiedpallets/nonfungible/src/common.rsdiffbeforeafterboth
--- a/pallets/nonfungible/src/common.rs
+++ b/pallets/nonfungible/src/common.rs
@@ -22,7 +22,7 @@
 	PropertyKeyPermission, PropertyValue,
 };
 use pallet_common::{
-	CommonCollectionOperations, CommonWeightInfo, with_weight, weights::WeightInfo as _,
+	CommonCollectionOperations, CommonWeightInfo, with_weight, weights::WeightInfo as _
 };
 use sp_runtime::DispatchError;
 use sp_std::vec::Vec;
modifiedpallets/nonfungible/src/erc.rsdiffbeforeafterboth
--- a/pallets/nonfungible/src/erc.rs
+++ b/pallets/nonfungible/src/erc.rs
@@ -21,13 +21,16 @@
 };
 use evm_coder::{ToLog, execution::*, generate_stubgen, solidity, solidity_interface, types::*, weight};
 use frame_support::BoundedVec;
-use up_data_structs::{TokenId, SchemaVersion, PropertyPermission, PropertyKeyPermission, Property};
+use up_data_structs::{
+	TokenId, SchemaVersion, PropertyPermission, PropertyKeyPermission, Property, CollectionId,
+	PropertyKey, CollectionPropertiesVec,
+};
 use pallet_evm_coder_substrate::dispatch_to_evm;
 use sp_core::{H160, U256};
 use sp_std::vec::Vec;
 use pallet_common::{
-	erc::{CommonEvmHandler, PrecompileResult, CollectionPropertiesCall},
-	CollectionHandle,
+	erc::{CommonEvmHandler, PrecompileResult, CollectionCall},
+	CollectionHandle, CollectionPropertyPermissions,
 };
 use pallet_evm::account::CrossAccountId;
 use pallet_evm_coder_substrate::call;
@@ -158,12 +161,21 @@
 	/// Returns token's const_metadata
 	#[solidity(rename_selector = "tokenURI")]
 	fn token_uri(&self, token_id: uint256) -> Result<string> {
+		let key = pallet_common::eth::KEY_TOKEN_URI.clone();
+		if !has_token_permission::<T>(self.id, &key) {
+			return Err("No tokenURI permission".into());
+		}
+
 		self.consume_store_reads(1)?;
-		let _token_id: u32 = token_id.try_into().map_err(|_| "token id overflow")?;
-		Ok(string::from_utf8_lossy(
-			todo!()
-		)
-		.into())
+		let token_id: u32 = token_id.try_into().map_err(|_| "token id overflow")?;
+
+		let properties = <TokenProperties<T>>::try_get((self.id, token_id))
+			.map_err(|_| Error::Revert("Token properties not found".into()))?;
+		if let Some(property) = properties.get(&key) {
+			return Ok(string::from_utf8_lossy(property).into());
+		}
+
+		Err("Property tokenURI not found".into())
 	}
 }
 
@@ -350,6 +362,12 @@
 		token_id: uint256,
 		token_uri: string,
 	) -> Result<bool> {
+		let key = pallet_common::eth::KEY_TOKEN_URI.clone();
+		let permission = get_token_permission::<T>(self.id, &key)?;
+		if !permission.collection_admin {
+			return Err("Operation is not allowed".into());
+		}
+
 		let caller = T::CrossAccountId::from_eth(caller);
 		let to = T::CrossAccountId::from_eth(to);
 		let token_id: u32 = token_id.try_into().map_err(|_| "amount overflow")?;
@@ -365,13 +383,22 @@
 			return Err("item id should be next".into());
 		}
 
-		todo!("token uri");
+		let mut properties = CollectionPropertiesVec::default();
+		properties
+			.try_push(Property {
+				key,
+				value: token_uri
+					.into_bytes()
+					.try_into()
+					.map_err(|_| "token uri is too long")?,
+			})
+			.map_err(|e| Error::Revert(alloc::format!("Can't add property: {:?}", e)))?;
 
 		<Pallet<T>>::create_item(
 			self,
 			&caller,
 			CreateItemData::<T> {
-				properties: BoundedVec::default(),
+				properties,
 				owner: to,
 			},
 			&budget,
@@ -386,6 +413,30 @@
 	}
 }
 
+fn get_token_permission<T: Config>(
+	collection_id: CollectionId,
+	key: &PropertyKey,
+) -> Result<PropertyPermission> {
+	let token_property_permissions = CollectionPropertyPermissions::<T>::try_get(collection_id)
+		.map_err(|_| Error::Revert("No permissions for collection".into()))?;
+	let a = token_property_permissions
+		.get(key)
+		.map(|p| p.clone())
+		.ok_or_else(|| Error::Revert("No permission".into()))?;
+	Ok(a)
+}
+
+fn has_token_permission<T: Config>(
+	collection_id: CollectionId,
+	key: &PropertyKey,
+) -> bool {
+	if let Ok(token_property_permissions) = CollectionPropertyPermissions::<T>::try_get(collection_id) {
+		return token_property_permissions.contains_key(key);
+	}
+
+	false
+}
+
 #[solidity_interface(name = "ERC721UniqueExtensions")]
 impl<T: Config> NonfungibleHandle<T> {
 	#[weight(<SelfWeightOf<T>>::transfer())]
@@ -491,7 +542,6 @@
 			}
 			expected_index = expected_index.checked_add(1).ok_or("item id overflow")?;
 
-			todo!("token uri");
 			data.push(CreateItemData::<T> {
 				properties: BoundedVec::default(),
 				owner: to.clone(),
@@ -513,7 +563,7 @@
 		ERC721UniqueExtensions,
 		ERC721Mintable,
 		ERC721Burnable,
-		via("CollectionHandle<T>", common_mut, CollectionProperties),
+		via("CollectionHandle<T>", common_mut, Collection),
 		TokenProperties,
 	)
 )]
modifiedpallets/nonfungible/src/lib.rsdiffbeforeafterboth
--- a/pallets/nonfungible/src/lib.rs
+++ b/pallets/nonfungible/src/lib.rs
@@ -33,9 +33,8 @@
 use pallet_evm_coder_substrate::{SubstrateRecorder, WithRecorder};
 use sp_core::H160;
 use sp_runtime::{ArithmeticError, DispatchError, DispatchResult, TransactionOutcome};
-use sp_std::{vec::Vec, vec, collections::btree_set::BTreeSet};
+use sp_std::{vec::Vec, vec, collections::btree_map::BTreeMap, collections::btree_set::BTreeSet};
 use core::ops::Deref;
-use sp_std::collections::btree_map::BTreeMap;
 use codec::{Encode, Decode, MaxEncodedLen};
 use scale_info::TypeInfo;
 
modifiedpallets/nonfungible/src/stubs/UniqueNFT.rawdiffbeforeafterboth

binary blob — no preview

modifiedpallets/nonfungible/src/stubs/UniqueNFT.soldiffbeforeafterboth
--- a/pallets/nonfungible/src/stubs/UniqueNFT.sol
+++ b/pallets/nonfungible/src/stubs/UniqueNFT.sol
@@ -330,40 +330,6 @@
 	}
 }
 
-// Selector: 9b5e29c5
-contract CollectionProperties is Dummy, ERC165 {
-	// Selector: setCollectionProperty(string,bytes) 2f073f66
-	function setCollectionProperty(string memory key, bytes memory value)
-		public
-	{
-		require(false, stub_error);
-		key;
-		value;
-		dummy = 0;
-	}
-
-	// Selector: deleteCollectionProperty(string) 7b7debce
-	function deleteCollectionProperty(string memory key) public {
-		require(false, stub_error);
-		key;
-		dummy = 0;
-	}
-
-	// Throws error if key not found
-	//
-	// Selector: collectionProperty(string) cf24fd6d
-	function collectionProperty(string memory key)
-		public
-		view
-		returns (bytes memory)
-	{
-		require(false, stub_error);
-		key;
-		dummy;
-		return hex"";
-	}
-}
-
 // Selector: d74d154f
 contract ERC721UniqueExtensions is Dummy, ERC165 {
 	// Selector: transfer(address,uint256) a9059cbb
@@ -414,6 +380,68 @@
 	}
 }
 
+// Selector: f5652829
+contract Collection is Dummy, ERC165 {
+	// Selector: setCollectionProperty(string,bytes) 2f073f66
+	function setCollectionProperty(string memory key, bytes memory value)
+		public
+	{
+		require(false, stub_error);
+		key;
+		value;
+		dummy = 0;
+	}
+
+	// Selector: deleteCollectionProperty(string) 7b7debce
+	function deleteCollectionProperty(string memory key) public {
+		require(false, stub_error);
+		key;
+		dummy = 0;
+	}
+
+	// Throws error if key not found
+	//
+	// Selector: collectionProperty(string) cf24fd6d
+	function collectionProperty(string memory key)
+		public
+		view
+		returns (bytes memory)
+	{
+		require(false, stub_error);
+		key;
+		dummy;
+		return hex"";
+	}
+
+	// Selector: ethSetSponsor(address) 8f9af356
+	function ethSetSponsor(address sponsor) public {
+		require(false, stub_error);
+		sponsor;
+		dummy = 0;
+	}
+
+	// Selector: ethConfirmSponsorship() a8580d1a
+	function ethConfirmSponsorship() public {
+		require(false, stub_error);
+		dummy = 0;
+	}
+
+	// Selector: setLimit(string,string) bf4d2014
+	function setLimit(string memory limit, string memory value) public {
+		require(false, stub_error);
+		limit;
+		value;
+		dummy = 0;
+	}
+
+	// Selector: contractAddress() f6b4dfb4
+	function contractAddress() public view returns (address) {
+		require(false, stub_error);
+		dummy;
+		return 0x0000000000000000000000000000000000000000;
+	}
+}
+
 contract UniqueNFT is
 	Dummy,
 	ERC165,
@@ -423,6 +451,6 @@
 	ERC721UniqueExtensions,
 	ERC721Mintable,
 	ERC721Burnable,
-	CollectionProperties,
+	Collection,
 	TokenProperties
 {}
modifiedpallets/unique/Cargo.tomldiffbeforeafterboth
--- a/pallets/unique/Cargo.toml
+++ b/pallets/unique/Cargo.toml
@@ -19,6 +19,7 @@
 runtime-benchmarks = ['frame-benchmarking', 'pallet-common/runtime-benchmarks']
 std = [
     'codec/std',
+    'serde/std',
     'frame-support/std',
     'frame-system/std',
     'pallet-evm/std',
@@ -27,10 +28,25 @@
     'sp-std/std',
     'sp-runtime/std',
     'frame-benchmarking/std',
+    'evm-coder/std',
+    'pallet-evm-coder-substrate/std',
+    'pallet-nonfungible/std',
 ]
 limit-testing = ["up-data-structs/limit-testing"]
 
 ################################################################################
+# Standart Dependencies
+
+[dependencies.serde]
+default-features = false
+features = ['derive']
+version = '1.0.130'
+
+[dependencies.ethereum]
+version = "0.12.0"
+default-features = false
+
+################################################################################
 # Substrate Dependencies
 
 [dependencies.codec]
@@ -74,7 +90,6 @@
 default-features = false
 git = "https://github.com/paritytech/substrate"
 branch = "polkadot-v0.9.21"
-
 
 ################################################################################
 # Local Dependencies
@@ -85,3 +100,6 @@
 ] }
 pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }
 pallet-common = { default-features = false, path = "../common" }
+evm-coder = { default-features = false, path = '../../crates/evm-coder' }
+pallet-evm-coder-substrate = { default-features = false, path = '../../pallets/evm-coder-substrate' }
+pallet-nonfungible = { default-features = false, path = '../../pallets/nonfungible' }
addedpallets/unique/src/eth/mod.rsdiffbeforeafterboth
--- /dev/null
+++ b/pallets/unique/src/eth/mod.rs
@@ -0,0 +1,171 @@
+// 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 core::marker::PhantomData;
+use evm_coder::{execution::*, generate_stubgen, solidity_interface, types::*, ToLog};
+use ethereum as _;
+use pallet_evm_coder_substrate::{SubstrateRecorder, WithRecorder};
+use pallet_evm::{OnMethodCall, PrecompileResult, account::CrossAccountId, Pallet as PalletEvm};
+use up_data_structs::{
+	CreateCollectionData, MAX_COLLECTION_DESCRIPTION_LENGTH, MAX_TOKEN_PREFIX_LENGTH,
+	MAX_COLLECTION_NAME_LENGTH,
+};
+use frame_support::traits::Get;
+use sp_core::H160;
+use pallet_common::CollectionById;
+
+use sp_std::vec::Vec;
+use alloc::format;
+
+pub trait Config:
+	frame_system::Config
+	+ pallet_evm_coder_substrate::Config
+	+ pallet_evm::account::Config
+	+ pallet_nonfungible::Config
+{
+	type ContractAddress: Get<H160>;
+}
+
+struct EvmCollectionHelper<T: Config>(SubstrateRecorder<T>);
+impl<T: Config> WithRecorder<T> for EvmCollectionHelper<T> {
+	fn recorder(&self) -> &SubstrateRecorder<T> {
+		&self.0
+	}
+
+	fn into_recorder(self) -> SubstrateRecorder<T> {
+		self.0
+	}
+}
+
+#[solidity_interface(name = "CollectionHelper")]
+impl<T: Config> EvmCollectionHelper<T> {
+	fn create_721_collection(
+		&self,
+		caller: caller,
+		name: string,
+		description: string,
+		token_prefix: string,
+	) -> Result<address> {
+		let caller = T::CrossAccountId::from_eth(caller);
+		let name = name
+			.encode_utf16()
+			.collect::<Vec<u16>>()
+			.try_into()
+			.map_err(|_| error_feild_too_long(stringify!(name), MAX_COLLECTION_NAME_LENGTH))?;
+		let description = description
+			.encode_utf16()
+			.collect::<Vec<u16>>()
+			.try_into()
+			.map_err(|_| {
+				error_feild_too_long(stringify!(description), MAX_COLLECTION_DESCRIPTION_LENGTH)
+			})?;
+		let token_prefix = token_prefix
+			.into_bytes()
+			.try_into()
+			.map_err(|_| error_feild_too_long(stringify!(token_prefix), MAX_TOKEN_PREFIX_LENGTH))?;
+
+		let key = pallet_common::eth::KEY_TOKEN_URI.clone();
+		let permission = up_data_structs::PropertyPermission {
+			mutable: true,
+			collection_admin: true,
+			token_owner: false,
+		};
+		let mut token_property_permissions =
+			up_data_structs::CollectionPropertiesPermissionsVec::default();
+		token_property_permissions
+			.try_push(up_data_structs::PropertyKeyPermission { key, permission })
+			.map_err(|e| Error::Revert(format!("{:?}", e)))?;
+
+		let data = CreateCollectionData {
+			name,
+			description,
+			token_prefix,
+			token_property_permissions,
+			..Default::default()
+		};
+
+		let collection_id =
+			<pallet_nonfungible::Pallet<T>>::init_collection(caller.as_sub().clone(), data)
+				.map_err(pallet_evm_coder_substrate::dispatch_to_evm::<T>)?;
+
+		let address = pallet_common::eth::collection_id_to_address(collection_id);
+		<PalletEvm<T>>::deposit_log(
+			EthCollectionEvent::CollectionCreated {
+				owner: *caller.as_eth(),
+				collection_id: address,
+			}
+			.to_log(address),
+		);
+		Ok(address)
+	}
+
+	fn is_collection_exist(&self, _caller: caller, collection_address: address) -> Result<bool> {
+		if let Some(id) = pallet_common::eth::map_eth_to_id(&collection_address) {
+			let collection_id = id;
+			return Ok(<CollectionById<T>>::contains_key(collection_id));
+		}
+
+		Ok(false)
+	}
+}
+
+#[derive(ToLog)]
+pub enum EthCollectionEvent {
+	CollectionCreated {
+		#[indexed]
+		owner: address,
+		#[indexed]
+		collection_id: address,
+	},
+}
+
+pub struct CollectionHelperOnMethodCall<T: Config>(PhantomData<*const T>);
+impl<T: Config> OnMethodCall<T> for CollectionHelperOnMethodCall<T> {
+	fn is_reserved(contract: &sp_core::H160) -> bool {
+		contract == &T::ContractAddress::get()
+	}
+
+	fn is_used(contract: &sp_core::H160) -> bool {
+		contract == &T::ContractAddress::get()
+	}
+
+	fn call(
+		source: &sp_core::H160,
+		target: &sp_core::H160,
+		gas_left: u64,
+		input: &[u8],
+		value: sp_core::U256,
+	) -> Option<PrecompileResult> {
+		if target != &T::ContractAddress::get() {
+			return None;
+		}
+
+		let helpers = EvmCollectionHelper::<T>(SubstrateRecorder::<T>::new(gas_left));
+		pallet_evm_coder_substrate::call(*source, helpers, value, input)
+	}
+
+	fn get_code(contract: &sp_core::H160) -> Option<Vec<u8>> {
+		(contract == &T::ContractAddress::get())
+			.then(|| include_bytes!("./stubs/CollectionHelper.raw").to_vec())
+	}
+}
+
+generate_stubgen!(collection_helper_impl, CollectionHelperCall<()>, true);
+generate_stubgen!(collection_helper_iface, CollectionHelperCall<()>, false);
+
+fn error_feild_too_long(feild: &str, bound: u32) -> Error {
+	Error::Revert(format!("{} is too long. Max length is {}.", feild, bound))
+}
addedpallets/unique/src/eth/stubs/CollectionHelper.rawdiffbeforeafterboth

binary blob — no preview

addedpallets/unique/src/eth/stubs/CollectionHelper.soldiffbeforeafterboth
--- /dev/null
+++ b/pallets/unique/src/eth/stubs/CollectionHelper.sol
@@ -0,0 +1,51 @@
+// SPDX-License-Identifier: OTHER
+// This code is automatically generated
+
+pragma solidity >=0.8.0 <0.9.0;
+
+// Common stubs holder
+contract Dummy {
+	uint8 dummy;
+	string stub_error = "this contract is implemented in native";
+}
+
+contract ERC165 is Dummy {
+	function supportsInterface(bytes4 interfaceID)
+		external
+		view
+		returns (bool)
+	{
+		require(false, stub_error);
+		interfaceID;
+		return true;
+	}
+}
+
+// Selector: 56c215c5
+contract CollectionHelper is Dummy, ERC165 {
+	// Selector: create721Collection(string,string,string) 951c0151
+	function create721Collection(
+		string memory name,
+		string memory description,
+		string memory tokenPrefix
+	) public view returns (address) {
+		require(false, stub_error);
+		name;
+		description;
+		tokenPrefix;
+		dummy;
+		return 0x0000000000000000000000000000000000000000;
+	}
+
+	// Selector: isCollectionExist(address) c3de1494
+	function isCollectionExist(address collectionAddress)
+		public
+		view
+		returns (bool)
+	{
+		require(false, stub_error);
+		collectionAddress;
+		dummy;
+		return false;
+	}
+}
modifiedpallets/unique/src/lib.rsdiffbeforeafterboth
--- a/pallets/unique/src/lib.rs
+++ b/pallets/unique/src/lib.rs
@@ -22,6 +22,8 @@
 	clippy::unused_unit
 )]
 
+extern crate alloc;
+
 use frame_support::{
 	decl_module, decl_storage, decl_error, decl_event,
 	dispatch::DispatchResult,
@@ -46,6 +48,7 @@
 	CollectionHandle, Pallet as PalletCommon, CommonWeightInfo, dispatch::dispatch_call,
 	dispatch::CollectionDispatch,
 };
+pub mod eth;
 
 #[cfg(feature = "runtime-benchmarks")]
 mod benchmarking;
@@ -520,7 +523,7 @@
 			let mut target_collection = <CollectionHandle<T>>::try_get(collection_id)?;
 			target_collection.check_is_owner(&sender)?;
 
-			target_collection.sponsorship = SponsorshipState::Unconfirmed(new_sponsor.clone());
+			target_collection.set_sponsor(new_sponsor.clone());
 
 			<Pallet<T>>::deposit_event(Event::<T>::CollectionSponsorSet(
 				collection_id,
@@ -544,11 +547,9 @@
 
 			let mut target_collection = <CollectionHandle<T>>::try_get(collection_id)?;
 			ensure!(
-				target_collection.sponsorship.pending_sponsor() == Some(&sender),
+				target_collection.confirm_sponsorship(&sender),
 				Error::<T>::ConfirmUnsetSponsorFail
 			);
-
-			target_collection.sponsorship = SponsorshipState::Confirmed(sender.clone());
 
 			<Pallet<T>>::deposit_event(Event::<T>::SponsorshipConfirmed(
 				collection_id,
modifiedprimitives/data-structs/Cargo.tomldiffbeforeafterboth
--- a/primitives/data-structs/Cargo.toml
+++ b/primitives/data-structs/Cargo.toml
@@ -40,6 +40,6 @@
   "sp-std/std",
   "pallet-evm/std",
 ]
-serde1 = ["serde"]
+serde1 = ["serde/alloc"]
 limit-testing = []
 runtime-benchmarks = []
\ No newline at end of file
modifiedprimitives/data-structs/src/lib.rsdiffbeforeafterboth
--- a/primitives/data-structs/src/lib.rs
+++ b/primitives/data-structs/src/lib.rs
@@ -506,6 +506,7 @@
 }
 
 #[derive(Encode, Decode, Debug, Clone, PartialEq, TypeInfo, MaxEncodedLen)]
+#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]
 pub enum MetaUpdatePermission {
 	ItemOwner,
 	Admin,
@@ -760,6 +761,10 @@
 		self.0.get(key)
 	}
 
+	pub fn contains_key(&self, key: &PropertyKey) -> bool {
+		self.0.contains_key(key)
+	}
+
 	fn check_property_key(key: &PropertyKey) -> Result<(), PropertiesError> {
 		if key.is_empty() {
 			return Err(PropertiesError::EmptyPropertyKey);
modifiedruntime/opal/src/lib.rsdiffbeforeafterboth
--- a/runtime/opal/src/lib.rs
+++ b/runtime/opal/src/lib.rs
@@ -50,6 +50,7 @@
 pub use pallet_balances::Call as BalancesCall;
 pub use pallet_evm::{
 	EnsureAddressTruncated, HashedAddressMapping, Runner, account::CrossAccountId as _,
+	OnMethodCall, Account as EVMAccount, FeeCalculator, GasWeightMapping,
 };
 pub use frame_support::{
 	construct_runtime, match_types,
@@ -79,7 +80,6 @@
 };
 use smallvec::smallvec;
 use codec::{Encode, Decode};
-use pallet_evm::{Account as EVMAccount, FeeCalculator, GasWeightMapping};
 use fp_rpc::TransactionStatus;
 use sp_runtime::{
 	traits::{BlockNumberProvider, Dispatchable, PostDispatchInfoOf, Saturating},
@@ -306,6 +306,7 @@
 		pallet_evm_migration::OnMethodCall<Self>,
 		pallet_evm_contract_helpers::HelpersOnMethodCall<Self>,
 		CollectionDispatchT<Self>,
+		pallet_unique::eth::CollectionHelperOnMethodCall<Self>,
 	);
 	type OnCreate = pallet_evm_contract_helpers::HelpersOnCreate<Self>;
 	type ChainId = ChainId;
@@ -974,6 +975,11 @@
 	pub const HelpersContractAddress: H160 = H160([
 		0x84, 0x28, 0x99, 0xec, 0xf3, 0x80, 0x55, 0x3e, 0x8a, 0x4d, 0xe7, 0x5b, 0xf5, 0x34, 0xcd, 0xf6, 0xfb, 0xf6, 0x40, 0x49,
 	]);
+
+	// 0x6c4e9fe1ae37a41e93cee429e8e1881abdcbb54f
+	pub const EvmCollectionHelperAddress: H160 = H160([
+		0x6c, 0x4e, 0x9f, 0xe1, 0xae, 0x37, 0xa4, 0x1e, 0x93, 0xce, 0xe4, 0x29, 0xe8, 0xe1, 0x88, 0x1a, 0xbd, 0xcb, 0xb5, 0x4f,
+	]);
 }
 
 impl pallet_evm_contract_helpers::Config for Runtime {
@@ -981,6 +987,10 @@
 	type DefaultSponsoringRateLimit = DefaultSponsoringRateLimit;
 }
 
+impl pallet_unique::eth::Config for Runtime {
+	type ContractAddress = EvmCollectionHelperAddress;
+}
+
 construct_runtime!(
 	pub enum Runtime where
 		Block = Block,
modifiedruntime/quartz/src/lib.rsdiffbeforeafterboth
--- a/runtime/quartz/src/lib.rs
+++ b/runtime/quartz/src/lib.rs
@@ -66,7 +66,6 @@
 		WeightToFeePolynomial, WeightToFeeCoefficient, WeightToFeeCoefficients, ConstantMultiplier,
 	},
 };
-use unique_runtime_common::dispatch::{CollectionDispatchT, CollectionDispatch};
 use up_data_structs::*;
 // use pallet_contracts::weights::WeightInfo;
 // #[cfg(any(feature = "std", test))]
@@ -116,7 +115,15 @@
 //use xcm_executor::traits::MatchesFungible;
 use sp_runtime::traits::CheckedConversion;
 
-use unique_runtime_common::{impl_common_runtime_apis, types::*, constants::*};
+use unique_runtime_common::{
+	impl_common_runtime_apis,
+	types::*,
+	constants::*,
+	dispatch::{CollectionDispatchT, CollectionDispatch},
+	sponsoring::UniqueSponsorshipHandler,
+	eth_sponsoring::UniqueEthSponsorshipHandler,
+	weights::CommonWeights,
+};
 
 pub const RUNTIME_NAME: &str = "quartz";
 pub const TOKEN_SYMBOL: &str = "QTZ";
@@ -278,6 +285,7 @@
 		pallet_evm_migration::OnMethodCall<Self>,
 		pallet_evm_contract_helpers::HelpersOnMethodCall<Self>,
 		CollectionDispatchT<Self>,
+		pallet_unique::eth::CollectionHelperOnMethodCall<Self>,
 	);
 	type OnCreate = pallet_evm_contract_helpers::HelpersOnCreate<Self>;
 	type ChainId = ChainId;
@@ -891,6 +899,7 @@
 impl pallet_unique::Config for Runtime {
 	type Event = Event;
 	type WeightInfo = pallet_unique::weights::SubstrateWeight<Self>;
+	type CommonWeightInfo = CommonWeights<Self>;
 }
 
 parameter_types! {
@@ -912,11 +921,11 @@
 // }
 
 type EvmSponsorshipHandler = (
-	pallet_unique::UniqueEthSponsorshipHandler<Runtime>,
+	UniqueEthSponsorshipHandler<Runtime>,
 	pallet_evm_contract_helpers::HelpersContractSponsoring<Runtime>,
 );
 type SponsorshipHandler = (
-	pallet_unique::UniqueSponsorshipHandler<Runtime>,
+	UniqueSponsorshipHandler<Runtime>,
 	//pallet_contract_helpers::ContractSponsorshipHandler<Runtime>,
 	pallet_evm_transaction_payment::BridgeSponsorshipHandler<Runtime>,
 );
@@ -951,6 +960,11 @@
 	pub const HelpersContractAddress: H160 = H160([
 		0x84, 0x28, 0x99, 0xec, 0xf3, 0x80, 0x55, 0x3e, 0x8a, 0x4d, 0xe7, 0x5b, 0xf5, 0x34, 0xcd, 0xf6, 0xfb, 0xf6, 0x40, 0x49,
 	]);
+		
+	// 0x6c4e9fe1ae37a41e93cee429e8e1881abdcbb54f
+	pub const EvmCollectionHelperAddress: H160 = H160([
+		0x6c, 0x4e, 0x9f, 0xe1, 0xae, 0x37, 0xa4, 0x1e, 0x93, 0xce, 0xe4, 0x29, 0xe8, 0xe1, 0x88, 0x1a, 0xbd, 0xcb, 0xb5, 0x4f,
+	]);
 }
 
 impl pallet_evm_contract_helpers::Config for Runtime {
@@ -958,6 +972,10 @@
 	type DefaultSponsoringRateLimit = DefaultSponsoringRateLimit;
 }
 
+impl pallet_unique::eth::Config for Runtime {
+	type ContractAddress = EvmCollectionHelperAddress;
+}
+
 construct_runtime!(
 	pub enum Runtime where
 		Block = Block,
modifiedruntime/unique/src/lib.rsdiffbeforeafterboth
before · runtime/unique/src/lib.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/>.1617//! The Substrate Node Template runtime. This can be compiled with `#[no_std]`, ready for Wasm.1819#![cfg_attr(not(feature = "std"), no_std)]20// `construct_runtime!` does a lot of recursion and requires us to increase the limit to 256.21#![recursion_limit = "1024"]22#![allow(clippy::from_over_into, clippy::identity_op)]23#![allow(clippy::fn_to_numeric_cast_with_truncation)]24// Make the WASM binary available.25#[cfg(feature = "std")]26include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));2728use sp_api::impl_runtime_apis;29use sp_core::{crypto::KeyTypeId, OpaqueMetadata, H256, U256, H160};30use sp_runtime::DispatchError;31// #[cfg(any(feature = "std", test))]32// pub use sp_runtime::BuildStorage;3334use sp_runtime::{35	Permill, Perbill, Percent, create_runtime_str, generic, impl_opaque_keys,36	traits::{AccountIdLookup, BlakeTwo256, Block as BlockT, AccountIdConversion, Zero},37	transaction_validity::{TransactionSource, TransactionValidity},38	ApplyExtrinsicResult, RuntimeAppPublic,39};4041use sp_std::prelude::*;4243#[cfg(feature = "std")]44use sp_version::NativeVersion;45use sp_version::RuntimeVersion;46pub use pallet_transaction_payment::{47	Multiplier, TargetedFeeAdjustment, FeeDetails, RuntimeDispatchInfo,48};49// A few exports that help ease life for downstream crates.50pub use pallet_balances::Call as BalancesCall;51pub use pallet_evm::{52	EnsureAddressTruncated, HashedAddressMapping, Runner, account::CrossAccountId as _,53};54pub use frame_support::{55	construct_runtime, match_types,56	dispatch::DispatchResult,57	PalletId, parameter_types, StorageValue, ConsensusEngineId,58	traits::{59		tokens::currency::Currency as CurrencyT, OnUnbalanced as OnUnbalancedT, Everything,60		Currency, ExistenceRequirement, Get, IsInVec, KeyOwnerProofSystem, LockIdentifier,61		OnUnbalanced, Randomness, FindAuthor, ConstU32, Imbalance,62	},63	weights::{64		constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_PER_SECOND},65		DispatchClass, DispatchInfo, GetDispatchInfo, IdentityFee, Pays, PostDispatchInfo, Weight,66		WeightToFeePolynomial, WeightToFeeCoefficient, WeightToFeeCoefficients, ConstantMultiplier,67	},68};69use unique_runtime_common::{70	dispatch::{CollectionDispatchT, CollectionDispatch},71	weights::CommonWeights,72	sponsoring::UniqueSponsorshipHandler,73	eth_sponsoring::UniqueEthSponsorshipHandler,74};75use up_data_structs::*;76// use pallet_contracts::weights::WeightInfo;77// #[cfg(any(feature = "std", test))]78use frame_system::{79	self as frame_system, EnsureRoot, EnsureSigned,80	limits::{BlockWeights, BlockLength},81};82use sp_arithmetic::{83	traits::{BaseArithmetic, Unsigned},84};85use smallvec::smallvec;86use codec::{Encode, Decode};87use pallet_evm::{Account as EVMAccount, FeeCalculator, GasWeightMapping};88use fp_rpc::TransactionStatus;89use sp_runtime::{90	traits::{BlockNumberProvider, Dispatchable, PostDispatchInfoOf, Saturating},91	transaction_validity::TransactionValidityError,92	SaturatedConversion,93};9495// pub use pallet_timestamp::Call as TimestampCall;9697// Polkadot imports98use pallet_xcm::XcmPassthrough;99use polkadot_parachain::primitives::Sibling;100use up_data_structs::mapping::{CrossTokenAddressMapping, EvmTokenAddressMapping};101use xcm::v1::{BodyId, Junction::*, MultiLocation, NetworkId, Junctions::*};102use xcm_builder::{103	AccountId32Aliases, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, CurrencyAdapter,104	EnsureXcmOrigin, FixedWeightBounds, LocationInverter, NativeAsset, ParentAsSuperuser,105	RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia,106	SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit,107	ParentIsPreset,108};109use xcm_executor::{Config, XcmExecutor, Assets};110use sp_std::{marker::PhantomData};111112use xcm::latest::{113	//	Xcm,114	AssetId::{Concrete},115	Fungibility::Fungible as XcmFungible,116	MultiAsset,117	Error as XcmError,118};119use xcm_executor::traits::{MatchesFungible, WeightTrader};120//use xcm_executor::traits::MatchesFungible;121use sp_runtime::traits::CheckedConversion;122123use unique_runtime_common::{impl_common_runtime_apis, types::*, constants::*};124125pub const RUNTIME_NAME: &str = "unique";126pub const TOKEN_SYMBOL: &str = "UNQ";127128type CrossAccountId = pallet_evm::account::BasicCrossAccountId<Runtime>;129130impl RuntimeInstance for Runtime {131	type CrossAccountId = self::CrossAccountId;132133	type TransactionConverter = self::TransactionConverter;134135	fn get_transaction_converter() -> TransactionConverter {136		TransactionConverter137	}138}139140/// Opaque types. These are used by the CLI to instantiate machinery that don't need to know141/// the specifics of the runtime. They can then be made to be agnostic over specific formats142/// of data like extrinsics, allowing for them to continue syncing the network through upgrades143/// to even the core data structures.144pub mod opaque {145	use sp_std::prelude::*;146	use sp_runtime::impl_opaque_keys;147	use super::Aura;148149	pub use unique_runtime_common::types::*;150151	impl_opaque_keys! {152		pub struct SessionKeys {153			pub aura: Aura,154		}155	}156}157158/// This runtime version.159pub const VERSION: RuntimeVersion = RuntimeVersion {160	spec_name: create_runtime_str!(RUNTIME_NAME),161	impl_name: create_runtime_str!(RUNTIME_NAME),162	authoring_version: 1,163	spec_version: 920000,164	impl_version: 0,165	apis: RUNTIME_API_VERSIONS,166	transaction_version: 1,167	state_version: 0,168};169170#[derive(codec::Encode, codec::Decode)]171pub enum XCMPMessage<XAccountId, XBalance> {172	/// Transfer tokens to the given account from the Parachain account.173	TransferToken(XAccountId, XBalance),174}175176/// The version information used to identify this runtime when compiled natively.177#[cfg(feature = "std")]178pub fn native_version() -> NativeVersion {179	NativeVersion {180		runtime_version: VERSION,181		can_author_with: Default::default(),182	}183}184185type NegativeImbalance = <Balances as Currency<AccountId>>::NegativeImbalance;186187pub struct DealWithFees;188impl OnUnbalanced<NegativeImbalance> for DealWithFees {189	fn on_unbalanceds<B>(mut fees_then_tips: impl Iterator<Item = NegativeImbalance>) {190		if let Some(fees) = fees_then_tips.next() {191			// for fees, 100% to treasury192			let mut split = fees.ration(100, 0);193			if let Some(tips) = fees_then_tips.next() {194				// for tips, if any, 100% to treasury195				tips.ration_merge_into(100, 0, &mut split);196			}197			Treasury::on_unbalanced(split.0);198			// Author::on_unbalanced(split.1);199		}200	}201}202203parameter_types! {204	pub const BlockHashCount: BlockNumber = 2400;205	pub RuntimeBlockLength: BlockLength =206		BlockLength::max_with_normal_ratio(5 * 1024 * 1024, NORMAL_DISPATCH_RATIO);207	pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);208	pub const MaximumBlockLength: u32 = 5 * 1024 * 1024;209	pub RuntimeBlockWeights: BlockWeights = BlockWeights::builder()210		.base_block(BlockExecutionWeight::get())211		.for_class(DispatchClass::all(), |weights| {212			weights.base_extrinsic = ExtrinsicBaseWeight::get();213		})214		.for_class(DispatchClass::Normal, |weights| {215			weights.max_total = Some(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT);216		})217		.for_class(DispatchClass::Operational, |weights| {218			weights.max_total = Some(MAXIMUM_BLOCK_WEIGHT);219			// Operational transactions have some extra reserved space, so that they220			// are included even if block reached `MAXIMUM_BLOCK_WEIGHT`.221			weights.reserved = Some(222				MAXIMUM_BLOCK_WEIGHT - NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT223			);224		})225		.avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO)226		.build_or_panic();227	pub const Version: RuntimeVersion = VERSION;228	pub const SS58Prefix: u16 = 7391;229}230231parameter_types! {232	pub const ChainId: u64 = 8880;233}234235pub struct FixedFee;236impl FeeCalculator for FixedFee {237	fn min_gas_price() -> U256 {238		MIN_GAS_PRICE.into()239	}240}241242// Assuming slowest ethereum opcode is SSTORE, with gas price of 20000 as our worst case243// (contract, which only writes a lot of data),244// approximating on top of our real store write weight245parameter_types! {246	pub const WritesPerSecond: u64 = WEIGHT_PER_SECOND / <Runtime as frame_system::Config>::DbWeight::get().write;247	pub const GasPerSecond: u64 = WritesPerSecond::get() * 20000;248	pub const WeightPerGas: u64 = WEIGHT_PER_SECOND / GasPerSecond::get();249}250251/// Limiting EVM execution to 50% of block for substrate users and management tasks252/// EVM transaction consumes more weight than substrate's, so we can't rely on them being253/// scheduled fairly254const EVM_DISPATCH_RATIO: Perbill = Perbill::from_percent(50);255parameter_types! {256	pub BlockGasLimit: U256 = U256::from(NORMAL_DISPATCH_RATIO * EVM_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT / WeightPerGas::get());257}258259pub enum FixedGasWeightMapping {}260impl GasWeightMapping for FixedGasWeightMapping {261	fn gas_to_weight(gas: u64) -> Weight {262		gas.saturating_mul(WeightPerGas::get())263	}264	fn weight_to_gas(weight: Weight) -> u64 {265		weight / WeightPerGas::get()266	}267}268269impl pallet_evm::Config for Runtime {270	type BlockGasLimit = BlockGasLimit;271	type FeeCalculator = FixedFee;272	type GasWeightMapping = FixedGasWeightMapping;273	type BlockHashMapping = pallet_ethereum::EthereumBlockHashMapping<Self>;274	type CallOrigin = EnsureAddressTruncated<Self>;275	type WithdrawOrigin = EnsureAddressTruncated<Self>;276	type AddressMapping = HashedAddressMapping<Self::Hashing>;277	type PrecompilesType = ();278	type PrecompilesValue = ();279	type Currency = Balances;280	type Event = Event;281	type OnMethodCall = (282		pallet_evm_migration::OnMethodCall<Self>,283		pallet_evm_contract_helpers::HelpersOnMethodCall<Self>,284		CollectionDispatchT<Self>,285	);286	type OnCreate = pallet_evm_contract_helpers::HelpersOnCreate<Self>;287	type ChainId = ChainId;288	type Runner = pallet_evm::runner::stack::Runner<Self>;289	type OnChargeTransaction = pallet_evm::EVMCurrencyAdapter<Balances, DealWithFees>;290	type TransactionValidityHack = pallet_evm_transaction_payment::TransactionValidityHack<Self>;291	type FindAuthor = EthereumFindAuthor<Aura>;292}293294impl pallet_evm_migration::Config for Runtime {295	type WeightInfo = pallet_evm_migration::weights::SubstrateWeight<Self>;296}297298pub struct EthereumFindAuthor<F>(core::marker::PhantomData<F>);299impl<F: FindAuthor<u32>> FindAuthor<H160> for EthereumFindAuthor<F> {300	fn find_author<'a, I>(digests: I) -> Option<H160>301	where302		I: 'a + IntoIterator<Item = (ConsensusEngineId, &'a [u8])>,303	{304		if let Some(author_index) = F::find_author(digests) {305			let authority_id = Aura::authorities()[author_index as usize].clone();306			return Some(H160::from_slice(&authority_id.to_raw_vec()[4..24]));307		}308		None309	}310}311312impl pallet_ethereum::Config for Runtime {313	type Event = Event;314	type StateRoot = pallet_ethereum::IntermediateStateRoot<Self>;315}316317impl pallet_randomness_collective_flip::Config for Runtime {}318319impl frame_system::Config for Runtime {320	/// The data to be stored in an account.321	type AccountData = pallet_balances::AccountData<Balance>;322	/// The identifier used to distinguish between accounts.323	type AccountId = AccountId;324	/// The basic call filter to use in dispatchable.325	type BaseCallFilter = Everything;326	/// Maximum number of block number to block hash mappings to keep (oldest pruned first).327	type BlockHashCount = BlockHashCount;328	/// The maximum length of a block (in bytes).329	type BlockLength = RuntimeBlockLength;330	/// The index type for blocks.331	type BlockNumber = BlockNumber;332	/// The weight of the overhead invoked on the block import process, independent of the extrinsics included in that block.333	type BlockWeights = RuntimeBlockWeights;334	/// The aggregated dispatch type that is available for extrinsics.335	type Call = Call;336	/// The weight of database operations that the runtime can invoke.337	type DbWeight = RocksDbWeight;338	/// The ubiquitous event type.339	type Event = Event;340	/// The type for hashing blocks and tries.341	type Hash = Hash;342	/// The hashing algorithm used.343	type Hashing = BlakeTwo256;344	/// The header type.345	type Header = generic::Header<BlockNumber, BlakeTwo256>;346	/// The index type for storing how many extrinsics an account has signed.347	type Index = Index;348	/// The lookup mechanism to get account ID from whatever is passed in dispatchers.349	type Lookup = AccountIdLookup<AccountId, ()>;350	/// What to do if an account is fully reaped from the system.351	type OnKilledAccount = ();352	/// What to do if a new account is created.353	type OnNewAccount = ();354	type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode<Self>;355	/// The ubiquitous origin type.356	type Origin = Origin;357	/// This type is being generated by `construct_runtime!`.358	type PalletInfo = PalletInfo;359	/// This is used as an identifier of the chain. 42 is the generic substrate prefix.360	type SS58Prefix = SS58Prefix;361	/// Weight information for the extrinsics of this pallet.362	type SystemWeightInfo = frame_system::weights::SubstrateWeight<Self>;363	/// Version of the runtime.364	type Version = Version;365	type MaxConsumers = ConstU32<16>;366}367368parameter_types! {369	pub const MinimumPeriod: u64 = SLOT_DURATION / 2;370}371372impl pallet_timestamp::Config for Runtime {373	/// A timestamp: milliseconds since the unix epoch.374	type Moment = u64;375	type OnTimestampSet = ();376	type MinimumPeriod = MinimumPeriod;377	type WeightInfo = ();378}379380parameter_types! {381	// pub const ExistentialDeposit: u128 = 500;382	pub const ExistentialDeposit: u128 = 0;383	pub const MaxLocks: u32 = 50;384}385386impl pallet_balances::Config for Runtime {387	type MaxLocks = MaxLocks;388	type MaxReserves = ();389	type ReserveIdentifier = [u8; 8];390	/// The type for recording an account's balance.391	type Balance = Balance;392	/// The ubiquitous event type.393	type Event = Event;394	type DustRemoval = Treasury;395	type ExistentialDeposit = ExistentialDeposit;396	type AccountStore = System;397	type WeightInfo = pallet_balances::weights::SubstrateWeight<Self>;398}399400pub const fn deposit(items: u32, bytes: u32) -> Balance {401	items as Balance * 15 * CENTIUNIQUE + (bytes as Balance) * 6 * CENTIUNIQUE402}403404/*405parameter_types! {406	pub TombstoneDeposit: Balance = deposit(407		1,408		sp_std::mem::size_of::<pallet_contracts::Pallet<Runtime>> as u32,409	);410	pub DepositPerContract: Balance = TombstoneDeposit::get();411	pub const DepositPerStorageByte: Balance = deposit(0, 1);412	pub const DepositPerStorageItem: Balance = deposit(1, 0);413	pub RentFraction: Perbill = Perbill::from_rational(1u32, 30 * DAYS);414	pub const SurchargeReward: Balance = 150 * MILLIUNIQUE;415	pub const SignedClaimHandicap: u32 = 2;416	pub const MaxDepth: u32 = 32;417	pub const MaxValueSize: u32 = 16 * 1024;418	pub const MaxCodeSize: u32 = 1024 * 1024 * 25; // 25 Mb419	// The lazy deletion runs inside on_initialize.420	pub DeletionWeightLimit: Weight = AVERAGE_ON_INITIALIZE_RATIO *421		RuntimeBlockWeights::get().max_block;422	// The weight needed for decoding the queue should be less or equal than a fifth423	// of the overall weight dedicated to the lazy deletion.424	pub DeletionQueueDepth: u32 = ((DeletionWeightLimit::get() / (425			<Runtime as pallet_contracts::Config>::WeightInfo::on_initialize_per_queue_item(1) -426			<Runtime as pallet_contracts::Config>::WeightInfo::on_initialize_per_queue_item(0)427		)) / 5) as u32;428	pub Schedule: pallet_contracts::Schedule<Runtime> = Default::default();429}430431impl pallet_contracts::Config for Runtime {432	type Time = Timestamp;433	type Randomness = RandomnessCollectiveFlip;434	type Currency = Balances;435	type Event = Event;436	type RentPayment = ();437	type SignedClaimHandicap = SignedClaimHandicap;438	type TombstoneDeposit = TombstoneDeposit;439	type DepositPerContract = DepositPerContract;440	type DepositPerStorageByte = DepositPerStorageByte;441	type DepositPerStorageItem = DepositPerStorageItem;442	type RentFraction = RentFraction;443	type SurchargeReward = SurchargeReward;444	type WeightPrice = pallet_transaction_payment::Pallet<Self>;445	type WeightInfo = pallet_contracts::weights::SubstrateWeight<Self>;446	type ChainExtension = NFTExtension;447	type DeletionQueueDepth = DeletionQueueDepth;448	type DeletionWeightLimit = DeletionWeightLimit;449	type Schedule = Schedule;450	type CallStack = [pallet_contracts::Frame<Self>; 31];451}452*/453454parameter_types! {455	/// This value increases the priority of `Operational` transactions by adding456	/// a "virtual tip" that's equal to the `OperationalFeeMultiplier * final_fee`.457	pub const OperationalFeeMultiplier: u8 = 5;458}459460/// Linear implementor of `WeightToFeePolynomial`461pub struct LinearFee<T>(sp_std::marker::PhantomData<T>);462463impl<T> WeightToFeePolynomial for LinearFee<T>464where465	T: BaseArithmetic + From<u32> + Copy + Unsigned,466{467	type Balance = T;468469	fn polynomial() -> WeightToFeeCoefficients<Self::Balance> {470		smallvec!(WeightToFeeCoefficient {471			// Targeting 0.1 Unique per NFT transfer472			coeff_integer: WEIGHT_TO_FEE_COEFF.into(),473			coeff_frac: Perbill::zero(),474			negative: false,475			degree: 1,476		})477	}478}479480impl pallet_transaction_payment::Config for Runtime {481	type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter<Balances, DealWithFees>;482	type LengthToFee = ConstantMultiplier<Balance, TransactionByteFee>;483	type OperationalFeeMultiplier = OperationalFeeMultiplier;484	type WeightToFee = LinearFee<Balance>;485	type FeeMultiplierUpdate = ();486}487488parameter_types! {489	pub const ProposalBond: Permill = Permill::from_percent(5);490	pub const ProposalBondMinimum: Balance = 1 * UNIQUE;491	pub const ProposalBondMaximum: Balance = 1000 * UNIQUE;492	pub const SpendPeriod: BlockNumber = 5 * MINUTES;493	pub const Burn: Permill = Permill::from_percent(0);494	pub const TipCountdown: BlockNumber = 1 * DAYS;495	pub const TipFindersFee: Percent = Percent::from_percent(20);496	pub const TipReportDepositBase: Balance = 1 * UNIQUE;497	pub const DataDepositPerByte: Balance = 1 * CENTIUNIQUE;498	pub const BountyDepositBase: Balance = 1 * UNIQUE;499	pub const BountyDepositPayoutDelay: BlockNumber = 1 * DAYS;500	pub const TreasuryModuleId: PalletId = PalletId(*b"py/trsry");501	pub const BountyUpdatePeriod: BlockNumber = 14 * DAYS;502	pub const MaximumReasonLength: u32 = 16384;503	pub const BountyCuratorDeposit: Permill = Permill::from_percent(50);504	pub const BountyValueMinimum: Balance = 5 * UNIQUE;505	pub const MaxApprovals: u32 = 100;506}507508impl pallet_treasury::Config for Runtime {509	type PalletId = TreasuryModuleId;510	type Currency = Balances;511	type ApproveOrigin = EnsureRoot<AccountId>;512	type RejectOrigin = EnsureRoot<AccountId>;513	type Event = Event;514	type OnSlash = ();515	type ProposalBond = ProposalBond;516	type ProposalBondMinimum = ProposalBondMinimum;517	type ProposalBondMaximum = ProposalBondMaximum;518	type SpendPeriod = SpendPeriod;519	type Burn = Burn;520	type BurnDestination = ();521	type SpendFunds = ();522	type WeightInfo = pallet_treasury::weights::SubstrateWeight<Self>;523	type MaxApprovals = MaxApprovals;524}525526impl pallet_sudo::Config for Runtime {527	type Event = Event;528	type Call = Call;529}530531pub struct RelayChainBlockNumberProvider<T>(sp_std::marker::PhantomData<T>);532533impl<T: cumulus_pallet_parachain_system::Config> BlockNumberProvider534	for RelayChainBlockNumberProvider<T>535{536	type BlockNumber = BlockNumber;537538	fn current_block_number() -> Self::BlockNumber {539		cumulus_pallet_parachain_system::Pallet::<T>::validation_data()540			.map(|d| d.relay_parent_number)541			.unwrap_or_default()542	}543}544545parameter_types! {546	pub const MinVestedTransfer: Balance = 10 * UNIQUE;547	pub const MaxVestingSchedules: u32 = 28;548}549550impl orml_vesting::Config for Runtime {551	type Event = Event;552	type Currency = pallet_balances::Pallet<Runtime>;553	type MinVestedTransfer = MinVestedTransfer;554	type VestedTransferOrigin = EnsureSigned<AccountId>;555	type WeightInfo = ();556	type MaxVestingSchedules = MaxVestingSchedules;557	type BlockNumberProvider = RelayChainBlockNumberProvider<Runtime>;558}559560parameter_types! {561	pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 4;562	pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 4;563}564565impl cumulus_pallet_parachain_system::Config for Runtime {566	type Event = Event;567	type SelfParaId = parachain_info::Pallet<Self>;568	type OnSystemEvent = ();569	// type DownwardMessageHandlers = cumulus_primitives_utility::UnqueuedDmpAsParent<570	// 	MaxDownwardMessageWeight,571	// 	XcmExecutor<XcmConfig>,572	// 	Call,573	// >;574	type OutboundXcmpMessageSource = XcmpQueue;575	type DmpMessageHandler = DmpQueue;576	type ReservedDmpWeight = ReservedDmpWeight;577	type ReservedXcmpWeight = ReservedXcmpWeight;578	type XcmpMessageHandler = XcmpQueue;579}580581impl parachain_info::Config for Runtime {}582583impl cumulus_pallet_aura_ext::Config for Runtime {}584585parameter_types! {586	pub const RelayLocation: MultiLocation = MultiLocation::parent();587	pub const RelayNetwork: NetworkId = NetworkId::Polkadot;588	pub RelayOrigin: Origin = cumulus_pallet_xcm::Origin::Relay.into();589	pub Ancestry: MultiLocation = Parachain(ParachainInfo::parachain_id().into()).into();590}591592/// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used593/// when determining ownership of accounts for asset transacting and when attempting to use XCM594/// `Transact` in order to determine the dispatch Origin.595pub type LocationToAccountId = (596	// The parent (Relay-chain) origin converts to the default `AccountId`.597	ParentIsPreset<AccountId>,598	// Sibling parachain origins convert to AccountId via the `ParaId::into`.599	SiblingParachainConvertsVia<Sibling, AccountId>,600	// Straight up local `AccountId32` origins just alias directly to `AccountId`.601	AccountId32Aliases<RelayNetwork, AccountId>,602);603604pub struct OnlySelfCurrency;605impl<B: TryFrom<u128>> MatchesFungible<B> for OnlySelfCurrency {606	fn matches_fungible(a: &MultiAsset) -> Option<B> {607		match (&a.id, &a.fun) {608			(Concrete(_), XcmFungible(ref amount)) => CheckedConversion::checked_from(*amount),609			_ => None,610		}611	}612}613614/// Means for transacting assets on this chain.615pub type LocalAssetTransactor = CurrencyAdapter<616	// Use this currency:617	Balances,618	// Use this currency when it is a fungible asset matching the given location or name:619	OnlySelfCurrency,620	// Do a simple punn to convert an AccountId32 MultiLocation into a native chain account ID:621	LocationToAccountId,622	// Our chain's account ID type (we can't get away without mentioning it explicitly):623	AccountId,624	// We don't track any teleports.625	(),626>;627628/// This is the type we use to convert an (incoming) XCM origin into a local `Origin` instance,629/// ready for dispatching a transaction with Xcm's `Transact`. There is an `OriginKind` which can630/// biases the kind of local `Origin` it will become.631pub type XcmOriginToTransactDispatchOrigin = (632	// Sovereign account converter; this attempts to derive an `AccountId` from the origin location633	// using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for634	// foreign chains who want to have a local sovereign account on this chain which they control.635	SovereignSignedViaLocation<LocationToAccountId, Origin>,636	// Native converter for Relay-chain (Parent) location; will converts to a `Relay` origin when637	// recognised.638	RelayChainAsNative<RelayOrigin, Origin>,639	// Native converter for sibling Parachains; will convert to a `SiblingPara` origin when640	// recognised.641	SiblingParachainAsNative<cumulus_pallet_xcm::Origin, Origin>,642	// Superuser converter for the Relay-chain (Parent) location. This will allow it to issue a643	// transaction from the Root origin.644	ParentAsSuperuser<Origin>,645	// Native signed account converter; this just converts an `AccountId32` origin into a normal646	// `Origin::Signed` origin of the same 32-byte value.647	SignedAccountId32AsNative<RelayNetwork, Origin>,648	// Xcm origins can be represented natively under the Xcm pallet's Xcm origin.649	XcmPassthrough<Origin>,650);651652parameter_types! {653	// One XCM operation is 1_000_000 weight - almost certainly a conservative estimate.654	pub UnitWeightCost: Weight = 1_000_000;655	// 1200 UNIQUEs buy 1 second of weight.656	pub const WeightPrice: (MultiLocation, u128) = (MultiLocation::parent(), 1_200 * UNIQUE);657	pub const MaxInstructions: u32 = 100;658	pub const MaxAuthorities: u32 = 100_000;659}660661match_types! {662	pub type ParentOrParentsUnitPlurality: impl Contains<MultiLocation> = {663		MultiLocation { parents: 1, interior: Here } |664		MultiLocation { parents: 1, interior: X1(Plurality { id: BodyId::Unit, .. }) }665	};666}667668pub type Barrier = (669	TakeWeightCredit,670	AllowTopLevelPaidExecutionFrom<Everything>,671	AllowUnpaidExecutionFrom<ParentOrParentsUnitPlurality>,672	// ^^^ Parent & its unit plurality gets free execution673);674675pub struct UsingOnlySelfCurrencyComponents<676	WeightToFee: WeightToFeePolynomial<Balance = Currency::Balance>,677	AssetId: Get<MultiLocation>,678	AccountId,679	Currency: CurrencyT<AccountId>,680	OnUnbalanced: OnUnbalancedT<Currency::NegativeImbalance>,681>(682	Weight,683	Currency::Balance,684	PhantomData<(WeightToFee, AssetId, AccountId, Currency, OnUnbalanced)>,685);686impl<687		WeightToFee: WeightToFeePolynomial<Balance = Currency::Balance>,688		AssetId: Get<MultiLocation>,689		AccountId,690		Currency: CurrencyT<AccountId>,691		OnUnbalanced: OnUnbalancedT<Currency::NegativeImbalance>,692	> WeightTrader693	for UsingOnlySelfCurrencyComponents<WeightToFee, AssetId, AccountId, Currency, OnUnbalanced>694{695	fn new() -> Self {696		Self(0, Zero::zero(), PhantomData)697	}698699	fn buy_weight(&mut self, weight: Weight, payment: Assets) -> Result<Assets, XcmError> {700		let amount = WeightToFee::calc(&weight);701		let u128_amount: u128 = amount.try_into().map_err(|_| XcmError::Overflow)?;702703		// location to this parachain through relay chain704		let option1: xcm::v1::AssetId = Concrete(MultiLocation {705			parents: 1,706			interior: X1(Parachain(ParachainInfo::parachain_id().into())),707		});708		// direct location709		let option2: xcm::v1::AssetId = Concrete(MultiLocation {710			parents: 0,711			interior: Here,712		});713714		let required = if payment.fungible.contains_key(&option1) {715			(option1, u128_amount).into()716		} else if payment.fungible.contains_key(&option2) {717			(option2, u128_amount).into()718		} else {719			(Concrete(MultiLocation::default()), u128_amount).into()720		};721722		let unused = payment723			.checked_sub(required)724			.map_err(|_| XcmError::TooExpensive)?;725		self.0 = self.0.saturating_add(weight);726		self.1 = self.1.saturating_add(amount);727		Ok(unused)728	}729730	fn refund_weight(&mut self, weight: Weight) -> Option<MultiAsset> {731		let weight = weight.min(self.0);732		let amount = WeightToFee::calc(&weight);733		self.0 -= weight;734		self.1 = self.1.saturating_sub(amount);735		let amount: u128 = amount.saturated_into();736		if amount > 0 {737			Some((AssetId::get(), amount).into())738		} else {739			None740		}741	}742}743impl<744		WeightToFee: WeightToFeePolynomial<Balance = Currency::Balance>,745		AssetId: Get<MultiLocation>,746		AccountId,747		Currency: CurrencyT<AccountId>,748		OnUnbalanced: OnUnbalancedT<Currency::NegativeImbalance>,749	> Drop750	for UsingOnlySelfCurrencyComponents<WeightToFee, AssetId, AccountId, Currency, OnUnbalanced>751{752	fn drop(&mut self) {753		OnUnbalanced::on_unbalanced(Currency::issue(self.1));754	}755}756757pub struct XcmConfig;758impl Config for XcmConfig {759	type Call = Call;760	type XcmSender = XcmRouter;761	// How to withdraw and deposit an asset.762	type AssetTransactor = LocalAssetTransactor;763	type OriginConverter = XcmOriginToTransactDispatchOrigin;764	type IsReserve = NativeAsset;765	type IsTeleporter = (); // Teleportation is disabled766	type LocationInverter = LocationInverter<Ancestry>;767	type Barrier = Barrier;768	type Weigher = FixedWeightBounds<UnitWeightCost, Call, MaxInstructions>;769	type Trader = UsingOnlySelfCurrencyComponents<770		IdentityFee<Balance>,771		RelayLocation,772		AccountId,773		Balances,774		(),775	>;776	type ResponseHandler = (); // Don't handle responses for now.777	type SubscriptionService = PolkadotXcm;778779	type AssetTrap = PolkadotXcm;780	type AssetClaims = PolkadotXcm;781}782783// parameter_types! {784// 	pub const MaxDownwardMessageWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 10;785// }786787/// No local origins on this chain are allowed to dispatch XCM sends/executions.788pub type LocalOriginToLocation = (SignedToAccountId32<Origin, AccountId, RelayNetwork>,);789790/// The means for routing XCM messages which are not for local execution into the right message791/// queues.792pub type XcmRouter = (793	// Two routers - use UMP to communicate with the relay chain:794	cumulus_primitives_utility::ParentAsUmp<ParachainSystem, ()>,795	// ..and XCMP to communicate with the sibling chains.796	XcmpQueue,797);798799impl pallet_evm_coder_substrate::Config for Runtime {800	type GasWeightMapping = FixedGasWeightMapping;801}802803impl pallet_xcm::Config for Runtime {804	type Event = Event;805	type SendXcmOrigin = EnsureXcmOrigin<Origin, LocalOriginToLocation>;806	type XcmRouter = XcmRouter;807	type ExecuteXcmOrigin = EnsureXcmOrigin<Origin, LocalOriginToLocation>;808	type XcmExecuteFilter = Everything;809	type XcmExecutor = XcmExecutor<XcmConfig>;810	type XcmTeleportFilter = Everything;811	type XcmReserveTransferFilter = Everything;812	type Weigher = FixedWeightBounds<UnitWeightCost, Call, MaxInstructions>;813	type LocationInverter = LocationInverter<Ancestry>;814	type Origin = Origin;815	type Call = Call;816	const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100;817	type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion;818}819820impl cumulus_pallet_xcm::Config for Runtime {821	type Event = Event;822	type XcmExecutor = XcmExecutor<XcmConfig>;823}824825impl cumulus_pallet_xcmp_queue::Config for Runtime {826	type WeightInfo = ();827	type Event = Event;828	type XcmExecutor = XcmExecutor<XcmConfig>;829	type ChannelInfo = ParachainSystem;830	type VersionWrapper = ();831	type ExecuteOverweightOrigin = frame_system::EnsureRoot<AccountId>;832	type ControllerOrigin = EnsureRoot<AccountId>;833	type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin;834}835836impl cumulus_pallet_dmp_queue::Config for Runtime {837	type Event = Event;838	type XcmExecutor = XcmExecutor<XcmConfig>;839	type ExecuteOverweightOrigin = frame_system::EnsureRoot<AccountId>;840}841842impl pallet_aura::Config for Runtime {843	type AuthorityId = AuraId;844	type DisabledValidators = ();845	type MaxAuthorities = MaxAuthorities;846}847848parameter_types! {849	pub TreasuryAccountId: AccountId = TreasuryModuleId::get().into_account();850	pub const CollectionCreationPrice: Balance = 2 * UNIQUE;851}852853impl pallet_common::Config for Runtime {854	type WeightInfo = pallet_common::weights::SubstrateWeight<Self>;855	type Event = Event;856	type Currency = Balances;857	type CollectionCreationPrice = CollectionCreationPrice;858	type TreasuryAccountId = TreasuryAccountId;859	type CollectionDispatch = CollectionDispatchT<Self>;860861	type EvmTokenAddressMapping = EvmTokenAddressMapping;862	type CrossTokenAddressMapping = CrossTokenAddressMapping<Self::AccountId>;863}864865impl pallet_structure::Config for Runtime {866	type Event = Event;867	type Call = Call;868	type WeightInfo = pallet_structure::weights::SubstrateWeight<Self>;869}870871impl pallet_evm::account::Config for Runtime {872	type CrossAccountId = pallet_evm::account::BasicCrossAccountId<Self>;873	type EvmAddressMapping = HashedAddressMapping<Self::Hashing>;874	type EvmBackwardsAddressMapping = fp_evm_mapping::MapBackwardsAddressTruncated;875}876877impl pallet_fungible::Config for Runtime {878	type WeightInfo = pallet_fungible::weights::SubstrateWeight<Self>;879}880impl pallet_refungible::Config for Runtime {881	type WeightInfo = pallet_refungible::weights::SubstrateWeight<Self>;882}883impl pallet_nonfungible::Config for Runtime {884	type WeightInfo = pallet_nonfungible::weights::SubstrateWeight<Self>;885}886887impl pallet_proxy_rmrk_core::Config for Runtime {888	type Event = Event;889}890891impl pallet_proxy_rmrk_equip::Config for Runtime {892	type Event = Event;893}894895impl pallet_unique::Config for Runtime {896	type Event = Event;897	type WeightInfo = pallet_unique::weights::SubstrateWeight<Self>;898	type CommonWeightInfo = CommonWeights<Self>;899}900901parameter_types! {902	pub const InflationBlockInterval: BlockNumber = 100; // every time per how many blocks inflation is applied903}904905/// Used for the pallet inflation906impl pallet_inflation::Config for Runtime {907	type Currency = Balances;908	type TreasuryAccountId = TreasuryAccountId;909	type InflationBlockInterval = InflationBlockInterval;910	type BlockNumberProvider = RelayChainBlockNumberProvider<Runtime>;911}912913// parameter_types! {914// 	pub MaximumSchedulerWeight: Weight = Perbill::from_percent(50) *915// 		RuntimeBlockWeights::get().max_block;916// 	pub const MaxScheduledPerBlock: u32 = 50;917// }918919type EvmSponsorshipHandler = (920	UniqueEthSponsorshipHandler<Runtime>,921	pallet_evm_contract_helpers::HelpersContractSponsoring<Runtime>,922);923type SponsorshipHandler = (924	UniqueSponsorshipHandler<Runtime>,925	//pallet_contract_helpers::ContractSponsorshipHandler<Runtime>,926	pallet_evm_transaction_payment::BridgeSponsorshipHandler<Runtime>,927);928929// impl pallet_unq_scheduler::Config for Runtime {930// 	type Event = Event;931// 	type Origin = Origin;932// 	type PalletsOrigin = OriginCaller;933// 	type Call = Call;934// 	type MaximumWeight = MaximumSchedulerWeight;935// 	type ScheduleOrigin = EnsureSigned<AccountId>;936// 	type MaxScheduledPerBlock = MaxScheduledPerBlock;937// 	type SponsorshipHandler = SponsorshipHandler;938// 	type WeightInfo = ();939// }940941impl pallet_evm_transaction_payment::Config for Runtime {942	type EvmSponsorshipHandler = EvmSponsorshipHandler;943	type Currency = Balances;944}945946impl pallet_charge_transaction::Config for Runtime {947	type SponsorshipHandler = SponsorshipHandler;948}949950// impl pallet_contract_helpers::Config for Runtime {951//	 type DefaultSponsoringRateLimit = DefaultSponsoringRateLimit;952// }953954parameter_types! {955	// 0x842899ECF380553E8a4de75bF534cdf6fBF64049956	pub const HelpersContractAddress: H160 = H160([957		0x84, 0x28, 0x99, 0xec, 0xf3, 0x80, 0x55, 0x3e, 0x8a, 0x4d, 0xe7, 0x5b, 0xf5, 0x34, 0xcd, 0xf6, 0xfb, 0xf6, 0x40, 0x49,958	]);959}960961impl pallet_evm_contract_helpers::Config for Runtime {962	type ContractAddress = HelpersContractAddress;963	type DefaultSponsoringRateLimit = DefaultSponsoringRateLimit;964}965966construct_runtime!(967	pub enum Runtime where968		Block = Block,969		NodeBlock = opaque::Block,970		UncheckedExtrinsic = UncheckedExtrinsic971	{972		ParachainSystem: cumulus_pallet_parachain_system::{Pallet, Call, Config, Storage, Inherent, Event<T>, ValidateUnsigned} = 20,973		ParachainInfo: parachain_info::{Pallet, Storage, Config} = 21,974975		Aura: pallet_aura::{Pallet, Config<T>} = 22,976		AuraExt: cumulus_pallet_aura_ext::{Pallet, Config} = 23,977978		Balances: pallet_balances::{Pallet, Call, Storage, Config<T>, Event<T>} = 30,979		RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Pallet, Storage} = 31,980		Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 32,981		TransactionPayment: pallet_transaction_payment::{Pallet, Storage} = 33,982		Treasury: pallet_treasury::{Pallet, Call, Storage, Config, Event<T>} = 34,983		Sudo: pallet_sudo::{Pallet, Call, Storage, Config<T>, Event<T>} = 35,984		System: frame_system::{Pallet, Call, Storage, Config, Event<T>} = 36,985		Vesting: orml_vesting::{Pallet, Storage, Call, Event<T>, Config<T>} = 37,986		// Vesting: pallet_vesting::{Pallet, Call, Config<T>, Storage, Event<T>} = 37,987		// Contracts: pallet_contracts::{Pallet, Call, Storage, Event<T>} = 38,988989		// XCM helpers.990		XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event<T>} = 50,991		PolkadotXcm: pallet_xcm::{Pallet, Call, Event<T>, Origin} = 51,992		CumulusXcm: cumulus_pallet_xcm::{Pallet, Call, Event<T>, Origin} = 52,993		DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event<T>} = 53,994995		// Unique Pallets996		Inflation: pallet_inflation::{Pallet, Call, Storage} = 60,997		Unique: pallet_unique::{Pallet, Call, Storage, Event<T>} = 61,998		// Scheduler: pallet_unq_scheduler::{Pallet, Call, Storage, Event<T>} = 62,999		// free = 631000		Charging: pallet_charge_transaction::{Pallet, Call, Storage } = 64,1001		// ContractHelpers: pallet_contract_helpers::{Pallet, Call, Storage} = 65,1002		Common: pallet_common::{Pallet, Storage, Event<T>} = 66,1003		Fungible: pallet_fungible::{Pallet, Storage} = 67,1004		Refungible: pallet_refungible::{Pallet, Storage} = 68,1005		Nonfungible: pallet_nonfungible::{Pallet, Storage} = 69,1006		Structure: pallet_structure::{Pallet, Call, Storage, Event<T>} = 70,1007		RmrkCore: pallet_proxy_rmrk_core::{Pallet, Call, Storage, Event<T>} = 71,1008		RmrkEquip: pallet_proxy_rmrk_equip::{Pallet, Call, Storage, Event<T>} = 72,10091010		// Frontier1011		EVM: pallet_evm::{Pallet, Config, Call, Storage, Event<T>} = 100,1012		Ethereum: pallet_ethereum::{Pallet, Config, Call, Storage, Event, Origin} = 101,10131014		EvmCoderSubstrate: pallet_evm_coder_substrate::{Pallet, Storage} = 150,1015		EvmContractHelpers: pallet_evm_contract_helpers::{Pallet, Storage} = 151,1016		EvmTransactionPayment: pallet_evm_transaction_payment::{Pallet} = 152,1017		EvmMigration: pallet_evm_migration::{Pallet, Call, Storage} = 153,1018	}1019);10201021pub struct TransactionConverter;10221023impl fp_rpc::ConvertTransaction<UncheckedExtrinsic> for TransactionConverter {1024	fn convert_transaction(&self, transaction: pallet_ethereum::Transaction) -> UncheckedExtrinsic {1025		UncheckedExtrinsic::new_unsigned(1026			pallet_ethereum::Call::<Runtime>::transact { transaction }.into(),1027		)1028	}1029}10301031impl fp_rpc::ConvertTransaction<opaque::UncheckedExtrinsic> for TransactionConverter {1032	fn convert_transaction(1033		&self,1034		transaction: pallet_ethereum::Transaction,1035	) -> opaque::UncheckedExtrinsic {1036		let extrinsic = UncheckedExtrinsic::new_unsigned(1037			pallet_ethereum::Call::<Runtime>::transact { transaction }.into(),1038		);1039		let encoded = extrinsic.encode();1040		opaque::UncheckedExtrinsic::decode(&mut &encoded[..])1041			.expect("Encoded extrinsic is always valid")1042	}1043}10441045/// The address format for describing accounts.1046pub type Address = sp_runtime::MultiAddress<AccountId, ()>;1047/// Block header type as expected by this runtime.1048pub type Header = generic::Header<BlockNumber, BlakeTwo256>;1049/// Block type as expected by this runtime.1050pub type Block = generic::Block<Header, UncheckedExtrinsic>;1051/// A Block signed with a Justification1052pub type SignedBlock = generic::SignedBlock<Block>;1053/// BlockId type as expected by this runtime.1054pub type BlockId = generic::BlockId<Block>;1055/// The SignedExtension to the basic transaction logic.1056pub type SignedExtra = (1057	frame_system::CheckSpecVersion<Runtime>,1058	// system::CheckTxVersion<Runtime>,1059	frame_system::CheckGenesis<Runtime>,1060	frame_system::CheckEra<Runtime>,1061	frame_system::CheckNonce<Runtime>,1062	frame_system::CheckWeight<Runtime>,1063	pallet_charge_transaction::ChargeTransactionPayment<Runtime>,1064	//pallet_contract_helpers::ContractHelpersExtension<Runtime>,1065	pallet_ethereum::FakeTransactionFinalizer<Runtime>,1066);1067/// Unchecked extrinsic type as expected by this runtime.1068pub type UncheckedExtrinsic =1069	fp_self_contained::UncheckedExtrinsic<Address, Call, Signature, SignedExtra>;1070/// Extrinsic type that has already been checked.1071pub type CheckedExtrinsic = fp_self_contained::CheckedExtrinsic<AccountId, Call, SignedExtra, H160>;1072/// Executive: handles dispatch to the various modules.1073pub type Executive = frame_executive::Executive<1074	Runtime,1075	Block,1076	frame_system::ChainContext<Runtime>,1077	Runtime,1078	AllPalletsReversedWithSystemFirst,1079>;10801081impl_opaque_keys! {1082	pub struct SessionKeys {1083		pub aura: Aura,1084	}1085}10861087impl fp_self_contained::SelfContainedCall for Call {1088	type SignedInfo = H160;10891090	fn is_self_contained(&self) -> bool {1091		match self {1092			Call::Ethereum(call) => call.is_self_contained(),1093			_ => false,1094		}1095	}10961097	fn check_self_contained(&self) -> Option<Result<Self::SignedInfo, TransactionValidityError>> {1098		match self {1099			Call::Ethereum(call) => call.check_self_contained(),1100			_ => None,1101		}1102	}11031104	fn validate_self_contained(&self, info: &Self::SignedInfo) -> Option<TransactionValidity> {1105		match self {1106			Call::Ethereum(call) => call.validate_self_contained(info),1107			_ => None,1108		}1109	}11101111	fn pre_dispatch_self_contained(1112		&self,1113		info: &Self::SignedInfo,1114	) -> Option<Result<(), TransactionValidityError>> {1115		match self {1116			Call::Ethereum(call) => call.pre_dispatch_self_contained(info),1117			_ => None,1118		}1119	}11201121	fn apply_self_contained(1122		self,1123		info: Self::SignedInfo,1124	) -> Option<sp_runtime::DispatchResultWithInfo<PostDispatchInfoOf<Self>>> {1125		match self {1126			call @ Call::Ethereum(pallet_ethereum::Call::transact { .. }) => Some(call.dispatch(1127				Origin::from(pallet_ethereum::RawOrigin::EthereumTransaction(info)),1128			)),1129			_ => None,1130		}1131	}1132}11331134macro_rules! dispatch_unique_runtime {1135	($collection:ident.$method:ident($($name:ident),*)) => {{1136		let collection = <Runtime as pallet_common::Config>::CollectionDispatch::dispatch(<pallet_common::CollectionHandle<Runtime>>::try_get($collection)?);1137		let dispatch = collection.as_dyn();11381139		Ok::<_, DispatchError>(dispatch.$method($($name),*))1140	}};1141}11421143impl_common_runtime_apis!();11441145struct CheckInherents;11461147impl cumulus_pallet_parachain_system::CheckInherents<Block> for CheckInherents {1148	fn check_inherents(1149		block: &Block,1150		relay_state_proof: &cumulus_pallet_parachain_system::RelayChainStateProof,1151	) -> sp_inherents::CheckInherentsResult {1152		let relay_chain_slot = relay_state_proof1153			.read_slot()1154			.expect("Could not read the relay chain slot from the proof");11551156		let inherent_data =1157			cumulus_primitives_timestamp::InherentDataProvider::from_relay_chain_slot_and_duration(1158				relay_chain_slot,1159				sp_std::time::Duration::from_secs(6),1160			)1161			.create_inherent_data()1162			.expect("Could not create the timestamp inherent data");11631164		inherent_data.check_extrinsics(block)1165	}1166}11671168cumulus_pallet_parachain_system::register_validate_block!(1169	Runtime = Runtime,1170	BlockExecutor = cumulus_pallet_aura_ext::BlockExecutor::<Runtime, Executive>,1171	CheckInherents = CheckInherents,1172);
after · runtime/unique/src/lib.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/>.1617//! The Substrate Node Template runtime. This can be compiled with `#[no_std]`, ready for Wasm.1819#![cfg_attr(not(feature = "std"), no_std)]20// `construct_runtime!` does a lot of recursion and requires us to increase the limit to 256.21#![recursion_limit = "1024"]22#![allow(clippy::from_over_into, clippy::identity_op)]23#![allow(clippy::fn_to_numeric_cast_with_truncation)]24// Make the WASM binary available.25#[cfg(feature = "std")]26include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));2728use sp_api::impl_runtime_apis;29use sp_core::{crypto::KeyTypeId, OpaqueMetadata, H256, U256, H160};30use sp_runtime::DispatchError;31// #[cfg(any(feature = "std", test))]32// pub use sp_runtime::BuildStorage;3334use sp_runtime::{35	Permill, Perbill, Percent, create_runtime_str, generic, impl_opaque_keys,36	traits::{AccountIdLookup, BlakeTwo256, Block as BlockT, AccountIdConversion, Zero},37	transaction_validity::{TransactionSource, TransactionValidity},38	ApplyExtrinsicResult, RuntimeAppPublic,39};4041use sp_std::prelude::*;4243#[cfg(feature = "std")]44use sp_version::NativeVersion;45use sp_version::RuntimeVersion;46pub use pallet_transaction_payment::{47	Multiplier, TargetedFeeAdjustment, FeeDetails, RuntimeDispatchInfo,48};49// A few exports that help ease life for downstream crates.50pub use pallet_balances::Call as BalancesCall;51pub use pallet_evm::{52	EnsureAddressTruncated, HashedAddressMapping, Runner, account::CrossAccountId as _, OnMethodCall,53	Account as EVMAccount, FeeCalculator, GasWeightMapping,54};55pub use frame_support::{56	construct_runtime, match_types,57	dispatch::DispatchResult,58	PalletId, parameter_types, StorageValue, ConsensusEngineId,59	traits::{60		tokens::currency::Currency as CurrencyT, OnUnbalanced as OnUnbalancedT, Everything,61		Currency, ExistenceRequirement, Get, IsInVec, KeyOwnerProofSystem, LockIdentifier,62		OnUnbalanced, Randomness, FindAuthor, ConstU32, Imbalance,63	},64	weights::{65		constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_PER_SECOND},66		DispatchClass, DispatchInfo, GetDispatchInfo, IdentityFee, Pays, PostDispatchInfo, Weight,67		WeightToFeePolynomial, WeightToFeeCoefficient, WeightToFeeCoefficients, ConstantMultiplier,68	},69};70use unique_runtime_common::{71	dispatch::{CollectionDispatchT, CollectionDispatch},72	weights::CommonWeights,73	sponsoring::UniqueSponsorshipHandler,74	eth_sponsoring::UniqueEthSponsorshipHandler,75};76use up_data_structs::*;77// use pallet_contracts::weights::WeightInfo;78// #[cfg(any(feature = "std", test))]79use frame_system::{80	self as frame_system, EnsureRoot, EnsureSigned,81	limits::{BlockWeights, BlockLength},82};83use sp_arithmetic::{84	traits::{BaseArithmetic, Unsigned},85};86use smallvec::smallvec;87use codec::{Encode, Decode};88use fp_rpc::TransactionStatus;89use sp_runtime::{90	traits::{BlockNumberProvider, Dispatchable, PostDispatchInfoOf, Saturating},91	transaction_validity::TransactionValidityError,92	SaturatedConversion,93};9495// pub use pallet_timestamp::Call as TimestampCall;9697// Polkadot imports98use pallet_xcm::XcmPassthrough;99use polkadot_parachain::primitives::Sibling;100use up_data_structs::mapping::{CrossTokenAddressMapping, EvmTokenAddressMapping};101use xcm::v1::{BodyId, Junction::*, MultiLocation, NetworkId, Junctions::*};102use xcm_builder::{103	AccountId32Aliases, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, CurrencyAdapter,104	EnsureXcmOrigin, FixedWeightBounds, LocationInverter, NativeAsset, ParentAsSuperuser,105	RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia,106	SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit,107	ParentIsPreset,108};109use xcm_executor::{Config, XcmExecutor, Assets};110use sp_std::{marker::PhantomData};111112use xcm::latest::{113	//	Xcm,114	AssetId::{Concrete},115	Fungibility::Fungible as XcmFungible,116	MultiAsset,117	Error as XcmError,118};119use xcm_executor::traits::{MatchesFungible, WeightTrader};120//use xcm_executor::traits::MatchesFungible;121use sp_runtime::traits::CheckedConversion;122123use unique_runtime_common::{124	impl_common_runtime_apis,125	types::*,126	constants::*,127	dispatch::{CollectionDispatchT, CollectionDispatch},128	sponsoring::UniqueSponsorshipHandler,129	eth_sponsoring::UniqueEthSponsorshipHandler,130	weights::CommonWeights,131};132133pub const RUNTIME_NAME: &str = "unique";134pub const TOKEN_SYMBOL: &str = "UNQ";135136type CrossAccountId = pallet_evm::account::BasicCrossAccountId<Runtime>;137138impl RuntimeInstance for Runtime {139	type CrossAccountId = self::CrossAccountId;140141	type TransactionConverter = self::TransactionConverter;142143	fn get_transaction_converter() -> TransactionConverter {144		TransactionConverter145	}146}147148/// Opaque types. These are used by the CLI to instantiate machinery that don't need to know149/// the specifics of the runtime. They can then be made to be agnostic over specific formats150/// of data like extrinsics, allowing for them to continue syncing the network through upgrades151/// to even the core data structures.152pub mod opaque {153	use sp_std::prelude::*;154	use sp_runtime::impl_opaque_keys;155	use super::Aura;156157	pub use unique_runtime_common::types::*;158159	impl_opaque_keys! {160		pub struct SessionKeys {161			pub aura: Aura,162		}163	}164}165166/// This runtime version.167pub const VERSION: RuntimeVersion = RuntimeVersion {168	spec_name: create_runtime_str!(RUNTIME_NAME),169	impl_name: create_runtime_str!(RUNTIME_NAME),170	authoring_version: 1,171	spec_version: 920000,172	impl_version: 0,173	apis: RUNTIME_API_VERSIONS,174	transaction_version: 1,175	state_version: 0,176};177178#[derive(codec::Encode, codec::Decode)]179pub enum XCMPMessage<XAccountId, XBalance> {180	/// Transfer tokens to the given account from the Parachain account.181	TransferToken(XAccountId, XBalance),182}183184/// The version information used to identify this runtime when compiled natively.185#[cfg(feature = "std")]186pub fn native_version() -> NativeVersion {187	NativeVersion {188		runtime_version: VERSION,189		can_author_with: Default::default(),190	}191}192193type NegativeImbalance = <Balances as Currency<AccountId>>::NegativeImbalance;194195pub struct DealWithFees;196impl OnUnbalanced<NegativeImbalance> for DealWithFees {197	fn on_unbalanceds<B>(mut fees_then_tips: impl Iterator<Item = NegativeImbalance>) {198		if let Some(fees) = fees_then_tips.next() {199			// for fees, 100% to treasury200			let mut split = fees.ration(100, 0);201			if let Some(tips) = fees_then_tips.next() {202				// for tips, if any, 100% to treasury203				tips.ration_merge_into(100, 0, &mut split);204			}205			Treasury::on_unbalanced(split.0);206			// Author::on_unbalanced(split.1);207		}208	}209}210211parameter_types! {212	pub const BlockHashCount: BlockNumber = 2400;213	pub RuntimeBlockLength: BlockLength =214		BlockLength::max_with_normal_ratio(5 * 1024 * 1024, NORMAL_DISPATCH_RATIO);215	pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);216	pub const MaximumBlockLength: u32 = 5 * 1024 * 1024;217	pub RuntimeBlockWeights: BlockWeights = BlockWeights::builder()218		.base_block(BlockExecutionWeight::get())219		.for_class(DispatchClass::all(), |weights| {220			weights.base_extrinsic = ExtrinsicBaseWeight::get();221		})222		.for_class(DispatchClass::Normal, |weights| {223			weights.max_total = Some(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT);224		})225		.for_class(DispatchClass::Operational, |weights| {226			weights.max_total = Some(MAXIMUM_BLOCK_WEIGHT);227			// Operational transactions have some extra reserved space, so that they228			// are included even if block reached `MAXIMUM_BLOCK_WEIGHT`.229			weights.reserved = Some(230				MAXIMUM_BLOCK_WEIGHT - NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT231			);232		})233		.avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO)234		.build_or_panic();235	pub const Version: RuntimeVersion = VERSION;236	pub const SS58Prefix: u16 = 7391;237}238239parameter_types! {240	pub const ChainId: u64 = 8880;241}242243pub struct FixedFee;244impl FeeCalculator for FixedFee {245	fn min_gas_price() -> U256 {246		MIN_GAS_PRICE.into()247	}248}249250// Assuming slowest ethereum opcode is SSTORE, with gas price of 20000 as our worst case251// (contract, which only writes a lot of data),252// approximating on top of our real store write weight253parameter_types! {254	pub const WritesPerSecond: u64 = WEIGHT_PER_SECOND / <Runtime as frame_system::Config>::DbWeight::get().write;255	pub const GasPerSecond: u64 = WritesPerSecond::get() * 20000;256	pub const WeightPerGas: u64 = WEIGHT_PER_SECOND / GasPerSecond::get();257}258259/// Limiting EVM execution to 50% of block for substrate users and management tasks260/// EVM transaction consumes more weight than substrate's, so we can't rely on them being261/// scheduled fairly262const EVM_DISPATCH_RATIO: Perbill = Perbill::from_percent(50);263parameter_types! {264	pub BlockGasLimit: U256 = U256::from(NORMAL_DISPATCH_RATIO * EVM_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT / WeightPerGas::get());265}266267pub enum FixedGasWeightMapping {}268impl GasWeightMapping for FixedGasWeightMapping {269	fn gas_to_weight(gas: u64) -> Weight {270		gas.saturating_mul(WeightPerGas::get())271	}272	fn weight_to_gas(weight: Weight) -> u64 {273		weight / WeightPerGas::get()274	}275}276277impl pallet_evm::Config for Runtime {278	type BlockGasLimit = BlockGasLimit;279	type FeeCalculator = FixedFee;280	type GasWeightMapping = FixedGasWeightMapping;281	type BlockHashMapping = pallet_ethereum::EthereumBlockHashMapping<Self>;282	type CallOrigin = EnsureAddressTruncated<Self>;283	type WithdrawOrigin = EnsureAddressTruncated<Self>;284	type AddressMapping = HashedAddressMapping<Self::Hashing>;285	type PrecompilesType = ();286	type PrecompilesValue = ();287	type Currency = Balances;288	type Event = Event;289	type OnMethodCall = (290		pallet_evm_migration::OnMethodCall<Self>,291		pallet_evm_contract_helpers::HelpersOnMethodCall<Self>,292		CollectionDispatchT<Self>,293		pallet_unique::eth::CollectionHelperOnMethodCall<Self>,294	);295	type OnCreate = pallet_evm_contract_helpers::HelpersOnCreate<Self>;296	type ChainId = ChainId;297	type Runner = pallet_evm::runner::stack::Runner<Self>;298	type OnChargeTransaction = pallet_evm::EVMCurrencyAdapter<Balances, DealWithFees>;299	type TransactionValidityHack = pallet_evm_transaction_payment::TransactionValidityHack<Self>;300	type FindAuthor = EthereumFindAuthor<Aura>;301}302303impl pallet_evm_migration::Config for Runtime {304	type WeightInfo = pallet_evm_migration::weights::SubstrateWeight<Self>;305}306307pub struct EthereumFindAuthor<F>(core::marker::PhantomData<F>);308impl<F: FindAuthor<u32>> FindAuthor<H160> for EthereumFindAuthor<F> {309	fn find_author<'a, I>(digests: I) -> Option<H160>310	where311		I: 'a + IntoIterator<Item = (ConsensusEngineId, &'a [u8])>,312	{313		if let Some(author_index) = F::find_author(digests) {314			let authority_id = Aura::authorities()[author_index as usize].clone();315			return Some(H160::from_slice(&authority_id.to_raw_vec()[4..24]));316		}317		None318	}319}320321impl pallet_ethereum::Config for Runtime {322	type Event = Event;323	type StateRoot = pallet_ethereum::IntermediateStateRoot<Self>;324}325326impl pallet_randomness_collective_flip::Config for Runtime {}327328impl frame_system::Config for Runtime {329	/// The data to be stored in an account.330	type AccountData = pallet_balances::AccountData<Balance>;331	/// The identifier used to distinguish between accounts.332	type AccountId = AccountId;333	/// The basic call filter to use in dispatchable.334	type BaseCallFilter = Everything;335	/// Maximum number of block number to block hash mappings to keep (oldest pruned first).336	type BlockHashCount = BlockHashCount;337	/// The maximum length of a block (in bytes).338	type BlockLength = RuntimeBlockLength;339	/// The index type for blocks.340	type BlockNumber = BlockNumber;341	/// The weight of the overhead invoked on the block import process, independent of the extrinsics included in that block.342	type BlockWeights = RuntimeBlockWeights;343	/// The aggregated dispatch type that is available for extrinsics.344	type Call = Call;345	/// The weight of database operations that the runtime can invoke.346	type DbWeight = RocksDbWeight;347	/// The ubiquitous event type.348	type Event = Event;349	/// The type for hashing blocks and tries.350	type Hash = Hash;351	/// The hashing algorithm used.352	type Hashing = BlakeTwo256;353	/// The header type.354	type Header = generic::Header<BlockNumber, BlakeTwo256>;355	/// The index type for storing how many extrinsics an account has signed.356	type Index = Index;357	/// The lookup mechanism to get account ID from whatever is passed in dispatchers.358	type Lookup = AccountIdLookup<AccountId, ()>;359	/// What to do if an account is fully reaped from the system.360	type OnKilledAccount = ();361	/// What to do if a new account is created.362	type OnNewAccount = ();363	type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode<Self>;364	/// The ubiquitous origin type.365	type Origin = Origin;366	/// This type is being generated by `construct_runtime!`.367	type PalletInfo = PalletInfo;368	/// This is used as an identifier of the chain. 42 is the generic substrate prefix.369	type SS58Prefix = SS58Prefix;370	/// Weight information for the extrinsics of this pallet.371	type SystemWeightInfo = frame_system::weights::SubstrateWeight<Self>;372	/// Version of the runtime.373	type Version = Version;374	type MaxConsumers = ConstU32<16>;375}376377parameter_types! {378	pub const MinimumPeriod: u64 = SLOT_DURATION / 2;379}380381impl pallet_timestamp::Config for Runtime {382	/// A timestamp: milliseconds since the unix epoch.383	type Moment = u64;384	type OnTimestampSet = ();385	type MinimumPeriod = MinimumPeriod;386	type WeightInfo = ();387}388389parameter_types! {390	// pub const ExistentialDeposit: u128 = 500;391	pub const ExistentialDeposit: u128 = 0;392	pub const MaxLocks: u32 = 50;393}394395impl pallet_balances::Config for Runtime {396	type MaxLocks = MaxLocks;397	type MaxReserves = ();398	type ReserveIdentifier = [u8; 8];399	/// The type for recording an account's balance.400	type Balance = Balance;401	/// The ubiquitous event type.402	type Event = Event;403	type DustRemoval = Treasury;404	type ExistentialDeposit = ExistentialDeposit;405	type AccountStore = System;406	type WeightInfo = pallet_balances::weights::SubstrateWeight<Self>;407}408409pub const fn deposit(items: u32, bytes: u32) -> Balance {410	items as Balance * 15 * CENTIUNIQUE + (bytes as Balance) * 6 * CENTIUNIQUE411}412413/*414parameter_types! {415	pub TombstoneDeposit: Balance = deposit(416		1,417		sp_std::mem::size_of::<pallet_contracts::Pallet<Runtime>> as u32,418	);419	pub DepositPerContract: Balance = TombstoneDeposit::get();420	pub const DepositPerStorageByte: Balance = deposit(0, 1);421	pub const DepositPerStorageItem: Balance = deposit(1, 0);422	pub RentFraction: Perbill = Perbill::from_rational(1u32, 30 * DAYS);423	pub const SurchargeReward: Balance = 150 * MILLIUNIQUE;424	pub const SignedClaimHandicap: u32 = 2;425	pub const MaxDepth: u32 = 32;426	pub const MaxValueSize: u32 = 16 * 1024;427	pub const MaxCodeSize: u32 = 1024 * 1024 * 25; // 25 Mb428	// The lazy deletion runs inside on_initialize.429	pub DeletionWeightLimit: Weight = AVERAGE_ON_INITIALIZE_RATIO *430		RuntimeBlockWeights::get().max_block;431	// The weight needed for decoding the queue should be less or equal than a fifth432	// of the overall weight dedicated to the lazy deletion.433	pub DeletionQueueDepth: u32 = ((DeletionWeightLimit::get() / (434			<Runtime as pallet_contracts::Config>::WeightInfo::on_initialize_per_queue_item(1) -435			<Runtime as pallet_contracts::Config>::WeightInfo::on_initialize_per_queue_item(0)436		)) / 5) as u32;437	pub Schedule: pallet_contracts::Schedule<Runtime> = Default::default();438}439440impl pallet_contracts::Config for Runtime {441	type Time = Timestamp;442	type Randomness = RandomnessCollectiveFlip;443	type Currency = Balances;444	type Event = Event;445	type RentPayment = ();446	type SignedClaimHandicap = SignedClaimHandicap;447	type TombstoneDeposit = TombstoneDeposit;448	type DepositPerContract = DepositPerContract;449	type DepositPerStorageByte = DepositPerStorageByte;450	type DepositPerStorageItem = DepositPerStorageItem;451	type RentFraction = RentFraction;452	type SurchargeReward = SurchargeReward;453	type WeightPrice = pallet_transaction_payment::Pallet<Self>;454	type WeightInfo = pallet_contracts::weights::SubstrateWeight<Self>;455	type ChainExtension = NFTExtension;456	type DeletionQueueDepth = DeletionQueueDepth;457	type DeletionWeightLimit = DeletionWeightLimit;458	type Schedule = Schedule;459	type CallStack = [pallet_contracts::Frame<Self>; 31];460}461*/462463parameter_types! {464	/// This value increases the priority of `Operational` transactions by adding465	/// a "virtual tip" that's equal to the `OperationalFeeMultiplier * final_fee`.466	pub const OperationalFeeMultiplier: u8 = 5;467}468469/// Linear implementor of `WeightToFeePolynomial`470pub struct LinearFee<T>(sp_std::marker::PhantomData<T>);471472impl<T> WeightToFeePolynomial for LinearFee<T>473where474	T: BaseArithmetic + From<u32> + Copy + Unsigned,475{476	type Balance = T;477478	fn polynomial() -> WeightToFeeCoefficients<Self::Balance> {479		smallvec!(WeightToFeeCoefficient {480			// Targeting 0.1 Unique per NFT transfer481			coeff_integer: WEIGHT_TO_FEE_COEFF.into(),482			coeff_frac: Perbill::zero(),483			negative: false,484			degree: 1,485		})486	}487}488489impl pallet_transaction_payment::Config for Runtime {490	type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter<Balances, DealWithFees>;491	type LengthToFee = ConstantMultiplier<Balance, TransactionByteFee>;492	type OperationalFeeMultiplier = OperationalFeeMultiplier;493	type WeightToFee = LinearFee<Balance>;494	type FeeMultiplierUpdate = ();495}496497parameter_types! {498	pub const ProposalBond: Permill = Permill::from_percent(5);499	pub const ProposalBondMinimum: Balance = 1 * UNIQUE;500	pub const ProposalBondMaximum: Balance = 1000 * UNIQUE;501	pub const SpendPeriod: BlockNumber = 5 * MINUTES;502	pub const Burn: Permill = Permill::from_percent(0);503	pub const TipCountdown: BlockNumber = 1 * DAYS;504	pub const TipFindersFee: Percent = Percent::from_percent(20);505	pub const TipReportDepositBase: Balance = 1 * UNIQUE;506	pub const DataDepositPerByte: Balance = 1 * CENTIUNIQUE;507	pub const BountyDepositBase: Balance = 1 * UNIQUE;508	pub const BountyDepositPayoutDelay: BlockNumber = 1 * DAYS;509	pub const TreasuryModuleId: PalletId = PalletId(*b"py/trsry");510	pub const BountyUpdatePeriod: BlockNumber = 14 * DAYS;511	pub const MaximumReasonLength: u32 = 16384;512	pub const BountyCuratorDeposit: Permill = Permill::from_percent(50);513	pub const BountyValueMinimum: Balance = 5 * UNIQUE;514	pub const MaxApprovals: u32 = 100;515}516517impl pallet_treasury::Config for Runtime {518	type PalletId = TreasuryModuleId;519	type Currency = Balances;520	type ApproveOrigin = EnsureRoot<AccountId>;521	type RejectOrigin = EnsureRoot<AccountId>;522	type Event = Event;523	type OnSlash = ();524	type ProposalBond = ProposalBond;525	type ProposalBondMinimum = ProposalBondMinimum;526	type ProposalBondMaximum = ProposalBondMaximum;527	type SpendPeriod = SpendPeriod;528	type Burn = Burn;529	type BurnDestination = ();530	type SpendFunds = ();531	type WeightInfo = pallet_treasury::weights::SubstrateWeight<Self>;532	type MaxApprovals = MaxApprovals;533}534535impl pallet_sudo::Config for Runtime {536	type Event = Event;537	type Call = Call;538}539540pub struct RelayChainBlockNumberProvider<T>(sp_std::marker::PhantomData<T>);541542impl<T: cumulus_pallet_parachain_system::Config> BlockNumberProvider543	for RelayChainBlockNumberProvider<T>544{545	type BlockNumber = BlockNumber;546547	fn current_block_number() -> Self::BlockNumber {548		cumulus_pallet_parachain_system::Pallet::<T>::validation_data()549			.map(|d| d.relay_parent_number)550			.unwrap_or_default()551	}552}553554parameter_types! {555	pub const MinVestedTransfer: Balance = 10 * UNIQUE;556	pub const MaxVestingSchedules: u32 = 28;557}558559impl orml_vesting::Config for Runtime {560	type Event = Event;561	type Currency = pallet_balances::Pallet<Runtime>;562	type MinVestedTransfer = MinVestedTransfer;563	type VestedTransferOrigin = EnsureSigned<AccountId>;564	type WeightInfo = ();565	type MaxVestingSchedules = MaxVestingSchedules;566	type BlockNumberProvider = RelayChainBlockNumberProvider<Runtime>;567}568569parameter_types! {570	pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 4;571	pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 4;572}573574impl cumulus_pallet_parachain_system::Config for Runtime {575	type Event = Event;576	type SelfParaId = parachain_info::Pallet<Self>;577	type OnSystemEvent = ();578	// type DownwardMessageHandlers = cumulus_primitives_utility::UnqueuedDmpAsParent<579	// 	MaxDownwardMessageWeight,580	// 	XcmExecutor<XcmConfig>,581	// 	Call,582	// >;583	type OutboundXcmpMessageSource = XcmpQueue;584	type DmpMessageHandler = DmpQueue;585	type ReservedDmpWeight = ReservedDmpWeight;586	type ReservedXcmpWeight = ReservedXcmpWeight;587	type XcmpMessageHandler = XcmpQueue;588}589590impl parachain_info::Config for Runtime {}591592impl cumulus_pallet_aura_ext::Config for Runtime {}593594parameter_types! {595	pub const RelayLocation: MultiLocation = MultiLocation::parent();596	pub const RelayNetwork: NetworkId = NetworkId::Polkadot;597	pub RelayOrigin: Origin = cumulus_pallet_xcm::Origin::Relay.into();598	pub Ancestry: MultiLocation = Parachain(ParachainInfo::parachain_id().into()).into();599}600601/// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used602/// when determining ownership of accounts for asset transacting and when attempting to use XCM603/// `Transact` in order to determine the dispatch Origin.604pub type LocationToAccountId = (605	// The parent (Relay-chain) origin converts to the default `AccountId`.606	ParentIsPreset<AccountId>,607	// Sibling parachain origins convert to AccountId via the `ParaId::into`.608	SiblingParachainConvertsVia<Sibling, AccountId>,609	// Straight up local `AccountId32` origins just alias directly to `AccountId`.610	AccountId32Aliases<RelayNetwork, AccountId>,611);612613pub struct OnlySelfCurrency;614impl<B: TryFrom<u128>> MatchesFungible<B> for OnlySelfCurrency {615	fn matches_fungible(a: &MultiAsset) -> Option<B> {616		match (&a.id, &a.fun) {617			(Concrete(_), XcmFungible(ref amount)) => CheckedConversion::checked_from(*amount),618			_ => None,619		}620	}621}622623/// Means for transacting assets on this chain.624pub type LocalAssetTransactor = CurrencyAdapter<625	// Use this currency:626	Balances,627	// Use this currency when it is a fungible asset matching the given location or name:628	OnlySelfCurrency,629	// Do a simple punn to convert an AccountId32 MultiLocation into a native chain account ID:630	LocationToAccountId,631	// Our chain's account ID type (we can't get away without mentioning it explicitly):632	AccountId,633	// We don't track any teleports.634	(),635>;636637/// This is the type we use to convert an (incoming) XCM origin into a local `Origin` instance,638/// ready for dispatching a transaction with Xcm's `Transact`. There is an `OriginKind` which can639/// biases the kind of local `Origin` it will become.640pub type XcmOriginToTransactDispatchOrigin = (641	// Sovereign account converter; this attempts to derive an `AccountId` from the origin location642	// using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for643	// foreign chains who want to have a local sovereign account on this chain which they control.644	SovereignSignedViaLocation<LocationToAccountId, Origin>,645	// Native converter for Relay-chain (Parent) location; will converts to a `Relay` origin when646	// recognised.647	RelayChainAsNative<RelayOrigin, Origin>,648	// Native converter for sibling Parachains; will convert to a `SiblingPara` origin when649	// recognised.650	SiblingParachainAsNative<cumulus_pallet_xcm::Origin, Origin>,651	// Superuser converter for the Relay-chain (Parent) location. This will allow it to issue a652	// transaction from the Root origin.653	ParentAsSuperuser<Origin>,654	// Native signed account converter; this just converts an `AccountId32` origin into a normal655	// `Origin::Signed` origin of the same 32-byte value.656	SignedAccountId32AsNative<RelayNetwork, Origin>,657	// Xcm origins can be represented natively under the Xcm pallet's Xcm origin.658	XcmPassthrough<Origin>,659);660661parameter_types! {662	// One XCM operation is 1_000_000 weight - almost certainly a conservative estimate.663	pub UnitWeightCost: Weight = 1_000_000;664	// 1200 UNIQUEs buy 1 second of weight.665	pub const WeightPrice: (MultiLocation, u128) = (MultiLocation::parent(), 1_200 * UNIQUE);666	pub const MaxInstructions: u32 = 100;667	pub const MaxAuthorities: u32 = 100_000;668}669670match_types! {671	pub type ParentOrParentsUnitPlurality: impl Contains<MultiLocation> = {672		MultiLocation { parents: 1, interior: Here } |673		MultiLocation { parents: 1, interior: X1(Plurality { id: BodyId::Unit, .. }) }674	};675}676677pub type Barrier = (678	TakeWeightCredit,679	AllowTopLevelPaidExecutionFrom<Everything>,680	AllowUnpaidExecutionFrom<ParentOrParentsUnitPlurality>,681	// ^^^ Parent & its unit plurality gets free execution682);683684pub struct UsingOnlySelfCurrencyComponents<685	WeightToFee: WeightToFeePolynomial<Balance = Currency::Balance>,686	AssetId: Get<MultiLocation>,687	AccountId,688	Currency: CurrencyT<AccountId>,689	OnUnbalanced: OnUnbalancedT<Currency::NegativeImbalance>,690>(691	Weight,692	Currency::Balance,693	PhantomData<(WeightToFee, AssetId, AccountId, Currency, OnUnbalanced)>,694);695impl<696		WeightToFee: WeightToFeePolynomial<Balance = Currency::Balance>,697		AssetId: Get<MultiLocation>,698		AccountId,699		Currency: CurrencyT<AccountId>,700		OnUnbalanced: OnUnbalancedT<Currency::NegativeImbalance>,701	> WeightTrader702	for UsingOnlySelfCurrencyComponents<WeightToFee, AssetId, AccountId, Currency, OnUnbalanced>703{704	fn new() -> Self {705		Self(0, Zero::zero(), PhantomData)706	}707708	fn buy_weight(&mut self, weight: Weight, payment: Assets) -> Result<Assets, XcmError> {709		let amount = WeightToFee::calc(&weight);710		let u128_amount: u128 = amount.try_into().map_err(|_| XcmError::Overflow)?;711712		// location to this parachain through relay chain713		let option1: xcm::v1::AssetId = Concrete(MultiLocation {714			parents: 1,715			interior: X1(Parachain(ParachainInfo::parachain_id().into())),716		});717		// direct location718		let option2: xcm::v1::AssetId = Concrete(MultiLocation {719			parents: 0,720			interior: Here,721		});722723		let required = if payment.fungible.contains_key(&option1) {724			(option1, u128_amount).into()725		} else if payment.fungible.contains_key(&option2) {726			(option2, u128_amount).into()727		} else {728			(Concrete(MultiLocation::default()), u128_amount).into()729		};730731		let unused = payment732			.checked_sub(required)733			.map_err(|_| XcmError::TooExpensive)?;734		self.0 = self.0.saturating_add(weight);735		self.1 = self.1.saturating_add(amount);736		Ok(unused)737	}738739	fn refund_weight(&mut self, weight: Weight) -> Option<MultiAsset> {740		let weight = weight.min(self.0);741		let amount = WeightToFee::calc(&weight);742		self.0 -= weight;743		self.1 = self.1.saturating_sub(amount);744		let amount: u128 = amount.saturated_into();745		if amount > 0 {746			Some((AssetId::get(), amount).into())747		} else {748			None749		}750	}751}752impl<753		WeightToFee: WeightToFeePolynomial<Balance = Currency::Balance>,754		AssetId: Get<MultiLocation>,755		AccountId,756		Currency: CurrencyT<AccountId>,757		OnUnbalanced: OnUnbalancedT<Currency::NegativeImbalance>,758	> Drop759	for UsingOnlySelfCurrencyComponents<WeightToFee, AssetId, AccountId, Currency, OnUnbalanced>760{761	fn drop(&mut self) {762		OnUnbalanced::on_unbalanced(Currency::issue(self.1));763	}764}765766pub struct XcmConfig;767impl Config for XcmConfig {768	type Call = Call;769	type XcmSender = XcmRouter;770	// How to withdraw and deposit an asset.771	type AssetTransactor = LocalAssetTransactor;772	type OriginConverter = XcmOriginToTransactDispatchOrigin;773	type IsReserve = NativeAsset;774	type IsTeleporter = (); // Teleportation is disabled775	type LocationInverter = LocationInverter<Ancestry>;776	type Barrier = Barrier;777	type Weigher = FixedWeightBounds<UnitWeightCost, Call, MaxInstructions>;778	type Trader = UsingOnlySelfCurrencyComponents<779		IdentityFee<Balance>,780		RelayLocation,781		AccountId,782		Balances,783		(),784	>;785	type ResponseHandler = (); // Don't handle responses for now.786	type SubscriptionService = PolkadotXcm;787788	type AssetTrap = PolkadotXcm;789	type AssetClaims = PolkadotXcm;790}791792// parameter_types! {793// 	pub const MaxDownwardMessageWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 10;794// }795796/// No local origins on this chain are allowed to dispatch XCM sends/executions.797pub type LocalOriginToLocation = (SignedToAccountId32<Origin, AccountId, RelayNetwork>,);798799/// The means for routing XCM messages which are not for local execution into the right message800/// queues.801pub type XcmRouter = (802	// Two routers - use UMP to communicate with the relay chain:803	cumulus_primitives_utility::ParentAsUmp<ParachainSystem, ()>,804	// ..and XCMP to communicate with the sibling chains.805	XcmpQueue,806);807808impl pallet_evm_coder_substrate::Config for Runtime {809	type GasWeightMapping = FixedGasWeightMapping;810}811812impl pallet_xcm::Config for Runtime {813	type Event = Event;814	type SendXcmOrigin = EnsureXcmOrigin<Origin, LocalOriginToLocation>;815	type XcmRouter = XcmRouter;816	type ExecuteXcmOrigin = EnsureXcmOrigin<Origin, LocalOriginToLocation>;817	type XcmExecuteFilter = Everything;818	type XcmExecutor = XcmExecutor<XcmConfig>;819	type XcmTeleportFilter = Everything;820	type XcmReserveTransferFilter = Everything;821	type Weigher = FixedWeightBounds<UnitWeightCost, Call, MaxInstructions>;822	type LocationInverter = LocationInverter<Ancestry>;823	type Origin = Origin;824	type Call = Call;825	const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100;826	type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion;827}828829impl cumulus_pallet_xcm::Config for Runtime {830	type Event = Event;831	type XcmExecutor = XcmExecutor<XcmConfig>;832}833834impl cumulus_pallet_xcmp_queue::Config for Runtime {835	type WeightInfo = ();836	type Event = Event;837	type XcmExecutor = XcmExecutor<XcmConfig>;838	type ChannelInfo = ParachainSystem;839	type VersionWrapper = ();840	type ExecuteOverweightOrigin = frame_system::EnsureRoot<AccountId>;841	type ControllerOrigin = EnsureRoot<AccountId>;842	type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin;843}844845impl cumulus_pallet_dmp_queue::Config for Runtime {846	type Event = Event;847	type XcmExecutor = XcmExecutor<XcmConfig>;848	type ExecuteOverweightOrigin = frame_system::EnsureRoot<AccountId>;849}850851impl pallet_aura::Config for Runtime {852	type AuthorityId = AuraId;853	type DisabledValidators = ();854	type MaxAuthorities = MaxAuthorities;855}856857parameter_types! {858	pub TreasuryAccountId: AccountId = TreasuryModuleId::get().into_account();859	pub const CollectionCreationPrice: Balance = 2 * UNIQUE;860}861862impl pallet_common::Config for Runtime {863	type WeightInfo = pallet_common::weights::SubstrateWeight<Self>;864	type Event = Event;865	type Currency = Balances;866	type CollectionCreationPrice = CollectionCreationPrice;867	type TreasuryAccountId = TreasuryAccountId;868	type CollectionDispatch = CollectionDispatchT<Self>;869870	type EvmTokenAddressMapping = EvmTokenAddressMapping;871	type CrossTokenAddressMapping = CrossTokenAddressMapping<Self::AccountId>;872}873874impl pallet_structure::Config for Runtime {875	type Event = Event;876	type Call = Call;877	type WeightInfo = pallet_structure::weights::SubstrateWeight<Self>;878}879880impl pallet_evm::account::Config for Runtime {881	type CrossAccountId = pallet_evm::account::BasicCrossAccountId<Self>;882	type EvmAddressMapping = HashedAddressMapping<Self::Hashing>;883	type EvmBackwardsAddressMapping = fp_evm_mapping::MapBackwardsAddressTruncated;884}885886impl pallet_fungible::Config for Runtime {887	type WeightInfo = pallet_fungible::weights::SubstrateWeight<Self>;888}889impl pallet_refungible::Config for Runtime {890	type WeightInfo = pallet_refungible::weights::SubstrateWeight<Self>;891}892impl pallet_nonfungible::Config for Runtime {893	type WeightInfo = pallet_nonfungible::weights::SubstrateWeight<Self>;894}895896impl pallet_proxy_rmrk_core::Config for Runtime {897	type Event = Event;898}899900impl pallet_proxy_rmrk_equip::Config for Runtime {901	type Event = Event;902}903904impl pallet_unique::Config for Runtime {905	type Event = Event;906	type WeightInfo = pallet_unique::weights::SubstrateWeight<Self>;907	type CommonWeightInfo = CommonWeights<Self>;908}909910parameter_types! {911	pub const InflationBlockInterval: BlockNumber = 100; // every time per how many blocks inflation is applied912}913914/// Used for the pallet inflation915impl pallet_inflation::Config for Runtime {916	type Currency = Balances;917	type TreasuryAccountId = TreasuryAccountId;918	type InflationBlockInterval = InflationBlockInterval;919	type BlockNumberProvider = RelayChainBlockNumberProvider<Runtime>;920}921922// parameter_types! {923// 	pub MaximumSchedulerWeight: Weight = Perbill::from_percent(50) *924// 		RuntimeBlockWeights::get().max_block;925// 	pub const MaxScheduledPerBlock: u32 = 50;926// }927928type EvmSponsorshipHandler = (929	UniqueEthSponsorshipHandler<Runtime>,930	pallet_evm_contract_helpers::HelpersContractSponsoring<Runtime>,931);932type SponsorshipHandler = (933	UniqueSponsorshipHandler<Runtime>,934	//pallet_contract_helpers::ContractSponsorshipHandler<Runtime>,935	pallet_evm_transaction_payment::BridgeSponsorshipHandler<Runtime>,936);937938// impl pallet_unq_scheduler::Config for Runtime {939// 	type Event = Event;940// 	type Origin = Origin;941// 	type PalletsOrigin = OriginCaller;942// 	type Call = Call;943// 	type MaximumWeight = MaximumSchedulerWeight;944// 	type ScheduleOrigin = EnsureSigned<AccountId>;945// 	type MaxScheduledPerBlock = MaxScheduledPerBlock;946// 	type SponsorshipHandler = SponsorshipHandler;947// 	type WeightInfo = ();948// }949950impl pallet_evm_transaction_payment::Config for Runtime {951	type EvmSponsorshipHandler = EvmSponsorshipHandler;952	type Currency = Balances;953}954955impl pallet_charge_transaction::Config for Runtime {956	type SponsorshipHandler = SponsorshipHandler;957}958959// impl pallet_contract_helpers::Config for Runtime {960//	 type DefaultSponsoringRateLimit = DefaultSponsoringRateLimit;961// }962963parameter_types! {964	// 0x842899ECF380553E8a4de75bF534cdf6fBF64049965	pub const HelpersContractAddress: H160 = H160([966		0x84, 0x28, 0x99, 0xec, 0xf3, 0x80, 0x55, 0x3e, 0x8a, 0x4d, 0xe7, 0x5b, 0xf5, 0x34, 0xcd, 0xf6, 0xfb, 0xf6, 0x40, 0x49,967	]);968		969	// 0x6c4e9fe1ae37a41e93cee429e8e1881abdcbb54f970	pub const EvmCollectionHelperAddress: H160 = H160([971		0x6c, 0x4e, 0x9f, 0xe1, 0xae, 0x37, 0xa4, 0x1e, 0x93, 0xce, 0xe4, 0x29, 0xe8, 0xe1, 0x88, 0x1a, 0xbd, 0xcb, 0xb5, 0x4f,972	]);973}974975impl pallet_evm_contract_helpers::Config for Runtime {976	type ContractAddress = HelpersContractAddress;977	type DefaultSponsoringRateLimit = DefaultSponsoringRateLimit;978}979980impl pallet_unique::eth::Config for Runtime {981	type ContractAddress = EvmCollectionHelperAddress;982}983984construct_runtime!(985	pub enum Runtime where986		Block = Block,987		NodeBlock = opaque::Block,988		UncheckedExtrinsic = UncheckedExtrinsic989	{990		ParachainSystem: cumulus_pallet_parachain_system::{Pallet, Call, Config, Storage, Inherent, Event<T>, ValidateUnsigned} = 20,991		ParachainInfo: parachain_info::{Pallet, Storage, Config} = 21,992993		Aura: pallet_aura::{Pallet, Config<T>} = 22,994		AuraExt: cumulus_pallet_aura_ext::{Pallet, Config} = 23,995996		Balances: pallet_balances::{Pallet, Call, Storage, Config<T>, Event<T>} = 30,997		RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Pallet, Storage} = 31,998		Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 32,999		TransactionPayment: pallet_transaction_payment::{Pallet, Storage} = 33,1000		Treasury: pallet_treasury::{Pallet, Call, Storage, Config, Event<T>} = 34,1001		Sudo: pallet_sudo::{Pallet, Call, Storage, Config<T>, Event<T>} = 35,1002		System: frame_system::{Pallet, Call, Storage, Config, Event<T>} = 36,1003		Vesting: orml_vesting::{Pallet, Storage, Call, Event<T>, Config<T>} = 37,1004		// Vesting: pallet_vesting::{Pallet, Call, Config<T>, Storage, Event<T>} = 37,1005		// Contracts: pallet_contracts::{Pallet, Call, Storage, Event<T>} = 38,10061007		// XCM helpers.1008		XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event<T>} = 50,1009		PolkadotXcm: pallet_xcm::{Pallet, Call, Event<T>, Origin} = 51,1010		CumulusXcm: cumulus_pallet_xcm::{Pallet, Call, Event<T>, Origin} = 52,1011		DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event<T>} = 53,10121013		// Unique Pallets1014		Inflation: pallet_inflation::{Pallet, Call, Storage} = 60,1015		Unique: pallet_unique::{Pallet, Call, Storage, Event<T>} = 61,1016		// Scheduler: pallet_unq_scheduler::{Pallet, Call, Storage, Event<T>} = 62,1017		// free = 631018		Charging: pallet_charge_transaction::{Pallet, Call, Storage } = 64,1019		// ContractHelpers: pallet_contract_helpers::{Pallet, Call, Storage} = 65,1020		Common: pallet_common::{Pallet, Storage, Event<T>} = 66,1021		Fungible: pallet_fungible::{Pallet, Storage} = 67,1022		Refungible: pallet_refungible::{Pallet, Storage} = 68,1023		Nonfungible: pallet_nonfungible::{Pallet, Storage} = 69,1024		Structure: pallet_structure::{Pallet, Call, Storage, Event<T>} = 70,1025		RmrkCore: pallet_proxy_rmrk_core::{Pallet, Call, Storage, Event<T>} = 71,1026		RmrkEquip: pallet_proxy_rmrk_equip::{Pallet, Call, Storage, Event<T>} = 72,10271028		// Frontier1029		EVM: pallet_evm::{Pallet, Config, Call, Storage, Event<T>} = 100,1030		Ethereum: pallet_ethereum::{Pallet, Config, Call, Storage, Event, Origin} = 101,10311032		EvmCoderSubstrate: pallet_evm_coder_substrate::{Pallet, Storage} = 150,1033		EvmContractHelpers: pallet_evm_contract_helpers::{Pallet, Storage} = 151,1034		EvmTransactionPayment: pallet_evm_transaction_payment::{Pallet} = 152,1035		EvmMigration: pallet_evm_migration::{Pallet, Call, Storage} = 153,1036	}1037);10381039pub struct TransactionConverter;10401041impl fp_rpc::ConvertTransaction<UncheckedExtrinsic> for TransactionConverter {1042	fn convert_transaction(&self, transaction: pallet_ethereum::Transaction) -> UncheckedExtrinsic {1043		UncheckedExtrinsic::new_unsigned(1044			pallet_ethereum::Call::<Runtime>::transact { transaction }.into(),1045		)1046	}1047}10481049impl fp_rpc::ConvertTransaction<opaque::UncheckedExtrinsic> for TransactionConverter {1050	fn convert_transaction(1051		&self,1052		transaction: pallet_ethereum::Transaction,1053	) -> opaque::UncheckedExtrinsic {1054		let extrinsic = UncheckedExtrinsic::new_unsigned(1055			pallet_ethereum::Call::<Runtime>::transact { transaction }.into(),1056		);1057		let encoded = extrinsic.encode();1058		opaque::UncheckedExtrinsic::decode(&mut &encoded[..])1059			.expect("Encoded extrinsic is always valid")1060	}1061}10621063/// The address format for describing accounts.1064pub type Address = sp_runtime::MultiAddress<AccountId, ()>;1065/// Block header type as expected by this runtime.1066pub type Header = generic::Header<BlockNumber, BlakeTwo256>;1067/// Block type as expected by this runtime.1068pub type Block = generic::Block<Header, UncheckedExtrinsic>;1069/// A Block signed with a Justification1070pub type SignedBlock = generic::SignedBlock<Block>;1071/// BlockId type as expected by this runtime.1072pub type BlockId = generic::BlockId<Block>;1073/// The SignedExtension to the basic transaction logic.1074pub type SignedExtra = (1075	frame_system::CheckSpecVersion<Runtime>,1076	// system::CheckTxVersion<Runtime>,1077	frame_system::CheckGenesis<Runtime>,1078	frame_system::CheckEra<Runtime>,1079	frame_system::CheckNonce<Runtime>,1080	frame_system::CheckWeight<Runtime>,1081	pallet_charge_transaction::ChargeTransactionPayment<Runtime>,1082	//pallet_contract_helpers::ContractHelpersExtension<Runtime>,1083	pallet_ethereum::FakeTransactionFinalizer<Runtime>,1084);1085/// Unchecked extrinsic type as expected by this runtime.1086pub type UncheckedExtrinsic =1087	fp_self_contained::UncheckedExtrinsic<Address, Call, Signature, SignedExtra>;1088/// Extrinsic type that has already been checked.1089pub type CheckedExtrinsic = fp_self_contained::CheckedExtrinsic<AccountId, Call, SignedExtra, H160>;1090/// Executive: handles dispatch to the various modules.1091pub type Executive = frame_executive::Executive<1092	Runtime,1093	Block,1094	frame_system::ChainContext<Runtime>,1095	Runtime,1096	AllPalletsReversedWithSystemFirst,1097>;10981099impl_opaque_keys! {1100	pub struct SessionKeys {1101		pub aura: Aura,1102	}1103}11041105impl fp_self_contained::SelfContainedCall for Call {1106	type SignedInfo = H160;11071108	fn is_self_contained(&self) -> bool {1109		match self {1110			Call::Ethereum(call) => call.is_self_contained(),1111			_ => false,1112		}1113	}11141115	fn check_self_contained(&self) -> Option<Result<Self::SignedInfo, TransactionValidityError>> {1116		match self {1117			Call::Ethereum(call) => call.check_self_contained(),1118			_ => None,1119		}1120	}11211122	fn validate_self_contained(&self, info: &Self::SignedInfo) -> Option<TransactionValidity> {1123		match self {1124			Call::Ethereum(call) => call.validate_self_contained(info),1125			_ => None,1126		}1127	}11281129	fn pre_dispatch_self_contained(1130		&self,1131		info: &Self::SignedInfo,1132	) -> Option<Result<(), TransactionValidityError>> {1133		match self {1134			Call::Ethereum(call) => call.pre_dispatch_self_contained(info),1135			_ => None,1136		}1137	}11381139	fn apply_self_contained(1140		self,1141		info: Self::SignedInfo,1142	) -> Option<sp_runtime::DispatchResultWithInfo<PostDispatchInfoOf<Self>>> {1143		match self {1144			call @ Call::Ethereum(pallet_ethereum::Call::transact { .. }) => Some(call.dispatch(1145				Origin::from(pallet_ethereum::RawOrigin::EthereumTransaction(info)),1146			)),1147			_ => None,1148		}1149	}1150}11511152macro_rules! dispatch_unique_runtime {1153	($collection:ident.$method:ident($($name:ident),*)) => {{1154		let collection = <Runtime as pallet_common::Config>::CollectionDispatch::dispatch(<pallet_common::CollectionHandle<Runtime>>::try_get($collection)?);1155		let dispatch = collection.as_dyn();11561157		Ok::<_, DispatchError>(dispatch.$method($($name),*))1158	}};1159}11601161impl_common_runtime_apis!();11621163struct CheckInherents;11641165impl cumulus_pallet_parachain_system::CheckInherents<Block> for CheckInherents {1166	fn check_inherents(1167		block: &Block,1168		relay_state_proof: &cumulus_pallet_parachain_system::RelayChainStateProof,1169	) -> sp_inherents::CheckInherentsResult {1170		let relay_chain_slot = relay_state_proof1171			.read_slot()1172			.expect("Could not read the relay chain slot from the proof");11731174		let inherent_data =1175			cumulus_primitives_timestamp::InherentDataProvider::from_relay_chain_slot_and_duration(1176				relay_chain_slot,1177				sp_std::time::Duration::from_secs(6),1178			)1179			.create_inherent_data()1180			.expect("Could not create the timestamp inherent data");11811182		inherent_data.check_extrinsics(block)1183	}1184}11851186cumulus_pallet_parachain_system::register_validate_block!(1187	Runtime = Runtime,1188	BlockExecutor = cumulus_pallet_aura_ext::BlockExecutor::<Runtime, Executive>,1189	CheckInherents = CheckInherents,1190);
modifiedtests/package.jsondiffbeforeafterboth
--- a/tests/package.json
+++ b/tests/package.json
@@ -73,6 +73,7 @@
     "testBlockProduction": "mocha --timeout 9999999 -r ts-node/register ./**/block-production.test.ts",
     "testEnableDisableTransfers": "mocha --timeout 9999999 -r ts-node/register ./**/enableDisableTransfer.test.ts",
     "testLimits": "mocha --timeout 9999999 -r ts-node/register ./**/limits.test.ts",
+    "testEthCreateCollection": "mocha --timeout 9999999 -r ts-node/register ./**/eth/createCollection.test.ts",
     "polkadot-types-fetch-metadata": "curl -H 'Content-Type: application/json' -d '{\"id\":\"1\", \"jsonrpc\":\"2.0\", \"method\": \"state_getMetadata\", \"params\":[]}' http://localhost:9933 > src/interfaces/metadata.json",
     "polkadot-types-from-defs": "ts-node ./node_modules/.bin/polkadot-types-from-defs --endpoint src/interfaces/metadata.json --input src/interfaces/ --package .",
     "polkadot-types-from-chain": "ts-node ./node_modules/.bin/polkadot-types-from-chain --endpoint src/interfaces/metadata.json --output src/interfaces/ --package .",
@@ -88,7 +89,7 @@
     "bignumber.js": "^9.0.2",
     "chai-as-promised": "^7.1.1",
     "find-process": "^1.4.7",
-    "solc": "^0.8.13",
+    "solc": "0.8.13",
     "web3": "^1.7.3"
   },
   "standard": {
addedtests/src/eth/api/CollectionHelper.soldiffbeforeafterboth
--- /dev/null
+++ b/tests/src/eth/api/CollectionHelper.sol
@@ -0,0 +1,29 @@
+// SPDX-License-Identifier: OTHER
+// This code is automatically generated
+
+pragma solidity >=0.8.0 <0.9.0;
+
+// Common stubs holder
+interface Dummy {
+
+}
+
+interface ERC165 is Dummy {
+	function supportsInterface(bytes4 interfaceID) external view returns (bool);
+}
+
+// Selector: 56c215c5
+interface CollectionHelper is Dummy, ERC165 {
+	// Selector: create721Collection(string,string,string) 951c0151
+	function create721Collection(
+		string memory name,
+		string memory description,
+		string memory tokenPrefix
+	) external view returns (address);
+
+	// Selector: isCollectionExist(address) c3de1494
+	function isCollectionExist(address collectionAddress)
+		external
+		view
+		returns (bool);
+}
modifiedtests/src/eth/api/UniqueFungible.soldiffbeforeafterboth
--- a/tests/src/eth/api/UniqueFungible.sol
+++ b/tests/src/eth/api/UniqueFungible.sol
@@ -65,8 +65,8 @@
 		returns (uint256);
 }
 
-// Selector: 9b5e29c5
-interface CollectionProperties is Dummy, ERC165 {
+// Selector: f5652829
+interface Collection is Dummy, ERC165 {
 	// Selector: setCollectionProperty(string,bytes) 2f073f66
 	function setCollectionProperty(string memory key, bytes memory value)
 		external;
@@ -81,6 +81,18 @@
 		external
 		view
 		returns (bytes memory);
+
+	// Selector: ethSetSponsor(address) 8f9af356
+	function ethSetSponsor(address sponsor) external;
+
+	// Selector: ethConfirmSponsorship() a8580d1a
+	function ethConfirmSponsorship() external;
+
+	// Selector: setLimit(string,string) bf4d2014
+	function setLimit(string memory limit, string memory value) external;
+
+	// Selector: contractAddress() f6b4dfb4
+	function contractAddress() external view returns (address);
 }
 
 interface UniqueFungible is
@@ -88,5 +100,5 @@
 	ERC165,
 	ERC20,
 	ERC20UniqueExtensions,
-	CollectionProperties
+	Collection
 {}
modifiedtests/src/eth/api/UniqueNFT.soldiffbeforeafterboth
--- a/tests/src/eth/api/UniqueNFT.sol
+++ b/tests/src/eth/api/UniqueNFT.sol
@@ -191,24 +191,6 @@
 	function totalSupply() external view returns (uint256);
 }
 
-// Selector: 9b5e29c5
-interface CollectionProperties is Dummy, ERC165 {
-	// Selector: setCollectionProperty(string,bytes) 2f073f66
-	function setCollectionProperty(string memory key, bytes memory value)
-		external;
-
-	// Selector: deleteCollectionProperty(string) 7b7debce
-	function deleteCollectionProperty(string memory key) external;
-
-	// Throws error if key not found
-	//
-	// Selector: collectionProperty(string) cf24fd6d
-	function collectionProperty(string memory key)
-		external
-		view
-		returns (bytes memory);
-}
-
 // Selector: d74d154f
 interface ERC721UniqueExtensions is Dummy, ERC165 {
 	// Selector: transfer(address,uint256) a9059cbb
@@ -231,6 +213,36 @@
 		returns (bool);
 }
 
+// Selector: f5652829
+interface Collection is Dummy, ERC165 {
+	// Selector: setCollectionProperty(string,bytes) 2f073f66
+	function setCollectionProperty(string memory key, bytes memory value)
+		external;
+
+	// Selector: deleteCollectionProperty(string) 7b7debce
+	function deleteCollectionProperty(string memory key) external;
+
+	// Throws error if key not found
+	//
+	// Selector: collectionProperty(string) cf24fd6d
+	function collectionProperty(string memory key)
+		external
+		view
+		returns (bytes memory);
+
+	// Selector: ethSetSponsor(address) 8f9af356
+	function ethSetSponsor(address sponsor) external;
+
+	// Selector: ethConfirmSponsorship() a8580d1a
+	function ethConfirmSponsorship() external;
+
+	// Selector: setLimit(string,string) bf4d2014
+	function setLimit(string memory limit, string memory value) external;
+
+	// Selector: contractAddress() f6b4dfb4
+	function contractAddress() external view returns (address);
+}
+
 interface UniqueNFT is
 	Dummy,
 	ERC165,
@@ -240,6 +252,6 @@
 	ERC721UniqueExtensions,
 	ERC721Mintable,
 	ERC721Burnable,
-	CollectionProperties,
+	Collection,
 	TokenProperties
 {}
modifiedtests/src/eth/base.test.tsdiffbeforeafterboth
--- a/tests/src/eth/base.test.ts
+++ b/tests/src/eth/base.test.ts
@@ -14,7 +14,17 @@
 // You should have received a copy of the GNU General Public License
 // along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
 
-import {collectionIdToAddress, createEthAccount, createEthAccountWithBalance, deployFlipper, ethBalanceViaSub, GAS_ARGS, itWeb3, recordEthFee, usingWeb3} from './util/helpers';
+import {
+  collectionIdToAddress, 
+  createEthAccount, 
+  createEthAccountWithBalance, 
+  deployFlipper, 
+  ethBalanceViaSub, 
+  GAS_ARGS, 
+  itWeb3, 
+  recordEthFee, 
+  usingWeb3,
+} from './util/helpers';
 import {expect} from 'chai';
 import {createCollectionExpectSuccess, createItemExpectSuccess, UNIQUE} from '../util/helpers';
 import nonFungibleAbi from './nonFungibleAbi.json';
addedtests/src/eth/collectionHelperAbi.jsondiffbeforeafterboth
--- /dev/null
+++ b/tests/src/eth/collectionHelperAbi.json
@@ -0,0 +1,35 @@
+[
+  {
+    "inputs": [
+      { "internalType": "string", "name": "name", "type": "string" },
+      { "internalType": "string", "name": "description", "type": "string" },
+      { "internalType": "string", "name": "tokenPrefix", "type": "string" }
+    ],
+    "name": "create721Collection",
+    "outputs": [{ "internalType": "address", "name": "", "type": "address" }],
+    "stateMutability": "view",
+    "type": "function"
+  },
+  {
+    "inputs": [
+      {
+        "internalType": "address",
+        "name": "collectionAddress",
+        "type": "address"
+      }
+    ],
+    "name": "isCollectionExist",
+    "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
+    "stateMutability": "view",
+    "type": "function"
+  },
+  {
+    "inputs": [
+      { "internalType": "bytes4", "name": "interfaceID", "type": "bytes4" }
+    ],
+    "name": "supportsInterface",
+    "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
+    "stateMutability": "view",
+    "type": "function"
+  }
+]
modifiedtests/src/eth/contractSponsoring.test.tsdiffbeforeafterboth
--- a/tests/src/eth/contractSponsoring.test.ts
+++ b/tests/src/eth/contractSponsoring.test.ts
@@ -29,19 +29,19 @@
   normalizeEvents,
   subToEth,
   executeEthTxOnSub,
+  evmCollectionHelper,
+  getCollectionAddressFromResult,
+  evmCollection,
 } from './util/helpers';
 import {
   addCollectionAdminExpectSuccess,
   createCollectionExpectSuccess,
-  getCreateCollectionResult,
+  getDetailedCollectionInfo,
   transferBalanceTo,
 } from '../util/helpers';
 import nonFungibleAbi from './nonFungibleAbi.json';
-import {
-  submitTransactionAsync,
-} from '../substrate/substrate-api';
 import getBalance from '../substrate/get-balance';
-import {alicesPublicKey} from '../accounts';
+import {evmToAddress} from '@polkadot/util-crypto';
 
 describe('Sponsoring EVM contracts', () => {
   itWeb3('Sponsoring can be set by the address that has deployed the contract', async ({api, web3}) => {
@@ -221,89 +221,87 @@
     expect(await helpers.methods.getSponsoringRateLimit(flipper.options.address).call()).to.be.equals('7200');
   });
 
-  itWeb3('Sponsoring evm address from substrate collection', async ({api, web3}) => {
-    const owner = privateKey('//Alice');
-    const userEth = createEthAccount(web3);
-    const collectionId = await createCollectionExpectSuccess();
+  //TODO: CORE-302 add eth methods
+  itWeb3.skip('Sponsoring evm address from substrate collection', async ({api, web3}) => {
+    const owner = await createEthAccountWithBalance(api, web3);
+    const collectionHelper = evmCollectionHelper(web3, owner);
+    let result = await collectionHelper.methods.create721Collection('Sponsor collection', '1', '1').send();
+    const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result);
+    const sponsor = await createEthAccountWithBalance(api, web3);
+    const collectionEvm = evmCollection(web3, owner, collectionIdAddress);
+    result = await collectionEvm.methods.ethSetSponsor(sponsor).send();
+    let collectionSub = (await getDetailedCollectionInfo(api, collectionId))!;
+    expect(collectionSub.sponsorship.isUnconfirmed).to.be.true;
+    expect(collectionSub.sponsorship.asUnconfirmed.toHuman()).to.be.eq(evmToAddress(sponsor));
+    await expect(collectionEvm.methods.ethConfirmSponsorship().call()).to.be.rejectedWith('Caller is not set as sponsor');
 
-    {
-      const tx = api.tx.unique.setCollectionSponsor(collectionId, owner.address);
-      const events = await submitTransactionAsync(owner, tx);
-      const result = getCreateCollectionResult(events);
-      expect(result.success).to.be.true;
-    }
-    {
-      const tx = api.tx.unique.confirmSponsorship(collectionId);
-      const events = await submitTransactionAsync(owner, tx);
-      const result = getCreateCollectionResult(events);
-      expect(result.success).to.be.true;
-    }
+    const sponsorCollection = evmCollection(web3, sponsor, collectionIdAddress);
+    await sponsorCollection.methods.ethConfirmSponsorship().send();
+    collectionSub = (await getDetailedCollectionInfo(api, collectionId))!;
+    expect(collectionSub.sponsorship.isConfirmed).to.be.true;
+    expect(collectionSub.sponsorship.asConfirmed.toHuman()).to.be.eq(evmToAddress(sponsor));
 
-    const address = collectionIdToAddress(collectionId);
-    const contract = new web3.eth.Contract(nonFungibleAbi as any, address, {from: userEth, ...GAS_ARGS});
+    const user = createEthAccount(web3);
+    const userContract = evmCollection(web3, user, collectionIdAddress);
+    const nextTokenId = await userContract.methods.nextTokenId().call();
 
-    { // This part should fail, because user not in access list and user have no money
-      const nextTokenId = await contract.methods.nextTokenId().call();
-      expect(nextTokenId).to.be.equal('1');
-      await expect(contract.methods.mintWithTokenURI(
-        userEth,
-        nextTokenId,
-        'Test URI',
-      ).call({from: userEth})).to.be.rejectedWith(/PublicMintingNotAllowed/);
-    }
-
-    {
-      const tx = api.tx.unique.setPublicAccessMode(collectionId, 'AllowList');
-      const events = await submitTransactionAsync(owner, tx);
-      const result = getCreateCollectionResult(events);
-      expect(result.success).to.be.true;
-    }
-    {
-      const tx = api.tx.unique.addToAllowList(collectionId, {Ethereum: userEth});
-      const events = await submitTransactionAsync(owner, tx);
-      const result = getCreateCollectionResult(events);
-      expect(result.success).to.be.true;
-    }
-    {
-      const tx = api.tx.unique.setMintPermission(collectionId, true);
-      const events = await submitTransactionAsync(owner, tx);
-      const result = getCreateCollectionResult(events);
-      expect(result.success).to.be.true;
-    }
+    expect(nextTokenId).to.be.equal('1');
+    await expect(userContract.methods.mintWithTokenURI(
+      user,
+      nextTokenId,
+      'Test URI',
+    ).call()).to.be.rejectedWith('PublicMintingNotAllowed');
+    
+    // TODO: add this methods to eth
+    // {
+    //   const tx = api.tx.unique.setPublicAccessMode(collectionId, 'AllowList');
+    //   const events = await submitTransactionAsync(owner, tx);
+    //   const result = getCreateCollectionResult(events);
+    //   expect(result.success).to.be.true;
+    // }
+    // {
+    //   const tx = api.tx.unique.addToAllowList(collectionId, {Ethereum: userEth});
+    //   const events = await submitTransactionAsync(owner, tx);
+    //   const result = getCreateCollectionResult(events);
+    //   expect(result.success).to.be.true;
+    // }
+    // {
+    //   const tx = api.tx.unique.setMintPermission(collectionId, true);
+    //   const events = await submitTransactionAsync(owner, tx);
+    //   const result = getCreateCollectionResult(events);
+    //   expect(result.success).to.be.true;
+    // }
 
-    const [alicesBalanceBefore] = await getBalance(api, [alicesPublicKey]);
+    // const [alicesBalanceBefore] = await getBalance(api, [alicesPublicKey]);
 
     {
-      const nextTokenId = await contract.methods.nextTokenId().call();
+      const nextTokenId = await userContract.methods.nextTokenId().call();
       expect(nextTokenId).to.be.equal('1');
-      const result = await contract.methods.mintWithTokenURI(
-        userEth,
+      const result = await userContract.methods.mintWithTokenURI(
+        user,
         nextTokenId,
         'Test URI',
-      ).send({from: userEth});
+      ).send();
       const events = normalizeEvents(result.events);
 
       expect(events).to.be.deep.equal([
         {
-          address,
+          collectionIdAddress,
           event: 'Transfer',
           args: {
             from: '0x0000000000000000000000000000000000000000',
-            to: userEth,
+            to: user,
             tokenId: nextTokenId,
           },
         },
       ]);
 
-      expect(await contract.methods.tokenURI(nextTokenId).call()).to.be.equal('Test URI');
+      expect(await userContract.methods.tokenURI(nextTokenId).call()).to.be.equal('Test URI');
     }
-
-    const [alicesBalanceAfter] = await getBalance(api, [alicesPublicKey]);
-    expect(alicesBalanceAfter < alicesBalanceBefore).to.be.true;
   });
-
 
-  itWeb3('Check that transaction via EVM spend money from substrate address', async ({api, web3}) => {
+  //TODO: CORE-302 add eth methods
+  itWeb3.skip('Check that transaction via EVM spend money from substrate address', async ({api, web3}) => {
     const owner = privateKey('//Alice');
     const user = privateKey(`//User/${Date.now()}`);
     const userEth = subToEth(user.address);
addedtests/src/eth/createCollection.test.tsdiffbeforeafterboth
--- /dev/null
+++ b/tests/src/eth/createCollection.test.ts
@@ -0,0 +1,236 @@
+// 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/>.
+
+import {evmToAddress} from '@polkadot/util-crypto';
+import {expect} from 'chai';
+import {getCreatedCollectionCount, getDetailedCollectionInfo} from '../util/helpers';
+import {
+  evmCollectionHelper,
+  collectionIdToAddress,
+  createEthAccount,
+  createEthAccountWithBalance,
+  evmCollection,
+  itWeb3,
+  getCollectionAddressFromResult,
+} from './util/helpers';
+
+describe('Create collection from EVM', () => {
+  itWeb3('Create collection', async ({api, web3}) => {
+    const owner = await createEthAccountWithBalance(api, web3);
+    const helper = evmCollectionHelper(web3, owner);
+    const collectionName = 'CollectionEVM';
+    const description = 'Some description';
+    const tokenPrefix = 'token prefix';
+  
+    const collectionCountBefore = await getCreatedCollectionCount(api);
+    const result = await helper.methods
+      .create721Collection(collectionName, description, tokenPrefix)
+      .send();
+    const collectionCountAfter = await getCreatedCollectionCount(api);
+  
+    const {collectionId, collection} = await getCollectionAddressFromResult(api, result);
+    expect(collectionCountAfter - collectionCountBefore).to.be.eq(1);
+    expect(collectionId).to.be.eq(collectionCountAfter);
+    expect(collection.name.map(v => String.fromCharCode(v.toNumber())).join('')).to.be.eq(collectionName);
+    expect(collection.description.map(v => String.fromCharCode(v.toNumber())).join('')).to.be.eq(description);
+    expect(collection.tokenPrefix.toHuman()).to.be.eq(tokenPrefix);
+    expect(collection.schemaVersion.type).to.be.eq('ImageURL');
+  });
+
+  itWeb3('Check collection address exist', async ({api, web3}) => {
+    const owner = await createEthAccountWithBalance(api, web3);
+    const collectionHelper = evmCollectionHelper(web3, owner);
+  
+    const expectedCollectionId = await getCreatedCollectionCount(api) + 1;
+    const expectedCollectionAddress = collectionIdToAddress(expectedCollectionId);
+    expect(await collectionHelper.methods
+      .isCollectionExist(expectedCollectionAddress)
+      .call()).to.be.false;
+
+    await collectionHelper.methods
+      .create721Collection('A', 'A', 'A')
+      .send();
+    
+    expect(await collectionHelper.methods
+      .isCollectionExist(expectedCollectionAddress)
+      .call()).to.be.true;
+  });
+  
+  itWeb3('Set sponsorship', async ({api, web3}) => {
+    const owner = await createEthAccountWithBalance(api, web3);
+    const collectionHelper = evmCollectionHelper(web3, owner);
+    let result = await collectionHelper.methods.create721Collection('Sponsor collection', '1', '1').send();
+    const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result);
+    const sponsor = await createEthAccountWithBalance(api, web3);
+    const collectionEvm = evmCollection(web3, owner, collectionIdAddress);
+    result = await collectionEvm.methods.ethSetSponsor(sponsor).send();
+    let collectionSub = (await getDetailedCollectionInfo(api, collectionId))!;
+    expect(collectionSub.sponsorship.isUnconfirmed).to.be.true;
+    expect(collectionSub.sponsorship.asUnconfirmed.toHuman()).to.be.eq(evmToAddress(sponsor));
+    await expect(collectionEvm.methods.ethConfirmSponsorship().call()).to.be.rejectedWith('Caller is not set as sponsor');
+    const sponsorCollection = evmCollection(web3, sponsor, collectionIdAddress);
+    await sponsorCollection.methods.ethConfirmSponsorship().send();
+    collectionSub = (await getDetailedCollectionInfo(api, collectionId))!;
+    expect(collectionSub.sponsorship.isConfirmed).to.be.true;
+    expect(collectionSub.sponsorship.asConfirmed.toHuman()).to.be.eq(evmToAddress(sponsor));
+  });
+
+  itWeb3('Set limits', async ({api, web3}) => {
+    const owner = await createEthAccountWithBalance(api, web3);
+    const collectionHelper = evmCollectionHelper(web3, owner);
+    const result = await collectionHelper.methods.create721Collection('Const collection', '5', '5').send();
+    const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result);
+    const limits = {
+      accountTokenOwnershipLimit: 1000,
+      sponsoredDataSize: 1024,
+      sponsoredDataRateLimit: 30,
+      tokenLimit: 1000000,
+      sponsorTransferTimeout: 6,
+      sponsorApproveTimeout: 6,
+      ownerCanTransfer: false,
+      ownerCanDestroy: false,
+      transfersEnabled: false,
+    };
+
+    const collectionEvm = evmCollection(web3, owner, collectionIdAddress);
+    await collectionEvm.methods.setLimit('accountTokenOwnershipLimit', limits.accountTokenOwnershipLimit.toString()).send();
+    await collectionEvm.methods.setLimit('sponsoredDataSize', limits.sponsoredDataSize.toString()).send();
+    await collectionEvm.methods.setLimit('sponsoredDataRateLimit', limits.sponsoredDataRateLimit.toString()).send();
+    await collectionEvm.methods.setLimit('tokenLimit', limits.tokenLimit.toString()).send();
+    await collectionEvm.methods.setLimit('sponsorTransferTimeout', limits.sponsorTransferTimeout.toString()).send();
+    await collectionEvm.methods.setLimit('sponsorApproveTimeout', limits.sponsorApproveTimeout.toString()).send();
+    await collectionEvm.methods.setLimit('ownerCanTransfer', limits.ownerCanTransfer.toString()).send();
+    await collectionEvm.methods.setLimit('ownerCanDestroy', limits.ownerCanDestroy.toString()).send();
+    await collectionEvm.methods.setLimit('transfersEnabled', limits.transfersEnabled.toString()).send();
+    
+    const collectionSub = (await getDetailedCollectionInfo(api, collectionId))!;
+    expect(collectionSub.limits.accountTokenOwnershipLimit.unwrap().toNumber()).to.be.eq(limits.accountTokenOwnershipLimit);
+    expect(collectionSub.limits.sponsoredDataSize.unwrap().toNumber()).to.be.eq(limits.sponsoredDataSize);
+    expect(collectionSub.limits.sponsoredDataRateLimit.unwrap().asBlocks.toNumber()).to.be.eq(limits.sponsoredDataRateLimit);
+    expect(collectionSub.limits.tokenLimit.unwrap().toNumber()).to.be.eq(limits.tokenLimit);
+    expect(collectionSub.limits.sponsorTransferTimeout.unwrap().toNumber()).to.be.eq(limits.sponsorTransferTimeout);
+    expect(collectionSub.limits.sponsorApproveTimeout.unwrap().toNumber()).to.be.eq(limits.sponsorApproveTimeout);
+    expect(collectionSub.limits.ownerCanTransfer.toHuman()).to.be.eq(limits.ownerCanTransfer);
+    expect(collectionSub.limits.ownerCanDestroy.toHuman()).to.be.eq(limits.ownerCanDestroy);
+    expect(collectionSub.limits.transfersEnabled.toHuman()).to.be.eq(limits.transfersEnabled);
+  });
+
+  itWeb3('Collection address exist', async ({api, web3}) => {
+    const owner = await createEthAccountWithBalance(api, web3);
+    const collectionAddressForNonexistentCollection = '0x17C4E6453CC49AAAAEACA894E6D9683E00112233';
+    const collectionHelper = evmCollectionHelper(web3, owner);
+    expect(await collectionHelper.methods
+      .isCollectionExist(collectionAddressForNonexistentCollection).call())
+      .to.be.false;
+    
+    const result = await collectionHelper.methods.create721Collection('Collection address exist', '7', '7').send();
+    const {collectionIdAddress} = await getCollectionAddressFromResult(api, result);
+    expect(await collectionHelper.methods
+      .isCollectionExist(collectionIdAddress).call())
+      .to.be.true;
+  });
+});
+
+describe('(!negative tests!) Create collection from EVM', () => {
+  itWeb3('(!negative test!) Create collection (bad lengths)', async ({api, web3}) => {
+    const owner = await createEthAccountWithBalance(api, web3);
+    const helper = evmCollectionHelper(web3, owner);
+    {
+      const MAX_NAME_LENGHT = 64;
+      const collectionName = 'A'.repeat(MAX_NAME_LENGHT + 1);
+      const description = 'A';
+      const tokenPrefix = 'A';
+    
+      await expect(helper.methods
+        .create721Collection(collectionName, description, tokenPrefix)
+        .call()).to.be.rejectedWith('name is too long. Max length is ' + MAX_NAME_LENGHT);
+      
+    }
+    {  
+      const MAX_DESCRIPTION_LENGHT = 256;
+      const collectionName = 'A';
+      const description = 'A'.repeat(MAX_DESCRIPTION_LENGHT + 1);
+      const tokenPrefix = 'A';
+      await expect(helper.methods
+        .create721Collection(collectionName, description, tokenPrefix)
+        .call()).to.be.rejectedWith('description is too long. Max length is ' + MAX_DESCRIPTION_LENGHT);
+    }
+    {  
+      const MAX_TOKEN_PREFIX_LENGHT = 16;
+      const collectionName = 'A';
+      const description = 'A';
+      const tokenPrefix = 'A'.repeat(MAX_TOKEN_PREFIX_LENGHT + 1);
+      await expect(helper.methods
+        .create721Collection(collectionName, description, tokenPrefix)
+        .call()).to.be.rejectedWith('token_prefix is too long. Max length is ' + MAX_TOKEN_PREFIX_LENGHT);
+    }
+  });
+  
+  itWeb3('(!negative test!) Create collection (no funds)', async ({web3}) => {
+    const owner = await createEthAccount(web3);
+    const helper = evmCollectionHelper(web3, owner);
+    const collectionName = 'A';
+    const description = 'A';
+    const tokenPrefix = 'A';
+    
+    await expect(helper.methods
+      .create721Collection(collectionName, description, tokenPrefix)
+      .call()).to.be.rejectedWith('NotSufficientFounds');
+  });
+
+  itWeb3('(!negative test!) Check owner', async ({api, web3}) => {
+    const owner = await createEthAccountWithBalance(api, web3);
+    const notOwner = await createEthAccount(web3);
+    const collectionHelper = evmCollectionHelper(web3, owner);
+    const result = await collectionHelper.methods.create721Collection('A', 'A', 'A').send();
+    const {collectionIdAddress} = await getCollectionAddressFromResult(api, result);
+    const contractEvmFromNotOwner = evmCollection(web3, notOwner, collectionIdAddress);
+    const EXPECTED_ERROR = 'NoPermission';
+    {
+      const sponsor = await createEthAccountWithBalance(api, web3);
+      await expect(contractEvmFromNotOwner.methods
+        .ethSetSponsor(sponsor)
+        .call()).to.be.rejectedWith(EXPECTED_ERROR);
+      
+      const sponsorCollection = evmCollection(web3, sponsor, collectionIdAddress);
+      await expect(sponsorCollection.methods
+        .ethConfirmSponsorship()
+        .call()).to.be.rejectedWith('Caller is not set as sponsor');
+    }
+    {
+      await expect(contractEvmFromNotOwner.methods
+        .setLimit('account_token_ownership_limit', '1000')
+        .call()).to.be.rejectedWith(EXPECTED_ERROR);
+    }
+  });
+
+  itWeb3('(!negative test!) Set limits', async ({api, web3}) => {
+    const owner = await createEthAccountWithBalance(api, web3);
+    const collectionHelper = evmCollectionHelper(web3, owner);
+    const result = await collectionHelper.methods.create721Collection('Schema collection', 'A', 'A').send();
+    const {collectionIdAddress} = await getCollectionAddressFromResult(api, result);
+    const collectionEvm = evmCollection(web3, owner, collectionIdAddress);
+    await expect(collectionEvm.methods
+      .setLimit('badLimit', 'true')
+      .call()).to.be.rejectedWith('Unknown limit "badLimit"');
+    await expect(collectionEvm.methods
+      .setLimit('sponsoredDataSize', 'badValue')
+      .call()).to.be.rejectedWith('Int value "badValue" parse error:');
+    await expect(collectionEvm.methods
+      .setLimit('ownerCanTransfer', 'badValue')
+      .call()).to.be.rejectedWith('Bool value "badValue" parse error:');
+  });
+});
\ No newline at end of file
modifiedtests/src/eth/fungibleAbi.jsondiffbeforeafterboth
--- a/tests/src/eth/fungibleAbi.json
+++ b/tests/src/eth/fungibleAbi.json
@@ -1,175 +1,206 @@
 [
-    {
-        "constant": false,
-        "inputs": [
-            {
-                "name": "_spender",
-                "type": "address"
-            },
-            {
-                "name": "_value",
-                "type": "uint256"
-            }
-        ],
-        "name": "approve",
-        "outputs": [
-            {
-                "name": "",
-                "type": "bool"
-            }
-        ],
-        "payable": false,
-        "stateMutability": "nonpayable",
-        "type": "function"
-    },
-    {
-        "constant": true,
-        "inputs": [],
-        "name": "totalSupply",
-        "outputs": [
-            {
-                "name": "",
-                "type": "uint256"
-            }
-        ],
-        "payable": false,
-        "stateMutability": "view",
-        "type": "function"
-    },
-    {
-        "constant": false,
-        "inputs": [
-            {
-                "name": "_from",
-                "type": "address"
-            },
-            {
-                "name": "_to",
-                "type": "address"
-            },
-            {
-                "name": "_value",
-                "type": "uint256"
-            }
-        ],
-        "name": "transferFrom",
-        "outputs": [
-            {
-                "name": "",
-                "type": "bool"
-            }
-        ],
-        "payable": false,
-        "stateMutability": "nonpayable",
-        "type": "function"
-    },
-    {
-        "constant": true,
-        "inputs": [
-            {
-                "name": "_owner",
-                "type": "address"
-            }
-        ],
-        "name": "balanceOf",
-        "outputs": [
-            {
-                "name": "balance",
-                "type": "uint256"
-            }
-        ],
-        "payable": false,
-        "stateMutability": "view",
-        "type": "function"
-    },
-    {
-        "constant": false,
-        "inputs": [
-            {
-                "name": "_to",
-                "type": "address"
-            },
-            {
-                "name": "_value",
-                "type": "uint256"
-            }
-        ],
-        "name": "transfer",
-        "outputs": [
-            {
-                "name": "",
-                "type": "bool"
-            }
-        ],
-        "payable": false,
-        "stateMutability": "nonpayable",
-        "type": "function"
-    },
-    {
-        "constant": true,
-        "inputs": [
-            {
-                "name": "_owner",
-                "type": "address"
-            },
-            {
-                "name": "_spender",
-                "type": "address"
-            }
-        ],
-        "name": "allowance",
-        "outputs": [
-            {
-                "name": "",
-                "type": "uint256"
-            }
-        ],
-        "payable": false,
-        "stateMutability": "view",
-        "type": "function"
-    },
-    {
-        "anonymous": false,
-        "inputs": [
-            {
-                "indexed": true,
-                "name": "owner",
-                "type": "address"
-            },
-            {
-                "indexed": true,
-                "name": "spender",
-                "type": "address"
-            },
-            {
-                "indexed": false,
-                "name": "value",
-                "type": "uint256"
-            }
-        ],
-        "name": "Approval",
-        "type": "event"
-    },
-    {
-        "anonymous": false,
-        "inputs": [
-            {
-                "indexed": true,
-                "name": "from",
-                "type": "address"
-            },
-            {
-                "indexed": true,
-                "name": "to",
-                "type": "address"
-            },
-            {
-                "indexed": false,
-                "name": "value",
-                "type": "uint256"
-            }
-        ],
-        "name": "Transfer",
-        "type": "event"
-    }
-]
\ No newline at end of file
+  {
+    "anonymous": false,
+    "inputs": [
+      {
+        "indexed": true,
+        "internalType": "address",
+        "name": "owner",
+        "type": "address"
+      },
+      {
+        "indexed": true,
+        "internalType": "address",
+        "name": "spender",
+        "type": "address"
+      },
+      {
+        "indexed": false,
+        "internalType": "uint256",
+        "name": "value",
+        "type": "uint256"
+      }
+    ],
+    "name": "Approval",
+    "type": "event"
+  },
+  {
+    "anonymous": false,
+    "inputs": [
+      {
+        "indexed": true,
+        "internalType": "address",
+        "name": "from",
+        "type": "address"
+      },
+      {
+        "indexed": true,
+        "internalType": "address",
+        "name": "to",
+        "type": "address"
+      },
+      {
+        "indexed": false,
+        "internalType": "uint256",
+        "name": "value",
+        "type": "uint256"
+      }
+    ],
+    "name": "Transfer",
+    "type": "event"
+  },
+  {
+    "inputs": [
+      { "internalType": "address", "name": "owner", "type": "address" },
+      { "internalType": "address", "name": "spender", "type": "address" }
+    ],
+    "name": "allowance",
+    "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
+    "stateMutability": "view",
+    "type": "function"
+  },
+  {
+    "inputs": [
+      { "internalType": "address", "name": "spender", "type": "address" },
+      { "internalType": "uint256", "name": "amount", "type": "uint256" }
+    ],
+    "name": "approve",
+    "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
+    "stateMutability": "nonpayable",
+    "type": "function"
+  },
+  {
+    "inputs": [
+      { "internalType": "address", "name": "owner", "type": "address" }
+    ],
+    "name": "balanceOf",
+    "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
+    "stateMutability": "view",
+    "type": "function"
+  },
+  {
+    "inputs": [
+      { "internalType": "address", "name": "from", "type": "address" },
+      { "internalType": "uint256", "name": "amount", "type": "uint256" }
+    ],
+    "name": "burnFrom",
+    "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
+    "stateMutability": "nonpayable",
+    "type": "function"
+  },
+  {
+    "inputs": [{ "internalType": "string", "name": "key", "type": "string" }],
+    "name": "collectionProperty",
+    "outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }],
+    "stateMutability": "view",
+    "type": "function"
+  },
+  {
+    "inputs": [],
+    "name": "contractAddress",
+    "outputs": [{ "internalType": "address", "name": "", "type": "address" }],
+    "stateMutability": "view",
+    "type": "function"
+  },
+  {
+    "inputs": [],
+    "name": "decimals",
+    "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }],
+    "stateMutability": "view",
+    "type": "function"
+  },
+  {
+    "inputs": [{ "internalType": "string", "name": "key", "type": "string" }],
+    "name": "deleteCollectionProperty",
+    "outputs": [],
+    "stateMutability": "nonpayable",
+    "type": "function"
+  },
+  {
+    "inputs": [],
+    "name": "ethConfirmSponsorship",
+    "outputs": [],
+    "stateMutability": "nonpayable",
+    "type": "function"
+  },
+  {
+    "inputs": [
+      { "internalType": "address", "name": "sponsor", "type": "address" }
+    ],
+    "name": "ethSetSponsor",
+    "outputs": [],
+    "stateMutability": "nonpayable",
+    "type": "function"
+  },
+  {
+    "inputs": [],
+    "name": "name",
+    "outputs": [{ "internalType": "string", "name": "", "type": "string" }],
+    "stateMutability": "view",
+    "type": "function"
+  },
+  {
+    "inputs": [
+      { "internalType": "string", "name": "key", "type": "string" },
+      { "internalType": "bytes", "name": "value", "type": "bytes" }
+    ],
+    "name": "setCollectionProperty",
+    "outputs": [],
+    "stateMutability": "nonpayable",
+    "type": "function"
+  },
+  {
+    "inputs": [
+      { "internalType": "string", "name": "limit", "type": "string" },
+      { "internalType": "string", "name": "value", "type": "string" }
+    ],
+    "name": "setLimit",
+    "outputs": [],
+    "stateMutability": "nonpayable",
+    "type": "function"
+  },
+  {
+    "inputs": [
+      { "internalType": "bytes4", "name": "interfaceID", "type": "bytes4" }
+    ],
+    "name": "supportsInterface",
+    "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
+    "stateMutability": "view",
+    "type": "function"
+  },
+  {
+    "inputs": [],
+    "name": "symbol",
+    "outputs": [{ "internalType": "string", "name": "", "type": "string" }],
+    "stateMutability": "view",
+    "type": "function"
+  },
+  {
+    "inputs": [],
+    "name": "totalSupply",
+    "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
+    "stateMutability": "view",
+    "type": "function"
+  },
+  {
+    "inputs": [
+      { "internalType": "address", "name": "to", "type": "address" },
+      { "internalType": "uint256", "name": "amount", "type": "uint256" }
+    ],
+    "name": "transfer",
+    "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
+    "stateMutability": "nonpayable",
+    "type": "function"
+  },
+  {
+    "inputs": [
+      { "internalType": "address", "name": "from", "type": "address" },
+      { "internalType": "address", "name": "to", "type": "address" },
+      { "internalType": "uint256", "name": "amount", "type": "uint256" }
+    ],
+    "name": "transferFrom",
+    "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
+    "stateMutability": "nonpayable",
+    "type": "function"
+  }
+]
deletedtests/src/eth/fungibleMetadataAbi.jsondiffbeforeafterboth
--- a/tests/src/eth/fungibleMetadataAbi.json
+++ /dev/null
@@ -1,41 +0,0 @@
-[
-    {
-        "inputs": [],
-        "name": "name",
-        "outputs": [
-            {
-                "internalType": "string",
-                "name": "",
-                "type": "string"
-            }
-        ],
-        "stateMutability": "view",
-        "type": "function"
-    },
-    {
-        "inputs": [],
-        "name": "symbol",
-        "outputs": [
-            {
-                "internalType": "string",
-                "name": "",
-                "type": "string"
-            }
-        ],
-        "stateMutability": "view",
-        "type": "function"
-    },
-    {
-        "inputs": [],
-        "name": "decimals",
-        "outputs": [
-            {
-                "internalType": "uint8",
-                "name": "",
-                "type": "uint8"
-            }
-        ],
-        "stateMutability": "view",
-        "type": "function"
-    }
-]
\ No newline at end of file
deletedtests/src/eth/metadata.test.tsdiffbeforeafterboth
--- a/tests/src/eth/metadata.test.ts
+++ /dev/null
@@ -1,210 +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/>.
-
-import {expect} from 'chai';
-import {createCollectionExpectSuccess} from '../util/helpers';
-import {collectionIdToAddress, createEthAccount, createEthAccountWithBalance, GAS_ARGS, itWeb3, normalizeEvents} from './util/helpers';
-import fungibleMetadataAbi from './fungibleMetadataAbi.json';
-import privateKey from '../substrate/privateKey';
-import {submitTransactionAsync} from '../substrate/substrate-api';
-import nonFungibleAbi from './nonFungibleAbi.json';
-
-describe('Common metadata', () => {
-  itWeb3('Returns collection name', async ({api, web3}) => {
-    const collection = await createCollectionExpectSuccess({
-      name: 'token name',
-      mode: {type: 'NFT'},
-    });
-    const caller = await createEthAccountWithBalance(api, web3);
-
-    const address = collectionIdToAddress(collection);
-    const contract = new web3.eth.Contract(fungibleMetadataAbi as any, address, {from: caller, ...GAS_ARGS});
-    const name = await contract.methods.name().call();
-
-    expect(name).to.equal('token name');
-  });
-
-  itWeb3('Returns symbol name', async ({api, web3}) => {
-    const collection = await createCollectionExpectSuccess({
-      tokenPrefix: 'TOK',
-      mode: {type: 'NFT'},
-    });
-    const caller = await createEthAccountWithBalance(api, web3);
-
-    const address = collectionIdToAddress(collection);
-    const contract = new web3.eth.Contract(fungibleMetadataAbi as any, address, {from: caller, ...GAS_ARGS});
-    const symbol = await contract.methods.symbol().call();
-
-    expect(symbol).to.equal('TOK');
-  });
-});
-
-describe('Fungible metadata', () => {
-  itWeb3('Returns fungible decimals', async ({api, web3}) => {
-    const collection = await createCollectionExpectSuccess({
-      mode: {type: 'Fungible', decimalPoints: 6},
-    });
-    const caller = await createEthAccountWithBalance(api, web3);
-
-    const address = collectionIdToAddress(collection);
-    const contract = new web3.eth.Contract(fungibleMetadataAbi as any, address, {from: caller, ...GAS_ARGS});
-    const decimals = await contract.methods.decimals().call();
-
-    expect(+decimals).to.equal(6);
-  });
-});
-
-describe('Support ERC721Metadata', () => {
-  itWeb3('Check unsupport ERC721Metadata SchemaVersion::Unique', async ({web3, api}) => {
-    const collectionId = await createCollectionExpectSuccess({
-      mode: {type: 'NFT'},
-      schemaVersion: 'Unique',
-      name: 'some_name',
-      tokenPrefix: 'some_prefix',
-    });
-    const collection = await api.rpc.unique.collectionById(collectionId);
-    expect(collection.isSome).to.be.true;
-    expect(collection.unwrap().schemaVersion.toHuman()).to.be.eq('Unique');
-
-    const alice = privateKey('//Alice');
-
-    const caller = await createEthAccountWithBalance(api, web3);
-    const changeAdminTx = api.tx.unique.addCollectionAdmin(collectionId, {Ethereum: caller});
-    await submitTransactionAsync(alice, changeAdminTx);
-
-    const address = collectionIdToAddress(collectionId);
-    const contract = new web3.eth.Contract(nonFungibleAbi as any, address, {from: caller, ...GAS_ARGS});
-
-    expect(await contract.methods.name().call()).to.be.eq('some_name');
-    expect(await contract.methods.symbol().call()).to.be.eq('some_prefix');
-
-    const receiver = createEthAccount(web3);
-    const nextTokenId = await contract.methods.nextTokenId().call();
-    expect(nextTokenId).to.be.equal('1');
-    await expect(contract.methods.mintWithTokenURI(
-      receiver,
-      nextTokenId,
-      'Test URI',
-    ).call({from: caller})).to.be.rejectedWith('Unsupported schema version! Support only ImageURL');
-
-    await expect(contract.methods.mintBulkWithTokenURI(
-      receiver,
-      [
-        [nextTokenId, 'Test URI 0'],
-        [+nextTokenId + 1, 'Test URI 1'],
-        [+nextTokenId + 2, 'Test URI 2'],
-      ],
-    ).call({from: caller})).to.be.rejectedWith('Unsupported schema version! Support only ImageURL');
-  });
-
-  itWeb3('Check support ERC721Metadata for SchemaVersion::ImageURL', async ({web3, api}) => {
-    const collectionId = await createCollectionExpectSuccess({
-      mode: {type: 'NFT'},
-      name: 'some_name',
-      tokenPrefix: 'some_prefix',
-    });
-    const collection = await api.rpc.unique.collectionById(collectionId);
-    expect(collection.isSome).to.be.true;
-    expect(collection.unwrap().schemaVersion.toHuman()).to.be.eq('ImageURL');
-
-    const alice = privateKey('//Alice');
-
-    const caller = await createEthAccountWithBalance(api, web3);
-    const changeAdminTx = api.tx.unique.addCollectionAdmin(collectionId, {Ethereum: caller});
-    await submitTransactionAsync(alice, changeAdminTx);
-
-    const address = collectionIdToAddress(collectionId);
-    const contract = new web3.eth.Contract(nonFungibleAbi as any, address, {from: caller, ...GAS_ARGS});
-    
-    expect(await contract.methods.name().call()).to.be.eq('some_name');
-    expect(await contract.methods.symbol().call()).to.be.eq('some_prefix');
-
-    const receiver = createEthAccount(web3);
-    { // mintWithTokenURI
-      const nextTokenId = await contract.methods.nextTokenId().call();
-      expect(nextTokenId).to.be.equal('1');
-      const result = await contract.methods.mintWithTokenURI(
-        receiver,
-        nextTokenId,
-        'Test URI',
-      ).send({from: caller});
-      const events = normalizeEvents(result.events);
-  
-      expect(events).to.be.deep.equal([
-        {
-          address,
-          event: 'Transfer',
-          args: {
-            from: '0x0000000000000000000000000000000000000000',
-            to: receiver,
-            tokenId: nextTokenId,
-          },
-        },
-      ]);
-  
-      expect(await contract.methods.tokenURI(nextTokenId).call()).to.be.equal('Test URI');
-    }
-
-    { // mintBulkWithTokenURI
-      const nextTokenId = await contract.methods.nextTokenId().call();
-      expect(nextTokenId).to.be.equal('2');
-      const result = await contract.methods.mintBulkWithTokenURI(
-        receiver,
-        [
-          [nextTokenId, 'Test URI 0'],
-          [+nextTokenId + 1, 'Test URI 1'],
-          [+nextTokenId + 2, 'Test URI 2'],
-        ],
-      ).send({from: caller});
-      const events = normalizeEvents(result.events);
-
-      expect(events).to.be.deep.equal([
-        {
-          address,
-          event: 'Transfer',
-          args: {
-            from: '0x0000000000000000000000000000000000000000',
-            to: receiver,
-            tokenId: nextTokenId,
-          },
-        },
-        {
-          address,
-          event: 'Transfer',
-          args: {
-            from: '0x0000000000000000000000000000000000000000',
-            to: receiver,
-            tokenId: String(+nextTokenId + 1),
-          },
-        },
-        {
-          address,
-          event: 'Transfer',
-          args: {
-            from: '0x0000000000000000000000000000000000000000',
-            to: receiver,
-            tokenId: String(+nextTokenId + 2),
-          },
-        },
-      ]);
-
-      expect(await contract.methods.tokenURI(nextTokenId).call()).to.be.equal('Test URI 0');
-      expect(await contract.methods.tokenURI(+nextTokenId + 1).call()).to.be.equal('Test URI 1');
-      expect(await contract.methods.tokenURI(+nextTokenId + 2).call()).to.be.equal('Test URI 2');
-    }
-  });
-});
-
modifiedtests/src/eth/nonFungible.test.tsdiffbeforeafterboth
--- a/tests/src/eth/nonFungible.test.ts
+++ b/tests/src/eth/nonFungible.test.ts
@@ -16,7 +16,7 @@
 
 import privateKey from '../substrate/privateKey';
 import {approveExpectSuccess, burnItemExpectSuccess, createCollectionExpectSuccess, createItemExpectSuccess, transferExpectSuccess, transferFromExpectSuccess, UNIQUE} from '../util/helpers';
-import {collectionIdToAddress, createEthAccount, createEthAccountWithBalance, GAS_ARGS, itWeb3, normalizeEvents, recordEthFee, recordEvents, subToEth, transferBalanceToEth} from './util/helpers';
+import {collectionIdToAddress, createEthAccount, createEthAccountWithBalance, evmCollection, evmCollectionHelper, GAS_ARGS, getCollectionAddressFromResult, itWeb3, normalizeEvents, recordEthFee, recordEvents, subToEth, transferBalanceToEth} from './util/helpers';
 import nonFungibleAbi from './nonFungibleAbi.json';
 import {expect} from 'chai';
 import {submitTransactionAsync} from '../substrate/substrate-api';
@@ -75,45 +75,46 @@
 
 describe('NFT: Plain calls', () => {
   itWeb3('Can perform mint()', async ({web3, api}) => {
-    const collection = await createCollectionExpectSuccess({
-      mode: {type: 'NFT'},
-    });
-    const alice = privateKey('//Alice');
-
-    const caller = await createEthAccountWithBalance(api, web3);
-    const changeAdminTx = api.tx.unique.addCollectionAdmin(collection, {Ethereum: caller});
-    await submitTransactionAsync(alice, changeAdminTx);
+    const owner = await createEthAccountWithBalance(api, web3);
+    const helper = evmCollectionHelper(web3, owner);
+    let result = await helper.methods.create721Collection('Mint collection', '6', '6').send();
+    const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result);
     const receiver = createEthAccount(web3);
+    const contract = evmCollection(web3, owner, collectionIdAddress);
+    const nextTokenId = await contract.methods.nextTokenId().call();
 
-    const address = collectionIdToAddress(collection);
-    const contract = new web3.eth.Contract(nonFungibleAbi as any, address, {from: caller, ...GAS_ARGS});
+    expect(nextTokenId).to.be.equal('1');
+    result = await contract.methods.mintWithTokenURI(
+      receiver,
+      nextTokenId,
+      'Test URI',
+    ).send();
 
-    {
-      const nextTokenId = await contract.methods.nextTokenId().call();
-      expect(nextTokenId).to.be.equal('1');
-      const result = await contract.methods.mintWithTokenURI(
-        receiver,
-        nextTokenId,
-        'Test URI',
-      ).send({from: caller});
-      const events = normalizeEvents(result.events);
+    const events = normalizeEvents(result.events);
+    const address = collectionIdToAddress(collectionId);
 
-      expect(events).to.be.deep.equal([
-        {
-          address,
-          event: 'Transfer',
-          args: {
-            from: '0x0000000000000000000000000000000000000000',
-            to: receiver,
-            tokenId: nextTokenId,
-          },
+    expect(events).to.be.deep.equal([
+      {
+        address,
+        event: 'Transfer',
+        args: {
+          from: '0x0000000000000000000000000000000000000000',
+          to: receiver,
+          tokenId: nextTokenId,
         },
-      ]);
+      },
+    ]);
+
+    expect(await contract.methods.tokenURI(nextTokenId).call()).to.be.equal('Test URI');
 
-      expect(await contract.methods.tokenURI(nextTokenId).call()).to.be.equal('Test URI');
-    }
+    // TODO: this wont work right now, need release 919000 first
+    // await helper.methods.setOffchainSchema(collectionIdAddress, 'https://offchain-service.local/token-info/{id}').send();
+    // const tokenUri = await contract.methods.tokenURI(nextTokenId).call();
+    // expect(tokenUri).to.be.equal(`https://offchain-service.local/token-info/${nextTokenId}`);
   });
-  itWeb3('Can perform mintBulk()', async ({web3, api}) => {
+
+  //TODO: CORE-302 add eth methods
+  itWeb3.skip('Can perform mintBulk()', async ({web3, api}) => {
     const collection = await createCollectionExpectSuccess({
       mode: {type: 'NFT'},
     });
@@ -539,3 +540,33 @@
     ]);
   });
 });
+
+describe('Common metadata', () => {
+  itWeb3('Returns collection name', async ({api, web3}) => {
+    const collection = await createCollectionExpectSuccess({
+      name: 'token name',
+      mode: {type: 'NFT'},
+    });
+    const caller = await createEthAccountWithBalance(api, web3);
+
+    const address = collectionIdToAddress(collection);
+    const contract = new web3.eth.Contract(nonFungibleAbi as any, address, {from: caller, ...GAS_ARGS});
+    const name = await contract.methods.name().call();
+
+    expect(name).to.equal('token name');
+  });
+
+  itWeb3('Returns symbol name', async ({api, web3}) => {
+    const collection = await createCollectionExpectSuccess({
+      tokenPrefix: 'TOK',
+      mode: {type: 'NFT'},
+    });
+    const caller = await createEthAccountWithBalance(api, web3);
+
+    const address = collectionIdToAddress(collection);
+    const contract = new web3.eth.Contract(nonFungibleAbi as any, address, {from: caller, ...GAS_ARGS});
+    const symbol = await contract.methods.symbol().call();
+
+    expect(symbol).to.equal('TOK');
+  });
+});
\ No newline at end of file
modifiedtests/src/eth/nonFungibleAbi.jsondiffbeforeafterboth
--- a/tests/src/eth/nonFungibleAbi.json
+++ b/tests/src/eth/nonFungibleAbi.json
@@ -1,738 +1,431 @@
 [
-	{
-		"anonymous": false,
-		"inputs": [
-			{
-				"indexed": true,
-				"internalType": "address",
-				"name": "owner",
-				"type": "address"
-			},
-			{
-				"indexed": true,
-				"internalType": "address",
-				"name": "approved",
-				"type": "address"
-			},
-			{
-				"indexed": true,
-				"internalType": "uint256",
-				"name": "tokenId",
-				"type": "uint256"
-			}
-		],
-		"name": "Approval",
-		"type": "event"
-	},
-	{
-		"anonymous": false,
-		"inputs": [
-			{
-				"indexed": true,
-				"internalType": "address",
-				"name": "owner",
-				"type": "address"
-			},
-			{
-				"indexed": true,
-				"internalType": "address",
-				"name": "operator",
-				"type": "address"
-			},
-			{
-				"indexed": false,
-				"internalType": "bool",
-				"name": "approved",
-				"type": "bool"
-			}
-		],
-		"name": "ApprovalForAll",
-		"type": "event"
-	},
-	{
-		"anonymous": false,
-		"inputs": [],
-		"name": "MintingFinished",
-		"type": "event"
-	},
-	{
-		"anonymous": false,
-		"inputs": [
-			{
-				"indexed": true,
-				"internalType": "address",
-				"name": "from",
-				"type": "address"
-			},
-			{
-				"indexed": true,
-				"internalType": "address",
-				"name": "to",
-				"type": "address"
-			},
-			{
-				"indexed": true,
-				"internalType": "uint256",
-				"name": "tokenId",
-				"type": "uint256"
-			}
-		],
-		"name": "Transfer",
-		"type": "event"
-	},
-	{
-		"inputs": [
-			{
-				"internalType": "address",
-				"name": "approved",
-				"type": "address"
-			},
-			{
-				"internalType": "uint256",
-				"name": "tokenId",
-				"type": "uint256"
-			}
-		],
-		"name": "approve",
-		"outputs": [],
-		"stateMutability": "nonpayable",
-		"type": "function"
-	},
-	{
-		"inputs": [
-			{
-				"internalType": "address",
-				"name": "owner",
-				"type": "address"
-			}
-		],
-		"name": "balanceOf",
-		"outputs": [
-			{
-				"internalType": "uint256",
-				"name": "",
-				"type": "uint256"
-			}
-		],
-		"stateMutability": "view",
-		"type": "function"
-	},
-	{
-		"inputs": [
-			{
-				"internalType": "uint256",
-				"name": "tokenId",
-				"type": "uint256"
-			}
-		],
-		"name": "burn",
-		"outputs": [],
-		"stateMutability": "nonpayable",
-		"type": "function"
-	},
-	{
-		"inputs": [
-			{
-				"internalType": "address",
-				"name": "from",
-				"type": "address"
-			},
-			{
-				"internalType": "uint256",
-				"name": "tokenId",
-				"type": "uint256"
-			}
-		],
-		"name": "burnFrom",
-		"outputs": [],
-		"stateMutability": "nonpayable",
-		"type": "function"
-	},
-	{
-		"inputs": [
-			{
-				"internalType": "string",
-				"name": "key",
-				"type": "string"
-			}
-		],
-		"name": "collectionProperty",
-		"outputs": [
-			{
-				"internalType": "bytes",
-				"name": "",
-				"type": "bytes"
-			}
-		],
-		"stateMutability": "view",
-		"type": "function"
-	},
-	{
-		"inputs": [
-			{
-				"internalType": "string",
-				"name": "key",
-				"type": "string"
-			}
-		],
-		"name": "deleteCollectionProperty",
-		"outputs": [],
-		"stateMutability": "nonpayable",
-		"type": "function"
-	},
-	{
-		"inputs": [
-			{
-				"internalType": "uint256",
-				"name": "tokenId",
-				"type": "uint256"
-			},
-			{
-				"internalType": "string",
-				"name": "key",
-				"type": "string"
-			}
-		],
-		"name": "deleteProperty",
-		"outputs": [],
-		"stateMutability": "nonpayable",
-		"type": "function"
-	},
-	{
-		"inputs": [],
-		"name": "finishMinting",
-		"outputs": [
-			{
-				"internalType": "bool",
-				"name": "",
-				"type": "bool"
-			}
-		],
-		"stateMutability": "nonpayable",
-		"type": "function"
-	},
-	{
-		"inputs": [
-			{
-				"internalType": "uint256",
-				"name": "tokenId",
-				"type": "uint256"
-			}
-		],
-		"name": "getApproved",
-		"outputs": [
-			{
-				"internalType": "address",
-				"name": "",
-				"type": "address"
-			}
-		],
-		"stateMutability": "view",
-		"type": "function"
-	},
-	{
-		"inputs": [
-			{
-				"internalType": "address",
-				"name": "owner",
-				"type": "address"
-			},
-			{
-				"internalType": "address",
-				"name": "operator",
-				"type": "address"
-			}
-		],
-		"name": "isApprovedForAll",
-		"outputs": [
-			{
-				"internalType": "address",
-				"name": "",
-				"type": "address"
-			}
-		],
-		"stateMutability": "view",
-		"type": "function"
-	},
-	{
-		"inputs": [
-			{
-				"internalType": "address",
-				"name": "to",
-				"type": "address"
-			},
-			{
-				"internalType": "uint256",
-				"name": "tokenId",
-				"type": "uint256"
-			}
-		],
-		"name": "mint",
-		"outputs": [
-			{
-				"internalType": "bool",
-				"name": "",
-				"type": "bool"
-			}
-		],
-		"stateMutability": "nonpayable",
-		"type": "function"
-	},
-	{
-		"inputs": [
-			{
-				"internalType": "address",
-				"name": "to",
-				"type": "address"
-			},
-			{
-				"internalType": "uint256[]",
-				"name": "tokenIds",
-				"type": "uint256[]"
-			}
-		],
-		"name": "mintBulk",
-		"outputs": [
-			{
-				"internalType": "bool",
-				"name": "",
-				"type": "bool"
-			}
-		],
-		"stateMutability": "nonpayable",
-		"type": "function"
-	},
-	{
-		"inputs": [
-			{
-				"internalType": "address",
-				"name": "to",
-				"type": "address"
-			},
-			{
-				"components": [
-					{
-						"internalType": "uint256",
-						"name": "field_0",
-						"type": "uint256"
-					},
-					{
-						"internalType": "string",
-						"name": "field_1",
-						"type": "string"
-					}
-				],
-				"internalType": "struct Tuple0[]",
-				"name": "tokens",
-				"type": "tuple[]"
-			}
-		],
-		"name": "mintBulkWithTokenURI",
-		"outputs": [
-			{
-				"internalType": "bool",
-				"name": "",
-				"type": "bool"
-			}
-		],
-		"stateMutability": "nonpayable",
-		"type": "function"
-	},
-	{
-		"inputs": [
-			{
-				"internalType": "address",
-				"name": "to",
-				"type": "address"
-			},
-			{
-				"internalType": "uint256",
-				"name": "tokenId",
-				"type": "uint256"
-			},
-			{
-				"internalType": "string",
-				"name": "tokenUri",
-				"type": "string"
-			}
-		],
-		"name": "mintWithTokenURI",
-		"outputs": [
-			{
-				"internalType": "bool",
-				"name": "",
-				"type": "bool"
-			}
-		],
-		"stateMutability": "nonpayable",
-		"type": "function"
-	},
-	{
-		"inputs": [],
-		"name": "mintingFinished",
-		"outputs": [
-			{
-				"internalType": "bool",
-				"name": "",
-				"type": "bool"
-			}
-		],
-		"stateMutability": "view",
-		"type": "function"
-	},
-	{
-		"inputs": [],
-		"name": "name",
-		"outputs": [
-			{
-				"internalType": "string",
-				"name": "",
-				"type": "string"
-			}
-		],
-		"stateMutability": "view",
-		"type": "function"
-	},
-	{
-		"inputs": [],
-		"name": "nextTokenId",
-		"outputs": [
-			{
-				"internalType": "uint256",
-				"name": "",
-				"type": "uint256"
-			}
-		],
-		"stateMutability": "view",
-		"type": "function"
-	},
-	{
-		"inputs": [
-			{
-				"internalType": "uint256",
-				"name": "tokenId",
-				"type": "uint256"
-			}
-		],
-		"name": "ownerOf",
-		"outputs": [
-			{
-				"internalType": "address",
-				"name": "",
-				"type": "address"
-			}
-		],
-		"stateMutability": "view",
-		"type": "function"
-	},
-	{
-		"inputs": [
-			{
-				"internalType": "uint256",
-				"name": "tokenId",
-				"type": "uint256"
-			},
-			{
-				"internalType": "string",
-				"name": "key",
-				"type": "string"
-			}
-		],
-		"name": "property",
-		"outputs": [
-			{
-				"internalType": "bytes",
-				"name": "",
-				"type": "bytes"
-			}
-		],
-		"stateMutability": "view",
-		"type": "function"
-	},
-	{
-		"inputs": [
-			{
-				"internalType": "address",
-				"name": "from",
-				"type": "address"
-			},
-			{
-				"internalType": "address",
-				"name": "to",
-				"type": "address"
-			},
-			{
-				"internalType": "uint256",
-				"name": "tokenId",
-				"type": "uint256"
-			}
-		],
-		"name": "safeTransferFrom",
-		"outputs": [],
-		"stateMutability": "nonpayable",
-		"type": "function"
-	},
-	{
-		"inputs": [
-			{
-				"internalType": "address",
-				"name": "from",
-				"type": "address"
-			},
-			{
-				"internalType": "address",
-				"name": "to",
-				"type": "address"
-			},
-			{
-				"internalType": "uint256",
-				"name": "tokenId",
-				"type": "uint256"
-			},
-			{
-				"internalType": "bytes",
-				"name": "data",
-				"type": "bytes"
-			}
-		],
-		"name": "safeTransferFromWithData",
-		"outputs": [],
-		"stateMutability": "nonpayable",
-		"type": "function"
-	},
-	{
-		"inputs": [
-			{
-				"internalType": "address",
-				"name": "operator",
-				"type": "address"
-			},
-			{
-				"internalType": "bool",
-				"name": "approved",
-				"type": "bool"
-			}
-		],
-		"name": "setApprovalForAll",
-		"outputs": [],
-		"stateMutability": "nonpayable",
-		"type": "function"
-	},
-	{
-		"inputs": [
-			{
-				"internalType": "string",
-				"name": "key",
-				"type": "string"
-			},
-			{
-				"internalType": "bytes",
-				"name": "value",
-				"type": "bytes"
-			}
-		],
-		"name": "setCollectionProperty",
-		"outputs": [],
-		"stateMutability": "nonpayable",
-		"type": "function"
-	},
-	{
-		"inputs": [
-			{
-				"internalType": "uint256",
-				"name": "tokenId",
-				"type": "uint256"
-			},
-			{
-				"internalType": "string",
-				"name": "key",
-				"type": "string"
-			},
-			{
-				"internalType": "bytes",
-				"name": "value",
-				"type": "bytes"
-			}
-		],
-		"name": "setProperty",
-		"outputs": [],
-		"stateMutability": "nonpayable",
-		"type": "function"
-	},
-	{
-		"inputs": [
-			{
-				"internalType": "string",
-				"name": "key",
-				"type": "string"
-			},
-			{
-				"internalType": "bool",
-				"name": "isMutable",
-				"type": "bool"
-			},
-			{
-				"internalType": "bool",
-				"name": "collectionAdmin",
-				"type": "bool"
-			},
-			{
-				"internalType": "bool",
-				"name": "tokenOwner",
-				"type": "bool"
-			}
-		],
-		"name": "setTokenPropertyPermission",
-		"outputs": [],
-		"stateMutability": "nonpayable",
-		"type": "function"
-	},
-	{
-		"inputs": [
-			{
-				"internalType": "bytes4",
-				"name": "interfaceID",
-				"type": "bytes4"
-			}
-		],
-		"name": "supportsInterface",
-		"outputs": [
-			{
-				"internalType": "bool",
-				"name": "",
-				"type": "bool"
-			}
-		],
-		"stateMutability": "view",
-		"type": "function"
-	},
-	{
-		"inputs": [],
-		"name": "symbol",
-		"outputs": [
-			{
-				"internalType": "string",
-				"name": "",
-				"type": "string"
-			}
-		],
-		"stateMutability": "view",
-		"type": "function"
-	},
-	{
-		"inputs": [
-			{
-				"internalType": "uint256",
-				"name": "index",
-				"type": "uint256"
-			}
-		],
-		"name": "tokenByIndex",
-		"outputs": [
-			{
-				"internalType": "uint256",
-				"name": "",
-				"type": "uint256"
-			}
-		],
-		"stateMutability": "view",
-		"type": "function"
-	},
-	{
-		"inputs": [
-			{
-				"internalType": "address",
-				"name": "owner",
-				"type": "address"
-			},
-			{
-				"internalType": "uint256",
-				"name": "index",
-				"type": "uint256"
-			}
-		],
-		"name": "tokenOfOwnerByIndex",
-		"outputs": [
-			{
-				"internalType": "uint256",
-				"name": "",
-				"type": "uint256"
-			}
-		],
-		"stateMutability": "view",
-		"type": "function"
-	},
-	{
-		"inputs": [
-			{
-				"internalType": "uint256",
-				"name": "tokenId",
-				"type": "uint256"
-			}
-		],
-		"name": "tokenURI",
-		"outputs": [
-			{
-				"internalType": "string",
-				"name": "",
-				"type": "string"
-			}
-		],
-		"stateMutability": "view",
-		"type": "function"
-	},
-	{
-		"inputs": [],
-		"name": "totalSupply",
-		"outputs": [
-			{
-				"internalType": "uint256",
-				"name": "",
-				"type": "uint256"
-			}
-		],
-		"stateMutability": "view",
-		"type": "function"
-	},
-	{
-		"inputs": [
-			{
-				"internalType": "address",
-				"name": "to",
-				"type": "address"
-			},
-			{
-				"internalType": "uint256",
-				"name": "tokenId",
-				"type": "uint256"
-			}
-		],
-		"name": "transfer",
-		"outputs": [],
-		"stateMutability": "nonpayable",
-		"type": "function"
-	},
-	{
-		"inputs": [
-			{
-				"internalType": "address",
-				"name": "from",
-				"type": "address"
-			},
-			{
-				"internalType": "address",
-				"name": "to",
-				"type": "address"
-			},
-			{
-				"internalType": "uint256",
-				"name": "tokenId",
-				"type": "uint256"
-			}
-		],
-		"name": "transferFrom",
-		"outputs": [],
-		"stateMutability": "nonpayable",
-		"type": "function"
-	}
-]
\ No newline at end of file
+  {
+    "anonymous": false,
+    "inputs": [
+      {
+        "indexed": true,
+        "internalType": "address",
+        "name": "owner",
+        "type": "address"
+      },
+      {
+        "indexed": true,
+        "internalType": "address",
+        "name": "approved",
+        "type": "address"
+      },
+      {
+        "indexed": true,
+        "internalType": "uint256",
+        "name": "tokenId",
+        "type": "uint256"
+      }
+    ],
+    "name": "Approval",
+    "type": "event"
+  },
+  {
+    "anonymous": false,
+    "inputs": [
+      {
+        "indexed": true,
+        "internalType": "address",
+        "name": "owner",
+        "type": "address"
+      },
+      {
+        "indexed": true,
+        "internalType": "address",
+        "name": "operator",
+        "type": "address"
+      },
+      {
+        "indexed": false,
+        "internalType": "bool",
+        "name": "approved",
+        "type": "bool"
+      }
+    ],
+    "name": "ApprovalForAll",
+    "type": "event"
+  },
+  {
+    "anonymous": false,
+    "inputs": [],
+    "name": "MintingFinished",
+    "type": "event"
+  },
+  {
+    "anonymous": false,
+    "inputs": [
+      {
+        "indexed": true,
+        "internalType": "address",
+        "name": "from",
+        "type": "address"
+      },
+      {
+        "indexed": true,
+        "internalType": "address",
+        "name": "to",
+        "type": "address"
+      },
+      {
+        "indexed": true,
+        "internalType": "uint256",
+        "name": "tokenId",
+        "type": "uint256"
+      }
+    ],
+    "name": "Transfer",
+    "type": "event"
+  },
+  {
+    "inputs": [
+      { "internalType": "address", "name": "approved", "type": "address" },
+      { "internalType": "uint256", "name": "tokenId", "type": "uint256" }
+    ],
+    "name": "approve",
+    "outputs": [],
+    "stateMutability": "nonpayable",
+    "type": "function"
+  },
+  {
+    "inputs": [
+      { "internalType": "address", "name": "owner", "type": "address" }
+    ],
+    "name": "balanceOf",
+    "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
+    "stateMutability": "view",
+    "type": "function"
+  },
+  {
+    "inputs": [
+      { "internalType": "uint256", "name": "tokenId", "type": "uint256" }
+    ],
+    "name": "burn",
+    "outputs": [],
+    "stateMutability": "nonpayable",
+    "type": "function"
+  },
+  {
+    "inputs": [
+      { "internalType": "address", "name": "from", "type": "address" },
+      { "internalType": "uint256", "name": "tokenId", "type": "uint256" }
+    ],
+    "name": "burnFrom",
+    "outputs": [],
+    "stateMutability": "nonpayable",
+    "type": "function"
+  },
+  {
+    "inputs": [{ "internalType": "string", "name": "key", "type": "string" }],
+    "name": "collectionProperty",
+    "outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }],
+    "stateMutability": "view",
+    "type": "function"
+  },
+  {
+    "inputs": [],
+    "name": "contractAddress",
+    "outputs": [{ "internalType": "address", "name": "", "type": "address" }],
+    "stateMutability": "view",
+    "type": "function"
+  },
+  {
+    "inputs": [{ "internalType": "string", "name": "key", "type": "string" }],
+    "name": "deleteCollectionProperty",
+    "outputs": [],
+    "stateMutability": "nonpayable",
+    "type": "function"
+  },
+  {
+    "inputs": [
+      { "internalType": "uint256", "name": "tokenId", "type": "uint256" },
+      { "internalType": "string", "name": "key", "type": "string" }
+    ],
+    "name": "deleteProperty",
+    "outputs": [],
+    "stateMutability": "nonpayable",
+    "type": "function"
+  },
+  {
+    "inputs": [],
+    "name": "ethConfirmSponsorship",
+    "outputs": [],
+    "stateMutability": "nonpayable",
+    "type": "function"
+  },
+  {
+    "inputs": [
+      { "internalType": "address", "name": "sponsor", "type": "address" }
+    ],
+    "name": "ethSetSponsor",
+    "outputs": [],
+    "stateMutability": "nonpayable",
+    "type": "function"
+  },
+  {
+    "inputs": [],
+    "name": "finishMinting",
+    "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
+    "stateMutability": "nonpayable",
+    "type": "function"
+  },
+  {
+    "inputs": [
+      { "internalType": "uint256", "name": "tokenId", "type": "uint256" }
+    ],
+    "name": "getApproved",
+    "outputs": [{ "internalType": "address", "name": "", "type": "address" }],
+    "stateMutability": "view",
+    "type": "function"
+  },
+  {
+    "inputs": [
+      { "internalType": "address", "name": "owner", "type": "address" },
+      { "internalType": "address", "name": "operator", "type": "address" }
+    ],
+    "name": "isApprovedForAll",
+    "outputs": [{ "internalType": "address", "name": "", "type": "address" }],
+    "stateMutability": "view",
+    "type": "function"
+  },
+  {
+    "inputs": [
+      { "internalType": "address", "name": "to", "type": "address" },
+      { "internalType": "uint256", "name": "tokenId", "type": "uint256" }
+    ],
+    "name": "mint",
+    "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
+    "stateMutability": "nonpayable",
+    "type": "function"
+  },
+  {
+    "inputs": [
+      { "internalType": "address", "name": "to", "type": "address" },
+      { "internalType": "uint256[]", "name": "tokenIds", "type": "uint256[]" }
+    ],
+    "name": "mintBulk",
+    "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
+    "stateMutability": "nonpayable",
+    "type": "function"
+  },
+  {
+    "inputs": [
+      { "internalType": "address", "name": "to", "type": "address" },
+      {
+        "components": [
+          { "internalType": "uint256", "name": "field_0", "type": "uint256" },
+          { "internalType": "string", "name": "field_1", "type": "string" }
+        ],
+        "internalType": "struct Tuple0[]",
+        "name": "tokens",
+        "type": "tuple[]"
+      }
+    ],
+    "name": "mintBulkWithTokenURI",
+    "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
+    "stateMutability": "nonpayable",
+    "type": "function"
+  },
+  {
+    "inputs": [
+      { "internalType": "address", "name": "to", "type": "address" },
+      { "internalType": "uint256", "name": "tokenId", "type": "uint256" },
+      { "internalType": "string", "name": "tokenUri", "type": "string" }
+    ],
+    "name": "mintWithTokenURI",
+    "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
+    "stateMutability": "nonpayable",
+    "type": "function"
+  },
+  {
+    "inputs": [],
+    "name": "mintingFinished",
+    "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
+    "stateMutability": "view",
+    "type": "function"
+  },
+  {
+    "inputs": [],
+    "name": "name",
+    "outputs": [{ "internalType": "string", "name": "", "type": "string" }],
+    "stateMutability": "view",
+    "type": "function"
+  },
+  {
+    "inputs": [],
+    "name": "nextTokenId",
+    "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
+    "stateMutability": "view",
+    "type": "function"
+  },
+  {
+    "inputs": [
+      { "internalType": "uint256", "name": "tokenId", "type": "uint256" }
+    ],
+    "name": "ownerOf",
+    "outputs": [{ "internalType": "address", "name": "", "type": "address" }],
+    "stateMutability": "view",
+    "type": "function"
+  },
+  {
+    "inputs": [
+      { "internalType": "uint256", "name": "tokenId", "type": "uint256" },
+      { "internalType": "string", "name": "key", "type": "string" }
+    ],
+    "name": "property",
+    "outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }],
+    "stateMutability": "view",
+    "type": "function"
+  },
+  {
+    "inputs": [
+      { "internalType": "address", "name": "from", "type": "address" },
+      { "internalType": "address", "name": "to", "type": "address" },
+      { "internalType": "uint256", "name": "tokenId", "type": "uint256" }
+    ],
+    "name": "safeTransferFrom",
+    "outputs": [],
+    "stateMutability": "nonpayable",
+    "type": "function"
+  },
+  {
+    "inputs": [
+      { "internalType": "address", "name": "from", "type": "address" },
+      { "internalType": "address", "name": "to", "type": "address" },
+      { "internalType": "uint256", "name": "tokenId", "type": "uint256" },
+      { "internalType": "bytes", "name": "data", "type": "bytes" }
+    ],
+    "name": "safeTransferFromWithData",
+    "outputs": [],
+    "stateMutability": "nonpayable",
+    "type": "function"
+  },
+  {
+    "inputs": [
+      { "internalType": "address", "name": "operator", "type": "address" },
+      { "internalType": "bool", "name": "approved", "type": "bool" }
+    ],
+    "name": "setApprovalForAll",
+    "outputs": [],
+    "stateMutability": "nonpayable",
+    "type": "function"
+  },
+  {
+    "inputs": [
+      { "internalType": "string", "name": "key", "type": "string" },
+      { "internalType": "bytes", "name": "value", "type": "bytes" }
+    ],
+    "name": "setCollectionProperty",
+    "outputs": [],
+    "stateMutability": "nonpayable",
+    "type": "function"
+  },
+  {
+    "inputs": [
+      { "internalType": "string", "name": "limit", "type": "string" },
+      { "internalType": "string", "name": "value", "type": "string" }
+    ],
+    "name": "setLimit",
+    "outputs": [],
+    "stateMutability": "nonpayable",
+    "type": "function"
+  },
+  {
+    "inputs": [
+      { "internalType": "uint256", "name": "tokenId", "type": "uint256" },
+      { "internalType": "string", "name": "key", "type": "string" },
+      { "internalType": "bytes", "name": "value", "type": "bytes" }
+    ],
+    "name": "setProperty",
+    "outputs": [],
+    "stateMutability": "nonpayable",
+    "type": "function"
+  },
+  {
+    "inputs": [
+      { "internalType": "string", "name": "key", "type": "string" },
+      { "internalType": "bool", "name": "isMutable", "type": "bool" },
+      { "internalType": "bool", "name": "collectionAdmin", "type": "bool" },
+      { "internalType": "bool", "name": "tokenOwner", "type": "bool" }
+    ],
+    "name": "setTokenPropertyPermission",
+    "outputs": [],
+    "stateMutability": "nonpayable",
+    "type": "function"
+  },
+  {
+    "inputs": [
+      { "internalType": "bytes4", "name": "interfaceID", "type": "bytes4" }
+    ],
+    "name": "supportsInterface",
+    "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
+    "stateMutability": "view",
+    "type": "function"
+  },
+  {
+    "inputs": [],
+    "name": "symbol",
+    "outputs": [{ "internalType": "string", "name": "", "type": "string" }],
+    "stateMutability": "view",
+    "type": "function"
+  },
+  {
+    "inputs": [
+      { "internalType": "uint256", "name": "index", "type": "uint256" }
+    ],
+    "name": "tokenByIndex",
+    "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
+    "stateMutability": "view",
+    "type": "function"
+  },
+  {
+    "inputs": [
+      { "internalType": "address", "name": "owner", "type": "address" },
+      { "internalType": "uint256", "name": "index", "type": "uint256" }
+    ],
+    "name": "tokenOfOwnerByIndex",
+    "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
+    "stateMutability": "view",
+    "type": "function"
+  },
+  {
+    "inputs": [
+      { "internalType": "uint256", "name": "tokenId", "type": "uint256" }
+    ],
+    "name": "tokenURI",
+    "outputs": [{ "internalType": "string", "name": "", "type": "string" }],
+    "stateMutability": "view",
+    "type": "function"
+  },
+  {
+    "inputs": [],
+    "name": "totalSupply",
+    "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
+    "stateMutability": "view",
+    "type": "function"
+  },
+  {
+    "inputs": [
+      { "internalType": "address", "name": "to", "type": "address" },
+      { "internalType": "uint256", "name": "tokenId", "type": "uint256" }
+    ],
+    "name": "transfer",
+    "outputs": [],
+    "stateMutability": "nonpayable",
+    "type": "function"
+  },
+  {
+    "inputs": [
+      { "internalType": "address", "name": "from", "type": "address" },
+      { "internalType": "address", "name": "to", "type": "address" },
+      { "internalType": "uint256", "name": "tokenId", "type": "uint256" }
+    ],
+    "name": "transferFrom",
+    "outputs": [],
+    "stateMutability": "nonpayable",
+    "type": "function"
+  }
+]
modifiedtests/src/eth/proxy/nonFungibleProxy.test.tsdiffbeforeafterboth
--- a/tests/src/eth/proxy/nonFungibleProxy.test.ts
+++ b/tests/src/eth/proxy/nonFungibleProxy.test.ts
@@ -88,7 +88,8 @@
 });
 
 describe('NFT (Via EVM proxy): Plain calls', () => {
-  itWeb3('Can perform mint()', async ({web3, api}) => {
+  //TODO: CORE-302 add eth methods
+  itWeb3.skip('Can perform mint()', async ({web3, api}) => {
     const collection = await createCollectionExpectSuccess({
       mode: {type: 'NFT'},
     });
@@ -127,7 +128,9 @@
       expect(await contract.methods.tokenURI(nextTokenId).call()).to.be.equal('Test URI');
     }
   });
-  itWeb3('Can perform mintBulk()', async ({web3, api}) => {
+  
+  //TODO: CORE-302 add eth methods
+  itWeb3.skip('Can perform mintBulk()', async ({web3, api}) => {
     const collection = await createCollectionExpectSuccess({
       mode: {type: 'NFT'},
     });
modifiedtests/src/eth/util/contractHelpersAbi.jsondiffbeforeafterboth
--- a/tests/src/eth/util/contractHelpersAbi.json
+++ b/tests/src/eth/util/contractHelpersAbi.json
@@ -1,216 +1,161 @@
 [
-    {
-        "inputs": [
-            {
-                "internalType": "address",
-                "name": "contract",
-                "type": "address"
-            }
-        ],
-        "name": "allowlistEnabled",
-        "outputs": [
-            {
-                "internalType": "bool",
-                "name": "",
-                "type": "bool"
-            }
-        ],
-        "stateMutability": "view",
-        "type": "function"
-    },
-    {
-        "inputs": [
-            {
-                "internalType": "address",
-                "name": "target",
-                "type": "address"
-            },
-            {
-                "internalType": "address",
-                "name": "caller",
-                "type": "address"
-            }
-        ],
-        "name": "allowed",
-        "outputs": [
-            {
-                "internalType": "bool",
-                "name": "",
-                "type": "bool"
-            }
-        ],
-        "stateMutability": "view",
-        "type": "function"
-    },
-    {
-        "inputs": [
-            {
-                "internalType": "address",
-                "name": "target",
-                "type": "address"
-            }
-        ],
-        "name": "contractOwner",
-        "outputs": [
-            {
-                "internalType": "address",
-                "name": "",
-                "type": "address"
-            }
-        ],
-        "stateMutability": "view",
-        "type": "function"
-    },
-    {
-        "inputs": [
-            {
-                "internalType": "address",
-                "name": "target",
-                "type": "address"
-            }
-        ],
-        "name": "sponsoringEnabled",
-        "outputs": [
-            {
-                "internalType": "bool",
-                "name": "",
-                "type": "bool"
-            }
-        ],
-        "stateMutability": "view",
-        "type": "function"
-    },
-    {
-        "inputs": [
-            {
-                "internalType": "address",
-                "name": "target",
-                "type": "address"
-            },
-            {
-                "internalType": "address",
-                "name": "user",
-                "type": "address"
-            },
-            {
-                "internalType": "bool",
-                "name": "isAllowed",
-                "type": "bool"
-            }
-        ],
-        "name": "toggleAllowed",
-        "outputs": [],
-        "stateMutability": "nonpayable",
-        "type": "function"
-    },
-    {
-        "inputs": [
-            {
-                "internalType": "address",
-                "name": "target",
-                "type": "address"
-            },
-            {
-                "internalType": "bool",
-                "name": "enabled",
-                "type": "bool"
-            }
-        ],
-        "name": "toggleAllowlist",
-        "outputs": [],
-        "stateMutability": "nonpayable",
-        "type": "function"
-    },
-    {
-        "inputs": [
-            {
-                "internalType": "address",
-                "name": "target",
-                "type": "address"
-            },
-            {
-                "internalType": "bool",
-                "name": "enabled",
-                "type": "bool"
-            }
-        ],
-        "name": "toggleSponsoring",
-        "outputs": [],
-        "stateMutability": "nonpayable",
-        "type": "function"
-    },
-    {
-        "inputs": [
-            {
-                "internalType": "address",
-                "name": "target",
-                "type": "address"
-            },
-            {
-                "internalType": "uint8",
-                "name": "mode",
-                "type": "uint8"
-            }
-        ],
-        "name": "setSponsoringMode",
-        "outputs": [],
-        "stateMutability": "nonpayable",
-        "type": "function"
-    },
-    {
-        "inputs": [
-            {
-                "internalType": "address",
-                "name": "target",
-                "type": "address"
-            }
-        ],
-        "name": "sponsoringMode",
-        "outputs": [
-            {
-                "internalType": "uint8",
-                "name": "",
-                "type": "uint8"
-            }
-        ],
-        "stateMutability": "nonpayable",
-        "type": "function"
-    },
-    {
-        "inputs": [
-            {
-                "internalType": "address",
-                "name": "target",
-                "type": "address"
-            },
-            {
-                "internalType": "uint32",
-                "name": "limit",
-                "type": "uint32"
-            }
-        ],
-        "name": "setSponsoringRateLimit",
-        "outputs": [],
-        "stateMutability": "nonpayable",
-        "type": "function"
-    },
-    {
-        "inputs": [
-            {
-                "internalType": "address",
-                "name": "contractAddress",
-                "type": "address"
-            }
-        ],
-        "name": "getSponsoringRateLimit",
-        "outputs": [
-            {
-                "internalType": "uint32",
-                "name": "",
-                "type": "uint32"
-            }
-        ],
-        "stateMutability": "view",
-        "type": "function"
-    }
+  {
+    "inputs": [
+      {
+        "internalType": "address",
+        "name": "contractAddress",
+        "type": "address"
+      },
+      { "internalType": "address", "name": "user", "type": "address" }
+    ],
+    "name": "allowed",
+    "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
+    "stateMutability": "view",
+    "type": "function"
+  },
+  {
+    "inputs": [
+      {
+        "internalType": "address",
+        "name": "contractAddress",
+        "type": "address"
+      }
+    ],
+    "name": "allowlistEnabled",
+    "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
+    "stateMutability": "view",
+    "type": "function"
+  },
+  {
+    "inputs": [
+      {
+        "internalType": "address",
+        "name": "contractAddress",
+        "type": "address"
+      }
+    ],
+    "name": "contractOwner",
+    "outputs": [{ "internalType": "address", "name": "", "type": "address" }],
+    "stateMutability": "view",
+    "type": "function"
+  },
+  {
+    "inputs": [
+      {
+        "internalType": "address",
+        "name": "contractAddress",
+        "type": "address"
+      }
+    ],
+    "name": "getSponsoringRateLimit",
+    "outputs": [{ "internalType": "uint32", "name": "", "type": "uint32" }],
+    "stateMutability": "view",
+    "type": "function"
+  },
+  {
+    "inputs": [
+      {
+        "internalType": "address",
+        "name": "contractAddress",
+        "type": "address"
+      },
+      { "internalType": "uint8", "name": "mode", "type": "uint8" }
+    ],
+    "name": "setSponsoringMode",
+    "outputs": [],
+    "stateMutability": "nonpayable",
+    "type": "function"
+  },
+  {
+    "inputs": [
+      {
+        "internalType": "address",
+        "name": "contractAddress",
+        "type": "address"
+      },
+      { "internalType": "uint32", "name": "rateLimit", "type": "uint32" }
+    ],
+    "name": "setSponsoringRateLimit",
+    "outputs": [],
+    "stateMutability": "nonpayable",
+    "type": "function"
+  },
+  {
+    "inputs": [
+      {
+        "internalType": "address",
+        "name": "contractAddress",
+        "type": "address"
+      }
+    ],
+    "name": "sponsoringEnabled",
+    "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
+    "stateMutability": "view",
+    "type": "function"
+  },
+  {
+    "inputs": [
+      {
+        "internalType": "address",
+        "name": "contractAddress",
+        "type": "address"
+      }
+    ],
+    "name": "sponsoringMode",
+    "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }],
+    "stateMutability": "view",
+    "type": "function"
+  },
+  {
+    "inputs": [
+      { "internalType": "bytes4", "name": "interfaceID", "type": "bytes4" }
+    ],
+    "name": "supportsInterface",
+    "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
+    "stateMutability": "view",
+    "type": "function"
+  },
+  {
+    "inputs": [
+      {
+        "internalType": "address",
+        "name": "contractAddress",
+        "type": "address"
+      },
+      { "internalType": "address", "name": "user", "type": "address" },
+      { "internalType": "bool", "name": "allowed", "type": "bool" }
+    ],
+    "name": "toggleAllowed",
+    "outputs": [],
+    "stateMutability": "nonpayable",
+    "type": "function"
+  },
+  {
+    "inputs": [
+      {
+        "internalType": "address",
+        "name": "contractAddress",
+        "type": "address"
+      },
+      { "internalType": "bool", "name": "enabled", "type": "bool" }
+    ],
+    "name": "toggleAllowlist",
+    "outputs": [],
+    "stateMutability": "nonpayable",
+    "type": "function"
+  },
+  {
+    "inputs": [
+      {
+        "internalType": "address",
+        "name": "contractAddress",
+        "type": "address"
+      },
+      { "internalType": "bool", "name": "enabled", "type": "bool" }
+    ],
+    "name": "toggleSponsoring",
+    "outputs": [],
+    "stateMutability": "nonpayable",
+    "type": "function"
+  }
 ]
modifiedtests/src/eth/util/helpers.tsdiffbeforeafterboth
--- a/tests/src/eth/util/helpers.ts
+++ b/tests/src/eth/util/helpers.ts
@@ -23,11 +23,13 @@
 import usingApi, {submitTransactionAsync} from '../../substrate/substrate-api';
 import {IKeyringPair} from '@polkadot/types/types';
 import {expect} from 'chai';
-import {CrossAccountId, getGenericResult, UNIQUE} from '../../util/helpers';
+import {CrossAccountId, getDetailedCollectionInfo, getGenericResult, UNIQUE} from '../../util/helpers';
 import * as solc from 'solc';
 import config from '../../config';
 import privateKey from '../../substrate/privateKey';
 import contractHelpersAbi from './contractHelpersAbi.json';
+import nonFungibleAbi from '../nonFungibleAbi.json';
+import collectionHelperAbi from '../collectionHelperAbi.json';
 import getBalance from '../../substrate/get-balance';
 import waitNewBlocks from '../../substrate/wait-new-blocks';
 
@@ -66,12 +68,30 @@
   ];
 }
 
+export async function getCollectionAddressFromResult(api: ApiPromise, result: any) {
+  const collectionIdAddress = normalizeAddress(result.events[0].raw.topics[2]);
+  const collectionId = collectionIdFromAddress(collectionIdAddress);  
+  const collection = (await getDetailedCollectionInfo(api, collectionId))!;
+  return {collectionIdAddress, collectionId, collection};
+}
+
 export function collectionIdToAddress(collection: number): string {
   const buf = Buffer.from([0x17, 0xc4, 0xe6, 0x45, 0x3c, 0xc4, 0x9a, 0xaa, 0xae, 0xac, 0xa8, 0x94, 0xe6, 0xd9, 0x68, 0x3e,
     ...encodeIntBE(collection),
   ]);
   return Web3.utils.toChecksumAddress('0x' + buf.toString('hex'));
 }
+export function collectionIdFromAddress(address: string): number {
+  if (!address.startsWith('0x'))
+    throw 'address not starts with "0x"';
+  if (address.length > 42)
+    throw 'address length is more than 20 bytes';
+  return Number('0x' + address.substring(address.length - 8));
+}
+  
+export function normalizeAddress(address: string): string {
+  return '0x' + address.substring(address.length - 40);
+}
 
 export function tokenIdToAddress(collection: number, token: number): string {
   const buf = Buffer.from([0xf8, 0x23, 0x8c, 0xcf, 0xff, 0x8e, 0xd8, 0x87, 0x46, 0x3f, 0xd5, 0xe0,
@@ -271,6 +291,26 @@
   return new web3.eth.Contract(contractHelpersAbi as any, '0x842899ECF380553E8a4de75bF534cdf6fBF64049', {from: caller, ...GAS_ARGS});
 }
 
+/** 
+ * evm collection helper
+ * @param web3 
+ * @param caller - eth address
+ * @returns 
+ */
+export function evmCollectionHelper(web3: Web3, caller: string) {
+  return new web3.eth.Contract(collectionHelperAbi as any, '0x6c4e9fe1ae37a41e93cee429e8e1881abdcbb54f', {from: caller, ...GAS_ARGS});
+}
+
+/** 
+ * evm collection
+ * @param web3 
+ * @param caller - eth address
+ * @returns 
+ */
+export function evmCollection(web3: Web3, caller: string, collection: string) {
+  return new web3.eth.Contract(nonFungibleAbi as any, collection, {from: caller, ...GAS_ARGS});
+}
+
 /**
  * Execute ethereum method call using substrate account
  * @param to target contract
modifiedtests/src/interfaces/augment-types.tsdiffbeforeafterboth
--- a/tests/src/interfaces/augment-types.ts
+++ b/tests/src/interfaces/augment-types.ts
@@ -1,7 +1,6 @@
 // Auto-generated via `yarn polkadot-types-from-defs`, do not edit
 /* eslint-disable */
 
-import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportPalletId, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSupportWeightsWeightToFeeCoefficient, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeRuntime, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletXcmCall, PalletXcmError, PalletXcmEvent, PhantomTypeUpDataStructsBaseInfo, PhantomTypeUpDataStructsCollectionInfo, PhantomTypeUpDataStructsNftChild, PhantomTypeUpDataStructsNftInfo, PhantomTypeUpDataStructsPartType, PhantomTypeUpDataStructsPropertyInfo, PhantomTypeUpDataStructsResourceInfo, PhantomTypeUpDataStructsRpcCollection, PhantomTypeUpDataStructsTheme, PhantomTypeUpDataStructsTokenData, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionField, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExData, UpDataStructsNestingRule, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsRmrkAccountIdOrCollectionNftTuple, UpDataStructsRmrkBaseInfo, UpDataStructsRmrkBasicResource, UpDataStructsRmrkCollectionInfo, UpDataStructsRmrkComposableResource, UpDataStructsRmrkEquippableList, UpDataStructsRmrkFixedPart, UpDataStructsRmrkNftChild, UpDataStructsRmrkNftInfo, UpDataStructsRmrkPartType, UpDataStructsRmrkPropertyInfo, UpDataStructsRmrkResourceInfo, UpDataStructsRmrkResourceTypes, UpDataStructsRmrkRoyaltyInfo, UpDataStructsRmrkSlotPart, UpDataStructsRmrkSlotResource, UpDataStructsRmrkTheme, UpDataStructsRmrkThemeProperty, UpDataStructsRpcCollection, UpDataStructsSchemaVersion, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipState, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from './unique';
 import type { Data, StorageKey } from '@polkadot/types';
 import type { BitVec, Bool, Bytes, I128, I16, I256, I32, I64, I8, Json, Null, Raw, Text, Type, U128, U16, U256, U32, U64, U8, USize, bool, i128, i16, i256, i32, i64, i8, u128, u16, u256, u32, u64, u8, usize } from '@polkadot/types-codec';
 import type { AssetApproval, AssetApprovalKey, AssetBalance, AssetDestroyWitness, AssetDetails, AssetMetadata, TAssetBalance, TAssetDepositBalance } from '@polkadot/types/interfaces/assets';
@@ -291,27 +290,6 @@
     CoreOccupied: CoreOccupied;
     CrateVersion: CrateVersion;
     CreatedBlock: CreatedBlock;
-    CumulusPalletDmpQueueCall: CumulusPalletDmpQueueCall;
-    CumulusPalletDmpQueueConfigData: CumulusPalletDmpQueueConfigData;
-    CumulusPalletDmpQueueError: CumulusPalletDmpQueueError;
-    CumulusPalletDmpQueueEvent: CumulusPalletDmpQueueEvent;
-    CumulusPalletDmpQueuePageIndexData: CumulusPalletDmpQueuePageIndexData;
-    CumulusPalletParachainSystemCall: CumulusPalletParachainSystemCall;
-    CumulusPalletParachainSystemError: CumulusPalletParachainSystemError;
-    CumulusPalletParachainSystemEvent: CumulusPalletParachainSystemEvent;
-    CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot: CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot;
-    CumulusPalletXcmCall: CumulusPalletXcmCall;
-    CumulusPalletXcmError: CumulusPalletXcmError;
-    CumulusPalletXcmEvent: CumulusPalletXcmEvent;
-    CumulusPalletXcmpQueueCall: CumulusPalletXcmpQueueCall;
-    CumulusPalletXcmpQueueError: CumulusPalletXcmpQueueError;
-    CumulusPalletXcmpQueueEvent: CumulusPalletXcmpQueueEvent;
-    CumulusPalletXcmpQueueInboundChannelDetails: CumulusPalletXcmpQueueInboundChannelDetails;
-    CumulusPalletXcmpQueueInboundState: CumulusPalletXcmpQueueInboundState;
-    CumulusPalletXcmpQueueOutboundChannelDetails: CumulusPalletXcmpQueueOutboundChannelDetails;
-    CumulusPalletXcmpQueueOutboundState: CumulusPalletXcmpQueueOutboundState;
-    CumulusPalletXcmpQueueQueueConfigData: CumulusPalletXcmpQueueQueueConfigData;
-    CumulusPrimitivesParachainInherentParachainInherentData: CumulusPrimitivesParachainInherentParachainInherentData;
     Data: Data;
     DeferredOffenceOf: DeferredOffenceOf;
     DefunctVoter: DefunctVoter;
@@ -378,25 +356,11 @@
     EthAddress: EthAddress;
     EthBlock: EthBlock;
     EthBloom: EthBloom;
-    EthbloomBloom: EthbloomBloom;
     EthCallRequest: EthCallRequest;
     EthereumAccountId: EthereumAccountId;
     EthereumAddress: EthereumAddress;
-    EthereumBlock: EthereumBlock;
-    EthereumHeader: EthereumHeader;
-    EthereumLog: EthereumLog;
     EthereumLookupSource: EthereumLookupSource;
-    EthereumReceiptEip658ReceiptData: EthereumReceiptEip658ReceiptData;
-    EthereumReceiptReceiptV3: EthereumReceiptReceiptV3;
     EthereumSignature: EthereumSignature;
-    EthereumTransactionAccessListItem: EthereumTransactionAccessListItem;
-    EthereumTransactionEip1559Transaction: EthereumTransactionEip1559Transaction;
-    EthereumTransactionEip2930Transaction: EthereumTransactionEip2930Transaction;
-    EthereumTransactionLegacyTransaction: EthereumTransactionLegacyTransaction;
-    EthereumTransactionTransactionAction: EthereumTransactionTransactionAction;
-    EthereumTransactionTransactionSignature: EthereumTransactionTransactionSignature;
-    EthereumTransactionTransactionV2: EthereumTransactionTransactionV2;
-    EthereumTypesHashH64: EthereumTypesHashH64;
     EthFilter: EthFilter;
     EthFilterAddress: EthFilterAddress;
     EthFilterChanges: EthFilterChanges;
@@ -433,11 +397,6 @@
     EventMetadataV9: EventMetadataV9;
     EventRecord: EventRecord;
     EvmAccount: EvmAccount;
-    EvmCoreErrorExitError: EvmCoreErrorExitError;
-    EvmCoreErrorExitFatal: EvmCoreErrorExitFatal;
-    EvmCoreErrorExitReason: EvmCoreErrorExitReason;
-    EvmCoreErrorExitRevert: EvmCoreErrorExitRevert;
-    EvmCoreErrorExitSucceed: EvmCoreErrorExitSucceed;
     EvmLog: EvmLog;
     EvmVicinity: EvmVicinity;
     ExecReturnValue: ExecReturnValue;
@@ -476,31 +435,6 @@
     Forcing: Forcing;
     ForkTreePendingChange: ForkTreePendingChange;
     ForkTreePendingChangeNode: ForkTreePendingChangeNode;
-    FpRpcTransactionStatus: FpRpcTransactionStatus;
-    FrameSupportPalletId: FrameSupportPalletId;
-    FrameSupportTokensMiscBalanceStatus: FrameSupportTokensMiscBalanceStatus;
-    FrameSupportWeightsDispatchClass: FrameSupportWeightsDispatchClass;
-    FrameSupportWeightsDispatchInfo: FrameSupportWeightsDispatchInfo;
-    FrameSupportWeightsPays: FrameSupportWeightsPays;
-    FrameSupportWeightsPerDispatchClassU32: FrameSupportWeightsPerDispatchClassU32;
-    FrameSupportWeightsPerDispatchClassU64: FrameSupportWeightsPerDispatchClassU64;
-    FrameSupportWeightsPerDispatchClassWeightsPerClass: FrameSupportWeightsPerDispatchClassWeightsPerClass;
-    FrameSupportWeightsRuntimeDbWeight: FrameSupportWeightsRuntimeDbWeight;
-    FrameSupportWeightsWeightToFeeCoefficient: FrameSupportWeightsWeightToFeeCoefficient;
-    FrameSystemAccountInfo: FrameSystemAccountInfo;
-    FrameSystemCall: FrameSystemCall;
-    FrameSystemError: FrameSystemError;
-    FrameSystemEvent: FrameSystemEvent;
-    FrameSystemEventRecord: FrameSystemEventRecord;
-    FrameSystemExtensionsCheckGenesis: FrameSystemExtensionsCheckGenesis;
-    FrameSystemExtensionsCheckNonce: FrameSystemExtensionsCheckNonce;
-    FrameSystemExtensionsCheckSpecVersion: FrameSystemExtensionsCheckSpecVersion;
-    FrameSystemExtensionsCheckWeight: FrameSystemExtensionsCheckWeight;
-    FrameSystemLastRuntimeUpgradeInfo: FrameSystemLastRuntimeUpgradeInfo;
-    FrameSystemLimitsBlockLength: FrameSystemLimitsBlockLength;
-    FrameSystemLimitsBlockWeights: FrameSystemLimitsBlockWeights;
-    FrameSystemLimitsWeightsPerClass: FrameSystemLimitsWeightsPerClass;
-    FrameSystemPhase: FrameSystemPhase;
     FullIdentification: FullIdentification;
     FunctionArgumentMetadataLatest: FunctionArgumentMetadataLatest;
     FunctionArgumentMetadataV10: FunctionArgumentMetadataV10;
@@ -716,7 +650,6 @@
     OffchainAccuracyCompact: OffchainAccuracyCompact;
     OffenceDetails: OffenceDetails;
     Offender: Offender;
-    OpalRuntimeRuntime: OpalRuntimeRuntime;
     OpaqueCall: OpaqueCall;
     OpaqueMultiaddr: OpaqueMultiaddr;
     OpaqueNetworkState: OpaqueNetworkState;
@@ -732,10 +665,6 @@
     OriginKindV0: OriginKindV0;
     OriginKindV1: OriginKindV1;
     OriginKindV2: OriginKindV2;
-    OrmlVestingModuleCall: OrmlVestingModuleCall;
-    OrmlVestingModuleError: OrmlVestingModuleError;
-    OrmlVestingModuleEvent: OrmlVestingModuleEvent;
-    OrmlVestingVestingSchedule: OrmlVestingVestingSchedule;
     OutboundHrmpMessage: OutboundHrmpMessage;
     OutboundLaneData: OutboundLaneData;
     OutboundMessageFee: OutboundMessageFee;
@@ -746,76 +675,21 @@
     Owner: Owner;
     PageCounter: PageCounter;
     PageIndexData: PageIndexData;
-    PalletBalancesAccountData: PalletBalancesAccountData;
-    PalletBalancesBalanceLock: PalletBalancesBalanceLock;
-    PalletBalancesCall: PalletBalancesCall;
-    PalletBalancesError: PalletBalancesError;
-    PalletBalancesEvent: PalletBalancesEvent;
-    PalletBalancesReasons: PalletBalancesReasons;
-    PalletBalancesReleases: PalletBalancesReleases;
-    PalletBalancesReserveData: PalletBalancesReserveData;
     PalletCallMetadataLatest: PalletCallMetadataLatest;
     PalletCallMetadataV14: PalletCallMetadataV14;
-    PalletCommonError: PalletCommonError;
-    PalletCommonEvent: PalletCommonEvent;
     PalletConstantMetadataLatest: PalletConstantMetadataLatest;
     PalletConstantMetadataV14: PalletConstantMetadataV14;
     PalletErrorMetadataLatest: PalletErrorMetadataLatest;
     PalletErrorMetadataV14: PalletErrorMetadataV14;
-    PalletEthereumCall: PalletEthereumCall;
-    PalletEthereumError: PalletEthereumError;
-    PalletEthereumEvent: PalletEthereumEvent;
-    PalletEthereumFakeTransactionFinalizer: PalletEthereumFakeTransactionFinalizer;
     PalletEventMetadataLatest: PalletEventMetadataLatest;
     PalletEventMetadataV14: PalletEventMetadataV14;
-    PalletEvmAccountBasicCrossAccountIdRepr: PalletEvmAccountBasicCrossAccountIdRepr;
-    PalletEvmCall: PalletEvmCall;
-    PalletEvmCoderSubstrateError: PalletEvmCoderSubstrateError;
-    PalletEvmContractHelpersError: PalletEvmContractHelpersError;
-    PalletEvmContractHelpersSponsoringModeT: PalletEvmContractHelpersSponsoringModeT;
-    PalletEvmError: PalletEvmError;
-    PalletEvmEvent: PalletEvmEvent;
-    PalletEvmMigrationCall: PalletEvmMigrationCall;
-    PalletEvmMigrationError: PalletEvmMigrationError;
-    PalletFungibleError: PalletFungibleError;
     PalletId: PalletId;
-    PalletInflationCall: PalletInflationCall;
     PalletMetadataLatest: PalletMetadataLatest;
     PalletMetadataV14: PalletMetadataV14;
-    PalletNonfungibleError: PalletNonfungibleError;
-    PalletNonfungibleItemData: PalletNonfungibleItemData;
-    PalletRefungibleError: PalletRefungibleError;
-    PalletRefungibleItemData: PalletRefungibleItemData;
-    PalletRmrkCoreCall: PalletRmrkCoreCall;
-    PalletRmrkCoreError: PalletRmrkCoreError;
-    PalletRmrkCoreEvent: PalletRmrkCoreEvent;
-    PalletRmrkEquipCall: PalletRmrkEquipCall;
-    PalletRmrkEquipError: PalletRmrkEquipError;
-    PalletRmrkEquipEvent: PalletRmrkEquipEvent;
     PalletsOrigin: PalletsOrigin;
     PalletStorageMetadataLatest: PalletStorageMetadataLatest;
     PalletStorageMetadataV14: PalletStorageMetadataV14;
-    PalletStructureCall: PalletStructureCall;
-    PalletStructureError: PalletStructureError;
-    PalletStructureEvent: PalletStructureEvent;
-    PalletSudoCall: PalletSudoCall;
-    PalletSudoError: PalletSudoError;
-    PalletSudoEvent: PalletSudoEvent;
-    PalletTemplateTransactionPaymentCall: PalletTemplateTransactionPaymentCall;
-    PalletTemplateTransactionPaymentChargeTransactionPayment: PalletTemplateTransactionPaymentChargeTransactionPayment;
-    PalletTimestampCall: PalletTimestampCall;
-    PalletTransactionPaymentReleases: PalletTransactionPaymentReleases;
-    PalletTreasuryCall: PalletTreasuryCall;
-    PalletTreasuryError: PalletTreasuryError;
-    PalletTreasuryEvent: PalletTreasuryEvent;
-    PalletTreasuryProposal: PalletTreasuryProposal;
-    PalletUniqueCall: PalletUniqueCall;
-    PalletUniqueError: PalletUniqueError;
-    PalletUniqueRawEvent: PalletUniqueRawEvent;
     PalletVersion: PalletVersion;
-    PalletXcmCall: PalletXcmCall;
-    PalletXcmError: PalletXcmError;
-    PalletXcmEvent: PalletXcmEvent;
     ParachainDispatchOrigin: ParachainDispatchOrigin;
     ParachainInherentData: ParachainInherentData;
     ParachainProposal: ParachainProposal;
@@ -855,27 +729,9 @@
     PerU16: PerU16;
     Phantom: Phantom;
     PhantomData: PhantomData;
-    PhantomTypeUpDataStructsBaseInfo: PhantomTypeUpDataStructsBaseInfo;
-    PhantomTypeUpDataStructsCollectionInfo: PhantomTypeUpDataStructsCollectionInfo;
-    PhantomTypeUpDataStructsNftChild: PhantomTypeUpDataStructsNftChild;
-    PhantomTypeUpDataStructsNftInfo: PhantomTypeUpDataStructsNftInfo;
-    PhantomTypeUpDataStructsPartType: PhantomTypeUpDataStructsPartType;
-    PhantomTypeUpDataStructsPropertyInfo: PhantomTypeUpDataStructsPropertyInfo;
-    PhantomTypeUpDataStructsResourceInfo: PhantomTypeUpDataStructsResourceInfo;
-    PhantomTypeUpDataStructsRpcCollection: PhantomTypeUpDataStructsRpcCollection;
-    PhantomTypeUpDataStructsTheme: PhantomTypeUpDataStructsTheme;
-    PhantomTypeUpDataStructsTokenData: PhantomTypeUpDataStructsTokenData;
     Phase: Phase;
     PhragmenScore: PhragmenScore;
     Points: Points;
-    PolkadotCorePrimitivesInboundDownwardMessage: PolkadotCorePrimitivesInboundDownwardMessage;
-    PolkadotCorePrimitivesInboundHrmpMessage: PolkadotCorePrimitivesInboundHrmpMessage;
-    PolkadotCorePrimitivesOutboundHrmpMessage: PolkadotCorePrimitivesOutboundHrmpMessage;
-    PolkadotParachainPrimitivesXcmpMessageFormat: PolkadotParachainPrimitivesXcmpMessageFormat;
-    PolkadotPrimitivesV2AbridgedHostConfiguration: PolkadotPrimitivesV2AbridgedHostConfiguration;
-    PolkadotPrimitivesV2AbridgedHrmpChannel: PolkadotPrimitivesV2AbridgedHrmpChannel;
-    PolkadotPrimitivesV2PersistedValidationData: PolkadotPrimitivesV2PersistedValidationData;
-    PolkadotPrimitivesV2UpgradeRestriction: PolkadotPrimitivesV2UpgradeRestriction;
     PortableType: PortableType;
     PortableTypeV14: PortableTypeV14;
     Precommits: Precommits;
@@ -1071,20 +927,7 @@
     SolutionSupports: SolutionSupports;
     SpanIndex: SpanIndex;
     SpanRecord: SpanRecord;
-    SpCoreEcdsaSignature: SpCoreEcdsaSignature;
-    SpCoreEd25519Signature: SpCoreEd25519Signature;
-    SpCoreSr25519Signature: SpCoreSr25519Signature;
     SpecVersion: SpecVersion;
-    SpRuntimeArithmeticError: SpRuntimeArithmeticError;
-    SpRuntimeDigest: SpRuntimeDigest;
-    SpRuntimeDigestDigestItem: SpRuntimeDigestDigestItem;
-    SpRuntimeDispatchError: SpRuntimeDispatchError;
-    SpRuntimeModuleError: SpRuntimeModuleError;
-    SpRuntimeMultiSignature: SpRuntimeMultiSignature;
-    SpRuntimeTokenError: SpRuntimeTokenError;
-    SpRuntimeTransactionalError: SpRuntimeTransactionalError;
-    SpTrieStorageProof: SpTrieStorageProof;
-    SpVersionRuntimeVersion: SpVersionRuntimeVersion;
     Sr25519Signature: Sr25519Signature;
     StakingLedger: StakingLedger;
     StakingLedgerTo223: StakingLedgerTo223;
@@ -1181,50 +1024,6 @@
     UnlockChunk: UnlockChunk;
     UnrewardedRelayer: UnrewardedRelayer;
     UnrewardedRelayersState: UnrewardedRelayersState;
-    UpDataStructsAccessMode: UpDataStructsAccessMode;
-    UpDataStructsCollection: UpDataStructsCollection;
-    UpDataStructsCollectionField: UpDataStructsCollectionField;
-    UpDataStructsCollectionLimits: UpDataStructsCollectionLimits;
-    UpDataStructsCollectionMode: UpDataStructsCollectionMode;
-    UpDataStructsCollectionStats: UpDataStructsCollectionStats;
-    UpDataStructsCreateCollectionData: UpDataStructsCreateCollectionData;
-    UpDataStructsCreateFungibleData: UpDataStructsCreateFungibleData;
-    UpDataStructsCreateItemData: UpDataStructsCreateItemData;
-    UpDataStructsCreateItemExData: UpDataStructsCreateItemExData;
-    UpDataStructsCreateNftData: UpDataStructsCreateNftData;
-    UpDataStructsCreateNftExData: UpDataStructsCreateNftExData;
-    UpDataStructsCreateReFungibleData: UpDataStructsCreateReFungibleData;
-    UpDataStructsCreateRefungibleExData: UpDataStructsCreateRefungibleExData;
-    UpDataStructsNestingRule: UpDataStructsNestingRule;
-    UpDataStructsProperties: UpDataStructsProperties;
-    UpDataStructsPropertiesMapBoundedVec: UpDataStructsPropertiesMapBoundedVec;
-    UpDataStructsPropertiesMapPropertyPermission: UpDataStructsPropertiesMapPropertyPermission;
-    UpDataStructsProperty: UpDataStructsProperty;
-    UpDataStructsPropertyKeyPermission: UpDataStructsPropertyKeyPermission;
-    UpDataStructsPropertyPermission: UpDataStructsPropertyPermission;
-    UpDataStructsRmrkAccountIdOrCollectionNftTuple: UpDataStructsRmrkAccountIdOrCollectionNftTuple;
-    UpDataStructsRmrkBaseInfo: UpDataStructsRmrkBaseInfo;
-    UpDataStructsRmrkBasicResource: UpDataStructsRmrkBasicResource;
-    UpDataStructsRmrkCollectionInfo: UpDataStructsRmrkCollectionInfo;
-    UpDataStructsRmrkComposableResource: UpDataStructsRmrkComposableResource;
-    UpDataStructsRmrkEquippableList: UpDataStructsRmrkEquippableList;
-    UpDataStructsRmrkFixedPart: UpDataStructsRmrkFixedPart;
-    UpDataStructsRmrkNftChild: UpDataStructsRmrkNftChild;
-    UpDataStructsRmrkNftInfo: UpDataStructsRmrkNftInfo;
-    UpDataStructsRmrkPartType: UpDataStructsRmrkPartType;
-    UpDataStructsRmrkPropertyInfo: UpDataStructsRmrkPropertyInfo;
-    UpDataStructsRmrkResourceInfo: UpDataStructsRmrkResourceInfo;
-    UpDataStructsRmrkResourceTypes: UpDataStructsRmrkResourceTypes;
-    UpDataStructsRmrkRoyaltyInfo: UpDataStructsRmrkRoyaltyInfo;
-    UpDataStructsRmrkSlotPart: UpDataStructsRmrkSlotPart;
-    UpDataStructsRmrkSlotResource: UpDataStructsRmrkSlotResource;
-    UpDataStructsRmrkTheme: UpDataStructsRmrkTheme;
-    UpDataStructsRmrkThemeProperty: UpDataStructsRmrkThemeProperty;
-    UpDataStructsRpcCollection: UpDataStructsRpcCollection;
-    UpDataStructsSchemaVersion: UpDataStructsSchemaVersion;
-    UpDataStructsSponsoringRateLimit: UpDataStructsSponsoringRateLimit;
-    UpDataStructsSponsorshipState: UpDataStructsSponsorshipState;
-    UpDataStructsTokenData: UpDataStructsTokenData;
     UpgradeGoAhead: UpgradeGoAhead;
     UpgradeRestriction: UpgradeRestriction;
     UpwardMessage: UpwardMessage;
@@ -1296,7 +1095,6 @@
     WithdrawReasons: WithdrawReasons;
     Xcm: Xcm;
     XcmAssetId: XcmAssetId;
-    XcmDoubleEncoded: XcmDoubleEncoded;
     XcmError: XcmError;
     XcmErrorV0: XcmErrorV0;
     XcmErrorV1: XcmErrorV1;
@@ -1309,41 +1107,8 @@
     XcmOriginKind: XcmOriginKind;
     XcmpMessageFormat: XcmpMessageFormat;
     XcmV0: XcmV0;
-    XcmV0Junction: XcmV0Junction;
-    XcmV0JunctionBodyId: XcmV0JunctionBodyId;
-    XcmV0JunctionBodyPart: XcmV0JunctionBodyPart;
-    XcmV0JunctionNetworkId: XcmV0JunctionNetworkId;
-    XcmV0MultiAsset: XcmV0MultiAsset;
-    XcmV0MultiLocation: XcmV0MultiLocation;
-    XcmV0Order: XcmV0Order;
-    XcmV0OriginKind: XcmV0OriginKind;
-    XcmV0Response: XcmV0Response;
-    XcmV0Xcm: XcmV0Xcm;
     XcmV1: XcmV1;
-    XcmV1Junction: XcmV1Junction;
-    XcmV1MultiAsset: XcmV1MultiAsset;
-    XcmV1MultiassetAssetId: XcmV1MultiassetAssetId;
-    XcmV1MultiassetAssetInstance: XcmV1MultiassetAssetInstance;
-    XcmV1MultiassetFungibility: XcmV1MultiassetFungibility;
-    XcmV1MultiassetMultiAssetFilter: XcmV1MultiassetMultiAssetFilter;
-    XcmV1MultiassetMultiAssets: XcmV1MultiassetMultiAssets;
-    XcmV1MultiassetWildFungibility: XcmV1MultiassetWildFungibility;
-    XcmV1MultiassetWildMultiAsset: XcmV1MultiassetWildMultiAsset;
-    XcmV1MultiLocation: XcmV1MultiLocation;
-    XcmV1MultilocationJunctions: XcmV1MultilocationJunctions;
-    XcmV1Order: XcmV1Order;
-    XcmV1Response: XcmV1Response;
-    XcmV1Xcm: XcmV1Xcm;
     XcmV2: XcmV2;
-    XcmV2Instruction: XcmV2Instruction;
-    XcmV2Response: XcmV2Response;
-    XcmV2TraitsError: XcmV2TraitsError;
-    XcmV2TraitsOutcome: XcmV2TraitsOutcome;
-    XcmV2WeightLimit: XcmV2WeightLimit;
-    XcmV2Xcm: XcmV2Xcm;
     XcmVersion: XcmVersion;
-    XcmVersionedMultiAssets: XcmVersionedMultiAssets;
-    XcmVersionedMultiLocation: XcmVersionedMultiLocation;
-    XcmVersionedXcm: XcmVersionedXcm;
   } // InterfaceTypes
 } // declare module
modifiedtests/src/interfaces/types.tsdiffbeforeafterboth
--- a/tests/src/interfaces/types.ts
+++ b/tests/src/interfaces/types.ts
@@ -1,5 +1,3 @@
 // Auto-generated via `yarn polkadot-types-from-defs`, do not edit
 /* eslint-disable */
 
-export * from './unique/types';
-export * from './rmrk/types';
modifiedtests/yarn.lockdiffbeforeafterboth
--- a/tests/yarn.lock
+++ b/tests/yarn.lock
@@ -8615,7 +8615,7 @@
   resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634"
   integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==
 
-solc@^0.8.13:
+solc@0.8.13:
   version "0.8.13"
   resolved "https://registry.yarnpkg.com/solc/-/solc-0.8.13.tgz#bafc7fcc11a627e2281e489076b80497123bb704"
   integrity sha512-C0yTN+rjEOGO6uVOXI8+EKa75SFMuZpQ2tryex4QxWIg0HRWZvCHKfVPuLZ5wx06Sb6GBp6uQA5yqQyXZnXOJw==