git.delta.rocks / unique-network / refs/commits / 25b82cffb2c3

difftreelog

style fix clippy/rustfmt warnings

Yaroslav Bolyukin2021-06-25parent: #fa23d15.patch.diff
in: master

35 files changed

modifiedcrates/evm-coder-macros/src/lib.rsdiffbeforeafterboth
--- a/crates/evm-coder-macros/src/lib.rs
+++ b/crates/evm-coder-macros/src/lib.rs
@@ -1,3 +1,5 @@
+#![allow(dead_code)]
+
 use darling::FromMeta;
 use inflector::cases;
 use proc_macro::TokenStream;
modifiedcrates/evm-coder-macros/src/solidity_interface.rsdiffbeforeafterboth
--- a/crates/evm-coder-macros/src/solidity_interface.rs
+++ b/crates/evm-coder-macros/src/solidity_interface.rs
@@ -1,3 +1,5 @@
+#![allow(dead_code)]
+
 use quote::quote;
 use darling::FromMeta;
 use inflector::cases;
@@ -545,6 +547,7 @@
 				#(
 					#call_inner
 				)*
+				#[allow(unreachable_code)] // In case of no inner calls
 				fn call(&mut self, c: Msg<#call_name>) -> ::core::result::Result<::evm_coder::abi::AbiWriter, Self::Error> {
 					use ::evm_coder::abi::AbiWrite;
 					type InternalCall = #call_name;
modifiedcrates/evm-coder/tests/a.rsdiffbeforeafterboth
--- a/crates/evm-coder/tests/a.rs
+++ b/crates/evm-coder/tests/a.rs
@@ -1,3 +1,5 @@
+#![allow(dead_code)] // This test only checks that macros is not panicking
+
 use evm_coder::{solidity_interface, types::*, ToLog};
 use evm_coder_macros::solidity;
 
modifiednode/cli/build.rsdiffbeforeafterboth
--- a/node/cli/build.rs
+++ b/node/cli/build.rs
@@ -6,7 +6,7 @@
 use substrate_build_script_utils::{generate_cargo_keys, rerun_if_git_head_changed};
 
 fn main() {
-    generate_cargo_keys();
+	generate_cargo_keys();
 
-    rerun_if_git_head_changed();
+	rerun_if_git_head_changed();
 }
modifiednode/cli/src/chain_spec.rsdiffbeforeafterboth
--- a/node/cli/src/chain_spec.rs
+++ b/node/cli/src/chain_spec.rs
@@ -64,20 +64,22 @@
 		// ID
 		"dev",
 		ChainType::Local,
-		move || testnet_genesis(
-			// Sudo account
-			get_account_id_from_seed::<sr25519::Public>("Alice"),
-			vec![
-				get_from_seed::<AuraId>("Alice"),
-				get_from_seed::<AuraId>("Bob"),
-			],
-			// Pre-funded accounts
-			vec![
+		move || {
+			testnet_genesis(
+				// Sudo account
 				get_account_id_from_seed::<sr25519::Public>("Alice"),
-				get_account_id_from_seed::<sr25519::Public>("Bob"),
-			],
-			id,
-		),
+				vec![
+					get_from_seed::<AuraId>("Alice"),
+					get_from_seed::<AuraId>("Bob"),
+				],
+				// Pre-funded accounts
+				vec![
+					get_account_id_from_seed::<sr25519::Public>("Alice"),
+					get_account_id_from_seed::<sr25519::Public>("Bob"),
+				],
+				id,
+			)
+		},
 		// Bootnodes
 		vec![],
 		// Telemetry
@@ -101,30 +103,32 @@
 		// ID
 		"local_testnet",
 		ChainType::Local,
-		move || testnet_genesis(
-			// Sudo account
-			get_account_id_from_seed::<sr25519::Public>("Alice"),
-			vec![
-				get_from_seed::<AuraId>("Alice"),
-				get_from_seed::<AuraId>("Bob"),
-			],
-			// Pre-funded accounts
-			vec![
+		move || {
+			testnet_genesis(
+				// Sudo account
 				get_account_id_from_seed::<sr25519::Public>("Alice"),
-				get_account_id_from_seed::<sr25519::Public>("Bob"),
-				get_account_id_from_seed::<sr25519::Public>("Charlie"),
-				get_account_id_from_seed::<sr25519::Public>("Dave"),
-				get_account_id_from_seed::<sr25519::Public>("Eve"),
-				get_account_id_from_seed::<sr25519::Public>("Ferdie"),
-				get_account_id_from_seed::<sr25519::Public>("Alice//stash"),
-				get_account_id_from_seed::<sr25519::Public>("Bob//stash"),
-				get_account_id_from_seed::<sr25519::Public>("Charlie//stash"),
-				get_account_id_from_seed::<sr25519::Public>("Dave//stash"),
-				get_account_id_from_seed::<sr25519::Public>("Eve//stash"),
-				get_account_id_from_seed::<sr25519::Public>("Ferdie//stash"),
-			],
-			id,
-		),
+				vec![
+					get_from_seed::<AuraId>("Alice"),
+					get_from_seed::<AuraId>("Bob"),
+				],
+				// Pre-funded accounts
+				vec![
+					get_account_id_from_seed::<sr25519::Public>("Alice"),
+					get_account_id_from_seed::<sr25519::Public>("Bob"),
+					get_account_id_from_seed::<sr25519::Public>("Charlie"),
+					get_account_id_from_seed::<sr25519::Public>("Dave"),
+					get_account_id_from_seed::<sr25519::Public>("Eve"),
+					get_account_id_from_seed::<sr25519::Public>("Ferdie"),
+					get_account_id_from_seed::<sr25519::Public>("Alice//stash"),
+					get_account_id_from_seed::<sr25519::Public>("Bob//stash"),
+					get_account_id_from_seed::<sr25519::Public>("Charlie//stash"),
+					get_account_id_from_seed::<sr25519::Public>("Dave//stash"),
+					get_account_id_from_seed::<sr25519::Public>("Eve//stash"),
+					get_account_id_from_seed::<sr25519::Public>("Ferdie//stash"),
+				],
+				id,
+			)
+		},
 		// Bootnodes
 		vec![],
 		// Telemetry
@@ -142,75 +146,74 @@
 }
 
 fn testnet_genesis(
-    root_key: AccountId,
+	root_key: AccountId,
 	initial_authorities: Vec<AuraId>,
-    endowed_accounts: Vec<AccountId>,
+	endowed_accounts: Vec<AccountId>,
 	id: ParaId,
 ) -> GenesisConfig {
-
-	let vested_accounts = vec![
-		get_account_id_from_seed::<sr25519::Public>("Bob"),
-	];
+	let vested_accounts = vec![get_account_id_from_seed::<sr25519::Public>("Bob")];
 
-    GenesisConfig {
+	GenesisConfig {
 		system: nft_runtime::SystemConfig {
 			code: nft_runtime::WASM_BINARY
 				.expect("WASM binary was not build, please build it!")
 				.to_vec(),
 			changes_trie_config: Default::default(),
 		},
-        pallet_balances: BalancesConfig {
-            balances: endowed_accounts
-                .iter()
-                .cloned()
-                .map(|k| (k, 1 << 70))
-                .collect(),
-        },
+		pallet_balances: BalancesConfig {
+			balances: endowed_accounts
+				.iter()
+				.cloned()
+				.map(|k| (k, 1 << 70))
+				.collect(),
+		},
 		pallet_treasury: Default::default(),
 		pallet_sudo: SudoConfig { key: root_key },
 		pallet_vesting: VestingConfig {
-            vesting: vested_accounts
-                .iter()
-                .cloned()
-                .map(|k| (k, 1000, 100, 1 << 98))
-                .collect(),
-        },
-        pallet_nft: NftConfig {
-            collection_id: vec![(
-                1,
-                Collection {
-                    owner: get_account_id_from_seed::<sr25519::Public>("Alice"),
-                    mode: CollectionMode::NFT,
-                    access: AccessMode::Normal,
-                    decimal_points: 0,
-                    name: vec![],
-                    description: vec![],
-                    token_prefix: vec![],
-                    mint_mode: false,
+			vesting: vested_accounts
+				.iter()
+				.cloned()
+				.map(|k| (k, 1000, 100, 1 << 98))
+				.collect(),
+		},
+		pallet_nft: NftConfig {
+			collection_id: vec![(
+				1,
+				Collection {
+					owner: get_account_id_from_seed::<sr25519::Public>("Alice"),
+					mode: CollectionMode::NFT,
+					access: AccessMode::Normal,
+					decimal_points: 0,
+					name: vec![],
+					description: vec![],
+					token_prefix: vec![],
+					mint_mode: false,
 					offchain_schema: vec![],
 					schema_version: SchemaVersion::default(),
-                    sponsorship: SponsorshipState::Confirmed(get_account_id_from_seed::<sr25519::Public>("Alice")),
-                    const_on_chain_schema: vec![],
+					sponsorship: SponsorshipState::Confirmed(get_account_id_from_seed::<
+						sr25519::Public,
+					>("Alice")),
+					const_on_chain_schema: vec![],
 					variable_on_chain_schema: vec![],
-					limits: CollectionLimits::default()
-                },
-            )],
-            nft_item_id: vec![],
-            fungible_item_id: vec![],
-            refungible_item_id: vec![],
-            chain_limit: ChainLimits {
-                collection_numbers_limit: 100000,
-                account_token_ownership_limit: 1000000,
-                collections_admins_limit: 5,
-                custom_data_limit: 2048,
-                nft_sponsor_transfer_timeout: 15,
-                fungible_sponsor_transfer_timeout: 15,
+					limits: CollectionLimits::default(),
+				},
+			)],
+			nft_item_id: vec![],
+			fungible_item_id: vec![],
+			refungible_item_id: vec![],
+			chain_limit: ChainLimits {
+				collection_numbers_limit: 100000,
+				account_token_ownership_limit: 1000000,
+				collections_admins_limit: 5,
+				custom_data_limit: 2048,
+				nft_sponsor_transfer_timeout: 15,
+				fungible_sponsor_transfer_timeout: 15,
 				refungible_sponsor_transfer_timeout: 15,
 				offchain_schema_limit: 1024,
 				variable_on_chain_schema_limit: 1024,
 				const_on_chain_schema_limit: 1024,
-            },
-        },
+			},
+		},
 		parachain_info: nft_runtime::ParachainInfoConfig { parachain_id: id },
 		pallet_aura: nft_runtime::AuraConfig {
 			authorities: initial_authorities,
@@ -220,5 +223,5 @@
 			accounts: BTreeMap::new(),
 		},
 		pallet_ethereum: EthereumConfig {},
-    }
+	}
 }
modifiednode/cli/src/command.rsdiffbeforeafterboth
--- a/node/cli/src/command.rs
+++ b/node/cli/src/command.rs
@@ -18,7 +18,7 @@
 use crate::{
 	chain_spec,
 	cli::{Cli, RelayChainCli, Subcommand},
-	service::{new_partial, ParachainRuntimeExecutor}
+	service::{new_partial, ParachainRuntimeExecutor},
 };
 use codec::Encode;
 use cumulus_primitives_core::ParaId;
@@ -31,7 +31,7 @@
 	NetworkParams, Result, RuntimeVersion, SharedParams, SubstrateCli,
 };
 use sc_service::{
-	config::{BasePath, PrometheusConfig}
+	config::{BasePath, PrometheusConfig},
 };
 use sp_core::hexdisplay::HexDisplay;
 use sp_runtime::traits::Block as BlockT;
@@ -251,7 +251,7 @@
 			}
 
 			Ok(())
-		},
+		}
 		Some(Subcommand::Benchmark(cmd)) => {
 			if cfg!(feature = "runtime-benchmarks") {
 				let runner = cli.create_runner(cmd)?;
@@ -259,9 +259,10 @@
 				runner.sync_run(|config| cmd.run::<Block, ParachainRuntimeExecutor>(config))
 			} else {
 				Err("Benchmarking wasn't enabled when building the node. \
-				You can enable it with `--features runtime-benchmarks`.".into())
+				You can enable it with `--features runtime-benchmarks`."
+					.into())
 			}
-		},
+		}
 		None => {
 			let runner = cli.create_runner(&cli.run.normalize())?;
 
@@ -289,12 +290,9 @@
 				let genesis_state = format!("0x{:?}", HexDisplay::from(&block.header().encode()));
 
 				let task_executor = config.task_executor.clone();
-				let polkadot_config = SubstrateCli::create_configuration(
-					&polkadot_cli,
-					&polkadot_cli,
-					task_executor,
-				)
-				.map_err(|err| format!("Relay chain argument error: {}", err))?;
+				let polkadot_config =
+					SubstrateCli::create_configuration(&polkadot_cli, &polkadot_cli, task_executor)
+						.map_err(|err| format!("Relay chain argument error: {}", err))?;
 
 				info!("Parachain id: {:?}", id);
 				info!("Parachain Account: {}", parachain_account);
@@ -443,4 +441,4 @@
 	) -> Result<Option<sc_telemetry::TelemetryEndpoints>> {
 		self.base.base.telemetry_endpoints(chain_spec)
 	}
-}
\ No newline at end of file
+}
modifiednode/cli/src/service.rsdiffbeforeafterboth
--- a/node/cli/src/service.rs
+++ b/node/cli/src/service.rs
@@ -15,9 +15,7 @@
 use nft_runtime::RuntimeApi;
 
 // Cumulus Imports
-use cumulus_client_consensus_aura::{
-	build_aura_consensus, BuildAuraConsensusParams, SlotProportion,
-};
+use cumulus_client_consensus_aura::{build_aura_consensus, BuildAuraConsensusParams, SlotProportion};
 use cumulus_client_consensus_common::ParachainConsensus;
 use cumulus_client_network::build_block_announce_validator;
 use cumulus_client_service::{
@@ -59,20 +57,23 @@
 );
 
 pub fn open_frontier_backend(config: &Configuration) -> Result<Arc<fc_db::Backend<Block>>, String> {
-	let config_dir = config.base_path.as_ref()
+	let config_dir = config
+		.base_path
+		.as_ref()
 		.map(|base_path| base_path.config_dir(config.chain_spec.id()))
 		.unwrap_or_else(|| {
-			BasePath::from_project("", "", "nft")
-				.config_dir(config.chain_spec.id())
+			BasePath::from_project("", "", "nft").config_dir(config.chain_spec.id())
 		});
 	let database_dir = config_dir.join("frontier").join("db");
 
-	Ok(Arc::new(fc_db::Backend::<Block>::new(&fc_db::DatabaseSettings {
-		source: fc_db::DatabaseSettingsSrc::RocksDb {
-			path: database_dir,
-			cache_size: 0,
-		}
-	})?))
+	Ok(Arc::new(fc_db::Backend::<Block>::new(
+		&fc_db::DatabaseSettings {
+			source: fc_db::DatabaseSettingsSrc::RocksDb {
+				path: database_dir,
+				cache_size: 0,
+			},
+		},
+	)?))
 }
 
 type Executor = ParachainRuntimeExecutor;
@@ -85,6 +86,7 @@
 ///
 /// Use this macro if you don't actually need the full service, but just the builder in order to
 /// be able to perform chain operations.
+#[allow(clippy::type_complexity)]
 pub fn new_partial<BIQ>(
 	config: &Configuration,
 	build_import_queue: BIQ,
@@ -95,7 +97,13 @@
 		FullSelectChain,
 		sp_consensus::DefaultImportQueue<Block, FullClient>,
 		sc_transaction_pool::FullPool<Block, FullClient>,
-		(Option<Telemetry>, PendingTransactions, Option<FilterPool>, Arc<fc_db::Backend<Block>>, Option<TelemetryWorkerHandle>),
+		(
+			Option<Telemetry>,
+			PendingTransactions,
+			Option<FilterPool>,
+			Arc<fc_db::Backend<Block>>,
+			Option<TelemetryWorkerHandle>,
+		),
 	>,
 	sc_service::Error,
 >
@@ -107,12 +115,9 @@
 		&Configuration,
 		Option<TelemetryHandle>,
 		&TaskManager,
-	) -> Result<
-		sp_consensus::DefaultImportQueue<Block, FullClient>,
-		sc_service::Error,
-	>,
+	) -> Result<sp_consensus::DefaultImportQueue<Block, FullClient>, sc_service::Error>,
 {
-	let telemetry = config
+	let _telemetry = config
 		.telemetry_endpoints
 		.clone()
 		.filter(|x| !x.is_empty())
@@ -123,7 +128,9 @@
 		})
 		.transpose()?;
 
-	let telemetry = config.telemetry_endpoints.clone()
+	let telemetry = config
+		.telemetry_endpoints
+		.clone()
 		.filter(|x| !x.is_empty())
 		.map(|endpoints| -> Result<_, sc_telemetry::Error> {
 			let worker = TelemetryWorker::new(16)?;
@@ -158,8 +165,7 @@
 
 	let pending_transactions: PendingTransactions = Some(Arc::new(Mutex::new(HashMap::new())));
 
-	let filter_pool: Option<FilterPool>
-		= Some(Arc::new(Mutex::new(BTreeMap::new())));
+	let filter_pool: Option<FilterPool> = Some(Arc::new(Mutex::new(BTreeMap::new())));
 
 	let frontier_backend = open_frontier_backend(config)?;
 
@@ -178,7 +184,13 @@
 		task_manager,
 		transaction_pool,
 		select_chain,
-		other: (telemetry, pending_transactions, filter_pool, frontier_backend, telemetry_worker_handle),
+		other: (
+			telemetry,
+			pending_transactions,
+			filter_pool,
+			frontier_backend,
+			telemetry_worker_handle,
+		),
 	};
 
 	Ok(params)
@@ -204,10 +216,7 @@
 		&Configuration,
 		Option<TelemetryHandle>,
 		&TaskManager,
-	) -> Result<
-		sp_consensus::DefaultImportQueue<Block, FullClient>,
-		sc_service::Error,
-	>,
+	) -> Result<sp_consensus::DefaultImportQueue<Block, FullClient>, sc_service::Error>,
 	BIC: FnOnce(
 		Arc<FullClient>,
 		Option<&Registry>,
@@ -227,7 +236,13 @@
 	let parachain_config = prepare_node_config(parachain_config);
 
 	let params = new_partial::<BIQ>(&parachain_config, build_import_queue)?;
-	let (mut telemetry, pending_transactions, filter_pool, frontier_backend, telemetry_worker_handle) = params.other;
+	let (
+		mut telemetry,
+		pending_transactions,
+		filter_pool,
+		frontier_backend,
+		telemetry_worker_handle,
+	) = params.other;
 
 	let relay_chain_full_node = cumulus_client_service::build_polkadot_full_node(
 		polkadot_config,
@@ -283,7 +298,7 @@
 			network: rpc_network.clone(),
 			pending_transactions: pending_transactions.clone(),
 			select_chain: select_chain.clone(),
-			is_authority: is_authority.clone(),
+			is_authority,
 			// TODO: Unhardcode
 			max_past_logs: 10000,
 		};
@@ -364,16 +379,9 @@
 	config: &Configuration,
 	telemetry: Option<TelemetryHandle>,
 	task_manager: &TaskManager,
-) -> Result<
-	sp_consensus::DefaultImportQueue<
-		Block,
-		FullClient,
-	>,
-	sc_service::Error,
-> {
+) -> Result<sp_consensus::DefaultImportQueue<Block, FullClient>, sc_service::Error> {
 	let slot_duration = cumulus_client_consensus_aura::slot_duration(&*client)?;
 
-
 	cumulus_client_consensus_aura::import_queue::<
 		sp_consensus_aura::sr25519::AuthorityPair,
 		_,
@@ -383,7 +391,7 @@
 		_,
 		_,
 	>(cumulus_client_consensus_aura::ImportQueueParams {
-		block_import:  client.clone(),
+		block_import: client.clone(),
 		client: client.clone(),
 		create_inherent_data_providers: move |_, _| async move {
 			let time = sp_timestamp::InherentDataProvider::from_system_time();
@@ -396,7 +404,7 @@
 
 			Ok((time, slot))
 		},
-		registry: config.prometheus_registry().clone(),
+		registry: config.prometheus_registry(),
 		can_author_with: sp_consensus::CanAuthorWithNativeVersion::new(client.executor().clone()),
 		spawner: &task_manager.spawn_essential_handle(),
 		telemetry,
@@ -432,7 +440,7 @@
 				task_manager.spawn_handle(),
 				client.clone(),
 				transaction_pool,
-				prometheus_registry.clone(),
+				prometheus_registry,
 				telemetry.clone(),
 			);
 
@@ -480,7 +488,7 @@
 				block_import: client.clone(),
 				relay_chain_client: relay_chain_node.client.clone(),
 				relay_chain_backend: relay_chain_node.backend.clone(),
-				para_client: client.clone(),
+				para_client: client,
 				backoff_authoring_blocks: Option::<()>::None,
 				sync_oracle,
 				keystore,
@@ -493,4 +501,4 @@
 		},
 	)
 	.await
-}
\ No newline at end of file
+}
modifiednode/rpc/src/lib.rsdiffbeforeafterboth
--- a/node/rpc/src/lib.rs
+++ b/node/rpc/src/lib.rs
@@ -189,7 +189,7 @@
 		pool.clone(),
 		nft_runtime::TransactionConverter,
 		network.clone(),
-		pending_transactions.clone(),
+		pending_transactions,
 		signers,
 		overrides.clone(),
 		backend,
@@ -200,8 +200,8 @@
 	if let Some(filter_pool) = filter_pool {
 		io.extend_with(EthFilterApiServer::to_delegate(EthFilterApi::new(
 			client.clone(),
-			filter_pool.clone(),
-			500 as usize, // max stored filters
+			filter_pool,
+			500_usize, // max stored filters
 			overrides.clone(),
 			max_past_logs,
 		)));
@@ -217,9 +217,9 @@
 	io.extend_with(Web3ApiServer::to_delegate(Web3Api::new(client.clone())));
 
 	io.extend_with(EthPubSubApiServer::to_delegate(EthPubSubApi::new(
-		pool.clone(),
-		client.clone(),
-		network.clone(),
+		pool,
+		client,
+		network,
 		SubscriptionManager::<HexEncodedIdProvider>::with_id_provider(
 			HexEncodedIdProvider::default(),
 			Arc::new(subscription_task_executor),
modifiedpallets/contract-helpers/src/lib.rsdiffbeforeafterboth
--- a/pallets/contract-helpers/src/lib.rs
+++ b/pallets/contract-helpers/src/lib.rs
@@ -15,11 +15,11 @@
 	use sp_std::vec::Vec;
 	use up_sponsorship::SponsorshipHandler;
 
-    #[pallet::error]
-    pub enum Error<T> {
-        /// Should be contract owner
-        NoPermission,
-    }
+	#[pallet::error]
+	pub enum Error<T> {
+		/// Should be contract owner
+		NoPermission,
+	}
 
 	#[pallet::config]
 	pub trait Config: frame_system::Config + pallet_contracts::Config {}
@@ -81,7 +81,10 @@
 			sponsoring: bool,
 		) -> DispatchResult {
 			let sender = ensure_signed(origin)?;
-			ensure!(<Owner<T>>::get(&contract) == sender, <Error<T>>::NoPermission);
+			ensure!(
+				<Owner<T>>::get(&contract) == sender,
+				<Error<T>>::NoPermission
+			);
 
 			if sponsoring {
 				<SelfSponsoring<T>>::insert(contract, true);
@@ -98,7 +101,10 @@
 			enabled: bool,
 		) -> DispatchResult {
 			let sender = ensure_signed(origin)?;
-			ensure!(<Owner<T>>::get(&contract) == sender, <Error<T>>::NoPermission);
+			ensure!(
+				<Owner<T>>::get(&contract) == sender,
+				<Error<T>>::NoPermission
+			);
 
 			if enabled {
 				<AllowlistEnabled<T>>::insert(contract, true);
@@ -116,7 +122,10 @@
 			allowed: bool,
 		) -> DispatchResult {
 			let sender = ensure_signed(origin)?;
-			ensure!(<Owner<T>>::get(&contract) == sender, <Error<T>>::NoPermission);
+			ensure!(
+				<Owner<T>>::get(&contract) == sender,
+				<Error<T>>::NoPermission
+			);
 
 			if allowed {
 				<Allowlist<T>>::insert(contract, user, true);
@@ -133,7 +142,10 @@
 			rate_limit: T::BlockNumber,
 		) -> DispatchResult {
 			let sender = ensure_signed(origin)?;
-			ensure!(<Owner<T>>::get(&contract) == sender, <Error<T>>::NoPermission);
+			ensure!(
+				<Owner<T>>::get(&contract) == sender,
+				<Error<T>>::NoPermission
+			);
 
 			<SponsoringRateLimit<T>>::insert(contract, rate_limit);
 			Ok(())
@@ -174,19 +186,17 @@
 			_info: &DispatchInfoOf<Self::Call>,
 			_len: usize,
 		) -> transaction_validity::TransactionValidity {
-			match IsSubType::<pallet_contracts::Call<T>>::is_sub_type(call) {
-				Some(pallet_contracts::Call::call(dest, _value, _gas_limit, _data)) => {
-					let called_contract: T::AccountId =
-						T::Lookup::lookup((*dest).clone()).unwrap_or(T::AccountId::default());
-					if <AllowlistEnabled<T>>::get(&called_contract) {
-						if !<Allowlist<T>>::get(&called_contract, who)
-							&& &<Owner<T>>::get(&called_contract) != who
-						{
-							return Err(transaction_validity::InvalidTransaction::Call.into());
-						}
-					}
+			if let Some(pallet_contracts::Call::call(dest, _value, _gas_limit, _data)) =
+				IsSubType::<pallet_contracts::Call<T>>::is_sub_type(call)
+			{
+				let called_contract: T::AccountId =
+					T::Lookup::lookup((*dest).clone()).unwrap_or_default();
+				if <AllowlistEnabled<T>>::get(&called_contract)
+					&& !<Allowlist<T>>::get(&called_contract, who)
+					&& &<Owner<T>>::get(&called_contract) != who
+				{
+					return Err(transaction_validity::InvalidTransaction::Call.into());
 				}
-				_ => {}
 			}
 			Ok(transaction_validity::ValidTransaction::default())
 		}
@@ -200,11 +210,11 @@
 		) -> Result<Self::Pre, TransactionValidityError> {
 			match IsSubType::<pallet_contracts::Call<T>>::is_sub_type(call) {
 				Some(pallet_contracts::Call::instantiate(_, _, code_hash, _, salt)) => {
-					Ok(Some((who.clone(), code_hash.clone(), salt.clone())))
+					Ok(Some((who.clone(), *code_hash, salt.clone())))
 				}
 				Some(pallet_contracts::Call::instantiate_with_code(_, _, code, _, salt)) => {
 					let code_hash = &T::Hashing::hash(&code);
-					Ok(Some((who.clone(), code_hash.clone(), salt.clone())))
+					Ok(Some((who.clone(), *code_hash, salt.clone())))
 				}
 				_ => Ok(None),
 			}
@@ -236,24 +246,22 @@
 		T::AccountId: AsRef<[u8]>,
 	{
 		fn get_sponsor(who: &T::AccountId, call: &C) -> Option<T::AccountId> {
-			match IsSubType::<pallet_contracts::Call<T>>::is_sub_type(call) {
-				Some(pallet_contracts::Call::call(dest, _value, _gas_limit, _data)) => {
-					let called_contract: T::AccountId =
-						T::Lookup::lookup((*dest).clone()).unwrap_or_default();
-					if <SelfSponsoring<T>>::get(&called_contract) {
-						let last_tx_block = SponsorBasket::<T>::get(&called_contract, &who);
-						let block_number =
-							<frame_system::Pallet<T>>::block_number() as T::BlockNumber;
-						let rate_limit = SponsoringRateLimit::<T>::get(&called_contract);
-						let limit_time = last_tx_block + rate_limit;
+			if let Some(pallet_contracts::Call::call(dest, _value, _gas_limit, _data)) =
+				IsSubType::<pallet_contracts::Call<T>>::is_sub_type(call)
+			{
+				let called_contract: T::AccountId =
+					T::Lookup::lookup((*dest).clone()).unwrap_or_default();
+				if <SelfSponsoring<T>>::get(&called_contract) {
+					let last_tx_block = SponsorBasket::<T>::get(&called_contract, &who);
+					let block_number = <frame_system::Pallet<T>>::block_number() as T::BlockNumber;
+					let rate_limit = SponsoringRateLimit::<T>::get(&called_contract);
+					let limit_time = last_tx_block + rate_limit;
 
-						if block_number >= limit_time {
-							SponsorBasket::<T>::insert(&called_contract, who, block_number);
-							return Some(called_contract);
-						}
+					if block_number >= limit_time {
+						SponsorBasket::<T>::insert(&called_contract, who, block_number);
+						return Some(called_contract);
 					}
 				}
-				_ => {}
 			}
 			None
 		}
modifiedpallets/inflation/src/benchmarking.rsdiffbeforeafterboth
--- a/pallets/inflation/src/benchmarking.rs
+++ b/pallets/inflation/src/benchmarking.rs
@@ -5,15 +5,15 @@
 
 use sp_std::prelude::*;
 use frame_system::RawOrigin;
-use frame_benchmarking::{benchmarks}; 
+use frame_benchmarking::{benchmarks};
 use frame_support::traits::OnInitialize;
 
 benchmarks! {
 
 	on_initialize {
-        let block1: T::BlockNumber = T::BlockNumber::from(1u32);
-        let block2: T::BlockNumber = T::BlockNumber::from(2u32);
-        Inflation::<T>::on_initialize(block1); // Create Treasury account
+		let block1: T::BlockNumber = T::BlockNumber::from(1u32);
+		let block2: T::BlockNumber = T::BlockNumber::from(2u32);
+		Inflation::<T>::on_initialize(block1); // Create Treasury account
 	}: { Inflation::<T>::on_initialize(block2); } // Benchmark deposit_into_existing path
 
 }
modifiedpallets/inflation/src/lib.rsdiffbeforeafterboth
--- a/pallets/inflation/src/lib.rs
+++ b/pallets/inflation/src/lib.rs
@@ -4,7 +4,6 @@
 //
 
 #![recursion_limit = "1024"]
-
 #![cfg_attr(not(feature = "std"), no_std)]
 
 #[cfg(feature = "std")]
@@ -19,8 +18,7 @@
 mod tests;
 
 pub use frame_support::{
-	construct_runtime, decl_module, decl_storage,
-	ensure,
+	construct_runtime, decl_module, decl_storage, ensure,
 	traits::{
 		Currency, ExistenceRequirement, Get, Imbalance, KeyOwnerProofSystem, OnUnbalanced,
 		Randomness, IsSubType, WithdrawReasons,
@@ -30,8 +28,7 @@
 		DispatchInfo, GetDispatchInfo, IdentityFee, Pays, PostDispatchInfo, Weight,
 		WeightToFeePolynomial, DispatchClass,
 	},
-	StorageValue,
-	transactional,
+	StorageValue, transactional,
 };
 
 // #[cfg(feature = "runtime-benchmarks")]
@@ -39,7 +36,7 @@
 
 use sp_runtime::{
 	Perbill,
-	traits::{Zero}
+	traits::{Zero},
 };
 use sp_std::convert::TryInto;
 
@@ -71,13 +68,13 @@
 }
 
 decl_module! {
-	pub struct Module<T: Config> for enum Call 
-	where 
+	pub struct Module<T: Config> for enum Call
+	where
 		origin: T::Origin,
 	{
 		const InflationBlockInterval: T::BlockNumber = T::InflationBlockInterval::get();
 
-		fn on_initialize(now: T::BlockNumber) -> Weight 
+		fn on_initialize(now: T::BlockNumber) -> Weight
 		{
 			let mut consumed_weight = 0;
 			let mut add_weight = |reads, writes, weight| {
@@ -95,14 +92,14 @@
 
 				if current_year <= TOTAL_YEARS_UNTIL_FLAT {
 					let amount: BalanceOf<T> = Perbill::from_rational(
-						block_interval * (START_INFLATION_PERCENT * TOTAL_YEARS_UNTIL_FLAT - current_year * (START_INFLATION_PERCENT - END_INFLATION_PERCENT)), 
+						block_interval * (START_INFLATION_PERCENT * TOTAL_YEARS_UNTIL_FLAT - current_year * (START_INFLATION_PERCENT - END_INFLATION_PERCENT)),
 						YEAR * TOTAL_YEARS_UNTIL_FLAT
 					) * ( one_percent * T::Currency::total_issuance() );
 					<BlockInflation<T>>::put(amount);
 				}
 				else {
 					let amount: BalanceOf<T> = Perbill::from_rational(
-						block_interval * END_INFLATION_PERCENT, 
+						block_interval * END_INFLATION_PERCENT,
 						YEAR
 					) * (one_percent * T::Currency::total_issuance());
 					<BlockInflation<T>>::put(amount);
modifiedpallets/inflation/src/tests.rsdiffbeforeafterboth
--- a/pallets/inflation/src/tests.rs
+++ b/pallets/inflation/src/tests.rs
@@ -1,242 +1,242 @@
-#[cfg(test)]
-mod tests {
-	use crate as pallet_inflation;
+#![cfg(test)]
+#![allow(clippy::from_over_into)]
+use crate as pallet_inflation;
 
-	use frame_system;
-	use frame_support::{traits::{Currency}, parameter_types};
-	use frame_support::{traits::OnInitialize};
-	use sp_core::H256;
-	use sp_runtime::{traits::{BlakeTwo256, IdentityLookup}, testing::Header};
+use frame_support::{
+	traits::{Currency},
+	parameter_types,
+};
+use frame_support::{traits::OnInitialize};
+use sp_core::H256;
+use sp_runtime::{
+	traits::{BlakeTwo256, IdentityLookup},
+	testing::Header,
+};
 
-	type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic<Test>;
-	type Block = frame_system::mocking::MockBlock<Test>;
+type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic<Test>;
+type Block = frame_system::mocking::MockBlock<Test>;
 
-	const YEAR: u64 = 5_259_600;
+const YEAR: u64 = 5_259_600;
 
-	parameter_types! {
-		pub const ExistentialDeposit: u64 = 1;
-		pub const MaxLocks: u32 = 50;
-	}
-	
-	impl pallet_balances::Config for Test {
-		type AccountStore = System;
-		type Balance = u64;
-		type DustRemoval = ();
-		type Event = ();
-		type ExistentialDeposit = ExistentialDeposit;
-		type WeightInfo = ();
-		type MaxLocks = MaxLocks;
-	}
-	
-	frame_support::construct_runtime!(
-		pub enum Test where
-			Block = Block,
-			NodeBlock = Block,
-			UncheckedExtrinsic = UncheckedExtrinsic,
-		{
-			Balances: pallet_balances::{Pallet, Call, Storage},
-			System: frame_system::{Pallet, Call, Config, Storage, Event<T>},
-			Inflation: pallet_inflation::{Pallet, Call, Storage},
-		}
-	);
+parameter_types! {
+	pub const ExistentialDeposit: u64 = 1;
+	pub const MaxLocks: u32 = 50;
+}
 
-	parameter_types! {
-		pub const BlockHashCount: u64 = 250;
-		pub BlockWeights: frame_system::limits::BlockWeights =
-			frame_system::limits::BlockWeights::simple_max(1024);
-		pub const SS58Prefix: u8 = 42;
-	}
+impl pallet_balances::Config for Test {
+	type AccountStore = System;
+	type Balance = u64;
+	type DustRemoval = ();
+	type Event = ();
+	type ExistentialDeposit = ExistentialDeposit;
+	type WeightInfo = ();
+	type MaxLocks = MaxLocks;
+}
 
-	impl frame_system::Config for Test {
-		type BaseCallFilter = ();
-		type BlockWeights = ();
-		type BlockLength = ();
-		type DbWeight = ();
-		type Origin = Origin;
-		type Call = Call;
-		type Index = u64;
-		type BlockNumber = u64;
-		type Hash = H256;
-		type Hashing = BlakeTwo256;
-		type AccountId = u64;
-		type Lookup = IdentityLookup<Self::AccountId>;
-		type Header = Header;
-		type Event = ();
-		type BlockHashCount = BlockHashCount;
-		type Version = ();
-		type PalletInfo = PalletInfo;
-		type AccountData = pallet_balances::AccountData<u64>;
-		type OnNewAccount = ();
-		type OnKilledAccount = ();
-		type SystemWeightInfo = ();
-		type SS58Prefix = SS58Prefix;
-        type OnSetCode = ();
+frame_support::construct_runtime!(
+	pub enum Test where
+		Block = Block,
+		NodeBlock = Block,
+		UncheckedExtrinsic = UncheckedExtrinsic,
+	{
+		Balances: pallet_balances::{Pallet, Call, Storage},
+		System: frame_system::{Pallet, Call, Config, Storage, Event<T>},
+		Inflation: pallet_inflation::{Pallet, Call, Storage},
 	}
+);
+
+parameter_types! {
+	pub const BlockHashCount: u64 = 250;
+	pub BlockWeights: frame_system::limits::BlockWeights =
+		frame_system::limits::BlockWeights::simple_max(1024);
+	pub const SS58Prefix: u8 = 42;
+}
+
+impl frame_system::Config for Test {
+	type BaseCallFilter = ();
+	type BlockWeights = ();
+	type BlockLength = ();
+	type DbWeight = ();
+	type Origin = Origin;
+	type Call = Call;
+	type Index = u64;
+	type BlockNumber = u64;
+	type Hash = H256;
+	type Hashing = BlakeTwo256;
+	type AccountId = u64;
+	type Lookup = IdentityLookup<Self::AccountId>;
+	type Header = Header;
+	type Event = ();
+	type BlockHashCount = BlockHashCount;
+	type Version = ();
+	type PalletInfo = PalletInfo;
+	type AccountData = pallet_balances::AccountData<u64>;
+	type OnNewAccount = ();
+	type OnKilledAccount = ();
+	type SystemWeightInfo = ();
+	type SS58Prefix = SS58Prefix;
+	type OnSetCode = ();
+}
 
-	parameter_types! {
-		pub TreasuryAccountId: u64 = 1234;
-		pub const InflationBlockInterval: u32 = 100; // every time per how many blocks inflation is applied
-	}
-		
-	impl pallet_inflation::Config for Test {
-		type Currency = Balances;
-		type TreasuryAccountId = TreasuryAccountId;
-		type InflationBlockInterval = InflationBlockInterval;
-	}
+parameter_types! {
+	pub TreasuryAccountId: u64 = 1234;
+	pub const InflationBlockInterval: u32 = 100; // every time per how many blocks inflation is applied
+}
 
-	// Build genesis storage according to the mock runtime.
-	pub fn new_test_ext() -> sp_io::TestExternalities {
-		frame_system::GenesisConfig::default().build_storage::<Test>().unwrap().into()
-	}
+impl pallet_inflation::Config for Test {
+	type Currency = Balances;
+	type TreasuryAccountId = TreasuryAccountId;
+	type InflationBlockInterval = InflationBlockInterval;
+}
 
-	#[test]
-	fn inflation_works() {
-		new_test_ext().execute_with(|| {
-			// Total issuance = 1_000_000_000
-			let initial_issuance: u64 = 1_000_000_000;
-			let _ = <Balances as Currency<_>>::deposit_creating(&1234, initial_issuance);
-			assert_eq!(Balances::free_balance(1234), initial_issuance);
+// Build genesis storage according to the mock runtime.
+pub fn new_test_ext() -> sp_io::TestExternalities {
+	frame_system::GenesisConfig::default()
+		.build_storage::<Test>()
+		.unwrap()
+		.into()
+}
 
-			// BlockInflation should be set after 1st block and 
-			// first inflation deposit should be equal to BlockInflation
-			Inflation::on_initialize(1);
-			assert!(Inflation::block_inflation() > 0);
-			assert_eq!(Balances::free_balance(1234) - initial_issuance, Inflation::block_inflation());
-		});
-	}
+#[test]
+fn inflation_works() {
+	new_test_ext().execute_with(|| {
+		// Total issuance = 1_000_000_000
+		let initial_issuance: u64 = 1_000_000_000;
+		let _ = <Balances as Currency<_>>::deposit_creating(&1234, initial_issuance);
+		assert_eq!(Balances::free_balance(1234), initial_issuance);
 
-	#[test]
-	fn inflation_second_deposit() {
-		new_test_ext().execute_with(|| {
-			// Total issuance = 1_000_000_000
-			let initial_issuance: u64 = 1_000_000_000;
-			let _ = <Balances as Currency<_>>::deposit_creating(&1234, initial_issuance);
-			assert_eq!(Balances::free_balance(1234), initial_issuance);
-			Inflation::on_initialize(1);
+		// BlockInflation should be set after 1st block and
+		// first inflation deposit should be equal to BlockInflation
+		Inflation::on_initialize(1);
+		assert!(Inflation::block_inflation() > 0);
+		assert_eq!(
+			Balances::free_balance(1234) - initial_issuance,
+			Inflation::block_inflation()
+		);
+	});
+}
 
-			// Next inflation deposit happens when block is multiple of InflationBlockInterval
-			let mut block: u32 = 2;
-			let balance_before: u64 = Balances::free_balance(1234);
-			while block % InflationBlockInterval::get() != 0 {
-				Inflation::on_initialize(block as u64);
-				block += 1;
-			}
-			let balance_just_before: u64 = Balances::free_balance(1234);
-			assert_eq!(balance_before, balance_just_before);
+#[test]
+fn inflation_second_deposit() {
+	new_test_ext().execute_with(|| {
+		// Total issuance = 1_000_000_000
+		let initial_issuance: u64 = 1_000_000_000;
+		let _ = <Balances as Currency<_>>::deposit_creating(&1234, initial_issuance);
+		assert_eq!(Balances::free_balance(1234), initial_issuance);
+		Inflation::on_initialize(1);
 
-			// The block with inflation
+		// Next inflation deposit happens when block is multiple of InflationBlockInterval
+		let mut block: u32 = 2;
+		let balance_before: u64 = Balances::free_balance(1234);
+		while block % InflationBlockInterval::get() != 0 {
 			Inflation::on_initialize(block as u64);
-			let balance_after: u64 = Balances::free_balance(1234);
-			assert_eq!(balance_after - balance_just_before, Inflation::block_inflation());
-		});
-	}
+			block += 1;
+		}
+		let balance_just_before: u64 = Balances::free_balance(1234);
+		assert_eq!(balance_before, balance_just_before);
 
-	#[test]
-	fn inflation_in_1_year() {
-		new_test_ext().execute_with(|| {
-			// Total issuance = 1_000_000_000
-			let initial_issuance: u64 = 1_000_000_000;
-			let _ = <Balances as Currency<_>>::deposit_creating(&1234, initial_issuance);
-			assert_eq!(Balances::free_balance(1234), initial_issuance);
-			Inflation::on_initialize(1);
-			let block_inflation_year_0 = Inflation::block_inflation();
+		// The block with inflation
+		Inflation::on_initialize(block as u64);
+		let balance_after: u64 = Balances::free_balance(1234);
+		assert_eq!(
+			balance_after - balance_just_before,
+			Inflation::block_inflation()
+		);
+	});
+}
 
-			Inflation::on_initialize(YEAR);
-			let block_inflation_year_1 = Inflation::block_inflation();
+#[test]
+fn inflation_in_1_year() {
+	new_test_ext().execute_with(|| {
+		// Total issuance = 1_000_000_000
+		let initial_issuance: u64 = 1_000_000_000;
+		let _ = <Balances as Currency<_>>::deposit_creating(&1234, initial_issuance);
+		assert_eq!(Balances::free_balance(1234), initial_issuance);
+		Inflation::on_initialize(1);
+		let block_inflation_year_0 = Inflation::block_inflation();
 
-			// Assert that year 1 inflation is less than year 0
-			assert!(block_inflation_year_0 > block_inflation_year_1);
-		});
-	}
+		Inflation::on_initialize(YEAR);
+		let block_inflation_year_1 = Inflation::block_inflation();
 
-	#[test]
-	fn inflation_in_1_to_9_years() {
-		new_test_ext().execute_with(|| {
-			// Total issuance = 1_000_000_000
-			let initial_issuance: u64 = 1_000_000_000;
-			let _ = <Balances as Currency<_>>::deposit_creating(&1234, initial_issuance);
-			assert_eq!(Balances::free_balance(1234), initial_issuance);
-			Inflation::on_initialize(1);
+		// Assert that year 1 inflation is less than year 0
+		assert!(block_inflation_year_0 > block_inflation_year_1);
+	});
+}
 
-			for year in 1..=9 {
-				let block_inflation_year_before = Inflation::block_inflation();
-				Inflation::on_initialize(YEAR * year);
-				let block_inflation_year_after = Inflation::block_inflation();
+#[test]
+fn inflation_in_1_to_9_years() {
+	new_test_ext().execute_with(|| {
+		// Total issuance = 1_000_000_000
+		let initial_issuance: u64 = 1_000_000_000;
+		let _ = <Balances as Currency<_>>::deposit_creating(&1234, initial_issuance);
+		assert_eq!(Balances::free_balance(1234), initial_issuance);
+		Inflation::on_initialize(1);
 
-				// Assert that next year inflation is less than previous year inflation
-				assert!(block_inflation_year_before > block_inflation_year_after);
-			}
+		for year in 1..=9 {
+			let block_inflation_year_before = Inflation::block_inflation();
+			Inflation::on_initialize(YEAR * year);
+			let block_inflation_year_after = Inflation::block_inflation();
 
-		});
-	}
+			// Assert that next year inflation is less than previous year inflation
+			assert!(block_inflation_year_before > block_inflation_year_after);
+		}
+	});
+}
 
-	#[test]
-	fn inflation_after_year_10_is_flat() {
-		new_test_ext().execute_with(|| {
-			// Total issuance = 1_000_000_000
-			let initial_issuance: u64 = 1_000_000_000;
-			let _ = <Balances as Currency<_>>::deposit_creating(&1234, initial_issuance);
-			assert_eq!(Balances::free_balance(1234), initial_issuance);
-			Inflation::on_initialize(YEAR * 9);
+#[test]
+fn inflation_after_year_10_is_flat() {
+	new_test_ext().execute_with(|| {
+		// Total issuance = 1_000_000_000
+		let initial_issuance: u64 = 1_000_000_000;
+		let _ = <Balances as Currency<_>>::deposit_creating(&1234, initial_issuance);
+		assert_eq!(Balances::free_balance(1234), initial_issuance);
+		Inflation::on_initialize(YEAR * 9);
 
-			for year in 10..=20 {
-				let block_inflation_year_before = Inflation::block_inflation();
-				Inflation::on_initialize(YEAR * year);
-				let block_inflation_year_after = Inflation::block_inflation();
+		for year in 10..=20 {
+			let block_inflation_year_before = Inflation::block_inflation();
+			Inflation::on_initialize(YEAR * year);
+			let block_inflation_year_after = Inflation::block_inflation();
 
-				// Assert that next year inflation is equal to previous year inflation
-				assert_eq!(block_inflation_year_before, block_inflation_year_after);
-			}
-		});
-	}
+			// Assert that next year inflation is equal to previous year inflation
+			assert_eq!(block_inflation_year_before, block_inflation_year_after);
+		}
+	});
+}
 
-	#[test]
-	fn inflation_rate_by_year() {
-		new_test_ext().execute_with(|| {
-			let payouts: u64 = YEAR / InflationBlockInterval::get() as u64;
+#[test]
+fn inflation_rate_by_year() {
+	new_test_ext().execute_with(|| {
+		let payouts: u64 = YEAR / InflationBlockInterval::get() as u64;
 
-			// Inflation starts at 10% and does down by 2/3% every year until year 9 (included), 
-			// then it is flat.
-			let payout_by_year: [u64; 11] = [
-				1000,
-				933,
-				867,
-				800,
-				733,
-				667,
-				600,
-				533,
-				467,
-				400,
-				400
-			];
+		// Inflation starts at 10% and does down by 2/3% every year until year 9 (included),
+		// then it is flat.
+		let payout_by_year: [u64; 11] = [1000, 933, 867, 800, 733, 667, 600, 533, 467, 400, 400];
 
-			// For accuracy total issuance = payout0 * payouts * 10;
-			let initial_issuance: u64 = payout_by_year[0] * payouts * 10;
-			let _ = <Balances as Currency<_>>::deposit_creating(&1234, initial_issuance);
-			assert_eq!(Balances::free_balance(1234), initial_issuance);
+		// For accuracy total issuance = payout0 * payouts * 10;
+		let initial_issuance: u64 = payout_by_year[0] * payouts * 10;
+		let _ = <Balances as Currency<_>>::deposit_creating(&1234, initial_issuance);
+		assert_eq!(Balances::free_balance(1234), initial_issuance);
 
-			for year in 0..=10 {
-				// Year first block
-				Inflation::on_initialize(year*YEAR);
-				let mut actual_payout = Inflation::block_inflation();
-				assert_eq!(actual_payout, payout_by_year[year as usize]);
+		for year in 0..=10 {
+			// Year first block
+			Inflation::on_initialize(year * YEAR);
+			let mut actual_payout = Inflation::block_inflation();
+			assert_eq!(actual_payout, payout_by_year[year as usize]);
 
-				// Year second block
-				Inflation::on_initialize(year*YEAR+1);
-				actual_payout = Inflation::block_inflation();
-				assert_eq!(actual_payout, payout_by_year[year as usize]);
+			// Year second block
+			Inflation::on_initialize(year * YEAR + 1);
+			actual_payout = Inflation::block_inflation();
+			assert_eq!(actual_payout, payout_by_year[year as usize]);
 
-				// Year middle block
-				Inflation::on_initialize(year*YEAR + YEAR/2);
-				actual_payout = Inflation::block_inflation();
-				assert_eq!(actual_payout, payout_by_year[year as usize]);
+			// Year middle block
+			Inflation::on_initialize(year * YEAR + YEAR / 2);
+			actual_payout = Inflation::block_inflation();
+			assert_eq!(actual_payout, payout_by_year[year as usize]);
 
-				// Year last block
-				Inflation::on_initialize((year + 1)*YEAR-1);
-				actual_payout = Inflation::block_inflation();
-				assert_eq!(actual_payout, payout_by_year[year as usize]);
-			}
-		});
-	}
+			// Year last block
+			Inflation::on_initialize((year + 1) * YEAR - 1);
+			actual_payout = Inflation::block_inflation();
+			assert_eq!(actual_payout, payout_by_year[year as usize]);
+		}
+	});
 }
modifiedpallets/nft-charge-transaction/src/lib.rsdiffbeforeafterboth
--- a/pallets/nft-charge-transaction/src/lib.rs
+++ b/pallets/nft-charge-transaction/src/lib.rs
@@ -11,47 +11,38 @@
 #[cfg(feature = "std")]
 pub use serde::*;
 
-#[cfg(feature = "runtime-benchmarks")]
-mod benchmarking;
-
 use codec::{Decode, Encode};
 use frame_support::traits::Get;
 use frame_support::{
 	decl_module, decl_storage,
-	weights::{
-		DispatchInfo, PostDispatchInfo, DispatchClass
-	}
+	weights::{DispatchInfo, PostDispatchInfo, DispatchClass},
 };
 use sp_runtime::{
-	traits::{ 
-		DispatchInfoOf, Dispatchable, PostDispatchInfoOf, Saturating, SaturatedConversion, SignedExtension, Zero,
+	traits::{
+		DispatchInfoOf, Dispatchable, PostDispatchInfoOf, Saturating, SaturatedConversion,
+		SignedExtension, Zero,
 	},
-	transaction_validity::{ 
+	transaction_validity::{
 		TransactionPriority, TransactionValidity, TransactionValidityError, ValidTransaction,
 	},
-	FixedPointOperand, DispatchResult
+	FixedPointOperand, DispatchResult,
 };
 use pallet_transaction_payment::OnChargeTransaction;
 use sp_std::prelude::*;
 
-
-pub trait Config: frame_system::Config + 
-    pallet_nft_transaction_payment::Config
-{
-
-}
+pub trait Config: frame_system::Config + pallet_nft_transaction_payment::Config {}
 
 decl_storage! {
-    trait Store for Module<T: Config> as NftTransactionPayment
-    {}
+	trait Store for Module<T: Config> as NftTransactionPayment
+	{}
 }
 
 decl_module! {
 
-	pub struct Module<T: Config> for enum Call 
-    where 
+	pub struct Module<T: Config> for enum Call
+	where
 		origin: T::Origin,
-    {}
+	{}
 }
 
 type BalanceOf<T> = <<T as pallet_transaction_payment::Config>::OnChargeTransaction as pallet_transaction_payment::OnChargeTransaction<T>>::Balance;
@@ -61,9 +52,7 @@
 #[derive(Encode, Decode, Clone, Eq, PartialEq)]
 pub struct ChargeTransactionPayment<T: Config>(#[codec(compact)] BalanceOf<T>);
 
-impl<T: Config + Send + Sync> sp_std::fmt::Debug 
-    for ChargeTransactionPayment<T>
-{
+impl<T: Config + Send + Sync> sp_std::fmt::Debug for ChargeTransactionPayment<T> {
 	#[cfg(feature = "std")]
 	fn fmt(&self, f: &mut sp_std::fmt::Formatter) -> sp_std::fmt::Result {
 		write!(f, "ChargeTransactionPayment<{:?}>", self.0)
@@ -76,32 +65,37 @@
 
 impl<T: Config> ChargeTransactionPayment<T>
 where
-	T::Call: Dispatchable<Info=DispatchInfo, PostInfo=PostDispatchInfo>,
-    BalanceOf<T>: Send + Sync + From<u64> + FixedPointOperand,
+	T::Call: Dispatchable<Info = DispatchInfo, PostInfo = PostDispatchInfo>,
+	BalanceOf<T>: Send + Sync + From<u64> + FixedPointOperand,
 {
-    fn traditional_fee(
-        len: usize,
-        info: &DispatchInfoOf<T::Call>,
-        tip: BalanceOf<T>,
-    ) -> BalanceOf<T>
-    where
-        T::Call: Dispatchable<Info = DispatchInfo>,
-    {
-        <pallet_transaction_payment::Module<T>>::compute_fee(len as u32, info, tip)
-    }
+	fn traditional_fee(
+		len: usize,
+		info: &DispatchInfoOf<T::Call>,
+		tip: BalanceOf<T>,
+	) -> BalanceOf<T>
+	where
+		T::Call: Dispatchable<Info = DispatchInfo>,
+	{
+		<pallet_transaction_payment::Module<T>>::compute_fee(len as u32, info, tip)
+	}
 
-	fn get_priority(len: usize, info: &DispatchInfoOf<T::Call>, final_fee: BalanceOf<T>) -> TransactionPriority {
-        let weight_saturation = T::BlockWeights::get().max_block / info.weight.max(1);
-        let max_block_length = *T::BlockLength::get().max.get(DispatchClass::Normal);
-        let len_saturation = max_block_length as u64 / (len as u64).max(1);
-        let coefficient: BalanceOf<T> = weight_saturation
-            .min(len_saturation)
-            .saturated_into::<BalanceOf<T>>();
-        final_fee
-            .saturating_mul(coefficient)
-            .saturated_into::<TransactionPriority>()
-    }
+	fn get_priority(
+		len: usize,
+		info: &DispatchInfoOf<T::Call>,
+		final_fee: BalanceOf<T>,
+	) -> TransactionPriority {
+		let weight_saturation = T::BlockWeights::get().max_block / info.weight.max(1);
+		let max_block_length = *T::BlockLength::get().max.get(DispatchClass::Normal);
+		let len_saturation = max_block_length as u64 / (len as u64).max(1);
+		let coefficient: BalanceOf<T> = weight_saturation
+			.min(len_saturation)
+			.saturated_into::<BalanceOf<T>>();
+		final_fee
+			.saturating_mul(coefficient)
+			.saturated_into::<TransactionPriority>()
+	}
 
+	#[allow(clippy::type_complexity)]
     fn withdraw_fee(
         &self,
         who: &T::AccountId,
@@ -114,39 +108,38 @@
 			<<T as pallet_transaction_payment::Config>::OnChargeTransaction as pallet_transaction_payment::OnChargeTransaction<T>>::LiquidityInfo,
 		),
 		TransactionValidityError,
-	> {
-        let tip = self.0;
+	>{
+		let tip = self.0;
 
-        let fee = Self::traditional_fee(len, info, tip);
+		let fee = Self::traditional_fee(len, info, tip);
 
-        // Only mess with balances if fee is not zero.
-        if fee.is_zero() {
-            return <<T as pallet_transaction_payment::Config>::OnChargeTransaction as pallet_transaction_payment::OnChargeTransaction<T>>::withdraw_fee(who, call, info, fee, tip)
+		// Only mess with balances if fee is not zero.
+		if fee.is_zero() {
+			return <<T as pallet_transaction_payment::Config>::OnChargeTransaction as pallet_transaction_payment::OnChargeTransaction<T>>::withdraw_fee(who, call, info, fee, tip)
 			.map(|i| (fee, i));
-        }
+		}
 
-        // Determine who is paying transaction fee based on ecnomic model
-		// Parse call to extract collection ID and access collection sponsor	
+		// Determine who is paying transaction fee based on ecnomic model
+		// Parse call to extract collection ID and access collection sponsor
 		let sponsor = <pallet_nft_transaction_payment::Module<T>>::withdraw_type(who, call);
 
-        let who_pays_fee = sponsor.unwrap_or_else(|| who.clone());
+		let who_pays_fee = sponsor.unwrap_or_else(|| who.clone());
 
 		<<T as pallet_transaction_payment::Config>::OnChargeTransaction as pallet_transaction_payment::OnChargeTransaction<T>>::withdraw_fee(&who_pays_fee, call, info, fee, tip)
 			.map(|i| (fee, i))
-    }
+	}
 }
 
-impl<T: Config + Send + Sync> SignedExtension
-    for ChargeTransactionPayment<T>
+impl<T: Config + Send + Sync> SignedExtension for ChargeTransactionPayment<T>
 where
-    BalanceOf<T>: Send + Sync + From<u64> + FixedPointOperand,
-	T::Call: Dispatchable<Info=DispatchInfo, PostInfo=PostDispatchInfo>,
+	BalanceOf<T>: Send + Sync + From<u64> + FixedPointOperand,
+	T::Call: Dispatchable<Info = DispatchInfo, PostInfo = PostDispatchInfo>,
 {
-    const IDENTIFIER: &'static str = "ChargeTransactionPayment";
-    type AccountId = T::AccountId;
-    type Call = T::Call;
-    type AdditionalSigned = ();
-    type Pre = (
+	const IDENTIFIER: &'static str = "ChargeTransactionPayment";
+	type AccountId = T::AccountId;
+	type Call = T::Call;
+	type AdditionalSigned = ();
+	type Pre = (
         // tip
         BalanceOf<T>,
         // who pays fee
@@ -154,50 +147,49 @@
 		// imbalance resulting from withdrawing the fee
 		<<T as pallet_transaction_payment::Config>::OnChargeTransaction as pallet_transaction_payment::OnChargeTransaction<T>>::LiquidityInfo,
     );
-    fn additional_signed(&self) -> sp_std::result::Result<(), TransactionValidityError> {
-        Ok(())
-    }
+	fn additional_signed(&self) -> sp_std::result::Result<(), TransactionValidityError> {
+		Ok(())
+	}
 
-    fn validate(
-        &self,
-        who: &Self::AccountId,
-        call: &Self::Call,
-        info: &DispatchInfoOf<Self::Call>,
-        len: usize,
-    ) -> TransactionValidity {
+	fn validate(
+		&self,
+		who: &Self::AccountId,
+		call: &Self::Call,
+		info: &DispatchInfoOf<Self::Call>,
+		len: usize,
+	) -> TransactionValidity {
 		let (fee, _) = self.withdraw_fee(who, call, info, len)?;
 		Ok(ValidTransaction {
 			priority: Self::get_priority(len, info, fee),
 			..Default::default()
 		})
-    }
+	}
 
-    fn pre_dispatch(
-        self,
-        who: &Self::AccountId,
-        call: &Self::Call,
-        info: &DispatchInfoOf<Self::Call>,
-        len: usize,
-    ) -> Result<Self::Pre, TransactionValidityError> {
-        let (_fee, imbalance) = self.withdraw_fee(who, call, info, len)?;
-        Ok((self.0, who.clone(), imbalance))
-    }
+	fn pre_dispatch(
+		self,
+		who: &Self::AccountId,
+		call: &Self::Call,
+		info: &DispatchInfoOf<Self::Call>,
+		len: usize,
+	) -> Result<Self::Pre, TransactionValidityError> {
+		let (_fee, imbalance) = self.withdraw_fee(who, call, info, len)?;
+		Ok((self.0, who.clone(), imbalance))
+	}
 
-    fn post_dispatch(
-        pre: Self::Pre,
-        info: &DispatchInfoOf<Self::Call>,
-        post_info: &PostDispatchInfoOf<Self::Call>,
-        len: usize,
-        _result: &DispatchResult,
-    ) -> Result<(), TransactionValidityError> {
+	fn post_dispatch(
+		pre: Self::Pre,
+		info: &DispatchInfoOf<Self::Call>,
+		post_info: &PostDispatchInfoOf<Self::Call>,
+		len: usize,
+		_result: &DispatchResult,
+	) -> Result<(), TransactionValidityError> {
 		let (tip, who, imbalance) = pre;
 		let actual_fee = pallet_transaction_payment::Pallet::<T>::compute_actual_fee(
-			len as u32,
-			info,
-			post_info,
-			tip,
+			len as u32, info, post_info, tip,
 		);
-		<T as pallet_transaction_payment::Config>::OnChargeTransaction::correct_and_deposit_fee(&who, info, post_info, actual_fee, tip, imbalance)?;
+		<T as pallet_transaction_payment::Config>::OnChargeTransaction::correct_and_deposit_fee(
+			&who, info, post_info, actual_fee, tip, imbalance,
+		)?;
 		Ok(())
-    }
-}
\ No newline at end of file
+	}
+}
modifiedpallets/nft-transaction-payment/src/benchmarking.rsdiffbeforeafterboth
--- a/pallets/nft-transaction-payment/src/benchmarking.rs
+++ b/pallets/nft-transaction-payment/src/benchmarking.rs
@@ -4,15 +4,15 @@
 
 use sp_std::prelude::*;
 use frame_system::RawOrigin;
-use frame_benchmarking::{benchmarks}; 
+use frame_benchmarking::{benchmarks};
 use frame_support::traits::OnInitialize;
 
 benchmarks! {
 
 	// on_initialize {
-        // let block1: T::BlockNumber = T::BlockNumber::from(1u32);
-        // let block2: T::BlockNumber = T::BlockNumber::from(2u32);
-        // Inflation::<T>::on_initialize(block1); // Create Treasury account
+		// let block1: T::BlockNumber = T::BlockNumber::from(1u32);
+		// let block2: T::BlockNumber = T::BlockNumber::from(2u32);
+		// Inflation::<T>::on_initialize(block1); // Create Treasury account
 	// }: { Inflation::<T>::on_initialize(block2); } // Benchmark deposit_into_existing path
 
 }
modifiedpallets/nft-transaction-payment/src/lib.rsdiffbeforeafterboth
--- a/pallets/nft-transaction-payment/src/lib.rs
+++ b/pallets/nft-transaction-payment/src/lib.rs
@@ -28,18 +28,15 @@
 }
 
 decl_module! {
-	pub struct Module<T: Config> for enum Call 
-    where 
+	pub struct Module<T: Config> for enum Call
+	where
 		origin: T::Origin,
-    {
+	{
 	}
 }
 
 impl<T: Config> Module<T> {
-	pub fn withdraw_type(
-		who: &T::AccountId,
-		call: &T::Call
-	) -> Option<T::AccountId> {
+	pub fn withdraw_type(who: &T::AccountId, call: &T::Call) -> Option<T::AccountId> {
 		T::SponsorshipHandler::get_sponsor(who, call)
 	}
-}
\ No newline at end of file
+}
modifiedpallets/nft/src/benchmarking.rsdiffbeforeafterboth
--- a/pallets/nft/src/benchmarking.rs
+++ b/pallets/nft/src/benchmarking.rs
@@ -5,415 +5,415 @@
 
 use sp_std::prelude::*;
 use frame_system::RawOrigin;
-use frame_benchmarking::{benchmarks, account, whitelisted_caller};  // , TrackedStorageKey, 
+use frame_benchmarking::{benchmarks, account, whitelisted_caller}; // , TrackedStorageKey,
 
 const SEED: u32 = 1;
 /*
 fn default_nft_data() -> CreateItemData {
-    CreateItemData::NFT(CreateNftData { const_data: vec![1, 2, 3], variable_data: vec![3, 2, 1] })
+	CreateItemData::NFT(CreateNftData { const_data: vec![1, 2, 3], variable_data: vec![3, 2, 1] })
 }
 
 fn default_fungible_data () -> CreateItemData {
-    CreateItemData::Fungible(CreateFungibleData { })
+	CreateItemData::Fungible(CreateFungibleData { })
 }
 
 fn default_re_fungible_data () -> CreateItemData {
-    CreateItemData::ReFungible(CreateReFungibleData { const_data: vec![1, 2, 3], variable_data: vec![3, 2, 1] })
+	CreateItemData::ReFungible(CreateReFungibleData { const_data: vec![1, 2, 3], variable_data: vec![3, 2, 1] })
 }
 */
 
 benchmarks! {
 
-    create_collection {
-        let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
-        let mode: CollectionMode = CollectionMode::NFT;
-        let caller: T::AccountId = account("caller", 0, SEED);
-    }: _(RawOrigin::Signed(caller.clone()), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode)
+	create_collection {
+		let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+		let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+		let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+		let mode: CollectionMode = CollectionMode::NFT;
+		let caller: T::AccountId = account("caller", 0, SEED);
+	}: _(RawOrigin::Signed(caller.clone()), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode)
 /*
-    verify {
-        assert_eq!(Nft::<T>::collection_id(2).owner, caller);
-    }
-    destroy_collection {
-        let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
-        let mode: CollectionMode = CollectionMode::NFT;
-        let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
-        Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
-    }: _(RawOrigin::Signed(caller.clone()), 2)
+	verify {
+		assert_eq!(Nft::<T>::collection_id(2).owner, caller);
+	}
+	destroy_collection {
+		let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+		let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+		let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+		let mode: CollectionMode = CollectionMode::NFT;
+		let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+		Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+	}: _(RawOrigin::Signed(caller.clone()), 2)
 
-    add_to_white_list {
-        let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
-        let mode: CollectionMode = CollectionMode::NFT;
-        let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
-        let whitelist_account: T::AccountId = account("admin", 0, SEED);
-        Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
-    }: add_to_white_list(RawOrigin::Signed(caller.clone()), 2, whitelist_account)
+	add_to_white_list {
+		let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+		let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+		let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+		let mode: CollectionMode = CollectionMode::NFT;
+		let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+		let whitelist_account: T::AccountId = account("admin", 0, SEED);
+		Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+	}: add_to_white_list(RawOrigin::Signed(caller.clone()), 2, whitelist_account)
 
-    remove_from_white_list {
-        let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
-        let mode: CollectionMode = CollectionMode::NFT;
-        let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
-        let whitelist_account: T::AccountId = account("admin", 0, SEED);
-        Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
-        Nft::<T>::add_to_white_list(RawOrigin::Signed(caller.clone()).into(), 2, whitelist_account.clone())?;
-    }: remove_from_white_list(RawOrigin::Signed(caller.clone()), 2, whitelist_account)
+	remove_from_white_list {
+		let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+		let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+		let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+		let mode: CollectionMode = CollectionMode::NFT;
+		let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+		let whitelist_account: T::AccountId = account("admin", 0, SEED);
+		Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+		Nft::<T>::add_to_white_list(RawOrigin::Signed(caller.clone()).into(), 2, whitelist_account.clone())?;
+	}: remove_from_white_list(RawOrigin::Signed(caller.clone()), 2, whitelist_account)
 
-    set_public_access_mode {
-        let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
-        let mode: CollectionMode = CollectionMode::NFT;
-        let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
-        Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
-    }: set_public_access_mode(RawOrigin::Signed(caller.clone()), 2, AccessMode::WhiteList)
+	set_public_access_mode {
+		let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+		let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+		let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+		let mode: CollectionMode = CollectionMode::NFT;
+		let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+		Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+	}: set_public_access_mode(RawOrigin::Signed(caller.clone()), 2, AccessMode::WhiteList)
 
-    set_mint_permission {
-        let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
-        let mode: CollectionMode = CollectionMode::NFT;
-        let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
-        Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
-    }: set_mint_permission(RawOrigin::Signed(caller.clone()), 2, true)
+	set_mint_permission {
+		let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+		let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+		let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+		let mode: CollectionMode = CollectionMode::NFT;
+		let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+		Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+	}: set_mint_permission(RawOrigin::Signed(caller.clone()), 2, true)
 
-    change_collection_owner {
-        let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
-        let mode: CollectionMode = CollectionMode::NFT;
-        let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
-        Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
-        let new_owner: T::AccountId = account("admin", 0, SEED);
-    }: change_collection_owner(RawOrigin::Signed(caller.clone()), 2, new_owner)
+	change_collection_owner {
+		let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+		let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+		let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+		let mode: CollectionMode = CollectionMode::NFT;
+		let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+		Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+		let new_owner: T::AccountId = account("admin", 0, SEED);
+	}: change_collection_owner(RawOrigin::Signed(caller.clone()), 2, new_owner)
 
-    add_collection_admin {
-        let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
-        let mode: CollectionMode = CollectionMode::NFT;
-        let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
-        Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
-        let new_admin: T::AccountId = account("admin", 0, SEED);
-    }: add_collection_admin(RawOrigin::Signed(caller.clone()), 2, new_admin)
+	add_collection_admin {
+		let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+		let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+		let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+		let mode: CollectionMode = CollectionMode::NFT;
+		let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+		Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+		let new_admin: T::AccountId = account("admin", 0, SEED);
+	}: add_collection_admin(RawOrigin::Signed(caller.clone()), 2, new_admin)
 
-    remove_collection_admin {
-        let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
-        let mode: CollectionMode = CollectionMode::NFT;
-        let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
-        Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
-        let new_admin: T::AccountId = account("admin", 0, SEED);
-        Nft::<T>::add_collection_admin(RawOrigin::Signed(caller.clone()).into(), 2, new_admin.clone())?;
-    }: remove_collection_admin(RawOrigin::Signed(caller.clone()), 2, new_admin)
+	remove_collection_admin {
+		let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+		let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+		let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+		let mode: CollectionMode = CollectionMode::NFT;
+		let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+		Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+		let new_admin: T::AccountId = account("admin", 0, SEED);
+		Nft::<T>::add_collection_admin(RawOrigin::Signed(caller.clone()).into(), 2, new_admin.clone())?;
+	}: remove_collection_admin(RawOrigin::Signed(caller.clone()), 2, new_admin)
 
-    set_collection_sponsor {
-        let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
-        let mode: CollectionMode = CollectionMode::NFT;
-        let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
-        Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
-    }: set_collection_sponsor(RawOrigin::Signed(caller.clone()), 2, caller.clone())
+	set_collection_sponsor {
+		let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+		let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+		let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+		let mode: CollectionMode = CollectionMode::NFT;
+		let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+		Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+	}: set_collection_sponsor(RawOrigin::Signed(caller.clone()), 2, caller.clone())
 
-    confirm_sponsorship {
-        let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
-        let mode: CollectionMode = CollectionMode::NFT;
-        let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
-        Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
-        Nft::<T>::set_collection_sponsor(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone())?;
-    }: confirm_sponsorship(RawOrigin::Signed(caller.clone()), 2)
+	confirm_sponsorship {
+		let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+		let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+		let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+		let mode: CollectionMode = CollectionMode::NFT;
+		let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+		Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+		Nft::<T>::set_collection_sponsor(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone())?;
+	}: confirm_sponsorship(RawOrigin::Signed(caller.clone()), 2)
 
-    remove_collection_sponsor {
-        let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
-        let mode: CollectionMode = CollectionMode::NFT;
-        let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
-        Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
-        Nft::<T>::set_collection_sponsor(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone())?;
-        Nft::<T>::confirm_sponsorship(RawOrigin::Signed(caller.clone()).into(), 2)?;
-    }: remove_collection_sponsor(RawOrigin::Signed(caller.clone()), 2)
+	remove_collection_sponsor {
+		let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+		let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+		let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+		let mode: CollectionMode = CollectionMode::NFT;
+		let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+		Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+		Nft::<T>::set_collection_sponsor(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone())?;
+		Nft::<T>::confirm_sponsorship(RawOrigin::Signed(caller.clone()).into(), 2)?;
+	}: remove_collection_sponsor(RawOrigin::Signed(caller.clone()), 2)
 
-    // nft item
-    create_item_nft {
-        let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
-        let mode: CollectionMode = CollectionMode::NFT;
-        let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
-        Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
-        let data = default_nft_data();
-        
-    }: create_item(RawOrigin::Signed(caller.clone()), 2, caller.clone(), data)
+	// nft item
+	create_item_nft {
+		let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+		let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+		let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+		let mode: CollectionMode = CollectionMode::NFT;
+		let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+		Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+		let data = default_nft_data();
 
-    #[extra]
-    create_item_nft_large {
-        let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
-        let mode: CollectionMode = CollectionMode::NFT;
-        let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
-        let mut nft_data = CreateNftData {
-            const_data: vec![],
-            variable_data: vec![]
-        };
-        for i in 0..1998 {
-            nft_data.const_data.push(10);
-            nft_data.variable_data.push(10);
-        }
-        let data = CreateItemData::NFT(nft_data);
-        Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+	}: create_item(RawOrigin::Signed(caller.clone()), 2, caller.clone(), data)
+
+	#[extra]
+	create_item_nft_large {
+		let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+		let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+		let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+		let mode: CollectionMode = CollectionMode::NFT;
+		let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+		let mut nft_data = CreateNftData {
+			const_data: vec![],
+			variable_data: vec![]
+		};
+		for i in 0..1998 {
+			nft_data.const_data.push(10);
+			nft_data.variable_data.push(10);
+		}
+		let data = CreateItemData::NFT(nft_data);
+		Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+
+	}: create_item(RawOrigin::Signed(caller.clone()), 2, caller.clone(), data)
 
-    }: create_item(RawOrigin::Signed(caller.clone()), 2, caller.clone(), data)
+	// fungible item
+	create_item_fungible {
+		let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+		let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+		let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+		let mode: CollectionMode = CollectionMode::Fungible(3);
+		let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+		Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+		let data = default_fungible_data();
+
+	}: create_item(RawOrigin::Signed(caller.clone()), 2, caller.clone(), data)
+
+	// refungible item
+	create_item_refungible {
+		let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+		let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+		let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+		let mode: CollectionMode = CollectionMode::ReFungible(3);
+		let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+		Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+		let data = default_re_fungible_data();
 
-    // fungible item
-    create_item_fungible {
-        let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
-        let mode: CollectionMode = CollectionMode::Fungible(3);
-        let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
-        Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
-        let data = default_fungible_data();
+	}: create_item(RawOrigin::Signed(caller.clone()), 2, caller.clone(), data)
 
-    }: create_item(RawOrigin::Signed(caller.clone()), 2, caller.clone(), data)
+	burn_item {
+		let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+		let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+		let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+		let mode: CollectionMode = CollectionMode::NFT;
+		let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+		Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+		let data = default_nft_data();
+		Nft::<T>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone(), data)?;
 
-    // refungible item
-    create_item_refungible {
-        let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
-        let mode: CollectionMode = CollectionMode::ReFungible(3);
-        let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
-        Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
-        let data = default_re_fungible_data();
+	}: burn_item(RawOrigin::Signed(caller.clone()), 2, 1)
 
-    }: create_item(RawOrigin::Signed(caller.clone()), 2, caller.clone(), data)
+	transfer_nft {
+		let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+		let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+		let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+		let mode: CollectionMode = CollectionMode::NFT;
+		let recipient: T::AccountId = account("recipient", 0, SEED);
+		let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+		Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+		let data = default_nft_data();
+		Nft::<T>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone(), data)?;
 
-    burn_item {
-        let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
-        let mode: CollectionMode = CollectionMode::NFT;
-        let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
-        Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
-        let data = default_nft_data();
-        Nft::<T>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone(), data)?;
+	}: transfer(RawOrigin::Signed(caller.clone()), recipient.clone(), 2, 1, 1)
 
-    }: burn_item(RawOrigin::Signed(caller.clone()), 2, 1)
+	transfer_fungible {
+		let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+		let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+		let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+		let mode: CollectionMode = CollectionMode::Fungible(3);
+		let recipient: T::AccountId = account("recipient", 0, SEED);
+		let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+		Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+		let data = default_fungible_data();
+		Nft::<T>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone(), data)?;
 
-    transfer_nft {
-        let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
-        let mode: CollectionMode = CollectionMode::NFT;
-        let recipient: T::AccountId = account("recipient", 0, SEED);
-        let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
-        Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
-        let data = default_nft_data();
-        Nft::<T>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone(), data)?;
+	}: transfer(RawOrigin::Signed(caller.clone()), recipient.clone(), 2, 1, 1)
 
-    }: transfer(RawOrigin::Signed(caller.clone()), recipient.clone(), 2, 1, 1)
-    
-    transfer_fungible {
-        let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
-        let mode: CollectionMode = CollectionMode::Fungible(3);
-        let recipient: T::AccountId = account("recipient", 0, SEED);
-        let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
-        Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
-        let data = default_fungible_data();
-        Nft::<T>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone(), data)?;
+	transfer_refungible {
+		let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+		let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+		let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+		let mode: CollectionMode = CollectionMode::ReFungible(3);
+		let recipient: T::AccountId = account("recipient", 0, SEED);
+		let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+		Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+		let data = default_re_fungible_data();
+		Nft::<T>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone(), data)?;
 
-    }: transfer(RawOrigin::Signed(caller.clone()), recipient.clone(), 2, 1, 1)
+	}: transfer(RawOrigin::Signed(caller.clone()), recipient.clone(), 2, 1, 1)
 
-    transfer_refungible {
-        let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
-        let mode: CollectionMode = CollectionMode::ReFungible(3);
-        let recipient: T::AccountId = account("recipient", 0, SEED);
-        let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
-        Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
-        let data = default_re_fungible_data();
-        Nft::<T>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone(), data)?;
+	approve {
+		let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+		let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+		let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+		let mode: CollectionMode = CollectionMode::ReFungible(3);
+		let recipient: T::AccountId = account("recipient", 0, SEED);
+		let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+		Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+		let data = default_re_fungible_data();
+		Nft::<T>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone(), data)?;
 
-    }: transfer(RawOrigin::Signed(caller.clone()), recipient.clone(), 2, 1, 1)
+	}: approve(RawOrigin::Signed(caller.clone()), recipient.clone(), 2, 1)
 
-    approve {
-        let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
-        let mode: CollectionMode = CollectionMode::ReFungible(3);
-        let recipient: T::AccountId = account("recipient", 0, SEED);
-        let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
-        Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
-        let data = default_re_fungible_data();
-        Nft::<T>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone(), data)?;
+	// Nft
+	transfer_from_nft {
+		let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+		let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+		let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+		let mode: CollectionMode = CollectionMode::NFT;
+		let recipient: T::AccountId = account("recipient", 0, SEED);
+		let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+		Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+		let data = default_nft_data();
+		Nft::<T>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone(), data)?;
+		Nft::<T>::approve(RawOrigin::Signed(caller.clone()).into(), recipient.clone(), 2, 1)?;
 
-    }: approve(RawOrigin::Signed(caller.clone()), recipient.clone(), 2, 1)
+	}: transfer_from(RawOrigin::Signed(caller.clone()), caller.clone(), recipient.clone(), 2, 1, 1)
 
-    // Nft
-    transfer_from_nft {
-        let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
-        let mode: CollectionMode = CollectionMode::NFT;
-        let recipient: T::AccountId = account("recipient", 0, SEED);
-        let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
-        Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
-        let data = default_nft_data();
-        Nft::<T>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone(), data)?;
-        Nft::<T>::approve(RawOrigin::Signed(caller.clone()).into(), recipient.clone(), 2, 1)?;
+	// Fungible
+	transfer_from_fungible {
+		let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+		let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+		let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+		let mode: CollectionMode = CollectionMode::Fungible(3);
+		let recipient: T::AccountId = account("recipient", 0, SEED);
+		let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+		Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+		let data = default_fungible_data();
+		Nft::<T>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone(), data)?;
+		Nft::<T>::approve(RawOrigin::Signed(caller.clone()).into(), recipient.clone(), 2, 1)?;
 
-    }: transfer_from(RawOrigin::Signed(caller.clone()), caller.clone(), recipient.clone(), 2, 1, 1)
+	}: transfer_from(RawOrigin::Signed(caller.clone()), caller.clone(), recipient.clone(), 2, 1, 1)
 
-    // Fungible
-    transfer_from_fungible {
-        let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
-        let mode: CollectionMode = CollectionMode::Fungible(3);
-        let recipient: T::AccountId = account("recipient", 0, SEED);
-        let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
-        Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
-        let data = default_fungible_data();
-        Nft::<T>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone(), data)?;
-        Nft::<T>::approve(RawOrigin::Signed(caller.clone()).into(), recipient.clone(), 2, 1)?;
+	// ReFungible
+	transfer_from_refungible {
+		let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+		let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+		let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+		let mode: CollectionMode = CollectionMode::ReFungible(3);
+		let recipient: T::AccountId = account("recipient", 0, SEED);
+		let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+		Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+		let data = default_re_fungible_data();
+		Nft::<T>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone(), data)?;
+		Nft::<T>::approve(RawOrigin::Signed(caller.clone()).into(), recipient.clone(), 2, 1)?;
 
-    }: transfer_from(RawOrigin::Signed(caller.clone()), caller.clone(), recipient.clone(), 2, 1, 1)
+	}: transfer_from(RawOrigin::Signed(caller.clone()), caller.clone(), recipient.clone(), 2, 1, 1)
 
-    // ReFungible
-    transfer_from_refungible {
-        let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
-        let mode: CollectionMode = CollectionMode::ReFungible(3);
-        let recipient: T::AccountId = account("recipient", 0, SEED);
-        let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
-        Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
-        let data = default_re_fungible_data();
-        Nft::<T>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone(), data)?;
-        Nft::<T>::approve(RawOrigin::Signed(caller.clone()).into(), recipient.clone(), 2, 1)?;
+	enable_contract_sponsoring {
+		let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
 
-    }: transfer_from(RawOrigin::Signed(caller.clone()), caller.clone(), recipient.clone(), 2, 1, 1)
+	}: enable_contract_sponsoring(RawOrigin::Signed(caller.clone()), caller.clone(), true)
 
-    enable_contract_sponsoring {
-        let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+	set_offchain_schema {
+		let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+		let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+		let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+		let mode: CollectionMode = CollectionMode::ReFungible(3);
+		let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+		Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
 
-    }: enable_contract_sponsoring(RawOrigin::Signed(caller.clone()), caller.clone(), true)
+	}: set_offchain_schema(RawOrigin::Signed(caller.clone()), 2, [1,2,3].to_vec())
 
-    set_offchain_schema {
-        let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
-        let mode: CollectionMode = CollectionMode::ReFungible(3);
-        let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
-        Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+	set_const_on_chain_schema {
+		let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+		let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+		let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+		let mode: CollectionMode = CollectionMode::ReFungible(3);
+		let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+		Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+	}: set_const_on_chain_schema(RawOrigin::Signed(caller.clone()), 2, [1,2,3].to_vec())
 
-    }: set_offchain_schema(RawOrigin::Signed(caller.clone()), 2, [1,2,3].to_vec())
+	set_variable_on_chain_schema {
+		let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+		let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+		let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+		let mode: CollectionMode = CollectionMode::ReFungible(3);
+		let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+		Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+	}: set_variable_on_chain_schema(RawOrigin::Signed(caller.clone()), 2, [1,2,3].to_vec())
 
-    set_const_on_chain_schema {
-        let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
-        let mode: CollectionMode = CollectionMode::ReFungible(3);
-        let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
-        Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
-    }: set_const_on_chain_schema(RawOrigin::Signed(caller.clone()), 2, [1,2,3].to_vec())
-    
-    set_variable_on_chain_schema {
-        let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
-        let mode: CollectionMode = CollectionMode::ReFungible(3);
-        let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
-        Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
-    }: set_variable_on_chain_schema(RawOrigin::Signed(caller.clone()), 2, [1,2,3].to_vec())
+	set_variable_meta_data {
+		let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+		let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+		let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+		let mode: CollectionMode = CollectionMode::NFT;
+		let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+		Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+		let data = default_nft_data();
+		Nft::<T>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone(), data)?;
 
-    set_variable_meta_data {
-        let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
-        let mode: CollectionMode = CollectionMode::NFT;
-        let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
-        Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
-        let data = default_nft_data();
-        Nft::<T>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone(), data)?;
+	}: set_variable_meta_data(RawOrigin::Signed(caller.clone()), 2, 1, [1, 2, 3].to_vec())
 
-    }: set_variable_meta_data(RawOrigin::Signed(caller.clone()), 2, 1, [1, 2, 3].to_vec())
+	set_schema_version {
+		let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+		let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+		let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+		let mode: CollectionMode = CollectionMode::NFT;
+		let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+		Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+	}: set_schema_version(RawOrigin::Signed(caller.clone()), 2, SchemaVersion::Unique)
 
-    set_schema_version {
-        let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
-        let mode: CollectionMode = CollectionMode::NFT;
-        let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
-        Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
-    }: set_schema_version(RawOrigin::Signed(caller.clone()), 2, SchemaVersion::Unique)
+	set_chain_limits {
+		let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+		let limits = ChainLimits {
+			collection_numbers_limit: 0,
+			account_token_ownership_limit: 0,
+			collections_admins_limit: 0,
+			custom_data_limit: 0,
+			nft_sponsor_transfer_timeout: 0,
+			fungible_sponsor_transfer_timeout: 0,
+			refungible_sponsor_transfer_timeout: 0
+		};
+	}: set_chain_limits(RawOrigin::Signed(caller.clone()), limits)
 
-    set_chain_limits {
-        let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
-        let limits = ChainLimits { 
-            collection_numbers_limit: 0,
-            account_token_ownership_limit: 0,
-            collections_admins_limit: 0,
-            custom_data_limit: 0,
-            nft_sponsor_transfer_timeout: 0,
-            fungible_sponsor_transfer_timeout: 0,
-            refungible_sponsor_transfer_timeout: 0
-        };
-    }: set_chain_limits(RawOrigin::Signed(caller.clone()), limits)
+	set_contract_sponsoring_rate_limit {
+		let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+		let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+		let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+		let mode: CollectionMode = CollectionMode::NFT;
+		let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+		Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+		let block_number: T::BlockNumber = 0.into();
+	}: set_contract_sponsoring_rate_limit(RawOrigin::Signed(caller.clone()), caller.clone(), block_number)
 
-    set_contract_sponsoring_rate_limit {
-        let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
-        let mode: CollectionMode = CollectionMode::NFT;
-        let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
-        Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
-        let block_number: T::BlockNumber = 0.into();   
-    }: set_contract_sponsoring_rate_limit(RawOrigin::Signed(caller.clone()), caller.clone(), block_number)
+	set_collection_limits{
+		let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+		let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+		let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+		let mode: CollectionMode = CollectionMode::NFT;
+		let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+		Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
 
-    set_collection_limits{
-        let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
-        let mode: CollectionMode = CollectionMode::NFT;
-        let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
-        Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
-    
-        let cl = CollectionLimits {
-            account_token_ownership_limit: 0,
-            sponsored_data_size: 0,
-            token_limit: 0,
-            sponsor_transfer_timeout: 0
-        };
+		let cl = CollectionLimits {
+			account_token_ownership_limit: 0,
+			sponsored_data_size: 0,
+			token_limit: 0,
+			sponsor_transfer_timeout: 0
+		};
 
-    }: set_collection_limits(RawOrigin::Signed(caller.clone()), 2, cl)
+	}: set_collection_limits(RawOrigin::Signed(caller.clone()), 2, cl)
 
-    add_to_contract_white_list{
-        let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
-    }: add_to_contract_white_list(RawOrigin::Signed(caller.clone()), caller.clone(), caller.clone())
+	add_to_contract_white_list{
+		let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+	}: add_to_contract_white_list(RawOrigin::Signed(caller.clone()), caller.clone(), caller.clone())
 
-    remove_from_contract_white_list{
-        let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
-        Nft::<T>::add_to_contract_white_list(RawOrigin::Signed(caller.clone()).into(), caller.clone(), caller.clone())?;
-    }: remove_from_contract_white_list(RawOrigin::Signed(caller.clone()), caller.clone(), caller.clone())
+	remove_from_contract_white_list{
+		let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+		Nft::<T>::add_to_contract_white_list(RawOrigin::Signed(caller.clone()).into(), caller.clone(), caller.clone())?;
+	}: remove_from_contract_white_list(RawOrigin::Signed(caller.clone()), caller.clone(), caller.clone())
 
-    toggle_contract_white_list{
-        let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
-    }: toggle_contract_white_list(RawOrigin::Signed(caller.clone()), caller.clone(), true)
+	toggle_contract_white_list{
+		let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+	}: toggle_contract_white_list(RawOrigin::Signed(caller.clone()), caller.clone(), true)
 */
 }
modifiedpallets/nft/src/default_weights.rsdiffbeforeafterboth
--- a/pallets/nft/src/default_weights.rs
+++ b/pallets/nft/src/default_weights.rs
@@ -2,154 +2,154 @@
 
 impl crate::WeightInfo for () {
 	fn create_collection() -> Weight {
-		(70_000_000 as Weight)
-			.saturating_add(DbWeight::get().reads(7 as Weight))
-			.saturating_add(DbWeight::get().writes(5 as Weight))
+		70_000_000_u64
+			.saturating_add(DbWeight::get().reads(7_u64))
+			.saturating_add(DbWeight::get().writes(5_u64))
 	}
 	fn destroy_collection() -> Weight {
-		(90_000_000 as Weight)
-			.saturating_add(DbWeight::get().reads(2 as Weight))
-			.saturating_add(DbWeight::get().writes(5 as Weight))
+		90_000_000_u64
+			.saturating_add(DbWeight::get().reads(2_u64))
+			.saturating_add(DbWeight::get().writes(5_u64))
 	}
 	fn add_to_white_list() -> Weight {
-		(30_000_000 as Weight)
-			.saturating_add(DbWeight::get().reads(3 as Weight))
-			.saturating_add(DbWeight::get().writes(1 as Weight))
-    }
-    fn remove_from_white_list() -> Weight {
-		(35_000_000 as Weight)
-			.saturating_add(DbWeight::get().reads(3 as Weight))
-			.saturating_add(DbWeight::get().writes(1 as Weight))
+		30_000_000_u64
+			.saturating_add(DbWeight::get().reads(3_u64))
+			.saturating_add(DbWeight::get().writes(1_u64))
+	}
+	fn remove_from_white_list() -> Weight {
+		35_000_000_u64
+			.saturating_add(DbWeight::get().reads(3_u64))
+			.saturating_add(DbWeight::get().writes(1_u64))
 	}
 	fn set_public_access_mode() -> Weight {
-		(27_000_000 as Weight)
-			.saturating_add(DbWeight::get().reads(1 as Weight))
-			.saturating_add(DbWeight::get().writes(1 as Weight))
+		27_000_000_u64
+			.saturating_add(DbWeight::get().reads(1_u64))
+			.saturating_add(DbWeight::get().writes(1_u64))
 	}
 	fn set_mint_permission() -> Weight {
-		(27_000_000 as Weight)
-			.saturating_add(DbWeight::get().reads(1 as Weight))
-			.saturating_add(DbWeight::get().writes(1 as Weight))
+		27_000_000_u64
+			.saturating_add(DbWeight::get().reads(1_u64))
+			.saturating_add(DbWeight::get().writes(1_u64))
 	}
 	fn change_collection_owner() -> Weight {
-		(27_000_000 as Weight)
-			.saturating_add(DbWeight::get().reads(1 as Weight))
-			.saturating_add(DbWeight::get().writes(1 as Weight))
+		27_000_000_u64
+			.saturating_add(DbWeight::get().reads(1_u64))
+			.saturating_add(DbWeight::get().writes(1_u64))
 	}
 	fn add_collection_admin() -> Weight {
-        (32_000_000 as Weight)
-            .saturating_add(DbWeight::get().reads(3 as Weight))
-            .saturating_add(DbWeight::get().writes(1 as Weight))
+		32_000_000_u64
+			.saturating_add(DbWeight::get().reads(3_u64))
+			.saturating_add(DbWeight::get().writes(1_u64))
 	}
 	fn remove_collection_admin() -> Weight {
-		(50_000_000 as Weight)
-            .saturating_add(DbWeight::get().reads(2 as Weight))
-            .saturating_add(DbWeight::get().writes(1 as Weight))
-    }
-    fn set_collection_sponsor() -> Weight {
-		(32_000_000 as Weight)
-            .saturating_add(DbWeight::get().reads(2 as Weight))
-            .saturating_add(DbWeight::get().writes(1 as Weight))
-    }  
-    fn confirm_sponsorship() -> Weight {
-		(22_000_000 as Weight)
-            .saturating_add(DbWeight::get().reads(1 as Weight))
-            .saturating_add(DbWeight::get().writes(1 as Weight))
-    }  
-    fn remove_collection_sponsor() -> Weight {
-		(24_000_000 as Weight)
-            .saturating_add(DbWeight::get().reads(1 as Weight))
-            .saturating_add(DbWeight::get().writes(1 as Weight))
-    }  
-    fn create_item(s: usize, ) -> Weight {
-        (130_000_000 as Weight)
-            .saturating_add((2135 as Weight).saturating_mul(s as Weight).saturating_mul(500 as Weight)) // 500 is temporary multiplier, fee for storage
-            .saturating_add(DbWeight::get().reads(10 as Weight))
-            .saturating_add(DbWeight::get().writes(8 as Weight))
-    }  
-    fn burn_item() -> Weight {
-		(170_000_000 as Weight)
-            .saturating_add(DbWeight::get().reads(9 as Weight))
-            .saturating_add(DbWeight::get().writes(7 as Weight))
-    }  
-    fn transfer() -> Weight {
-        (125_000_000 as Weight)
-            .saturating_add(DbWeight::get().reads(7 as Weight))
-            .saturating_add(DbWeight::get().writes(7 as Weight))
-    }  
-    fn approve() -> Weight {
-        (45_000_000 as Weight)
-            .saturating_add(DbWeight::get().reads(3 as Weight))
-            .saturating_add(DbWeight::get().writes(1 as Weight))
-    }
-    fn transfer_from() -> Weight {
-        (150_000_000 as Weight)
-            .saturating_add(DbWeight::get().reads(9 as Weight))
-            .saturating_add(DbWeight::get().writes(8 as Weight))
-    }
-    fn set_offchain_schema() -> Weight {
-        (33_000_000 as Weight)
-            .saturating_add(DbWeight::get().reads(2 as Weight))
-            .saturating_add(DbWeight::get().writes(1 as Weight))
-    }
-    fn set_const_on_chain_schema() -> Weight {
-        (11_100_000 as Weight)
-            .saturating_add(DbWeight::get().reads(2 as Weight))
-            .saturating_add(DbWeight::get().writes(1 as Weight))
-    }
-    fn set_variable_on_chain_schema() -> Weight {
-        (11_100_000 as Weight)
-            .saturating_add(DbWeight::get().reads(2 as Weight))
-            .saturating_add(DbWeight::get().writes(1 as Weight))
-    }
-    fn set_variable_meta_data() -> Weight {
-        (17_500_000 as Weight)
-            .saturating_add(DbWeight::get().reads(2 as Weight))
-            .saturating_add(DbWeight::get().writes(1 as Weight))
-    }
-    fn enable_contract_sponsoring() -> Weight {
-        (13_000_000 as Weight)
-            .saturating_add(DbWeight::get().reads(1 as Weight))
-            .saturating_add(DbWeight::get().writes(1 as Weight))
-    }
-    fn set_schema_version() -> Weight {
-        (8_500_000 as Weight)
-            .saturating_add(DbWeight::get().reads(2 as Weight))
-            .saturating_add(DbWeight::get().writes(1 as Weight))
-    }
-    fn set_chain_limits() -> Weight {
-        (1_300_000 as Weight)
-            .saturating_add(DbWeight::get().reads(0 as Weight))
-            .saturating_add(DbWeight::get().writes(1 as Weight))
-    }
-    fn set_contract_sponsoring_rate_limit() -> Weight {
-        (3_500_000 as Weight)
-            .saturating_add(DbWeight::get().reads(0 as Weight))
-            .saturating_add(DbWeight::get().writes(2 as Weight))
-    }    
-    fn set_variable_meta_data_sponsoring_rate_limit() -> Weight {
-        (3_500_000 as Weight)
-            .saturating_add(DbWeight::get().reads(2 as Weight))
-            .saturating_add(DbWeight::get().writes(1 as Weight))
-    }
-    fn toggle_contract_white_list() -> Weight {
-        (3_000_000 as Weight)
-            .saturating_add(DbWeight::get().reads(0 as Weight))
-            .saturating_add(DbWeight::get().writes(2 as Weight))
-    }    
-    fn add_to_contract_white_list() -> Weight {
-        (3_000_000 as Weight)
-            .saturating_add(DbWeight::get().reads(0 as Weight))
-            .saturating_add(DbWeight::get().writes(2 as Weight))
-    }    
-    fn remove_from_contract_white_list() -> Weight {
-        (3_200_000 as Weight)
-            .saturating_add(DbWeight::get().reads(0 as Weight))
-            .saturating_add(DbWeight::get().writes(2 as Weight))
-    }
-    fn set_collection_limits() -> Weight {
-        (8_900_000 as Weight)
-            .saturating_add(DbWeight::get().reads(2 as Weight))
-            .saturating_add(DbWeight::get().writes(1 as Weight))
-    }
+		50_000_000_u64
+			.saturating_add(DbWeight::get().reads(2_u64))
+			.saturating_add(DbWeight::get().writes(1_u64))
+	}
+	fn set_collection_sponsor() -> Weight {
+		32_000_000_u64
+			.saturating_add(DbWeight::get().reads(2_u64))
+			.saturating_add(DbWeight::get().writes(1_u64))
+	}
+	fn confirm_sponsorship() -> Weight {
+		22_000_000_u64
+			.saturating_add(DbWeight::get().reads(1_u64))
+			.saturating_add(DbWeight::get().writes(1_u64))
+	}
+	fn remove_collection_sponsor() -> Weight {
+		24_000_000_u64
+			.saturating_add(DbWeight::get().reads(1_u64))
+			.saturating_add(DbWeight::get().writes(1_u64))
+	}
+	fn create_item(s: usize) -> Weight {
+		130_000_000_u64
+			.saturating_add(2135_u64.saturating_mul(s as Weight).saturating_mul(500_u64)) // 500 is temporary multiplier, fee for storage
+			.saturating_add(DbWeight::get().reads(10_u64))
+			.saturating_add(DbWeight::get().writes(8_u64))
+	}
+	fn burn_item() -> Weight {
+		170_000_000_u64
+			.saturating_add(DbWeight::get().reads(9_u64))
+			.saturating_add(DbWeight::get().writes(7_u64))
+	}
+	fn transfer() -> Weight {
+		125_000_000_u64
+			.saturating_add(DbWeight::get().reads(7_u64))
+			.saturating_add(DbWeight::get().writes(7_u64))
+	}
+	fn approve() -> Weight {
+		45_000_000_u64
+			.saturating_add(DbWeight::get().reads(3_u64))
+			.saturating_add(DbWeight::get().writes(1_u64))
+	}
+	fn transfer_from() -> Weight {
+		150_000_000_u64
+			.saturating_add(DbWeight::get().reads(9_u64))
+			.saturating_add(DbWeight::get().writes(8_u64))
+	}
+	fn set_offchain_schema() -> Weight {
+		33_000_000_u64
+			.saturating_add(DbWeight::get().reads(2_u64))
+			.saturating_add(DbWeight::get().writes(1_u64))
+	}
+	fn set_const_on_chain_schema() -> Weight {
+		11_100_000_u64
+			.saturating_add(DbWeight::get().reads(2_u64))
+			.saturating_add(DbWeight::get().writes(1_u64))
+	}
+	fn set_variable_on_chain_schema() -> Weight {
+		11_100_000_u64
+			.saturating_add(DbWeight::get().reads(2_u64))
+			.saturating_add(DbWeight::get().writes(1_u64))
+	}
+	fn set_variable_meta_data() -> Weight {
+		17_500_000_u64
+			.saturating_add(DbWeight::get().reads(2_u64))
+			.saturating_add(DbWeight::get().writes(1_u64))
+	}
+	fn enable_contract_sponsoring() -> Weight {
+		13_000_000_u64
+			.saturating_add(DbWeight::get().reads(1_u64))
+			.saturating_add(DbWeight::get().writes(1_u64))
+	}
+	fn set_schema_version() -> Weight {
+		8_500_000_u64
+			.saturating_add(DbWeight::get().reads(2_u64))
+			.saturating_add(DbWeight::get().writes(1_u64))
+	}
+	fn set_chain_limits() -> Weight {
+		1_300_000_u64
+			.saturating_add(DbWeight::get().reads(0_u64))
+			.saturating_add(DbWeight::get().writes(1_u64))
+	}
+	fn set_contract_sponsoring_rate_limit() -> Weight {
+		3_500_000_u64
+			.saturating_add(DbWeight::get().reads(0_u64))
+			.saturating_add(DbWeight::get().writes(2_u64))
+	}
+	fn set_variable_meta_data_sponsoring_rate_limit() -> Weight {
+		3_500_000_u64
+			.saturating_add(DbWeight::get().reads(2_u64))
+			.saturating_add(DbWeight::get().writes(1_u64))
+	}
+	fn toggle_contract_white_list() -> Weight {
+		3_000_000_u64
+			.saturating_add(DbWeight::get().reads(0_u64))
+			.saturating_add(DbWeight::get().writes(2_u64))
+	}
+	fn add_to_contract_white_list() -> Weight {
+		3_000_000_u64
+			.saturating_add(DbWeight::get().reads(0_u64))
+			.saturating_add(DbWeight::get().writes(2_u64))
+	}
+	fn remove_from_contract_white_list() -> Weight {
+		3_200_000_u64
+			.saturating_add(DbWeight::get().reads(0_u64))
+			.saturating_add(DbWeight::get().writes(2_u64))
+	}
+	fn set_collection_limits() -> Weight {
+		8_900_000_u64
+			.saturating_add(DbWeight::get().reads(2_u64))
+			.saturating_add(DbWeight::get().writes(1_u64))
+	}
 }
modifiedpallets/nft/src/eth/account.rsdiffbeforeafterboth
--- a/pallets/nft/src/eth/account.rs
+++ b/pallets/nft/src/eth/account.rs
@@ -8,128 +8,129 @@
 use sp_std::vec::Vec;
 use sp_std::clone::Clone;
 
-pub trait CrossAccountId<AccountId>: 
-    Encode + EncodeLike + Decode + 
-    Clone + PartialEq + Ord + core::fmt::Debug // + 
-    // Serialize + Deserialize<'static> 
+pub trait CrossAccountId<AccountId>:
+	Encode + EncodeLike + Decode + Clone + PartialEq + Ord + core::fmt::Debug
+// +
+// Serialize + Deserialize<'static>
 {
-    fn as_sub(&self) -> &AccountId;
-    fn as_eth(&self) -> &H160;
+	fn as_sub(&self) -> &AccountId;
+	fn as_eth(&self) -> &H160;
 
-    fn from_sub(account: AccountId) -> Self;
-    fn from_eth(account: H160) -> Self;
+	fn from_sub(account: AccountId) -> Self;
+	fn from_eth(account: H160) -> Self;
 }
 
-#[derive(Eq)]
-#[derive(Serialize, Deserialize)]
+#[derive(Eq, Serialize, Deserialize)]
 pub struct BasicCrossAccountId<T: Config> {
-    /// If true - then ethereum is canonical encoding
-    from_ethereum: bool,
-    substrate: T::AccountId,
-    ethereum: H160,
+	/// If true - then ethereum is canonical encoding
+	from_ethereum: bool,
+	substrate: T::AccountId,
+	ethereum: H160,
 }
 
 impl<T: Config> core::fmt::Debug for BasicCrossAccountId<T> {
-    fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
-        if self.from_ethereum {
-            fmt.debug_tuple("CrossAccountId::Ethereum")
-                .field(&self.ethereum)
-                .finish()
-        } else {
-            fmt.debug_tuple("CrossAccountId::Substrate")
-                .field(&self.substrate)
-                .finish()
-        }
-    }
+	fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
+		if self.from_ethereum {
+			fmt.debug_tuple("CrossAccountId::Ethereum")
+				.field(&self.ethereum)
+				.finish()
+		} else {
+			fmt.debug_tuple("CrossAccountId::Substrate")
+				.field(&self.substrate)
+				.finish()
+		}
+	}
 }
 
 impl<T: Config> PartialOrd for BasicCrossAccountId<T> {
-    fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
-        Some(self.substrate.cmp(&other.substrate))
-    }
+	fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
+		Some(self.substrate.cmp(&other.substrate))
+	}
 }
 
 impl<T: Config> Ord for BasicCrossAccountId<T> {
-    fn cmp(&self, other: &Self) -> Ordering {
-        self.partial_cmp(other).expect("substrate account is total ordered")
-    }
+	fn cmp(&self, other: &Self) -> Ordering {
+		self.partial_cmp(other)
+			.expect("substrate account is total ordered")
+	}
 }
 
 impl<T: Config> PartialEq for BasicCrossAccountId<T> {
-    fn eq(&self, other: &Self) -> bool {
-        if self.from_ethereum == other.from_ethereum {
-            self.substrate == other.substrate && self.ethereum == other.ethereum
-        } else if self.from_ethereum {
-            // ethereum is canonical encoding, but we need to compare derived address
-            self.substrate == other.substrate
-        } else {
-            self.ethereum == other.ethereum
-        }
-    }
+	fn eq(&self, other: &Self) -> bool {
+		if self.from_ethereum == other.from_ethereum {
+			self.substrate == other.substrate && self.ethereum == other.ethereum
+		} else if self.from_ethereum {
+			// ethereum is canonical encoding, but we need to compare derived address
+			self.substrate == other.substrate
+		} else {
+			self.ethereum == other.ethereum
+		}
+	}
 }
 impl<T: Config> Clone for BasicCrossAccountId<T> {
-    fn clone(&self) -> Self {
-        Self {
-            from_ethereum: self.from_ethereum,
-            substrate: self.substrate.clone(),
-            ethereum: self.ethereum,
-        }
-    }
+	fn clone(&self) -> Self {
+		Self {
+			from_ethereum: self.from_ethereum,
+			substrate: self.substrate.clone(),
+			ethereum: self.ethereum,
+		}
+	}
 }
 impl<T: Config> Encode for BasicCrossAccountId<T> {
-    fn encode(&self) -> Vec<u8> {
-        let as_result = if !self.from_ethereum {
-            Ok(self.substrate.clone())
-        } else {
-            Err(self.ethereum)
-        };
-        as_result.encode()
-    }
+	fn encode(&self) -> Vec<u8> {
+		let as_result = if !self.from_ethereum {
+			Ok(self.substrate.clone())
+		} else {
+			Err(self.ethereum)
+		};
+		as_result.encode()
+	}
 }
 impl<T: Config> EncodeLike for BasicCrossAccountId<T> {}
 impl<T: Config> Decode for BasicCrossAccountId<T> {
-    fn decode<I>(input: &mut I) -> Result<Self, codec::Error>
-        where I: codec::Input
-    {
-        Ok(match <Result<T::AccountId, H160>>::decode(input)? {
-            Ok(s) => Self::from_sub(s),
-            Err(e) => Self::from_eth(e),
-        })
-    }
+	fn decode<I>(input: &mut I) -> Result<Self, codec::Error>
+	where
+		I: codec::Input,
+	{
+		Ok(match <Result<T::AccountId, H160>>::decode(input)? {
+			Ok(s) => Self::from_sub(s),
+			Err(e) => Self::from_eth(e),
+		})
+	}
 }
 impl<T: Config> CrossAccountId<T::AccountId> for BasicCrossAccountId<T> {
-    fn as_sub(&self) -> &T::AccountId {
-        &self.substrate
-    }
-    fn as_eth(&self) -> &H160 {
-        &self.ethereum
-    }
-    fn from_sub(substrate: T::AccountId) -> Self {
-        Self {
-            ethereum: T::EvmBackwardsAddressMapping::from_account_id(substrate.clone()),
-            substrate,
-            from_ethereum: false,
-        }
-    }
-    fn from_eth(ethereum: H160) -> Self {
-        Self {
-            ethereum,
-            substrate: T::EvmAddressMapping::into_account_id(ethereum),
-            from_ethereum: true,
-        }
-    }
+	fn as_sub(&self) -> &T::AccountId {
+		&self.substrate
+	}
+	fn as_eth(&self) -> &H160 {
+		&self.ethereum
+	}
+	fn from_sub(substrate: T::AccountId) -> Self {
+		Self {
+			ethereum: T::EvmBackwardsAddressMapping::from_account_id(substrate.clone()),
+			substrate,
+			from_ethereum: false,
+		}
+	}
+	fn from_eth(ethereum: H160) -> Self {
+		Self {
+			ethereum,
+			substrate: T::EvmAddressMapping::into_account_id(ethereum),
+			from_ethereum: true,
+		}
+	}
 }
 
 pub trait EvmBackwardsAddressMapping<AccountId> {
-    fn from_account_id(account_id: AccountId) -> H160;
+	fn from_account_id(account_id: AccountId) -> H160;
 }
 
 /// Should have same mapping as EnsureAddressTruncated
 pub struct MapBackwardsAddressTruncated;
 impl EvmBackwardsAddressMapping<AccountId32> for MapBackwardsAddressTruncated {
-    fn from_account_id(account_id: AccountId32) -> H160 {
-        let mut out = [0; 20];
-        out.copy_from_slice(&(account_id.as_ref() as &[u8])[0..20]);
-        H160(out)
-    }
-}
\ No newline at end of file
+	fn from_account_id(account_id: AccountId32) -> H160 {
+		let mut out = [0; 20];
+		out.copy_from_slice(&(account_id.as_ref() as &[u8])[0..20]);
+		H160(out)
+	}
+}
modifiedpallets/nft/src/eth/erc.rsdiffbeforeafterboth
--- a/pallets/nft/src/eth/erc.rs
+++ b/pallets/nft/src/eth/erc.rs
@@ -3,132 +3,199 @@
 
 #[solidity_interface]
 pub trait InlineNameSymbol {
-    type Error;
+	type Error;
 
-    fn name(&self) -> Result<string, Self::Error>;
-    fn symbol(&self) -> Result<string, Self::Error>;
+	fn name(&self) -> Result<string, Self::Error>;
+	fn symbol(&self) -> Result<string, Self::Error>;
 }
 
 #[solidity_interface]
 pub trait InlineTotalSupply {
-    type Error;
+	type Error;
 
-    fn total_supply(&self) -> Result<uint256, Self::Error>;
+	fn total_supply(&self) -> Result<uint256, Self::Error>;
 }
 
 #[solidity_interface]
 pub trait ERC165 {
-    type Error;
+	type Error;
 
-    fn supports_interface(&self, interface_id: bytes4) -> Result<bool, Self::Error>;
+	fn supports_interface(&self, interface_id: bytes4) -> Result<bool, Self::Error>;
 }
 
 #[solidity_interface(inline_is(InlineNameSymbol))]
 pub trait ERC721Metadata {
-    type Error;
+	type Error;
 
-    #[solidity(rename_selector = "tokenURI")]
-    fn token_uri(&self, token_id: uint256) -> Result<string, Self::Error>;
+	#[solidity(rename_selector = "tokenURI")]
+	fn token_uri(&self, token_id: uint256) -> Result<string, Self::Error>;
 }
 
 #[solidity_interface(inline_is(InlineTotalSupply))]
 pub trait ERC721Enumerable {
-    type Error;
+	type Error;
 
-    fn token_by_index(&self, index: uint256) -> Result<uint256, Self::Error>;
-    fn token_of_owner_by_index(&self, owner: address, index: uint256) -> Result<uint256, Self::Error>;
+	fn token_by_index(&self, index: uint256) -> Result<uint256, Self::Error>;
+	fn token_of_owner_by_index(
+		&self,
+		owner: address,
+		index: uint256,
+	) -> Result<uint256, Self::Error>;
 }
 
-
 #[derive(ToLog)]
 pub enum ERC721Events {
-    Transfer {
-        #[indexed] from: address,
-        #[indexed] to: address,
-        #[indexed] token_id: uint256,
-    },
-    Approval {
-        #[indexed] owner: address,
-        #[indexed] approved: address,
-        #[indexed] token_id: uint256,
-    },
-    #[allow(dead_code)]
-    ApprovalForAll {
-        #[indexed] owner: address,
-        #[indexed] operator: address,
-        approved: bool,
-    }
+	Transfer {
+		#[indexed]
+		from: address,
+		#[indexed]
+		to: address,
+		#[indexed]
+		token_id: uint256,
+	},
+	Approval {
+		#[indexed]
+		owner: address,
+		#[indexed]
+		approved: address,
+		#[indexed]
+		token_id: uint256,
+	},
+	#[allow(dead_code)]
+	ApprovalForAll {
+		#[indexed]
+		owner: address,
+		#[indexed]
+		operator: address,
+		approved: bool,
+	},
 }
 
 #[solidity_interface(is(ERC165), events(ERC721Events))]
 pub trait ERC721 {
-    type Error;
+	type Error;
 
-    fn balance_of(&self, owner: address) -> Result<uint256, Self::Error>;
-    fn owner_of(&self, token_id: uint256) -> Result<address, Self::Error>;
+	fn balance_of(&self, owner: address) -> Result<uint256, Self::Error>;
+	fn owner_of(&self, token_id: uint256) -> Result<address, Self::Error>;
 
-    #[solidity(rename_selector = "safeTransferFrom")]
-    fn safe_transfer_from_with_data(&mut self, from: address, to: address, token_id: uint256, data: bytes, value: value) -> Result<void, Self::Error>;
-    fn safe_transfer_from(&mut self, from: address, to: address, token_id: uint256, value: value) -> Result<void, Self::Error>;
+	#[solidity(rename_selector = "safeTransferFrom")]
+	fn safe_transfer_from_with_data(
+		&mut self,
+		from: address,
+		to: address,
+		token_id: uint256,
+		data: bytes,
+		value: value,
+	) -> Result<void, Self::Error>;
+	fn safe_transfer_from(
+		&mut self,
+		from: address,
+		to: address,
+		token_id: uint256,
+		value: value,
+	) -> Result<void, Self::Error>;
 
-    fn transfer_from(&mut self, caller: caller, from: address, to: address, token_id: uint256, value: value) -> Result<void, Self::Error>;
-    fn approve(&mut self, caller: caller, approved: address, token_id: uint256, value: value) -> Result<void, Self::Error>;
-    fn set_approval_for_all(&mut self, caller: caller, operator: address, approved: bool) -> Result<void, Self::Error>;
+	fn transfer_from(
+		&mut self,
+		caller: caller,
+		from: address,
+		to: address,
+		token_id: uint256,
+		value: value,
+	) -> Result<void, Self::Error>;
+	fn approve(
+		&mut self,
+		caller: caller,
+		approved: address,
+		token_id: uint256,
+		value: value,
+	) -> Result<void, Self::Error>;
+	fn set_approval_for_all(
+		&mut self,
+		caller: caller,
+		operator: address,
+		approved: bool,
+	) -> Result<void, Self::Error>;
 
-    fn get_approved(&self, token_id: uint256) -> Result<address, Self::Error>;
-    fn is_approved_for_all(&self, owner: address, operator: address) -> Result<address, Self::Error>;
+	fn get_approved(&self, token_id: uint256) -> Result<address, Self::Error>;
+	fn is_approved_for_all(
+		&self,
+		owner: address,
+		operator: address,
+	) -> Result<address, Self::Error>;
 }
 
 #[solidity_interface]
 pub trait ERC721UniqueExtensions {
-    type Error;
+	type Error;
 
-    fn transfer(&mut self, caller: caller, to: address, token_id: uint256, value: value) -> Result<void, Self::Error>;
+	fn transfer(
+		&mut self,
+		caller: caller,
+		to: address,
+		token_id: uint256,
+		value: value,
+	) -> Result<void, Self::Error>;
 }
 
-#[solidity_interface(is(ERC165, ERC721, ERC721Metadata, ERC721Enumerable, ERC721UniqueExtensions))]
+#[solidity_interface(is(
+	ERC165,
+	ERC721,
+	ERC721Metadata,
+	ERC721Enumerable,
+	ERC721UniqueExtensions
+))]
 pub trait UniqueNFT {
-    type Error;
+	type Error;
 }
 
 #[derive(ToLog)]
 pub enum ERC20Events {
-    Transfer {
-        #[indexed] from: address,
-        #[indexed] to: address,
-        value: uint256,
-    },
-    Approval {
-        #[indexed] owner: address,
-        #[indexed] spender: address,
-        value: uint256,
-    }
+	Transfer {
+		#[indexed]
+		from: address,
+		#[indexed]
+		to: address,
+		value: uint256,
+	},
+	Approval {
+		#[indexed]
+		owner: address,
+		#[indexed]
+		spender: address,
+		value: uint256,
+	},
 }
 
 #[solidity_interface(inline_is(InlineNameSymbol, InlineTotalSupply), events(ERC20Events))]
 pub trait ERC20 {
-    type Error;
-    
-    fn decimals(&self) -> Result<uint8, Self::Error>;
-    fn balance_of(&self, owner: address) -> Result<uint256, Self::Error>;
-    fn transfer(&mut self, caller: caller, to: address, value: uint256) -> Result<bool, Self::Error>;
-    fn transfer_from(&mut self, caller: caller, from: address, to: address, value: uint256) -> Result<bool, Self::Error>;
-    fn approve(&mut self, caller: caller, spender: address, value: uint256) -> Result<bool, Self::Error>;
-    fn allowance(&self, owner: address, spender: address) -> Result<uint256, Self::Error>;
+	type Error;
+
+	fn decimals(&self) -> Result<uint8, Self::Error>;
+	fn balance_of(&self, owner: address) -> Result<uint256, Self::Error>;
+	fn transfer(
+		&mut self,
+		caller: caller,
+		to: address,
+		value: uint256,
+	) -> Result<bool, Self::Error>;
+	fn transfer_from(
+		&mut self,
+		caller: caller,
+		from: address,
+		to: address,
+		value: uint256,
+	) -> Result<bool, Self::Error>;
+	fn approve(
+		&mut self,
+		caller: caller,
+		spender: address,
+		value: uint256,
+	) -> Result<bool, Self::Error>;
+	fn allowance(&self, owner: address, spender: address) -> Result<uint256, Self::Error>;
 }
 
 #[solidity_interface(is(ERC165, ERC20))]
 pub trait UniqueFungible {
-    type Error;
+	type Error;
 }
-
-/// Runtime metadata like helpers for evm
-#[solidity_interface]
-trait UniqueHelpers {
-    type Error;
-
-    /// Returns interface for NFT collections
-    fn nft_interface(&self) -> Result<string, Self::Error>;
-    /// Returns interface for Fungible collections
-    fn fungible_interface(&self) -> Result<string, Self::Error>;
-}
\ No newline at end of file
modifiedpallets/nft/src/eth/erc_impl.rsdiffbeforeafterboth
--- a/pallets/nft/src/eth/erc_impl.rs
+++ b/pallets/nft/src/eth/erc_impl.rs
@@ -56,7 +56,7 @@
 		Ok(index)
 	}
 
-	fn token_of_owner_by_index(&self, owner: address, index: uint256) -> Result<uint256> {
+	fn token_of_owner_by_index(&self, _owner: address, _index: uint256) -> Result<uint256> {
 		// TODO: Not implemetable
 		Err("not implemented".into())
 	}
@@ -77,7 +77,7 @@
 	fn owner_of(&self, token_id: uint256) -> Result<address> {
 		let token_id: u32 = token_id.try_into().map_err(|_| "token id overflow")?;
 		let token = <NftItemList<T>>::get(self.id, token_id).ok_or("unknown token")?;
-		Ok(token.owner.as_eth().clone())
+		Ok(*token.owner.as_eth())
 	}
 	fn safe_transfer_from_with_data(
 		&mut self,
@@ -170,7 +170,7 @@
 		caller: caller,
 		to: address,
 		token_id: uint256,
-		value: value,
+		_value: value,
 	) -> Result<void> {
 		let caller = T::CrossAccountId::from_eth(caller);
 		let to = T::CrossAccountId::from_eth(to);
modifiedpallets/nft/src/eth/log.rsdiffbeforeafterboth
--- a/pallets/nft/src/eth/log.rs
+++ b/pallets/nft/src/eth/log.rs
@@ -1,19 +1,19 @@
 use sp_std::cell::RefCell;
 use sp_std::vec::Vec;
-use sp_core::{H160, H256};
+
 use ethereum::Log;
 
 #[derive(Default)]
 pub struct LogRecorder(RefCell<Vec<Log>>);
 
 impl LogRecorder {
-    pub fn is_empty(&self) -> bool {
-        self.0.borrow().is_empty()
-    }
-    pub fn log(&self, log: Log) {
-        self.0.borrow_mut().push(log);
-    }
-    pub fn retrieve_logs(self) -> Vec<Log> {
-        self.0.into_inner()
-    }
+	pub fn is_empty(&self) -> bool {
+		self.0.borrow().is_empty()
+	}
+	pub fn log(&self, log: Log) {
+		self.0.borrow_mut().push(log);
+	}
+	pub fn retrieve_logs(self) -> Vec<Log> {
+		self.0.into_inner()
+	}
 }
modifiedpallets/nft/src/eth/mod.rsdiffbeforeafterboth
--- a/pallets/nft/src/eth/mod.rs
+++ b/pallets/nft/src/eth/mod.rs
@@ -28,7 +28,7 @@
 ];
 
 fn map_eth_to_id(eth: &H160) -> Option<CollectionId> {
-	if &eth[0..16] != ETH_ACCOUNT_PREFIX {
+	if eth[0..16] != ETH_ACCOUNT_PREFIX {
 		return None;
 	}
 	let mut id_bytes = [0; 4];
@@ -92,12 +92,9 @@
 				},
 			)?))
 		}
-		_ => {
-			return Err(StringError::from(
-				"erc calls only supported to fungible and nft collections for now",
-			)
-			.into())
-		}
+		_ => Err(StringError::from(
+			"erc calls only supported to fungible and nft collections for now",
+		)),
 	}
 }
 
@@ -156,11 +153,10 @@
 
 // TODO: This function is slow, and output can be memoized
 pub fn generate_transaction(collection_id: u32, chain_id: u64) -> ethereum::Transaction {
-	let contract = collection_id_to_address(collection_id);
-
 	// FIXME: Can be done on wasm runtime with https://github.com/paritytech/substrate/pull/8728
 	#[cfg(feature = "std")]
 	{
+		let contract = collection_id_to_address(collection_id);
 		let signed = ethereum_tx_sign::RawTransaction {
 			nonce: 0.into(),
 			to: Some(contract.0.into()),
@@ -183,6 +179,6 @@
 	}
 	#[cfg(not(feature = "std"))]
 	{
-		panic!("transaction generation not yet supported by wasm runtime")
+		panic!("transaction generation not yet supported by wasm runtime while generating transaction for collection_id {}, chain_id {}", collection_id, chain_id)
 	}
 }
modifiedpallets/nft/src/eth/sponsoring.rsdiffbeforeafterboth
--- a/pallets/nft/src/eth/sponsoring.rs
+++ b/pallets/nft/src/eth/sponsoring.rs
@@ -1,142 +1,170 @@
 //! Implements EVM sponsoring logic via OnChargeEVMTransaction
 
-use crate::{Collection, ChainLimit, CollectionById, Config, NftTransferBasket, FungibleTransferBasket, eth::account::EvmBackwardsAddressMapping};
+use crate::{
+	Collection, ChainLimit, CollectionById, Config, NftTransferBasket, FungibleTransferBasket,
+	eth::account::EvmBackwardsAddressMapping,
+};
 use evm_coder::abi::AbiReader;
-use frame_support::{storage::{StorageMap, StorageDoubleMap, StorageValue}, traits::Currency};
+use frame_support::{
+	storage::{StorageMap, StorageDoubleMap, StorageValue},
+	traits::Currency,
+};
 use pallet_evm::{EVMCurrencyAdapter, WithdrawReason};
 use sp_core::{H160, U256};
 use sp_std::prelude::*;
-use super::{account::CrossAccountId, erc::{UniqueFungibleCall, UniqueNFTCall, ERC721Call, ERC20Call, ERC721UniqueExtensionsCall}};
+use super::{
+	account::CrossAccountId,
+	erc::{UniqueFungibleCall, UniqueNFTCall, ERC721Call, ERC20Call, ERC721UniqueExtensionsCall},
+};
 use core::convert::TryInto;
 
 type NegativeImbalanceOf<C, T> =
-    <C as Currency<<T as frame_system::Config>::AccountId>>::NegativeImbalance;
+	<C as Currency<<T as frame_system::Config>::AccountId>>::NegativeImbalance;
 
 pub struct ChargeEvmTransaction;
 pub struct ChargeEvmLiquidityInfo<T>
 where
-    T: Config,
-    T: pallet_evm::Config,
+	T: Config,
+	T: pallet_evm::Config,
 {
-    who: H160,
-    negative_imbalance: NegativeImbalanceOf<<T as Config>::Currency, T>,
+	who: H160,
+	negative_imbalance: NegativeImbalanceOf<<T as Config>::Currency, T>,
 }
 
 struct AnyError;
 
-fn try_sponsor<T: Config>(caller: &H160, collection_id: u32, collection: &Collection<T>, call: &[u8]) -> Result<(), AnyError> {
-    let (method_id, mut reader) = AbiReader::new_call(call).map_err(|_| AnyError)?;
-    match &collection.mode {
-        crate::CollectionMode::NFT => {
-            let call: UniqueNFTCall = UniqueNFTCall::parse(method_id, &mut reader).map_err(|_| AnyError)?.ok_or(AnyError)?;
-            match call {
-                UniqueNFTCall::ERC721UniqueExtensions(ERC721UniqueExtensionsCall::Transfer {token_id, ..}) | UniqueNFTCall::ERC721(ERC721Call::TransferFrom {token_id, ..})  => {
-                    let token_id: u32 = token_id.try_into().map_err(|_| AnyError)?;
-                    let block_number = <frame_system::Pallet<T>>::block_number() as T::BlockNumber;
-                    let collection_limits = &collection.limits;
-                    let limit: u32 = if collection_limits.sponsor_transfer_timeout > 0 {
-                        collection_limits.sponsor_transfer_timeout
-                    } else {
-                        ChainLimit::get().nft_sponsor_transfer_timeout
-                    };
+fn try_sponsor<T: Config>(
+	caller: &H160,
+	collection_id: u32,
+	collection: &Collection<T>,
+	call: &[u8],
+) -> Result<(), AnyError> {
+	let (method_id, mut reader) = AbiReader::new_call(call).map_err(|_| AnyError)?;
+	match &collection.mode {
+		crate::CollectionMode::NFT => {
+			let call: UniqueNFTCall = UniqueNFTCall::parse(method_id, &mut reader)
+				.map_err(|_| AnyError)?
+				.ok_or(AnyError)?;
+			match call {
+				UniqueNFTCall::ERC721UniqueExtensions(ERC721UniqueExtensionsCall::Transfer {
+					token_id,
+					..
+				})
+				| UniqueNFTCall::ERC721(ERC721Call::TransferFrom { token_id, .. }) => {
+					let token_id: u32 = token_id.try_into().map_err(|_| AnyError)?;
+					let block_number = <frame_system::Pallet<T>>::block_number() as T::BlockNumber;
+					let collection_limits = &collection.limits;
+					let limit: u32 = if collection_limits.sponsor_transfer_timeout > 0 {
+						collection_limits.sponsor_transfer_timeout
+					} else {
+						ChainLimit::get().nft_sponsor_transfer_timeout
+					};
 
-                    let mut sponsor = true;
-                    if <NftTransferBasket<T>>::contains_key(collection_id, token_id) {
-                        let last_tx_block = <NftTransferBasket<T>>::get(collection_id, token_id);
-                        let limit_time = last_tx_block + limit.into();
-                        if block_number <= limit_time {
-                            sponsor = false;
-                        }
-                    }
-                    if sponsor {
-                        <NftTransferBasket<T>>::insert(collection_id, token_id, block_number);
-                        return Ok(())
-                    }
-                },
-                _ => {},
-            }
-        },
-        crate::CollectionMode::Fungible(_) => {
-            let call: UniqueFungibleCall = UniqueFungibleCall::parse(method_id, &mut reader).map_err(|_| AnyError)?.ok_or(AnyError)?;
-            match call {
-                UniqueFungibleCall::ERC20(ERC20Call::Transfer {..})  => {
-                    let who = T::CrossAccountId::from_eth(caller.clone());
-                    let collection_limits = &collection.limits;
-                    let limit: u32 = if collection_limits.sponsor_transfer_timeout > 0 {
-                        collection_limits.sponsor_transfer_timeout
-                    } else {
-                        ChainLimit::get().fungible_sponsor_transfer_timeout
-                    };
+					let mut sponsor = true;
+					if <NftTransferBasket<T>>::contains_key(collection_id, token_id) {
+						let last_tx_block = <NftTransferBasket<T>>::get(collection_id, token_id);
+						let limit_time = last_tx_block + limit.into();
+						if block_number <= limit_time {
+							sponsor = false;
+						}
+					}
+					if sponsor {
+						<NftTransferBasket<T>>::insert(collection_id, token_id, block_number);
+						return Ok(());
+					}
+				}
+				_ => {}
+			}
+		}
+		crate::CollectionMode::Fungible(_) => {
+			let call: UniqueFungibleCall = UniqueFungibleCall::parse(method_id, &mut reader)
+				.map_err(|_| AnyError)?
+				.ok_or(AnyError)?;
+			#[allow(clippy::single_match)]
+			match call {
+				UniqueFungibleCall::ERC20(ERC20Call::Transfer { .. }) => {
+					let who = T::CrossAccountId::from_eth(*caller);
+					let collection_limits = &collection.limits;
+					let limit: u32 = if collection_limits.sponsor_transfer_timeout > 0 {
+						collection_limits.sponsor_transfer_timeout
+					} else {
+						ChainLimit::get().fungible_sponsor_transfer_timeout
+					};
 
-                    let block_number = <frame_system::Pallet<T>>::block_number() as T::BlockNumber;
-                    let mut sponsored = true;
-                    if <FungibleTransferBasket<T>>::contains_key(collection_id, who.as_sub()) {
-                        let last_tx_block = <FungibleTransferBasket<T>>::get(collection_id, who.as_sub());
-                        let limit_time = last_tx_block + limit.into();
-                        if block_number <= limit_time {
-                            sponsored = false;
-                        }
-                    }
-                    if sponsored {
-                        <FungibleTransferBasket<T>>::insert(collection_id, who.as_sub(), block_number);
-                        return Ok(())
-                    }
-                },
-                _ => {},
-            }
-        },
-        _ => {},
-    }
-    return Err(AnyError)
+					let block_number = <frame_system::Pallet<T>>::block_number() as T::BlockNumber;
+					let mut sponsored = true;
+					if <FungibleTransferBasket<T>>::contains_key(collection_id, who.as_sub()) {
+						let last_tx_block =
+							<FungibleTransferBasket<T>>::get(collection_id, who.as_sub());
+						let limit_time = last_tx_block + limit.into();
+						if block_number <= limit_time {
+							sponsored = false;
+						}
+					}
+					if sponsored {
+						<FungibleTransferBasket<T>>::insert(
+							collection_id,
+							who.as_sub(),
+							block_number,
+						);
+						return Ok(());
+					}
+				}
+				_ => {}
+			}
+		}
+		_ => {}
+	}
+	Err(AnyError)
 }
 
 impl<T> pallet_evm::OnChargeEVMTransaction<T> for ChargeEvmTransaction
 where
-    T: Config,
-    T: pallet_evm::Config,
+	T: Config,
+	T: pallet_evm::Config,
 {
-    type LiquidityInfo = Option<ChargeEvmLiquidityInfo<T>>;
+	type LiquidityInfo = Option<ChargeEvmLiquidityInfo<T>>;
 
-    fn withdraw_fee(
-        who: &H160,
-        reason: WithdrawReason,
-        fee: U256,
-    ) -> Result<Self::LiquidityInfo, pallet_evm::Error<T>> {
-        let mut who_pays_fee = *who;
-        if let WithdrawReason::Call { target, input } = &reason {
-            if let Some(collection_id) = crate::eth::map_eth_to_id(&target) {
-                if let Some(collection) = <CollectionById<T>>::get(collection_id) {
-                    if let Some(sponsor) = collection.sponsorship.sponsor() {
-                        if try_sponsor(who, collection_id, &collection, &input).is_ok() {
-                            who_pays_fee =
-                                T::EvmBackwardsAddressMapping::from_account_id(sponsor.clone());
-                        }
-                    }
-                }
-            }
-        }
+	fn withdraw_fee(
+		who: &H160,
+		reason: WithdrawReason,
+		fee: U256,
+	) -> Result<Self::LiquidityInfo, pallet_evm::Error<T>> {
+		let mut who_pays_fee = *who;
+		if let WithdrawReason::Call { target, input } = &reason {
+			if let Some(collection_id) = crate::eth::map_eth_to_id(&target) {
+				if let Some(collection) = <CollectionById<T>>::get(collection_id) {
+					if let Some(sponsor) = collection.sponsorship.sponsor() {
+						if try_sponsor(who, collection_id, &collection, &input).is_ok() {
+							who_pays_fee =
+								T::EvmBackwardsAddressMapping::from_account_id(sponsor.clone());
+						}
+					}
+				}
+			}
+		}
 
-        // TODO: Pay fee from substrate address
-        let negative_imbalance = EVMCurrencyAdapter::<<T as Config>::Currency, ()>::withdraw_fee(
-            &who_pays_fee,
-            reason,
-            fee,
-        )?;
-        Ok(negative_imbalance.map(|i| ChargeEvmLiquidityInfo {
-            who: who_pays_fee,
-            negative_imbalance: i,
-        }))
-    }
+		// TODO: Pay fee from substrate address
+		let negative_imbalance = EVMCurrencyAdapter::<<T as Config>::Currency, ()>::withdraw_fee(
+			&who_pays_fee,
+			reason,
+			fee,
+		)?;
+		Ok(negative_imbalance.map(|i| ChargeEvmLiquidityInfo {
+			who: who_pays_fee,
+			negative_imbalance: i,
+		}))
+	}
 
-    fn correct_and_deposit_fee(
-        who: &H160,
-        corrected_fee: U256,
-        already_withdrawn: Self::LiquidityInfo,
-    ) -> Result<(), pallet_evm::Error<T>> {
-        EVMCurrencyAdapter::<<T as Config>::Currency, ()>::correct_and_deposit_fee(
-            &already_withdrawn.as_ref().map(|e| e.who).unwrap_or(*who),
-            corrected_fee,
-            already_withdrawn.map(|e| e.negative_imbalance),
-        )
-    }
+	fn correct_and_deposit_fee(
+		who: &H160,
+		corrected_fee: U256,
+		already_withdrawn: Self::LiquidityInfo,
+	) -> Result<(), pallet_evm::Error<T>> {
+		EVMCurrencyAdapter::<<T as Config>::Currency, ()>::correct_and_deposit_fee(
+			&already_withdrawn.as_ref().map(|e| e.who).unwrap_or(*who),
+			corrected_fee,
+			already_withdrawn.map(|e| e.negative_imbalance),
+		)
+	}
 }
modifiedpallets/nft/src/lib.rsdiffbeforeafterboth
--- a/pallets/nft/src/lib.rs
+++ b/pallets/nft/src/lib.rs
@@ -4,41 +4,44 @@
 //
 
 #![recursion_limit = "1024"]
-
 #![cfg_attr(not(feature = "std"), no_std)]
+#![allow(
+	clippy::too_many_arguments,
+	clippy::unnecessary_mut_passed,
+	clippy::unused_unit
+)]
 
 extern crate alloc;
 
 pub use serde::{Serialize, Deserialize};
 
 pub use frame_support::{
-    construct_runtime, decl_event, decl_module, decl_storage, decl_error,
-    dispatch::DispatchResult,
-    ensure, fail, parameter_types,
-    traits::{
-        Currency, ExistenceRequirement, Get, Imbalance, KeyOwnerProofSystem, OnUnbalanced,
-        Randomness, IsSubType, WithdrawReasons,
-    },
-    weights::{
-        constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_PER_SECOND},
-        DispatchInfo, GetDispatchInfo, IdentityFee, Pays, PostDispatchInfo, Weight,
-        WeightToFeePolynomial, DispatchClass,
-    },
-    StorageValue,
-    transactional,
+	construct_runtime, decl_event, decl_module, decl_storage, decl_error,
+	dispatch::DispatchResult,
+	ensure, fail, parameter_types,
+	traits::{
+		Currency, ExistenceRequirement, Get, Imbalance, KeyOwnerProofSystem, OnUnbalanced,
+		Randomness, IsSubType, WithdrawReasons,
+	},
+	weights::{
+		constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_PER_SECOND},
+		DispatchInfo, GetDispatchInfo, IdentityFee, Pays, PostDispatchInfo, Weight,
+		WeightToFeePolynomial, DispatchClass,
+	},
+	StorageValue, transactional,
 };
 
 use frame_system::{self as system, ensure_signed, ensure_root};
 use sp_core::H160;
+use sp_std::vec;
 use sp_runtime::sp_std::prelude::Vec;
 use core::ops::{Deref, DerefMut};
 use core::cell::RefCell;
 use nft_data_structs::{
-    MAX_DECIMAL_POINTS, MAX_SPONSOR_TIMEOUT, MAX_TOKEN_OWNERSHIP, MAX_REFUNGIBLE_PIECES,
-	AccessMode, ChainLimits, Collection, CreateItemData, CollectionLimits,
-    CollectionId, CollectionMode, TokenId, 
-    SchemaVersion, SponsorshipState, Ownership,
-    NftItemType, FungibleItemType, ReFungibleItemType
+	MAX_DECIMAL_POINTS, MAX_SPONSOR_TIMEOUT, MAX_TOKEN_OWNERSHIP, MAX_REFUNGIBLE_PIECES,
+	AccessMode, ChainLimits, Collection, CreateItemData, CollectionLimits, CollectionId,
+	CollectionMode, TokenId, SchemaVersion, SponsorshipState, Ownership, NftItemType,
+	FungibleItemType, ReFungibleItemType,
 };
 use pallet_ethereum::EthereumTransactionSender;
 
@@ -65,185 +68,186 @@
 	fn destroy_collection() -> Weight;
 	fn add_to_white_list() -> Weight;
 	fn remove_from_white_list() -> Weight;
-    fn set_public_access_mode() -> Weight;
-    fn set_mint_permission() -> Weight;
-    fn change_collection_owner() -> Weight;
-    fn add_collection_admin() -> Weight;
-    fn remove_collection_admin() -> Weight;
-    fn set_collection_sponsor() -> Weight;
-    fn confirm_sponsorship() -> Weight;
-    fn remove_collection_sponsor() -> Weight;
-    fn create_item(s: usize) -> Weight;
-    fn burn_item() -> Weight;
-    fn transfer() -> Weight;
-    fn approve() -> Weight;
-    fn transfer_from() -> Weight;
-    fn set_offchain_schema() -> Weight;
-    fn set_const_on_chain_schema() -> Weight;
-    fn set_variable_on_chain_schema() -> Weight;
-    fn set_variable_meta_data() -> Weight;
-    fn enable_contract_sponsoring() -> Weight;
-    fn set_schema_version() -> Weight;
-    fn set_chain_limits() -> Weight;
-    fn set_contract_sponsoring_rate_limit() -> Weight;
-    fn set_variable_meta_data_sponsoring_rate_limit() -> Weight;
-    fn toggle_contract_white_list() -> Weight;
-    fn add_to_contract_white_list() -> Weight;
-    fn remove_from_contract_white_list() -> Weight;
-    fn set_collection_limits() -> Weight;
+	fn set_public_access_mode() -> Weight;
+	fn set_mint_permission() -> Weight;
+	fn change_collection_owner() -> Weight;
+	fn add_collection_admin() -> Weight;
+	fn remove_collection_admin() -> Weight;
+	fn set_collection_sponsor() -> Weight;
+	fn confirm_sponsorship() -> Weight;
+	fn remove_collection_sponsor() -> Weight;
+	fn create_item(s: usize) -> Weight;
+	fn burn_item() -> Weight;
+	fn transfer() -> Weight;
+	fn approve() -> Weight;
+	fn transfer_from() -> Weight;
+	fn set_offchain_schema() -> Weight;
+	fn set_const_on_chain_schema() -> Weight;
+	fn set_variable_on_chain_schema() -> Weight;
+	fn set_variable_meta_data() -> Weight;
+	fn enable_contract_sponsoring() -> Weight;
+	fn set_schema_version() -> Weight;
+	fn set_chain_limits() -> Weight;
+	fn set_contract_sponsoring_rate_limit() -> Weight;
+	fn set_variable_meta_data_sponsoring_rate_limit() -> Weight;
+	fn toggle_contract_white_list() -> Weight;
+	fn add_to_contract_white_list() -> Weight;
+	fn remove_from_contract_white_list() -> Weight;
+	fn set_collection_limits() -> Weight;
 }
 
 decl_error! {
 	/// Error for non-fungible-token module.
 	pub enum Error for Module<T: Config> {
-        /// Total collections bound exceeded.
-        TotalCollectionsLimitExceeded,
+		/// Total collections bound exceeded.
+		TotalCollectionsLimitExceeded,
 		/// Decimal_points parameter must be lower than MAX_DECIMAL_POINTS constant, currently it is 30.
-        CollectionDecimalPointLimitExceeded, 
-        /// Collection name can not be longer than 63 char.
-        CollectionNameLimitExceeded, 
-        /// Collection description can not be longer than 255 char.
-        CollectionDescriptionLimitExceeded, 
-        /// Token prefix can not be longer than 15 char.
-        CollectionTokenPrefixLimitExceeded,
-        /// This collection does not exist.
-        CollectionNotFound,
-        /// Item not exists.
-        TokenNotFound,
-        /// Admin not found
-        AdminNotFound,
-        /// Arithmetic calculation overflow.
-        NumOverflow,       
-        /// Account already has admin role.
-        AlreadyAdmin,  
-        /// You do not own this collection.
-        NoPermission,
-        /// This address is not set as sponsor, use setCollectionSponsor first.
-        ConfirmUnsetSponsorFail,
-        /// Collection is not in mint mode.
-        PublicMintingNotAllowed,
-        /// Sender parameter and item owner must be equal.
-        MustBeTokenOwner,
-        /// Item balance not enough.
-        TokenValueTooLow,
-        /// Size of item is too large.
-        NftSizeLimitExceeded,
-        /// No approve found
-        ApproveNotFound,
-        /// Requested value more than approved.
-        TokenValueNotEnough,
-        /// Only approved addresses can call this method.
-        ApproveRequired,
-        /// Address is not in white list.
-        AddresNotInWhiteList,
-        /// Number of collection admins bound exceeded.
-        CollectionAdminsLimitExceeded,
-        /// Owned tokens by a single address bound exceeded.
-        AddressOwnershipLimitExceeded,
-        /// Length of items properties must be greater than 0.
-        EmptyArgument,
-        /// const_data exceeded data limit.
-        TokenConstDataLimitExceeded,
-        /// variable_data exceeded data limit.
-        TokenVariableDataLimitExceeded,
-        /// Not NFT item data used to mint in NFT collection.
-        NotNftDataUsedToMintNftCollectionToken,
-        /// Not Fungible item data used to mint in Fungible collection.
-        NotFungibleDataUsedToMintFungibleCollectionToken,
-        /// Not Re Fungible item data used to mint in Re Fungible collection.
-        NotReFungibleDataUsedToMintReFungibleCollectionToken,
-        /// Unexpected collection type.
-        UnexpectedCollectionType,
-        /// Can't store metadata in fungible tokens.
-        CantStoreMetadataInFungibleTokens,
-        /// Collection token limit exceeded
-        CollectionTokenLimitExceeded,
-        /// Account token limit exceeded per collection
-        AccountTokenLimitExceeded,
-        /// Collection limit bounds per collection exceeded
-        CollectionLimitBoundsExceeded,
-        /// Tried to enable permissions which are only permitted to be disabled
-        OwnerPermissionsCantBeReverted,
-        /// Schema data size limit bound exceeded
-        SchemaDataLimitExceeded,
-        /// Maximum refungibility exceeded
-        WrongRefungiblePieces,
-        /// createRefungible should be called with one owner
-        BadCreateRefungibleCall,
-        /// Gas limit exceeded
-        OutOfGas,
+		CollectionDecimalPointLimitExceeded,
+		/// Collection name can not be longer than 63 char.
+		CollectionNameLimitExceeded,
+		/// Collection description can not be longer than 255 char.
+		CollectionDescriptionLimitExceeded,
+		/// Token prefix can not be longer than 15 char.
+		CollectionTokenPrefixLimitExceeded,
+		/// This collection does not exist.
+		CollectionNotFound,
+		/// Item not exists.
+		TokenNotFound,
+		/// Admin not found
+		AdminNotFound,
+		/// Arithmetic calculation overflow.
+		NumOverflow,
+		/// Account already has admin role.
+		AlreadyAdmin,
+		/// You do not own this collection.
+		NoPermission,
+		/// This address is not set as sponsor, use setCollectionSponsor first.
+		ConfirmUnsetSponsorFail,
+		/// Collection is not in mint mode.
+		PublicMintingNotAllowed,
+		/// Sender parameter and item owner must be equal.
+		MustBeTokenOwner,
+		/// Item balance not enough.
+		TokenValueTooLow,
+		/// Size of item is too large.
+		NftSizeLimitExceeded,
+		/// No approve found
+		ApproveNotFound,
+		/// Requested value more than approved.
+		TokenValueNotEnough,
+		/// Only approved addresses can call this method.
+		ApproveRequired,
+		/// Address is not in white list.
+		AddresNotInWhiteList,
+		/// Number of collection admins bound exceeded.
+		CollectionAdminsLimitExceeded,
+		/// Owned tokens by a single address bound exceeded.
+		AddressOwnershipLimitExceeded,
+		/// Length of items properties must be greater than 0.
+		EmptyArgument,
+		/// const_data exceeded data limit.
+		TokenConstDataLimitExceeded,
+		/// variable_data exceeded data limit.
+		TokenVariableDataLimitExceeded,
+		/// Not NFT item data used to mint in NFT collection.
+		NotNftDataUsedToMintNftCollectionToken,
+		/// Not Fungible item data used to mint in Fungible collection.
+		NotFungibleDataUsedToMintFungibleCollectionToken,
+		/// Not Re Fungible item data used to mint in Re Fungible collection.
+		NotReFungibleDataUsedToMintReFungibleCollectionToken,
+		/// Unexpected collection type.
+		UnexpectedCollectionType,
+		/// Can't store metadata in fungible tokens.
+		CantStoreMetadataInFungibleTokens,
+		/// Collection token limit exceeded
+		CollectionTokenLimitExceeded,
+		/// Account token limit exceeded per collection
+		AccountTokenLimitExceeded,
+		/// Collection limit bounds per collection exceeded
+		CollectionLimitBoundsExceeded,
+		/// Tried to enable permissions which are only permitted to be disabled
+		OwnerPermissionsCantBeReverted,
+		/// Schema data size limit bound exceeded
+		SchemaDataLimitExceeded,
+		/// Maximum refungibility exceeded
+		WrongRefungiblePieces,
+		/// createRefungible should be called with one owner
+		BadCreateRefungibleCall,
+		/// Gas limit exceeded
+		OutOfGas,
 	}
 }
 
 pub struct CollectionHandle<T: Config> {
-    pub id: CollectionId,
-    collection: Collection<T>,
-    logs: eth::log::LogRecorder,
-    evm_address: H160,
-    gas_limit: RefCell<u64>,
+	pub id: CollectionId,
+	collection: Collection<T>,
+	logs: eth::log::LogRecorder,
+	evm_address: H160,
+	gas_limit: RefCell<u64>,
 }
 impl<T: Config> CollectionHandle<T> {
 	pub fn get_with_gas_limit(id: CollectionId, gas_limit: u64) -> Option<Self> {
-		<CollectionById<T>>::get(id)
-			.map(|collection| Self {
-				id,
-				collection,
-                logs: eth::log::LogRecorder::default(),
-                evm_address: eth::collection_id_to_address(id),
-                gas_limit: RefCell::new(gas_limit),
-			})
+		<CollectionById<T>>::get(id).map(|collection| Self {
+			id,
+			collection,
+			logs: eth::log::LogRecorder::default(),
+			evm_address: eth::collection_id_to_address(id),
+			gas_limit: RefCell::new(gas_limit),
+		})
+	}
+	pub fn get(id: CollectionId) -> Option<Self> {
+		Self::get_with_gas_limit(id, u64::MAX)
+	}
+	pub fn gas_left(&self) -> u64 {
+		*self.gas_limit.borrow()
+	}
+	pub fn consume_gas(&self, gas: u64) -> DispatchResult {
+		let mut gas_limit = self.gas_limit.borrow_mut();
+		if *gas_limit < gas {
+			fail!(Error::<T>::OutOfGas);
+		}
+		*gas_limit -= gas;
+		Ok(())
+	}
+	pub fn log(&self, log: impl evm_coder::ToLog) {
+		self.logs.log(log.to_log(self.evm_address))
+	}
+	pub fn into_inner(self) -> Collection<T> {
+		self.collection
 	}
-    pub fn get(id: CollectionId) -> Option<Self> {
-        Self::get_with_gas_limit(id, u64::MAX)
-    }
-    pub fn gas_left(&self) -> u64 {
-        *self.gas_limit.borrow()
-    }
-    pub fn consume_gas(&self, gas: u64) -> DispatchResult {
-        let mut gas_limit = self.gas_limit.borrow_mut();
-        if *gas_limit < gas {
-            fail!(Error::<T>::OutOfGas);
-        }
-        *gas_limit -= gas;
-        Ok(())
-    }
-    pub fn log(&self, log: impl evm_coder::ToLog) {
-        self.logs.log(log.to_log(self.evm_address))
-    }
-    pub fn into_inner(self) -> Collection<T> {
-        self.collection.clone()
-    }
 }
 impl<T: Config> Deref for CollectionHandle<T> {
-    type Target = Collection<T>;
+	type Target = Collection<T>;
 
-    fn deref(&self) -> &Self::Target {
-        &self.collection
-    }
+	fn deref(&self) -> &Self::Target {
+		&self.collection
+	}
 }
 
 impl<T: Config> DerefMut for CollectionHandle<T> {
-    fn deref_mut(&mut self) -> &mut Self::Target {
-        &mut self.collection
-    }
+	fn deref_mut(&mut self) -> &mut Self::Target {
+		&mut self.collection
+	}
 }
 
 pub trait Config: system::Config + Sized {
-    type Event: From<Event<Self>> + Into<<Self as system::Config>::Event>;
+	type Event: From<Event<Self>> + Into<<Self as system::Config>::Event>;
 
-    /// Weight information for extrinsics in this pallet.
+	/// Weight information for extrinsics in this pallet.
 	type WeightInfo: WeightInfo;
 
-    type EvmAddressMapping: pallet_evm::AddressMapping<Self::AccountId>;
-    type EvmBackwardsAddressMapping: EvmBackwardsAddressMapping<Self::AccountId>;
+	type EvmAddressMapping: pallet_evm::AddressMapping<Self::AccountId>;
+	type EvmBackwardsAddressMapping: EvmBackwardsAddressMapping<Self::AccountId>;
 
 	type CrossAccountId: CrossAccountId<Self::AccountId>;
-    type Currency: Currency<Self::AccountId>;
-    type CollectionCreationPrice: Get<<<Self as Config>::Currency as Currency<Self::AccountId>>::Balance>;
-    type TreasuryAccountId: Get<Self::AccountId>;
+	type Currency: Currency<Self::AccountId>;
+	type CollectionCreationPrice: Get<
+		<<Self as Config>::Currency as Currency<Self::AccountId>>::Balance,
+	>;
+	type TreasuryAccountId: Get<Self::AccountId>;
 
-    type EthereumChainId: Get<u64>;
-    type EthereumTransactionSender: pallet_ethereum::EthereumTransactionSender;
+	type EthereumChainId: Get<u64>;
+	type EthereumTransactionSender: pallet_ethereum::EthereumTransactionSender;
 }
 
 // # Used definitions
@@ -269,1057 +273,1078 @@
 // ?3 - real -> controlled
 //      no confirmation required, so addresses can be easily generated
 decl_storage! {
-    trait Store for Module<T: Config> as Nft {
+	trait Store for Module<T: Config> as Nft {
 
-        //#region Private members
-        /// Id of next collection
-        CreatedCollectionCount: u32;
-        /// Used for migrations
-        ChainVersion: u64;
-        /// Id of last collection token
-        /// Collection id (controlled?1)
-        ItemListIndex: map hasher(blake2_128_concat) CollectionId => TokenId;
-        //#endregion
+		//#region Private members
+		/// Id of next collection
+		CreatedCollectionCount: u32;
+		/// Used for migrations
+		ChainVersion: u64;
+		/// Id of last collection token
+		/// Collection id (controlled?1)
+		ItemListIndex: map hasher(blake2_128_concat) CollectionId => TokenId;
+		//#endregion
 
-        //#region Chain limits struct
-        pub ChainLimit get(fn chain_limit) config(): ChainLimits;
-        //#endregion
+		//#region Chain limits struct
+		pub ChainLimit get(fn chain_limit) config(): ChainLimits;
+		//#endregion
 
-        //#region Bound counters
-        /// Amount of collections destroyed, used for total amount tracking with
-        /// CreatedCollectionCount
-        DestroyedCollectionCount: u32;
-        /// Total amount of account owned tokens (NFTs + RFTs + unique fungibles)
-        /// Account id (real)
-        pub AccountItemCount get(fn account_item_count): map hasher(twox_64_concat) T::AccountId => u32;
-        //#endregion
+		//#region Bound counters
+		/// Amount of collections destroyed, used for total amount tracking with
+		/// CreatedCollectionCount
+		DestroyedCollectionCount: u32;
+		/// Total amount of account owned tokens (NFTs + RFTs + unique fungibles)
+		/// Account id (real)
+		pub AccountItemCount get(fn account_item_count): map hasher(twox_64_concat) T::AccountId => u32;
+		//#endregion
 
-        //#region Basic collections
-        /// Collection info
-        /// Collection id (controlled?1)
-        pub CollectionById get(fn collection_id) config(): map hasher(blake2_128_concat) CollectionId => Option<Collection<T>> = None;
-        /// List of collection admins
-        /// Collection id (controlled?2)
-        pub AdminList get(fn admin_list_collection): map hasher(blake2_128_concat) CollectionId => Vec<T::CrossAccountId>;
-        /// Whitelisted collection users
-        /// Collection id (controlled?2), user id (controlled?3)
-        pub WhiteList get(fn white_list): double_map hasher(blake2_128_concat) CollectionId, hasher(blake2_128_concat) T::AccountId => bool;
-        //#endregion
+		//#region Basic collections
+		/// Collection info
+		/// Collection id (controlled?1)
+		pub CollectionById get(fn collection_id) config(): map hasher(blake2_128_concat) CollectionId => Option<Collection<T>> = None;
+		/// List of collection admins
+		/// Collection id (controlled?2)
+		pub AdminList get(fn admin_list_collection): map hasher(blake2_128_concat) CollectionId => Vec<T::CrossAccountId>;
+		/// Whitelisted collection users
+		/// Collection id (controlled?2), user id (controlled?3)
+		pub WhiteList get(fn white_list): double_map hasher(blake2_128_concat) CollectionId, hasher(blake2_128_concat) T::AccountId => bool;
+		//#endregion
 
-        /// How many of collection items user have
-        /// Collection id (controlled?2), account id (real)
-        pub Balance get(fn balance_count): double_map hasher(blake2_128_concat) CollectionId, hasher(twox_64_concat) T::AccountId => u128;
+		/// How many of collection items user have
+		/// Collection id (controlled?2), account id (real)
+		pub Balance get(fn balance_count): double_map hasher(blake2_128_concat) CollectionId, hasher(twox_64_concat) T::AccountId => u128;
 
-        /// Amount of items which spender can transfer out of owners account (via transferFrom)
-        /// Collection id (controlled?2), (token id (controlled ?2) + owner account id (real) + spender account id (controlled?3))
-        /// TODO: Off chain worker should remove from this map when token gets removed
-        pub Allowances get(fn approved): double_map hasher(blake2_128_concat) CollectionId, hasher(blake2_128_concat) (TokenId, T::AccountId, T::AccountId) => u128;
+		/// Amount of items which spender can transfer out of owners account (via transferFrom)
+		/// Collection id (controlled?2), (token id (controlled ?2) + owner account id (real) + spender account id (controlled?3))
+		/// TODO: Off chain worker should remove from this map when token gets removed
+		pub Allowances get(fn approved): double_map hasher(blake2_128_concat) CollectionId, hasher(blake2_128_concat) (TokenId, T::AccountId, T::AccountId) => u128;
 
-        //#region Item collections
-        /// Collection id (controlled?2), token id (controlled?1)
-        pub NftItemList get(fn nft_item_id) config(): double_map hasher(blake2_128_concat) CollectionId, hasher(blake2_128_concat) TokenId => Option<NftItemType<T::CrossAccountId>>;
-        /// Collection id (controlled?2), owner (controlled?2)
-        pub FungibleItemList get(fn fungible_item_id) config(): double_map hasher(blake2_128_concat) CollectionId, hasher(blake2_128_concat) T::AccountId => FungibleItemType;
-        /// Collection id (controlled?2), token id (controlled?1)
-        pub ReFungibleItemList get(fn refungible_item_id) config(): double_map hasher(blake2_128_concat) CollectionId, hasher(blake2_128_concat) TokenId => Option<ReFungibleItemType<T::CrossAccountId>>;
-        //#endregion
+		//#region Item collections
+		/// Collection id (controlled?2), token id (controlled?1)
+		pub NftItemList get(fn nft_item_id) config(): double_map hasher(blake2_128_concat) CollectionId, hasher(blake2_128_concat) TokenId => Option<NftItemType<T::CrossAccountId>>;
+		/// Collection id (controlled?2), owner (controlled?2)
+		pub FungibleItemList get(fn fungible_item_id) config(): double_map hasher(blake2_128_concat) CollectionId, hasher(blake2_128_concat) T::AccountId => FungibleItemType;
+		/// Collection id (controlled?2), token id (controlled?1)
+		pub ReFungibleItemList get(fn refungible_item_id) config(): double_map hasher(blake2_128_concat) CollectionId, hasher(blake2_128_concat) TokenId => Option<ReFungibleItemType<T::CrossAccountId>>;
+		//#endregion
 
-        //#region Index list
-        /// Collection id (controlled?2), tokens owner (controlled?2)
-        pub AddressTokens get(fn address_tokens): double_map hasher(blake2_128_concat) CollectionId, hasher(blake2_128_concat) T::AccountId => Vec<TokenId>;
-        //#endregion
+		//#region Index list
+		/// Collection id (controlled?2), tokens owner (controlled?2)
+		pub AddressTokens get(fn address_tokens): double_map hasher(blake2_128_concat) CollectionId, hasher(blake2_128_concat) T::AccountId => Vec<TokenId>;
+		//#endregion
 
-        //#region Tokens transfer rate limit baskets
-        /// (Collection id (controlled?2), who created (real))
-        /// TODO: Off chain worker should remove from this map when collection gets removed
-        pub CreateItemBasket get(fn create_item_basket): map hasher(blake2_128_concat) (CollectionId, T::AccountId) => T::BlockNumber;
-        /// Collection id (controlled?2), token id (controlled?2)
-        pub NftTransferBasket get(fn nft_transfer_basket): double_map hasher(blake2_128_concat) CollectionId, hasher(blake2_128_concat) TokenId => T::BlockNumber;
-        /// Collection id (controlled?2), owning user (real)
-        pub FungibleTransferBasket get(fn fungible_transfer_basket): double_map hasher(blake2_128_concat) CollectionId, hasher(twox_64_concat) T::AccountId => T::BlockNumber;
-        /// Collection id (controlled?2), token id (controlled?2)
-        pub ReFungibleTransferBasket get(fn refungible_transfer_basket): double_map hasher(blake2_128_concat) CollectionId, hasher(blake2_128_concat) TokenId => T::BlockNumber;
-        //#endregion
+		//#region Tokens transfer rate limit baskets
+		/// (Collection id (controlled?2), who created (real))
+		/// TODO: Off chain worker should remove from this map when collection gets removed
+		pub CreateItemBasket get(fn create_item_basket): map hasher(blake2_128_concat) (CollectionId, T::AccountId) => T::BlockNumber;
+		/// Collection id (controlled?2), token id (controlled?2)
+		pub NftTransferBasket get(fn nft_transfer_basket): double_map hasher(blake2_128_concat) CollectionId, hasher(blake2_128_concat) TokenId => T::BlockNumber;
+		/// Collection id (controlled?2), owning user (real)
+		pub FungibleTransferBasket get(fn fungible_transfer_basket): double_map hasher(blake2_128_concat) CollectionId, hasher(twox_64_concat) T::AccountId => T::BlockNumber;
+		/// Collection id (controlled?2), token id (controlled?2)
+		pub ReFungibleTransferBasket get(fn refungible_transfer_basket): double_map hasher(blake2_128_concat) CollectionId, hasher(blake2_128_concat) TokenId => T::BlockNumber;
+		//#endregion
 
-        /// Variable metadata sponsoring
-        /// Collection id (controlled?2), token id (controlled?2)
-        pub VariableMetaDataBasket get(fn variable_meta_data_basket): double_map hasher(blake2_128_concat) CollectionId, hasher(blake2_128_concat) TokenId => Option<T::BlockNumber> = None;
-    }
-    add_extra_genesis {
-        build(|config: &GenesisConfig<T>| {
-            // Modification of storage
-            for (_num, _c) in &config.collection_id {
-                <Module<T>>::init_collection(_c);
-            }
+		/// Variable metadata sponsoring
+		/// Collection id (controlled?2), token id (controlled?2)
+		pub VariableMetaDataBasket get(fn variable_meta_data_basket): double_map hasher(blake2_128_concat) CollectionId, hasher(blake2_128_concat) TokenId => Option<T::BlockNumber> = None;
+	}
+	add_extra_genesis {
+		build(|config: &GenesisConfig<T>| {
+			// Modification of storage
+			for (_num, _c) in &config.collection_id {
+				<Module<T>>::init_collection(_c);
+			}
 
-            for (_num, _c, _i) in &config.nft_item_id {
-                <Module<T>>::init_nft_token(*_c, _i);
-            }
+			for (_num, _c, _i) in &config.nft_item_id {
+				<Module<T>>::init_nft_token(*_c, _i);
+			}
 
-            for (collection_id, account_id, fungible_item) in &config.fungible_item_id {
-                <Module<T>>::init_fungible_token(*collection_id, &T::CrossAccountId::from_sub(account_id.clone()), fungible_item);
-            }
+			for (collection_id, account_id, fungible_item) in &config.fungible_item_id {
+				<Module<T>>::init_fungible_token(*collection_id, &T::CrossAccountId::from_sub(account_id.clone()), fungible_item);
+			}
 
-            for (_num, _c, _i) in &config.refungible_item_id {
-                <Module<T>>::init_refungible_token(*_c, _i);
-            }
-        })
-    }
+			for (_num, _c, _i) in &config.refungible_item_id {
+				<Module<T>>::init_refungible_token(*_c, _i);
+			}
+		})
+	}
 }
 
 decl_event!(
-    pub enum Event<T>
-    where
-        AccountId = <T as frame_system::Config>::AccountId,
-        CrossAccountId = <T as Config>::CrossAccountId,
-    {
-        /// New collection was created
-        /// 
-        /// # Arguments
-        /// 
-        /// * collection_id: Globally unique identifier of newly created collection.
-        /// 
-        /// * mode: [CollectionMode] converted into u8.
-        /// 
-        /// * account_id: Collection owner.
-        CollectionCreated(CollectionId, u8, AccountId),
+	pub enum Event<T>
+	where
+		AccountId = <T as frame_system::Config>::AccountId,
+		CrossAccountId = <T as Config>::CrossAccountId,
+	{
+		/// New collection was created
+		///
+		/// # Arguments
+		///
+		/// * collection_id: Globally unique identifier of newly created collection.
+		///
+		/// * mode: [CollectionMode] converted into u8.
+		///
+		/// * account_id: Collection owner.
+		CollectionCreated(CollectionId, u8, AccountId),
 
-        /// New item was created.
-        /// 
-        /// # Arguments
-        /// 
-        /// * collection_id: Id of the collection where item was created.
-        /// 
-        /// * item_id: Id of an item. Unique within the collection.
-        ///
-        /// * recipient: Owner of newly created item 
-        ItemCreated(CollectionId, TokenId, CrossAccountId),
+		/// New item was created.
+		///
+		/// # Arguments
+		///
+		/// * collection_id: Id of the collection where item was created.
+		///
+		/// * item_id: Id of an item. Unique within the collection.
+		///
+		/// * recipient: Owner of newly created item
+		ItemCreated(CollectionId, TokenId, CrossAccountId),
 
-        /// Collection item was burned.
-        /// 
-        /// # Arguments
-        /// 
-        /// collection_id.
-        /// 
-        /// item_id: Identifier of burned NFT.
-        ItemDestroyed(CollectionId, TokenId),
+		/// Collection item was burned.
+		///
+		/// # Arguments
+		///
+		/// collection_id.
+		///
+		/// item_id: Identifier of burned NFT.
+		ItemDestroyed(CollectionId, TokenId),
 
-        /// Item was transferred
-        ///
-        /// * collection_id: Id of collection to which item is belong
-        ///
-        /// * item_id: Id of an item
-        ///
-        /// * sender: Original owner of item
-        ///
-        /// * recipient: New owner of item
-        ///
-        /// * amount: Always 1 for NFT
-        Transfer(CollectionId, TokenId, CrossAccountId, CrossAccountId, u128),
+		/// Item was transferred
+		///
+		/// * collection_id: Id of collection to which item is belong
+		///
+		/// * item_id: Id of an item
+		///
+		/// * sender: Original owner of item
+		///
+		/// * recipient: New owner of item
+		///
+		/// * amount: Always 1 for NFT
+		Transfer(CollectionId, TokenId, CrossAccountId, CrossAccountId, u128),
 
-        /// * collection_id
-        ///
-        /// * item_id
-        ///
-        /// * sender
-        ///
-        /// * spender
-        ///
-        /// * amount
-        Approved(CollectionId, TokenId, CrossAccountId, CrossAccountId, u128),
-    }
+		/// * collection_id
+		///
+		/// * item_id
+		///
+		/// * sender
+		///
+		/// * spender
+		///
+		/// * amount
+		Approved(CollectionId, TokenId, CrossAccountId, CrossAccountId, u128),
+	}
 );
 
 decl_module! {
-    pub struct Module<T: Config> for enum Call 
-    where 
-        origin: T::Origin
-    {
-        fn deposit_event() = default;
-        type Error = Error<T>;
+	pub struct Module<T: Config> for enum Call
+	where
+		origin: T::Origin
+	{
+		fn deposit_event() = default;
+		type Error = Error<T>;
 
-        fn on_initialize(_now: T::BlockNumber) -> Weight {
-            0
-        }
+		fn on_initialize(_now: T::BlockNumber) -> Weight {
+			0
+		}
 
-        /// This method creates a Collection of NFTs. Each Token may have multiple properties encoded as an array of bytes of certain length. The initial owner and admin of the collection are set to the address that signed the transaction. Both addresses can be changed later.
-        /// 
-        /// # Permissions
-        /// 
-        /// * Anyone.
-        /// 
-        /// # Arguments
-        /// 
-        /// * collection_name: UTF-16 string with collection name (limit 64 characters), will be stored as zero-terminated.
-        /// 
-        /// * collection_description: UTF-16 string with collection description (limit 256 characters), will be stored as zero-terminated.
-        /// 
-        /// * token_prefix: UTF-8 string with token prefix.
-        /// 
-        /// * mode: [CollectionMode] collection type and type dependent data.
-        // returns collection ID
-        #[weight = <T as Config>::WeightInfo::create_collection()]
-        #[transactional]
-        pub fn create_collection(origin,
-                                 collection_name: Vec<u16>,
-                                 collection_description: Vec<u16>,
-                                 token_prefix: Vec<u8>,
-                                 mode: CollectionMode) -> DispatchResult {
+		/// This method creates a Collection of NFTs. Each Token may have multiple properties encoded as an array of bytes of certain length. The initial owner and admin of the collection are set to the address that signed the transaction. Both addresses can be changed later.
+		///
+		/// # Permissions
+		///
+		/// * Anyone.
+		///
+		/// # Arguments
+		///
+		/// * collection_name: UTF-16 string with collection name (limit 64 characters), will be stored as zero-terminated.
+		///
+		/// * collection_description: UTF-16 string with collection description (limit 256 characters), will be stored as zero-terminated.
+		///
+		/// * token_prefix: UTF-8 string with token prefix.
+		///
+		/// * mode: [CollectionMode] collection type and type dependent data.
+		// returns collection ID
+		#[weight = <T as Config>::WeightInfo::create_collection()]
+		#[transactional]
+		pub fn create_collection(origin,
+								 collection_name: Vec<u16>,
+								 collection_description: Vec<u16>,
+								 token_prefix: Vec<u8>,
+								 mode: CollectionMode) -> DispatchResult {
 
-            // Anyone can create a collection
-            let who = ensure_signed(origin)?;
+			// Anyone can create a collection
+			let who = ensure_signed(origin)?;
 
-            // Take a (non-refundable) deposit of collection creation
-            let mut imbalance = <<<T as Config>::Currency as Currency<T::AccountId>>::PositiveImbalance>::zero();
-            imbalance.subsume(<<T as Config>::Currency as Currency<T::AccountId>>::deposit_creating(
-                &T::TreasuryAccountId::get(),
-                T::CollectionCreationPrice::get(),
-            ));
-            <T as Config>::Currency::settle(
-                &who,
-                imbalance,
-                WithdrawReasons::TRANSFER,
-                ExistenceRequirement::KeepAlive,
-            ).map_err(|_| Error::<T>::NoPermission)?;
+			// Take a (non-refundable) deposit of collection creation
+			let mut imbalance = <<<T as Config>::Currency as Currency<T::AccountId>>::PositiveImbalance>::zero();
+			imbalance.subsume(<<T as Config>::Currency as Currency<T::AccountId>>::deposit_creating(
+				&T::TreasuryAccountId::get(),
+				T::CollectionCreationPrice::get(),
+			));
+			<T as Config>::Currency::settle(
+				&who,
+				imbalance,
+				WithdrawReasons::TRANSFER,
+				ExistenceRequirement::KeepAlive,
+			).map_err(|_| Error::<T>::NoPermission)?;
 
-            let decimal_points = match mode {
-                CollectionMode::Fungible(points) => points,
-                _ => 0
-            };
+			let decimal_points = match mode {
+				CollectionMode::Fungible(points) => points,
+				_ => 0
+			};
 
-            let chain_limit = ChainLimit::get();
+			let chain_limit = ChainLimit::get();
 
-            let created_count = CreatedCollectionCount::get();
-            let destroyed_count = DestroyedCollectionCount::get();
+			let created_count = CreatedCollectionCount::get();
+			let destroyed_count = DestroyedCollectionCount::get();
 
-            // bound Total number of collections
-            ensure!(created_count - destroyed_count < chain_limit.collection_numbers_limit, Error::<T>::TotalCollectionsLimitExceeded);
+			// bound Total number of collections
+			ensure!(created_count - destroyed_count < chain_limit.collection_numbers_limit, Error::<T>::TotalCollectionsLimitExceeded);
 
-            // check params
-            ensure!(decimal_points <= MAX_DECIMAL_POINTS, Error::<T>::CollectionDecimalPointLimitExceeded);
-            ensure!(collection_name.len() <= 64, Error::<T>::CollectionNameLimitExceeded);
-            ensure!(collection_description.len() <= 256, Error::<T>::CollectionDescriptionLimitExceeded);
-            ensure!(token_prefix.len() <= 16, Error::<T>::CollectionTokenPrefixLimitExceeded);
+			// check params
+			ensure!(decimal_points <= MAX_DECIMAL_POINTS, Error::<T>::CollectionDecimalPointLimitExceeded);
+			ensure!(collection_name.len() <= 64, Error::<T>::CollectionNameLimitExceeded);
+			ensure!(collection_description.len() <= 256, Error::<T>::CollectionDescriptionLimitExceeded);
+			ensure!(token_prefix.len() <= 16, Error::<T>::CollectionTokenPrefixLimitExceeded);
 
-            // Generate next collection ID
-            let next_id = created_count
-                .checked_add(1)
-                .ok_or(Error::<T>::NumOverflow)?;
+			// Generate next collection ID
+			let next_id = created_count
+				.checked_add(1)
+				.ok_or(Error::<T>::NumOverflow)?;
 
-            CreatedCollectionCount::put(next_id);
+			CreatedCollectionCount::put(next_id);
 
-            let limits = CollectionLimits {
-                sponsored_data_size: chain_limit.custom_data_limit,
-                ..Default::default()
-            };
+			let limits = CollectionLimits {
+				sponsored_data_size: chain_limit.custom_data_limit,
+				..Default::default()
+			};
 
-            // Create new collection
-            let new_collection = Collection {
-                owner: who.clone(),
-                name: collection_name,
-                mode: mode.clone(),
-                mint_mode: false,
-                access: AccessMode::Normal,
-                description: collection_description,
-                decimal_points: decimal_points,
-                token_prefix: token_prefix,
-                offchain_schema: Vec::new(),
-                schema_version: SchemaVersion::ImageURL,
-                sponsorship: SponsorshipState::Disabled,
-                variable_on_chain_schema: Vec::new(),
-                const_on_chain_schema: Vec::new(),
-                limits,
-            };
+			// Create new collection
+			let new_collection = Collection {
+				owner: who.clone(),
+				name: collection_name,
+				mode: mode.clone(),
+				mint_mode: false,
+				access: AccessMode::Normal,
+				description: collection_description,
+				decimal_points,
+				token_prefix,
+				offchain_schema: Vec::new(),
+				schema_version: SchemaVersion::ImageURL,
+				sponsorship: SponsorshipState::Disabled,
+				variable_on_chain_schema: Vec::new(),
+				const_on_chain_schema: Vec::new(),
+				limits,
+			};
 
-            // Add new collection to map
-            <CollectionById<T>>::insert(next_id, new_collection);
+			// Add new collection to map
+			<CollectionById<T>>::insert(next_id, new_collection);
 
-            // call event
-            Self::deposit_event(RawEvent::CollectionCreated(next_id, mode.into(), who));
+			// call event
+			Self::deposit_event(RawEvent::CollectionCreated(next_id, mode.id(), who));
 
-            Ok(())
-        }
+			Ok(())
+		}
 
-        /// **DANGEROUS**: Destroys collection and all NFTs within this collection. Users irrecoverably lose their assets and may lose real money.
-        /// 
-        /// # Permissions
-        /// 
-        /// * Collection Owner.
-        /// 
-        /// # Arguments
-        /// 
-        /// * collection_id: collection to destroy.
-        #[weight = <T as Config>::WeightInfo::destroy_collection()]
-        #[transactional]
-        pub fn destroy_collection(origin, collection_id: CollectionId) -> DispatchResult {
+		/// **DANGEROUS**: Destroys collection and all NFTs within this collection. Users irrecoverably lose their assets and may lose real money.
+		///
+		/// # Permissions
+		///
+		/// * Collection Owner.
+		///
+		/// # Arguments
+		///
+		/// * collection_id: collection to destroy.
+		#[weight = <T as Config>::WeightInfo::destroy_collection()]
+		#[transactional]
+		pub fn destroy_collection(origin, collection_id: CollectionId) -> DispatchResult {
 
-            let sender = ensure_signed(origin)?;
-            let collection = Self::get_collection(collection_id)?;
-            Self::check_owner_permissions(&collection, &sender)?;
-            if !collection.limits.owner_can_destroy {
-                fail!(Error::<T>::NoPermission);
-            }
+			let sender = ensure_signed(origin)?;
+			let collection = Self::get_collection(collection_id)?;
+			Self::check_owner_permissions(&collection, &sender)?;
+			if !collection.limits.owner_can_destroy {
+				fail!(Error::<T>::NoPermission);
+			}
 
-            <AddressTokens<T>>::remove_prefix(collection_id);
-            <Allowances<T>>::remove_prefix(collection_id);
-            <Balance<T>>::remove_prefix(collection_id);
-            <ItemListIndex>::remove(collection_id);
-            <AdminList<T>>::remove(collection_id);
-            <CollectionById<T>>::remove(collection_id);
-            <WhiteList<T>>::remove_prefix(collection_id);
+			<AddressTokens<T>>::remove_prefix(collection_id);
+			<Allowances<T>>::remove_prefix(collection_id);
+			<Balance<T>>::remove_prefix(collection_id);
+			<ItemListIndex>::remove(collection_id);
+			<AdminList<T>>::remove(collection_id);
+			<CollectionById<T>>::remove(collection_id);
+			<WhiteList<T>>::remove_prefix(collection_id);
 
-            <NftItemList<T>>::remove_prefix(collection_id);
-            <FungibleItemList<T>>::remove_prefix(collection_id);
-            <ReFungibleItemList<T>>::remove_prefix(collection_id);
+			<NftItemList<T>>::remove_prefix(collection_id);
+			<FungibleItemList<T>>::remove_prefix(collection_id);
+			<ReFungibleItemList<T>>::remove_prefix(collection_id);
 
-            <NftTransferBasket<T>>::remove_prefix(collection_id);
-            <FungibleTransferBasket<T>>::remove_prefix(collection_id);
-            <ReFungibleTransferBasket<T>>::remove_prefix(collection_id);
+			<NftTransferBasket<T>>::remove_prefix(collection_id);
+			<FungibleTransferBasket<T>>::remove_prefix(collection_id);
+			<ReFungibleTransferBasket<T>>::remove_prefix(collection_id);
 
-            <VariableMetaDataBasket<T>>::remove_prefix(collection_id);
+			<VariableMetaDataBasket<T>>::remove_prefix(collection_id);
 
-            DestroyedCollectionCount::put(DestroyedCollectionCount::get()
-                .checked_add(1)
-                .ok_or(Error::<T>::NumOverflow)?);
+			DestroyedCollectionCount::put(DestroyedCollectionCount::get()
+				.checked_add(1)
+				.ok_or(Error::<T>::NumOverflow)?);
 
-            Ok(())
-        }
+			Ok(())
+		}
 
-        /// Add an address to white list.
-        /// 
-        /// # Permissions
-        /// 
-        /// * Collection Owner
-        /// * Collection Admin
-        /// 
-        /// # Arguments
-        /// 
-        /// * collection_id.
-        /// 
-        /// * address.
-        #[weight = <T as Config>::WeightInfo::add_to_white_list()]
-        #[transactional]
-        pub fn add_to_white_list(origin, collection_id: CollectionId, address: T::CrossAccountId) -> DispatchResult{
+		/// Add an address to white list.
+		///
+		/// # Permissions
+		///
+		/// * Collection Owner
+		/// * Collection Admin
+		///
+		/// # Arguments
+		///
+		/// * collection_id.
+		///
+		/// * address.
+		#[weight = <T as Config>::WeightInfo::add_to_white_list()]
+		#[transactional]
+		pub fn add_to_white_list(origin, collection_id: CollectionId, address: T::CrossAccountId) -> DispatchResult{
 
-            let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
-            let collection = Self::get_collection(collection_id)?;
+			let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
+			let collection = Self::get_collection(collection_id)?;
 
-            Self::toggle_white_list_internal(
-                &sender,
-                &collection,
-                &address,
-                true,
-            )?;
+			Self::toggle_white_list_internal(
+				&sender,
+				&collection,
+				&address,
+				true,
+			)?;
 
-            Ok(())
-        }
+			Ok(())
+		}
 
-        /// Remove an address from white list.
-        /// 
-        /// # Permissions
-        /// 
-        /// * Collection Owner
-        /// * Collection Admin
-        /// 
-        /// # Arguments
-        /// 
-        /// * collection_id.
-        /// 
-        /// * address.
-        #[weight = <T as Config>::WeightInfo::remove_from_white_list()]
-        #[transactional]
-        pub fn remove_from_white_list(origin, collection_id: CollectionId, address: T::CrossAccountId) -> DispatchResult{
+		/// Remove an address from white list.
+		///
+		/// # Permissions
+		///
+		/// * Collection Owner
+		/// * Collection Admin
+		///
+		/// # Arguments
+		///
+		/// * collection_id.
+		///
+		/// * address.
+		#[weight = <T as Config>::WeightInfo::remove_from_white_list()]
+		#[transactional]
+		pub fn remove_from_white_list(origin, collection_id: CollectionId, address: T::CrossAccountId) -> DispatchResult{
 
-            let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
-            let collection = Self::get_collection(collection_id)?;
+			let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
+			let collection = Self::get_collection(collection_id)?;
 
-            Self::toggle_white_list_internal(
-                &sender,
-                &collection,
-                &address,
-                false,
-            )?;
+			Self::toggle_white_list_internal(
+				&sender,
+				&collection,
+				&address,
+				false,
+			)?;
 
-            Ok(())
-        }
+			Ok(())
+		}
 
-        /// Toggle between normal and white list access for the methods with access for `Anyone`.
-        /// 
-        /// # Permissions
-        /// 
-        /// * Collection Owner.
-        /// 
-        /// # Arguments
-        /// 
-        /// * collection_id.
-        /// 
-        /// * mode: [AccessMode]
-        #[weight = <T as Config>::WeightInfo::set_public_access_mode()]
-        #[transactional]
-        pub fn set_public_access_mode(origin, collection_id: CollectionId, mode: AccessMode) -> DispatchResult
-        {
-            let sender = ensure_signed(origin)?;
+		/// Toggle between normal and white list access for the methods with access for `Anyone`.
+		///
+		/// # Permissions
+		///
+		/// * Collection Owner.
+		///
+		/// # Arguments
+		///
+		/// * collection_id.
+		///
+		/// * mode: [AccessMode]
+		#[weight = <T as Config>::WeightInfo::set_public_access_mode()]
+		#[transactional]
+		pub fn set_public_access_mode(origin, collection_id: CollectionId, mode: AccessMode) -> DispatchResult
+		{
+			let sender = ensure_signed(origin)?;
 
-            let mut target_collection = Self::get_collection(collection_id)?;
-            Self::check_owner_permissions(&target_collection, &sender)?;
-            target_collection.access = mode;
-            Self::save_collection(target_collection);
+			let mut target_collection = Self::get_collection(collection_id)?;
+			Self::check_owner_permissions(&target_collection, &sender)?;
+			target_collection.access = mode;
+			Self::save_collection(target_collection);
 
-            Ok(())
-        }
+			Ok(())
+		}
 
-        /// Allows Anyone to create tokens if:
-        /// * White List is enabled, and
-        /// * Address is added to white list, and
-        /// * This method was called with True parameter
-        /// 
-        /// # Permissions
-        /// * Collection Owner
-        ///
-        /// # Arguments
-        /// 
-        /// * collection_id.
-        /// 
-        /// * mint_permission: Boolean parameter. If True, allows minting to Anyone with conditions above.
-        #[weight = <T as Config>::WeightInfo::set_mint_permission()]
-        #[transactional]
-        pub fn set_mint_permission(origin, collection_id: CollectionId, mint_permission: bool) -> DispatchResult
-        {
-            let sender = ensure_signed(origin)?;
+		/// Allows Anyone to create tokens if:
+		/// * White List is enabled, and
+		/// * Address is added to white list, and
+		/// * This method was called with True parameter
+		///
+		/// # Permissions
+		/// * Collection Owner
+		///
+		/// # Arguments
+		///
+		/// * collection_id.
+		///
+		/// * mint_permission: Boolean parameter. If True, allows minting to Anyone with conditions above.
+		#[weight = <T as Config>::WeightInfo::set_mint_permission()]
+		#[transactional]
+		pub fn set_mint_permission(origin, collection_id: CollectionId, mint_permission: bool) -> DispatchResult
+		{
+			let sender = ensure_signed(origin)?;
 
-            let mut target_collection = Self::get_collection(collection_id)?;
-            Self::check_owner_permissions(&target_collection, &sender)?;
-            target_collection.mint_mode = mint_permission;
-            Self::save_collection(target_collection);
+			let mut target_collection = Self::get_collection(collection_id)?;
+			Self::check_owner_permissions(&target_collection, &sender)?;
+			target_collection.mint_mode = mint_permission;
+			Self::save_collection(target_collection);
 
-            Ok(())
-        }
+			Ok(())
+		}
 
-        /// Change the owner of the collection.
-        /// 
-        /// # Permissions
-        /// 
-        /// * Collection Owner.
-        /// 
-        /// # Arguments
-        /// 
-        /// * collection_id.
-        /// 
-        /// * new_owner.
-        #[weight = <T as Config>::WeightInfo::change_collection_owner()]
-        #[transactional]
-        pub fn change_collection_owner(origin, collection_id: CollectionId, new_owner: T::AccountId) -> DispatchResult {
+		/// Change the owner of the collection.
+		///
+		/// # Permissions
+		///
+		/// * Collection Owner.
+		///
+		/// # Arguments
+		///
+		/// * collection_id.
+		///
+		/// * new_owner.
+		#[weight = <T as Config>::WeightInfo::change_collection_owner()]
+		#[transactional]
+		pub fn change_collection_owner(origin, collection_id: CollectionId, new_owner: T::AccountId) -> DispatchResult {
 
-            let sender = ensure_signed(origin)?;
-            let mut target_collection = Self::get_collection(collection_id)?;
-            Self::check_owner_permissions(&target_collection, &sender)?;
-            target_collection.owner = new_owner;
-            Self::save_collection(target_collection);
+			let sender = ensure_signed(origin)?;
+			let mut target_collection = Self::get_collection(collection_id)?;
+			Self::check_owner_permissions(&target_collection, &sender)?;
+			target_collection.owner = new_owner;
+			Self::save_collection(target_collection);
 
-            Ok(())
-        }
+			Ok(())
+		}
 
-        /// Adds an admin of the Collection.
-        /// NFT Collection can be controlled by multiple admin addresses (some which can also be servers, for example). Admins can issue and burn NFTs, as well as add and remove other admins, but cannot change NFT or Collection ownership. 
-        /// 
-        /// # Permissions
-        /// 
-        /// * Collection Owner.
-        /// * Collection Admin.
-        /// 
-        /// # Arguments
-        /// 
-        /// * collection_id: ID of the Collection to add admin for.
-        /// 
-        /// * new_admin_id: Address of new admin to add.
-        #[weight = <T as Config>::WeightInfo::add_collection_admin()]
-        #[transactional]
-        pub fn add_collection_admin(origin, collection_id: CollectionId, new_admin_id: T::CrossAccountId) -> DispatchResult {
-            let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
-            let collection = Self::get_collection(collection_id)?;
-            Self::check_owner_or_admin_permissions(&collection, &sender)?;
-            let mut admin_arr = <AdminList<T>>::get(collection_id);
+		/// Adds an admin of the Collection.
+		/// NFT Collection can be controlled by multiple admin addresses (some which can also be servers, for example). Admins can issue and burn NFTs, as well as add and remove other admins, but cannot change NFT or Collection ownership.
+		///
+		/// # Permissions
+		///
+		/// * Collection Owner.
+		/// * Collection Admin.
+		///
+		/// # Arguments
+		///
+		/// * collection_id: ID of the Collection to add admin for.
+		///
+		/// * new_admin_id: Address of new admin to add.
+		#[weight = <T as Config>::WeightInfo::add_collection_admin()]
+		#[transactional]
+		pub fn add_collection_admin(origin, collection_id: CollectionId, new_admin_id: T::CrossAccountId) -> DispatchResult {
+			let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
+			let collection = Self::get_collection(collection_id)?;
+			Self::check_owner_or_admin_permissions(&collection, &sender)?;
+			let mut admin_arr = <AdminList<T>>::get(collection_id);
 
-            match admin_arr.binary_search(&new_admin_id) {
-                Ok(_) => {},
-                Err(idx) => {
-                    let limits = ChainLimit::get();
-                    ensure!(admin_arr.len() < limits.collections_admins_limit as usize, Error::<T>::CollectionAdminsLimitExceeded);
-                    admin_arr.insert(idx, new_admin_id);
-                    <AdminList<T>>::insert(collection_id, admin_arr);
-                }
-            }
-            Ok(())
-        }
+			match admin_arr.binary_search(&new_admin_id) {
+				Ok(_) => {},
+				Err(idx) => {
+					let limits = ChainLimit::get();
+					ensure!(admin_arr.len() < limits.collections_admins_limit as usize, Error::<T>::CollectionAdminsLimitExceeded);
+					admin_arr.insert(idx, new_admin_id);
+					<AdminList<T>>::insert(collection_id, admin_arr);
+				}
+			}
+			Ok(())
+		}
 
-        /// Remove admin address of the Collection. An admin address can remove itself. List of admins may become empty, in which case only Collection Owner will be able to add an Admin.
-        ///
-        /// # Permissions
-        /// 
-        /// * Collection Owner.
-        /// * Collection Admin.
-        /// 
-        /// # Arguments
-        /// 
-        /// * collection_id: ID of the Collection to remove admin for.
-        /// 
-        /// * account_id: Address of admin to remove.
-        #[weight = <T as Config>::WeightInfo::remove_collection_admin()]
-        #[transactional]
-        pub fn remove_collection_admin(origin, collection_id: CollectionId, account_id: T::CrossAccountId) -> DispatchResult {
-            let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
-            let collection = Self::get_collection(collection_id)?;
-            Self::check_owner_or_admin_permissions(&collection, &sender)?;
-            let mut admin_arr = <AdminList<T>>::get(collection_id);
+		/// Remove admin address of the Collection. An admin address can remove itself. List of admins may become empty, in which case only Collection Owner will be able to add an Admin.
+		///
+		/// # Permissions
+		///
+		/// * Collection Owner.
+		/// * Collection Admin.
+		///
+		/// # Arguments
+		///
+		/// * collection_id: ID of the Collection to remove admin for.
+		///
+		/// * account_id: Address of admin to remove.
+		#[weight = <T as Config>::WeightInfo::remove_collection_admin()]
+		#[transactional]
+		pub fn remove_collection_admin(origin, collection_id: CollectionId, account_id: T::CrossAccountId) -> DispatchResult {
+			let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
+			let collection = Self::get_collection(collection_id)?;
+			Self::check_owner_or_admin_permissions(&collection, &sender)?;
+			let mut admin_arr = <AdminList<T>>::get(collection_id);
 
-            match admin_arr.binary_search(&account_id) {
-                Ok(idx) => {
-                    admin_arr.remove(idx);
-                    <AdminList<T>>::insert(collection_id, admin_arr);
-                },
-                Err(_) => {}
-            }
-            Ok(())
-        }
+			if let Ok(idx) = admin_arr.binary_search(&account_id) {
+				admin_arr.remove(idx);
+				<AdminList<T>>::insert(collection_id, admin_arr);
+			}
+			Ok(())
+		}
 
-        /// # Permissions
-        /// 
-        /// * Collection Owner
-        /// 
-        /// # Arguments
-        /// 
-        /// * collection_id.
-        /// 
-        /// * new_sponsor.
-        #[weight = <T as Config>::WeightInfo::set_collection_sponsor()]
-        #[transactional]
-        pub fn set_collection_sponsor(origin, collection_id: CollectionId, new_sponsor: T::AccountId) -> DispatchResult {
-            let sender = ensure_signed(origin)?;
-            let mut target_collection = Self::get_collection(collection_id)?;
-            Self::check_owner_permissions(&target_collection, &sender)?;
+		/// # Permissions
+		///
+		/// * Collection Owner
+		///
+		/// # Arguments
+		///
+		/// * collection_id.
+		///
+		/// * new_sponsor.
+		#[weight = <T as Config>::WeightInfo::set_collection_sponsor()]
+		#[transactional]
+		pub fn set_collection_sponsor(origin, collection_id: CollectionId, new_sponsor: T::AccountId) -> DispatchResult {
+			let sender = ensure_signed(origin)?;
+			let mut target_collection = Self::get_collection(collection_id)?;
+			Self::check_owner_permissions(&target_collection, &sender)?;
 
-            target_collection.sponsorship = SponsorshipState::Unconfirmed(new_sponsor);
-            Self::save_collection(target_collection);
+			target_collection.sponsorship = SponsorshipState::Unconfirmed(new_sponsor);
+			Self::save_collection(target_collection);
 
-            Ok(())
-        }
+			Ok(())
+		}
 
-        /// # Permissions
-        /// 
-        /// * Sponsor.
-        /// 
-        /// # Arguments
-        /// 
-        /// * collection_id.
-        #[weight = <T as Config>::WeightInfo::confirm_sponsorship()]
-        #[transactional]
-        pub fn confirm_sponsorship(origin, collection_id: CollectionId) -> DispatchResult {
-            let sender = ensure_signed(origin)?;
+		/// # Permissions
+		///
+		/// * Sponsor.
+		///
+		/// # Arguments
+		///
+		/// * collection_id.
+		#[weight = <T as Config>::WeightInfo::confirm_sponsorship()]
+		#[transactional]
+		pub fn confirm_sponsorship(origin, collection_id: CollectionId) -> DispatchResult {
+			let sender = ensure_signed(origin)?;
 
-            let mut target_collection = Self::get_collection(collection_id)?;
-            ensure!(
-                target_collection.sponsorship.pending_sponsor() == Some(&sender),
-                Error::<T>::ConfirmUnsetSponsorFail
-            );
+			let mut target_collection = Self::get_collection(collection_id)?;
+			ensure!(
+				target_collection.sponsorship.pending_sponsor() == Some(&sender),
+				Error::<T>::ConfirmUnsetSponsorFail
+			);
 
-            target_collection.sponsorship = SponsorshipState::Confirmed(sender);
-            Self::save_collection(target_collection);
+			target_collection.sponsorship = SponsorshipState::Confirmed(sender);
+			Self::save_collection(target_collection);
 
-            Ok(())
-        }
+			Ok(())
+		}
 
-        /// Switch back to pay-per-own-transaction model.
-        ///
-        /// # Permissions
-        ///
-        /// * Collection owner.
-        /// 
-        /// # Arguments
-        /// 
-        /// * collection_id.
-        #[weight = <T as Config>::WeightInfo::remove_collection_sponsor()]
-        #[transactional]
-        pub fn remove_collection_sponsor(origin, collection_id: CollectionId) -> DispatchResult {
-            let sender = ensure_signed(origin)?;
+		/// Switch back to pay-per-own-transaction model.
+		///
+		/// # Permissions
+		///
+		/// * Collection owner.
+		///
+		/// # Arguments
+		///
+		/// * collection_id.
+		#[weight = <T as Config>::WeightInfo::remove_collection_sponsor()]
+		#[transactional]
+		pub fn remove_collection_sponsor(origin, collection_id: CollectionId) -> DispatchResult {
+			let sender = ensure_signed(origin)?;
 
-            let mut target_collection = Self::get_collection(collection_id)?;
-            Self::check_owner_permissions(&target_collection, &sender)?;
+			let mut target_collection = Self::get_collection(collection_id)?;
+			Self::check_owner_permissions(&target_collection, &sender)?;
 
-            target_collection.sponsorship = SponsorshipState::Disabled;
-            Self::save_collection(target_collection);
+			target_collection.sponsorship = SponsorshipState::Disabled;
+			Self::save_collection(target_collection);
 
-            Ok(())
-        }
+			Ok(())
+		}
 
-        /// This method creates a concrete instance of NFT Collection created with CreateCollection method.
-        /// 
-        /// # Permissions
-        /// 
-        /// * Collection Owner.
-        /// * Collection Admin.
-        /// * Anyone if
-        ///     * White List is enabled, and
-        ///     * Address is added to white list, and
-        ///     * MintPermission is enabled (see SetMintPermission method)
-        /// 
-        /// # Arguments
-        /// 
-        /// * collection_id: ID of the collection.
-        /// 
-        /// * owner: Address, initial owner of the NFT.
-        ///
-        /// * data: Token data to store on chain.
-        // #[weight =
-        // (130_000_000 as Weight)
-        // .saturating_add((2135 as Weight).saturating_mul((properties.len() as u64) as Weight))
-        // .saturating_add(RocksDbWeight::get().reads(10 as Weight))
-        // .saturating_add(RocksDbWeight::get().writes(8 as Weight))]
+		/// This method creates a concrete instance of NFT Collection created with CreateCollection method.
+		///
+		/// # Permissions
+		///
+		/// * Collection Owner.
+		/// * Collection Admin.
+		/// * Anyone if
+		///     * White List is enabled, and
+		///     * Address is added to white list, and
+		///     * MintPermission is enabled (see SetMintPermission method)
+		///
+		/// # Arguments
+		///
+		/// * collection_id: ID of the collection.
+		///
+		/// * owner: Address, initial owner of the NFT.
+		///
+		/// * data: Token data to store on chain.
+		// #[weight =
+		// (130_000_000 as Weight)
+		// .saturating_add((2135 as Weight).saturating_mul((properties.len() as u64) as Weight))
+		// .saturating_add(RocksDbWeight::get().reads(10 as Weight))
+		// .saturating_add(RocksDbWeight::get().writes(8 as Weight))]
 
-        #[weight = <T as Config>::WeightInfo::create_item(data.len())]
-        #[transactional]
-        pub fn create_item(origin, collection_id: CollectionId, owner: T::CrossAccountId, data: CreateItemData) -> DispatchResult {
-            let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
-            let collection = Self::get_collection(collection_id)?;
+		#[weight = <T as Config>::WeightInfo::create_item(data.data_size())]
+		#[transactional]
+		pub fn create_item(origin, collection_id: CollectionId, owner: T::CrossAccountId, data: CreateItemData) -> DispatchResult {
+			let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
+			let collection = Self::get_collection(collection_id)?;
 
-            Self::create_item_internal(&sender, &collection, &owner, data)?;
+			Self::create_item_internal(&sender, &collection, &owner, data)?;
 
-            Self::submit_logs(collection)?;
-            Ok(())
-        }
+			Self::submit_logs(collection)?;
+			Ok(())
+		}
 
-        /// This method creates multiple items in a collection created with CreateCollection method.
-        /// 
-        /// # Permissions
-        /// 
-        /// * Collection Owner.
-        /// * Collection Admin.
-        /// * Anyone if
-        ///     * White List is enabled, and
-        ///     * Address is added to white list, and
-        ///     * MintPermission is enabled (see SetMintPermission method)
-        /// 
-        /// # Arguments
-        /// 
-        /// * collection_id: ID of the collection.
-        /// 
-        /// * itemsData: Array items properties. Each property is an array of bytes itself, see [create_item].
-        /// 
-        /// * owner: Address, initial owner of the NFT.
-        #[weight = <T as Config>::WeightInfo::create_item(items_data.into_iter()
-                               .map(|data| { data.len() })
-                               .sum())]
-        #[transactional]
-        pub fn create_multiple_items(origin, collection_id: CollectionId, owner: T::CrossAccountId, items_data: Vec<CreateItemData>) -> DispatchResult {
+		/// This method creates multiple items in a collection created with CreateCollection method.
+		///
+		/// # Permissions
+		///
+		/// * Collection Owner.
+		/// * Collection Admin.
+		/// * Anyone if
+		///     * White List is enabled, and
+		///     * Address is added to white list, and
+		///     * MintPermission is enabled (see SetMintPermission method)
+		///
+		/// # Arguments
+		///
+		/// * collection_id: ID of the collection.
+		///
+		/// * itemsData: Array items properties. Each property is an array of bytes itself, see [create_item].
+		///
+		/// * owner: Address, initial owner of the NFT.
+		#[weight = <T as Config>::WeightInfo::create_item(items_data.iter()
+							   .map(|data| { data.data_size() })
+							   .sum())]
+		#[transactional]
+		pub fn create_multiple_items(origin, collection_id: CollectionId, owner: T::CrossAccountId, items_data: Vec<CreateItemData>) -> DispatchResult {
 
-            ensure!(items_data.len() > 0, Error::<T>::EmptyArgument);
-            let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
-            let collection = Self::get_collection(collection_id)?;
+			ensure!(!items_data.is_empty(), Error::<T>::EmptyArgument);
+			let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
+			let collection = Self::get_collection(collection_id)?;
 
-            Self::create_multiple_items_internal(&sender, &collection, &owner, items_data)?;
+			Self::create_multiple_items_internal(&sender, &collection, &owner, items_data)?;
 
-            Self::submit_logs(collection)?;
-            Ok(())
-        }
+			Self::submit_logs(collection)?;
+			Ok(())
+		}
 
-        /// Destroys a concrete instance of NFT.
-        /// 
-        /// # Permissions
-        /// 
-        /// * Collection Owner.
-        /// * Collection Admin.
-        /// * Current NFT Owner.
-        /// 
-        /// # Arguments
-        /// 
-        /// * collection_id: ID of the collection.
-        /// 
-        /// * item_id: ID of NFT to burn.
-        #[weight = <T as Config>::WeightInfo::burn_item()]
-        #[transactional]
-        pub fn burn_item(origin, collection_id: CollectionId, item_id: TokenId, value: u128) -> DispatchResult {
+		/// Destroys a concrete instance of NFT.
+		///
+		/// # Permissions
+		///
+		/// * Collection Owner.
+		/// * Collection Admin.
+		/// * Current NFT Owner.
+		///
+		/// # Arguments
+		///
+		/// * collection_id: ID of the collection.
+		///
+		/// * item_id: ID of NFT to burn.
+		#[weight = <T as Config>::WeightInfo::burn_item()]
+		#[transactional]
+		pub fn burn_item(origin, collection_id: CollectionId, item_id: TokenId, value: u128) -> DispatchResult {
 
-            let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
-            let target_collection = Self::get_collection(collection_id)?;
+			let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
+			let target_collection = Self::get_collection(collection_id)?;
 
-            Self::burn_item_internal(&sender, &target_collection, item_id, value)?;
+			Self::burn_item_internal(&sender, &target_collection, item_id, value)?;
 
-            Self::submit_logs(target_collection)?;
-            Ok(())
-        }
+			Self::submit_logs(target_collection)?;
+			Ok(())
+		}
 
-        /// Change ownership of the token.
-        /// 
-        /// # Permissions
-        /// 
-        /// * Collection Owner
-        /// * Collection Admin
-        /// * Current NFT owner
-        ///
-        /// # Arguments
-        /// 
-        /// * recipient: Address of token recipient.
-        /// 
-        /// * collection_id.
-        /// 
-        /// * item_id: ID of the item
-        ///     * Non-Fungible Mode: Required.
-        ///     * Fungible Mode: Ignored.
-        ///     * Re-Fungible Mode: Required.
-        /// 
-        /// * value: Amount to transfer.
-        ///     * Non-Fungible Mode: Ignored
-        ///     * Fungible Mode: Must specify transferred amount
-        ///     * Re-Fungible Mode: Must specify transferred portion (between 0 and 1)
-        #[weight = <T as Config>::WeightInfo::transfer()]
-        #[transactional]
-        pub fn transfer(origin, recipient: T::CrossAccountId, collection_id: CollectionId, item_id: TokenId, value: u128) -> DispatchResult {
-            let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
-            let collection = Self::get_collection(collection_id)?;
+		/// Change ownership of the token.
+		///
+		/// # Permissions
+		///
+		/// * Collection Owner
+		/// * Collection Admin
+		/// * Current NFT owner
+		///
+		/// # Arguments
+		///
+		/// * recipient: Address of token recipient.
+		///
+		/// * collection_id.
+		///
+		/// * item_id: ID of the item
+		///     * Non-Fungible Mode: Required.
+		///     * Fungible Mode: Ignored.
+		///     * Re-Fungible Mode: Required.
+		///
+		/// * value: Amount to transfer.
+		///     * Non-Fungible Mode: Ignored
+		///     * Fungible Mode: Must specify transferred amount
+		///     * Re-Fungible Mode: Must specify transferred portion (between 0 and 1)
+		#[weight = <T as Config>::WeightInfo::transfer()]
+		#[transactional]
+		pub fn transfer(origin, recipient: T::CrossAccountId, collection_id: CollectionId, item_id: TokenId, value: u128) -> DispatchResult {
+			let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
+			let collection = Self::get_collection(collection_id)?;
 
-            Self::transfer_internal(&sender, &recipient, &collection, item_id, value)?;
+			Self::transfer_internal(&sender, &recipient, &collection, item_id, value)?;
 
-            Self::submit_logs(collection)?;
-            Ok(())
-        }
+			Self::submit_logs(collection)?;
+			Ok(())
+		}
 
-        /// Set, change, or remove approved address to transfer the ownership of the NFT.
-        /// 
-        /// # Permissions
-        /// 
-        /// * Collection Owner
-        /// * Collection Admin
-        /// * Current NFT owner
-        /// 
-        /// # Arguments
-        /// 
-        /// * approved: Address that is approved to transfer this NFT or zero (if needed to remove approval).
-        /// 
-        /// * collection_id.
-        /// 
-        /// * item_id: ID of the item.
-        #[weight = <T as Config>::WeightInfo::approve()]
-        #[transactional]
-        pub fn approve(origin, spender: T::CrossAccountId, collection_id: CollectionId, item_id: TokenId, amount: u128) -> DispatchResult {
-            let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
-            let collection = Self::get_collection(collection_id)?;
+		/// Set, change, or remove approved address to transfer the ownership of the NFT.
+		///
+		/// # Permissions
+		///
+		/// * Collection Owner
+		/// * Collection Admin
+		/// * Current NFT owner
+		///
+		/// # Arguments
+		///
+		/// * approved: Address that is approved to transfer this NFT or zero (if needed to remove approval).
+		///
+		/// * collection_id.
+		///
+		/// * item_id: ID of the item.
+		#[weight = <T as Config>::WeightInfo::approve()]
+		#[transactional]
+		pub fn approve(origin, spender: T::CrossAccountId, collection_id: CollectionId, item_id: TokenId, amount: u128) -> DispatchResult {
+			let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
+			let collection = Self::get_collection(collection_id)?;
 
-            Self::approve_internal(&sender, &spender, &collection, item_id, amount)?;
+			Self::approve_internal(&sender, &spender, &collection, item_id, amount)?;
 
-            Self::submit_logs(collection)?;
-            Ok(())
-        }
-        
-        /// Change ownership of a NFT on behalf of the owner. See Approve method for additional information. After this method executes, the approval is removed so that the approved address will not be able to transfer this NFT again from this owner.
-        /// 
-        /// # Permissions
-        /// * Collection Owner
-        /// * Collection Admin
-        /// * Current NFT owner
-        /// * Address approved by current NFT owner
-        /// 
-        /// # Arguments
-        /// 
-        /// * from: Address that owns token.
-        /// 
-        /// * recipient: Address of token recipient.
-        /// 
-        /// * collection_id.
-        /// 
-        /// * item_id: ID of the item.
-        /// 
-        /// * value: Amount to transfer.
-        #[weight = <T as Config>::WeightInfo::transfer_from()]
-        #[transactional]
-        pub fn transfer_from(origin, from: T::CrossAccountId, recipient: T::CrossAccountId, collection_id: CollectionId, item_id: TokenId, value: u128 ) -> DispatchResult {
-            let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
-            let collection = Self::get_collection(collection_id)?;
+			Self::submit_logs(collection)?;
+			Ok(())
+		}
 
-            Self::transfer_from_internal(&sender, &from, &recipient, &collection, item_id, value)?;
+		/// Change ownership of a NFT on behalf of the owner. See Approve method for additional information. After this method executes, the approval is removed so that the approved address will not be able to transfer this NFT again from this owner.
+		///
+		/// # Permissions
+		/// * Collection Owner
+		/// * Collection Admin
+		/// * Current NFT owner
+		/// * Address approved by current NFT owner
+		///
+		/// # Arguments
+		///
+		/// * from: Address that owns token.
+		///
+		/// * recipient: Address of token recipient.
+		///
+		/// * collection_id.
+		///
+		/// * item_id: ID of the item.
+		///
+		/// * value: Amount to transfer.
+		#[weight = <T as Config>::WeightInfo::transfer_from()]
+		#[transactional]
+		pub fn transfer_from(origin, from: T::CrossAccountId, recipient: T::CrossAccountId, collection_id: CollectionId, item_id: TokenId, value: u128 ) -> DispatchResult {
+			let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
+			let collection = Self::get_collection(collection_id)?;
 
-            Self::submit_logs(collection)?;
-            Ok(())
-        }
-        // #[weight = 0]
-        //     // let no_perm_mes = "You do not have permissions to modify this collection";
-        //     // ensure!(<ApprovedList<T>>::contains_key((collection_id, item_id)), no_perm_mes);
-        //     // let list_itm = <ApprovedList<T>>::get((collection_id, item_id));
-        //     // ensure!(list_itm.contains(&new_owner.clone()), no_perm_mes);
+			Self::transfer_from_internal(&sender, &from, &recipient, &collection, item_id, value)?;
 
-        //     // // on_nft_received  call
+			Self::submit_logs(collection)?;
+			Ok(())
+		}
+		// #[weight = 0]
+		//     // let no_perm_mes = "You do not have permissions to modify this collection";
+		//     // ensure!(<ApprovedList<T>>::contains_key((collection_id, item_id)), no_perm_mes);
+		//     // let list_itm = <ApprovedList<T>>::get((collection_id, item_id));
+		//     // ensure!(list_itm.contains(&new_owner.clone()), no_perm_mes);
 
-        //     // Self::transfer(origin, collection_id, item_id, new_owner)?;
+		//     // // on_nft_received  call
 
-        //     Ok(())
-        // }
+		//     // Self::transfer(origin, collection_id, item_id, new_owner)?;
 
-        /// Set off-chain data schema.
-        /// 
-        /// # Permissions
-        /// 
-        /// * Collection Owner
-        /// * Collection Admin
-        /// 
-        /// # Arguments
-        /// 
-        /// * collection_id.
-        /// 
-        /// * schema: String representing the offchain data schema.
-        #[weight = <T as Config>::WeightInfo::set_variable_meta_data()]
-        #[transactional]
-        pub fn set_variable_meta_data (
-            origin,
-            collection_id: CollectionId,
-            item_id: TokenId,
-            data: Vec<u8>
-        ) -> DispatchResult {
-            let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
-            
-            let collection = Self::get_collection(collection_id)?;
+		//     Ok(())
+		// }
 
-            Self::set_variable_meta_data_internal(&sender, &collection, item_id, data)?;
+		/// Set off-chain data schema.
+		///
+		/// # Permissions
+		///
+		/// * Collection Owner
+		/// * Collection Admin
+		///
+		/// # Arguments
+		///
+		/// * collection_id.
+		///
+		/// * schema: String representing the offchain data schema.
+		#[weight = <T as Config>::WeightInfo::set_variable_meta_data()]
+		#[transactional]
+		pub fn set_variable_meta_data (
+			origin,
+			collection_id: CollectionId,
+			item_id: TokenId,
+			data: Vec<u8>
+		) -> DispatchResult {
+			let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
 
-            Ok(())
-        }
- 
-        /// Set schema standard
-        /// ImageURL
-        /// Unique
-        /// 
-        /// # Permissions
-        /// 
-        /// * Collection Owner
-        /// * Collection Admin
-        /// 
-        /// # Arguments
-        /// 
-        /// * collection_id.
-        /// 
-        /// * schema: SchemaVersion: enum
-        #[weight = <T as Config>::WeightInfo::set_schema_version()]
-        #[transactional]
-        pub fn set_schema_version(
-            origin,
-            collection_id: CollectionId,
-            version: SchemaVersion
-        ) -> DispatchResult {
-            let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
-            let mut target_collection = Self::get_collection(collection_id)?;
-            Self::check_owner_or_admin_permissions(&target_collection, &sender)?;
-            target_collection.schema_version = version;
-            Self::save_collection(target_collection);
+			let collection = Self::get_collection(collection_id)?;
 
-            Ok(())
-        }
+			Self::set_variable_meta_data_internal(&sender, &collection, item_id, data)?;
 
-        /// Set off-chain data schema.
-        /// 
-        /// # Permissions
-        /// 
-        /// * Collection Owner
-        /// * Collection Admin
-        /// 
-        /// # Arguments
-        /// 
-        /// * collection_id.
-        /// 
-        /// * schema: String representing the offchain data schema.
-        #[weight = <T as Config>::WeightInfo::set_offchain_schema()]
-        #[transactional]
-        pub fn set_offchain_schema(
-            origin,
-            collection_id: CollectionId,
-            schema: Vec<u8>
-        ) -> DispatchResult {
-            let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
-            let mut target_collection = Self::get_collection(collection_id)?;
-            Self::check_owner_or_admin_permissions(&target_collection, &sender)?;
+			Ok(())
+		}
 
-            // check schema limit
-            ensure!(schema.len() as u32 <= ChainLimit::get().offchain_schema_limit, "");
+		/// Set schema standard
+		/// ImageURL
+		/// Unique
+		///
+		/// # Permissions
+		///
+		/// * Collection Owner
+		/// * Collection Admin
+		///
+		/// # Arguments
+		///
+		/// * collection_id.
+		///
+		/// * schema: SchemaVersion: enum
+		#[weight = <T as Config>::WeightInfo::set_schema_version()]
+		#[transactional]
+		pub fn set_schema_version(
+			origin,
+			collection_id: CollectionId,
+			version: SchemaVersion
+		) -> DispatchResult {
+			let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
+			let mut target_collection = Self::get_collection(collection_id)?;
+			Self::check_owner_or_admin_permissions(&target_collection, &sender)?;
+			target_collection.schema_version = version;
+			Self::save_collection(target_collection);
 
-            target_collection.offchain_schema = schema;
-            Self::save_collection(target_collection);
+			Ok(())
+		}
 
-            Ok(())
-        }
+		/// Set off-chain data schema.
+		///
+		/// # Permissions
+		///
+		/// * Collection Owner
+		/// * Collection Admin
+		///
+		/// # Arguments
+		///
+		/// * collection_id.
+		///
+		/// * schema: String representing the offchain data schema.
+		#[weight = <T as Config>::WeightInfo::set_offchain_schema()]
+		#[transactional]
+		pub fn set_offchain_schema(
+			origin,
+			collection_id: CollectionId,
+			schema: Vec<u8>
+		) -> DispatchResult {
+			let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
+			let mut target_collection = Self::get_collection(collection_id)?;
+			Self::check_owner_or_admin_permissions(&target_collection, &sender)?;
 
-        /// Set const on-chain data schema.
-        /// 
-        /// # Permissions
-        /// 
-        /// * Collection Owner
-        /// * Collection Admin
-        /// 
-        /// # Arguments
-        /// 
-        /// * collection_id.
-        /// 
-        /// * schema: String representing the const on-chain data schema.
-        #[weight = <T as Config>::WeightInfo::set_const_on_chain_schema()]
-        #[transactional]
-        pub fn set_const_on_chain_schema (
-            origin,
-            collection_id: CollectionId,
-            schema: Vec<u8>
-        ) -> DispatchResult {
-            let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
-            let mut target_collection = Self::get_collection(collection_id)?;
-            Self::check_owner_or_admin_permissions(&target_collection, &sender)?;
+			// check schema limit
+			ensure!(schema.len() as u32 <= ChainLimit::get().offchain_schema_limit, "");
 
-            // check schema limit
-            ensure!(schema.len() as u32 <= ChainLimit::get().const_on_chain_schema_limit, "");
+			target_collection.offchain_schema = schema;
+			Self::save_collection(target_collection);
 
-            target_collection.const_on_chain_schema = schema;
-            Self::save_collection(target_collection);
+			Ok(())
+		}
 
-            Ok(())
-        }
+		/// Set const on-chain data schema.
+		///
+		/// # Permissions
+		///
+		/// * Collection Owner
+		/// * Collection Admin
+		///
+		/// # Arguments
+		///
+		/// * collection_id.
+		///
+		/// * schema: String representing the const on-chain data schema.
+		#[weight = <T as Config>::WeightInfo::set_const_on_chain_schema()]
+		#[transactional]
+		pub fn set_const_on_chain_schema (
+			origin,
+			collection_id: CollectionId,
+			schema: Vec<u8>
+		) -> DispatchResult {
+			let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
+			let mut target_collection = Self::get_collection(collection_id)?;
+			Self::check_owner_or_admin_permissions(&target_collection, &sender)?;
 
-        /// Set variable on-chain data schema.
-        /// 
-        /// # Permissions
-        /// 
-        /// * Collection Owner
-        /// * Collection Admin
-        /// 
-        /// # Arguments
-        /// 
-        /// * collection_id.
-        /// 
-        /// * schema: String representing the variable on-chain data schema.
-        #[weight = <T as Config>::WeightInfo::set_const_on_chain_schema()]
-        #[transactional]
-        pub fn set_variable_on_chain_schema (
-            origin,
-            collection_id: CollectionId,
-            schema: Vec<u8>
-        ) -> DispatchResult {
-            let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
-            let mut target_collection = Self::get_collection(collection_id)?;
-            Self::check_owner_or_admin_permissions(&target_collection, &sender)?;
+			// check schema limit
+			ensure!(schema.len() as u32 <= ChainLimit::get().const_on_chain_schema_limit, "");
 
-            // check schema limit
-            ensure!(schema.len() as u32 <= ChainLimit::get().variable_on_chain_schema_limit, "");
+			target_collection.const_on_chain_schema = schema;
+			Self::save_collection(target_collection);
 
-            target_collection.variable_on_chain_schema = schema;
-            Self::save_collection(target_collection);
+			Ok(())
+		}
 
-            Ok(())
-        }
+		/// Set variable on-chain data schema.
+		///
+		/// # Permissions
+		///
+		/// * Collection Owner
+		/// * Collection Admin
+		///
+		/// # Arguments
+		///
+		/// * collection_id.
+		///
+		/// * schema: String representing the variable on-chain data schema.
+		#[weight = <T as Config>::WeightInfo::set_const_on_chain_schema()]
+		#[transactional]
+		pub fn set_variable_on_chain_schema (
+			origin,
+			collection_id: CollectionId,
+			schema: Vec<u8>
+		) -> DispatchResult {
+			let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
+			let mut target_collection = Self::get_collection(collection_id)?;
+			Self::check_owner_or_admin_permissions(&target_collection, &sender)?;
 
-        // Sudo permissions function
-        #[weight = <T as Config>::WeightInfo::set_chain_limits()]
-        #[transactional]
-        pub fn set_chain_limits(
-            origin,
-            limits: ChainLimits
-        ) -> DispatchResult {
+			// check schema limit
+			ensure!(schema.len() as u32 <= ChainLimit::get().variable_on_chain_schema_limit, "");
 
-            #[cfg(not(feature = "runtime-benchmarks"))]
-            ensure_root(origin)?;
+			target_collection.variable_on_chain_schema = schema;
+			Self::save_collection(target_collection);
 
-            <ChainLimit>::put(limits);
-            Ok(())
-        }
+			Ok(())
+		}
 
-        #[weight = <T as Config>::WeightInfo::set_collection_limits()]
-        #[transactional]
-        pub fn set_collection_limits(
-            origin,
-            collection_id: u32,
-            new_limits: CollectionLimits<T::BlockNumber>,
-        ) -> DispatchResult {
-            let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
-            let mut target_collection = Self::get_collection(collection_id)?;
-            Self::check_owner_permissions(&target_collection, &sender.as_sub())?;
-            let old_limits = &target_collection.limits;
-            let chain_limits = ChainLimit::get();
+		// Sudo permissions function
+		#[weight = <T as Config>::WeightInfo::set_chain_limits()]
+		#[transactional]
+		pub fn set_chain_limits(
+			origin,
+			limits: ChainLimits
+		) -> DispatchResult {
 
-            // collection bounds
-            ensure!(new_limits.sponsor_transfer_timeout <= MAX_SPONSOR_TIMEOUT &&
-                new_limits.account_token_ownership_limit <= MAX_TOKEN_OWNERSHIP && 
-                new_limits.sponsored_data_size <= chain_limits.custom_data_limit,
-                Error::<T>::CollectionLimitBoundsExceeded);
+			#[cfg(not(feature = "runtime-benchmarks"))]
+			ensure_root(origin)?;
 
-            // token_limit   check  prev
-            ensure!(old_limits.token_limit >= new_limits.token_limit, Error::<T>::CollectionTokenLimitExceeded);
-            ensure!(new_limits.token_limit > 0, Error::<T>::CollectionTokenLimitExceeded);
+			<ChainLimit>::put(limits);
+			Ok(())
+		}
 
-            ensure!(
-                (old_limits.owner_can_transfer || !new_limits.owner_can_transfer) &&
-                (old_limits.owner_can_destroy || !new_limits.owner_can_destroy),
-                Error::<T>::OwnerPermissionsCantBeReverted,
-            );
+		#[weight = <T as Config>::WeightInfo::set_collection_limits()]
+		#[transactional]
+		pub fn set_collection_limits(
+			origin,
+			collection_id: u32,
+			new_limits: CollectionLimits<T::BlockNumber>,
+		) -> DispatchResult {
+			let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
+			let mut target_collection = Self::get_collection(collection_id)?;
+			Self::check_owner_permissions(&target_collection, &sender.as_sub())?;
+			let old_limits = &target_collection.limits;
+			let chain_limits = ChainLimit::get();
 
-            target_collection.limits = new_limits;
-            Self::save_collection(target_collection);
+			// collection bounds
+			ensure!(new_limits.sponsor_transfer_timeout <= MAX_SPONSOR_TIMEOUT &&
+				new_limits.account_token_ownership_limit <= MAX_TOKEN_OWNERSHIP &&
+				new_limits.sponsored_data_size <= chain_limits.custom_data_limit,
+				Error::<T>::CollectionLimitBoundsExceeded);
+
+			// token_limit   check  prev
+			ensure!(old_limits.token_limit >= new_limits.token_limit, Error::<T>::CollectionTokenLimitExceeded);
+			ensure!(new_limits.token_limit > 0, Error::<T>::CollectionTokenLimitExceeded);
 
-            Ok(())
-        } 
-    }
+			ensure!(
+				(old_limits.owner_can_transfer || !new_limits.owner_can_transfer) &&
+				(old_limits.owner_can_destroy || !new_limits.owner_can_destroy),
+				Error::<T>::OwnerPermissionsCantBeReverted,
+			);
+
+			target_collection.limits = new_limits;
+			Self::save_collection(target_collection);
+
+			Ok(())
+		}
+	}
 }
 
 impl<T: Config> Module<T> {
-    pub fn create_item_internal(sender: &T::CrossAccountId, collection: &CollectionHandle<T>, owner: &T::CrossAccountId, data: CreateItemData) -> DispatchResult {
-        Self::can_create_items_in_collection(&collection, &sender, &owner, 1)?;
-        Self::validate_create_item_args(&collection, &data)?;
-        Self::create_item_no_validation(&collection, owner, data)?;
+	pub fn create_item_internal(
+		sender: &T::CrossAccountId,
+		collection: &CollectionHandle<T>,
+		owner: &T::CrossAccountId,
+		data: CreateItemData,
+	) -> DispatchResult {
+		Self::can_create_items_in_collection(&collection, &sender, &owner, 1)?;
+		Self::validate_create_item_args(&collection, &data)?;
+		Self::create_item_no_validation(&collection, owner, data)?;
 
-        Ok(())
-    }
+		Ok(())
+	}
 
-    pub fn transfer_internal(sender: &T::CrossAccountId, recipient: &T::CrossAccountId, target_collection: &CollectionHandle<T>, item_id: TokenId, value: u128) -> DispatchResult {
-        target_collection.consume_gas(2000000)?;
-        // Limits check
-        Self::is_correct_transfer(target_collection, &recipient)?;
+	pub fn transfer_internal(
+		sender: &T::CrossAccountId,
+		recipient: &T::CrossAccountId,
+		target_collection: &CollectionHandle<T>,
+		item_id: TokenId,
+		value: u128,
+	) -> DispatchResult {
+		target_collection.consume_gas(2000000)?;
+		// Limits check
+		Self::is_correct_transfer(target_collection, &recipient)?;
 
-        // Transfer permissions check
-        ensure!(Self::is_item_owner(&sender, target_collection, item_id) ||
-            Self::is_owner_or_admin_permissions(target_collection, &sender),
-            Error::<T>::NoPermission);
+		// Transfer permissions check
+		ensure!(
+			Self::is_item_owner(&sender, target_collection, item_id)
+				|| Self::is_owner_or_admin_permissions(target_collection, &sender),
+			Error::<T>::NoPermission
+		);
 
-        if target_collection.access == AccessMode::WhiteList {
-            Self::check_white_list(target_collection, &sender)?;
-            Self::check_white_list(target_collection, &recipient)?;
-        }
+		if target_collection.access == AccessMode::WhiteList {
+			Self::check_white_list(target_collection, &sender)?;
+			Self::check_white_list(target_collection, &recipient)?;
+		}
 
-        match target_collection.mode
-        {
-            CollectionMode::NFT => Self::transfer_nft(target_collection, item_id, sender.clone(), recipient.clone())?,
-            CollectionMode::Fungible(_)  => Self::transfer_fungible(target_collection, value, &sender, &recipient)?,
-            CollectionMode::ReFungible  => Self::transfer_refungible(target_collection, item_id, value, sender.clone(), recipient.clone())?,
-            _ => ()
-        };
+		match target_collection.mode {
+			CollectionMode::NFT => Self::transfer_nft(
+				target_collection,
+				item_id,
+				sender.clone(),
+				recipient.clone(),
+			)?,
+			CollectionMode::Fungible(_) => {
+				Self::transfer_fungible(target_collection, value, &sender, &recipient)?
+			}
+			CollectionMode::ReFungible => Self::transfer_refungible(
+				target_collection,
+				item_id,
+				value,
+				sender.clone(),
+				recipient.clone(),
+			)?,
+			_ => (),
+		};
 
-        Self::deposit_event(RawEvent::Transfer(target_collection.id, item_id, sender.clone(), recipient.clone(), value));
+		Self::deposit_event(RawEvent::Transfer(
+			target_collection.id,
+			item_id,
+			sender.clone(),
+			recipient.clone(),
+			value,
+		));
 
-        Ok(())
-    }
+		Ok(())
+	}
 
 	pub fn approve_internal(
 		sender: &T::CrossAccountId,
 		spender: &T::CrossAccountId,
 		collection: &CollectionHandle<T>,
 		item_id: TokenId,
-		amount: u128
+		amount: u128,
 	) -> DispatchResult {
-        collection.consume_gas(2000000)?;
+		collection.consume_gas(2000000)?;
 		Self::token_exists(&collection, item_id)?;
 
 		// Transfer permissions check
-		let bypasses_limits = collection.limits.owner_can_transfer &&
-			Self::is_owner_or_admin_permissions(
-				&collection,
-				&sender,
-			);
+		let bypasses_limits = collection.limits.owner_can_transfer
+			&& Self::is_owner_or_admin_permissions(&collection, &sender);
 
 		let allowance_limit = if bypasses_limits {
 			None
-		} else if let Some(amount) = Self::owned_amount(
-			&sender,
-			&collection,
-			item_id,
-		) {
+		} else if let Some(amount) = Self::owned_amount(&sender, &collection, item_id) {
 			Some(amount)
 		} else {
 			fail!(Error::<T>::NoPermission);
@@ -1331,32 +1356,45 @@
 		}
 
 		let allowance: u128 = amount
-			.checked_add(<Allowances<T>>::get(collection.id, (item_id, sender.as_sub(), spender.as_sub())))
+			.checked_add(<Allowances<T>>::get(
+				collection.id,
+				(item_id, sender.as_sub(), spender.as_sub()),
+			))
 			.ok_or(Error::<T>::NumOverflow)?;
 		if let Some(limit) = allowance_limit {
 			ensure!(limit >= allowance, Error::<T>::TokenValueTooLow);
 		}
-		<Allowances<T>>::insert(collection.id, (item_id, sender.as_sub(), spender.as_sub()), allowance);
+		<Allowances<T>>::insert(
+			collection.id,
+			(item_id, sender.as_sub(), spender.as_sub()),
+			allowance,
+		);
 
 		if matches!(collection.mode, CollectionMode::NFT) {
 			// TODO: NFT: only one owner may exist for token in ERC721
 			collection.log(ERC721Events::Approval {
-                owner: *sender.as_eth(),
-                approved: *spender.as_eth(),
-                token_id: item_id.into(),
-            });
+				owner: *sender.as_eth(),
+				approved: *spender.as_eth(),
+				token_id: item_id.into(),
+			});
 		}
 
 		if matches!(collection.mode, CollectionMode::Fungible(_)) {
 			// TODO: NFT: only one owner may exist for token in ERC20
 			collection.log(ERC20Events::Approval {
-                owner: *sender.as_eth(),
-                spender: *spender.as_eth(),
-                value: allowance.into()
-            });
+				owner: *sender.as_eth(),
+				spender: *spender.as_eth(),
+				value: allowance.into(),
+			});
 		}
 
-		Self::deposit_event(RawEvent::Approved(collection.id, item_id, sender.clone(), spender.clone(), allowance));
+		Self::deposit_event(RawEvent::Approved(
+			collection.id,
+			item_id,
+			sender.clone(),
+			spender.clone(),
+			allowance,
+		));
 		Ok(())
 	}
 
@@ -1368,20 +1406,19 @@
 		item_id: TokenId,
 		amount: u128,
 	) -> DispatchResult {
-        collection.consume_gas(2000000)?;
+		collection.consume_gas(2000000)?;
 		// Check approval
-		let approval: u128 = <Allowances<T>>::get(collection.id, (item_id, from.as_sub(), sender.as_sub()));
+		let approval: u128 =
+			<Allowances<T>>::get(collection.id, (item_id, from.as_sub(), sender.as_sub()));
 
 		// Limits check
 		Self::is_correct_transfer(&collection, &recipient)?;
 
 		// Transfer permissions check
 		ensure!(
-			approval >= amount || 
-			(
-				collection.limits.owner_can_transfer &&
-				Self::is_owner_or_admin_permissions(&collection, &sender)
-			),
+			approval >= amount
+				|| (collection.limits.owner_can_transfer
+					&& Self::is_owner_or_admin_permissions(&collection, &sender)),
 			Error::<T>::NoPermission
 		);
 
@@ -1393,7 +1430,11 @@
 		// Reduce approval by transferred amount or remove if remaining approval drops to 0
 		let allowance = approval.saturating_sub(amount);
 		if allowance > 0 {
-			<Allowances<T>>::insert(collection.id, (item_id, from.as_sub(), sender.as_sub()), allowance);
+			<Allowances<T>>::insert(
+				collection.id,
+				(item_id, from.as_sub(), sender.as_sub()),
+				allowance,
+			);
 		} else {
 			<Allowances<T>>::remove(collection.id, (item_id, from.as_sub(), sender.as_sub()));
 		}
@@ -1405,842 +1446,948 @@
 			CollectionMode::Fungible(_) => {
 				Self::transfer_fungible(&collection, amount, &from, &recipient)?
 			}
-			CollectionMode::ReFungible => {
-				Self::transfer_refungible(&collection, item_id, amount, from.clone(), recipient.clone())?
-			}
-			_ => ()
+			CollectionMode::ReFungible => Self::transfer_refungible(
+				&collection,
+				item_id,
+				amount,
+				from.clone(),
+				recipient.clone(),
+			)?,
+			_ => (),
 		};
 
 		if matches!(collection.mode, CollectionMode::Fungible(_)) {
 			collection.log(ERC20Events::Approval {
-                owner: *from.as_eth(),
-                spender: *sender.as_eth(),
-                value: allowance.into()
-            });
+				owner: *from.as_eth(),
+				spender: *sender.as_eth(),
+				value: allowance.into(),
+			});
 		}
 
 		Ok(())
 	}
 
-    pub fn set_variable_meta_data_internal(
-        sender: &T::CrossAccountId,
-        collection: &CollectionHandle<T>, 
-        item_id: TokenId,
-        data: Vec<u8>,
-    ) -> DispatchResult {
-        Self::token_exists(&collection, item_id)?;
+	pub fn set_variable_meta_data_internal(
+		sender: &T::CrossAccountId,
+		collection: &CollectionHandle<T>,
+		item_id: TokenId,
+		data: Vec<u8>,
+	) -> DispatchResult {
+		Self::token_exists(&collection, item_id)?;
 
-        ensure!(ChainLimit::get().custom_data_limit >= data.len() as u32, Error::<T>::TokenVariableDataLimitExceeded);
+		ensure!(
+			ChainLimit::get().custom_data_limit >= data.len() as u32,
+			Error::<T>::TokenVariableDataLimitExceeded
+		);
 
-        // Modify permissions check
-        ensure!(Self::is_item_owner(&sender, &collection, item_id) ||
-            Self::is_owner_or_admin_permissions(&collection, &sender),
-            Error::<T>::NoPermission);
+		// Modify permissions check
+		ensure!(
+			Self::is_item_owner(&sender, &collection, item_id)
+				|| Self::is_owner_or_admin_permissions(&collection, &sender),
+			Error::<T>::NoPermission
+		);
 
-        match collection.mode
-        {
-            CollectionMode::NFT => Self::set_nft_variable_data(&collection, item_id, data)?,
-            CollectionMode::ReFungible  => Self::set_re_fungible_variable_data(&collection, item_id, data)?,
-            CollectionMode::Fungible(_) => fail!(Error::<T>::CantStoreMetadataInFungibleTokens),
-            _ => fail!(Error::<T>::UnexpectedCollectionType)
-        };
+		match collection.mode {
+			CollectionMode::NFT => Self::set_nft_variable_data(&collection, item_id, data)?,
+			CollectionMode::ReFungible => {
+				Self::set_re_fungible_variable_data(&collection, item_id, data)?
+			}
+			CollectionMode::Fungible(_) => fail!(Error::<T>::CantStoreMetadataInFungibleTokens),
+			_ => fail!(Error::<T>::UnexpectedCollectionType),
+		};
 
-        Ok(())
-    }
+		Ok(())
+	}
 
-    pub fn create_multiple_items_internal(
-        sender: &T::CrossAccountId,
-        collection: &CollectionHandle<T>,
-        owner: &T::CrossAccountId,
-        items_data: Vec<CreateItemData>,
-    ) -> DispatchResult {
-        Self::can_create_items_in_collection(&collection, &sender, &owner, items_data.len() as u32)?;
+	pub fn create_multiple_items_internal(
+		sender: &T::CrossAccountId,
+		collection: &CollectionHandle<T>,
+		owner: &T::CrossAccountId,
+		items_data: Vec<CreateItemData>,
+	) -> DispatchResult {
+		Self::can_create_items_in_collection(
+			&collection,
+			&sender,
+			&owner,
+			items_data.len() as u32,
+		)?;
 
-        for data in &items_data {
-            Self::validate_create_item_args(&collection, data)?;
-        }
-        for data in &items_data {
-            Self::create_item_no_validation(&collection, owner, data.clone())?;
-        }
+		for data in &items_data {
+			Self::validate_create_item_args(&collection, data)?;
+		}
+		for data in &items_data {
+			Self::create_item_no_validation(&collection, owner, data.clone())?;
+		}
 
-        Ok(())
-    }
+		Ok(())
+	}
 
-    pub fn burn_item_internal(
-        sender: &T::CrossAccountId,
-        collection: &CollectionHandle<T>,
-        item_id: TokenId,
-        value: u128,
-    ) -> DispatchResult {
-        ensure!(
-            Self::is_item_owner(&sender, &collection, item_id) ||
-            (
-                collection.limits.owner_can_transfer &&
-                Self::is_owner_or_admin_permissions(&collection, &sender)
-            ),
-            Error::<T>::NoPermission
-        );
+	pub fn burn_item_internal(
+		sender: &T::CrossAccountId,
+		collection: &CollectionHandle<T>,
+		item_id: TokenId,
+		value: u128,
+	) -> DispatchResult {
+		ensure!(
+			Self::is_item_owner(&sender, &collection, item_id)
+				|| (collection.limits.owner_can_transfer
+					&& Self::is_owner_or_admin_permissions(&collection, &sender)),
+			Error::<T>::NoPermission
+		);
 
-        if collection.access == AccessMode::WhiteList {
-            Self::check_white_list(&collection, &sender)?;
-        }
+		if collection.access == AccessMode::WhiteList {
+			Self::check_white_list(&collection, &sender)?;
+		}
 
-        match collection.mode
-        {
-            CollectionMode::NFT => Self::burn_nft_item(&collection, item_id)?,
-            CollectionMode::Fungible(_)  => Self::burn_fungible_item(&sender, &collection, value)?,
-            CollectionMode::ReFungible  => Self::burn_refungible_item(&collection, item_id, &sender)?,
-            _ => ()
-        };
+		match collection.mode {
+			CollectionMode::NFT => Self::burn_nft_item(&collection, item_id)?,
+			CollectionMode::Fungible(_) => Self::burn_fungible_item(&sender, &collection, value)?,
+			CollectionMode::ReFungible => {
+				Self::burn_refungible_item(&collection, item_id, &sender)?
+			}
+			_ => (),
+		};
 
-        Ok(())
-    }
+		Ok(())
+	}
 
-    pub fn toggle_white_list_internal(
-        sender: &T::CrossAccountId,
-        collection: &CollectionHandle<T>,
-        address: &T::CrossAccountId,
-        whitelisted: bool,
-    ) -> DispatchResult {
-        Self::check_owner_or_admin_permissions(&collection, &sender)?;
+	pub fn toggle_white_list_internal(
+		sender: &T::CrossAccountId,
+		collection: &CollectionHandle<T>,
+		address: &T::CrossAccountId,
+		whitelisted: bool,
+	) -> DispatchResult {
+		Self::check_owner_or_admin_permissions(&collection, &sender)?;
 
-        if whitelisted {
-            <WhiteList<T>>::insert(collection.id, address.as_sub(), true);
-        } else {
-            <WhiteList<T>>::remove(collection.id, address.as_sub());
-        }
+		if whitelisted {
+			<WhiteList<T>>::insert(collection.id, address.as_sub(), true);
+		} else {
+			<WhiteList<T>>::remove(collection.id, address.as_sub());
+		}
 
-        Ok(())
-    }
+		Ok(())
+	}
 
-    fn is_correct_transfer(collection: &CollectionHandle<T>, recipient: &T::CrossAccountId) -> DispatchResult {
-        let collection_id = collection.id;
+	fn is_correct_transfer(
+		collection: &CollectionHandle<T>,
+		recipient: &T::CrossAccountId,
+	) -> DispatchResult {
+		let collection_id = collection.id;
 
-        // check token limit and account token limit
-        let account_items: u32 = <AddressTokens<T>>::get(collection_id, recipient.as_sub()).len() as u32;
-        ensure!(collection.limits.account_token_ownership_limit > account_items,  Error::<T>::AccountTokenLimitExceeded);
-        
-        Ok(())
-    }
+		// check token limit and account token limit
+		let account_items: u32 =
+			<AddressTokens<T>>::get(collection_id, recipient.as_sub()).len() as u32;
+		ensure!(
+			collection.limits.account_token_ownership_limit > account_items,
+			Error::<T>::AccountTokenLimitExceeded
+		);
 
-    fn can_create_items_in_collection(collection: &CollectionHandle<T>, sender: &T::CrossAccountId, owner: &T::CrossAccountId, amount: u32) -> DispatchResult {
-        let collection_id = collection.id;
+		Ok(())
+	}
 
-        // check token limit and account token limit
-        let total_items: u32 = ItemListIndex::get(collection_id)
-            .checked_add(amount)
-            .ok_or(Error::<T>::CollectionTokenLimitExceeded)?;
-        let account_items: u32 = (<AddressTokens<T>>::get(collection_id, owner.as_sub()).len() as u32)
-            .checked_add(amount)
-            .ok_or(Error::<T>::AccountTokenLimitExceeded)?;
-        ensure!(collection.limits.token_limit >= total_items,  Error::<T>::CollectionTokenLimitExceeded);
-        ensure!(collection.limits.account_token_ownership_limit >= account_items,  Error::<T>::AccountTokenLimitExceeded);
+	fn can_create_items_in_collection(
+		collection: &CollectionHandle<T>,
+		sender: &T::CrossAccountId,
+		owner: &T::CrossAccountId,
+		amount: u32,
+	) -> DispatchResult {
+		let collection_id = collection.id;
 
-        if !Self::is_owner_or_admin_permissions(collection, &sender) {
-            ensure!(collection.mint_mode == true, Error::<T>::PublicMintingNotAllowed);
-            Self::check_white_list(collection, owner)?;
-            Self::check_white_list(collection, sender)?;
-        }
+		// check token limit and account token limit
+		let total_items: u32 = ItemListIndex::get(collection_id)
+			.checked_add(amount)
+			.ok_or(Error::<T>::CollectionTokenLimitExceeded)?;
+		let account_items: u32 = (<AddressTokens<T>>::get(collection_id, owner.as_sub()).len()
+			as u32)
+			.checked_add(amount)
+			.ok_or(Error::<T>::AccountTokenLimitExceeded)?;
+		ensure!(
+			collection.limits.token_limit >= total_items,
+			Error::<T>::CollectionTokenLimitExceeded
+		);
+		ensure!(
+			collection.limits.account_token_ownership_limit >= account_items,
+			Error::<T>::AccountTokenLimitExceeded
+		);
 
-        Ok(())
-    }
+		if !Self::is_owner_or_admin_permissions(collection, &sender) {
+			ensure!(collection.mint_mode, Error::<T>::PublicMintingNotAllowed);
+			Self::check_white_list(collection, owner)?;
+			Self::check_white_list(collection, sender)?;
+		}
 
-    fn validate_create_item_args(target_collection: &CollectionHandle<T>, data: &CreateItemData) -> DispatchResult {
-        match target_collection.mode
-        {
-            CollectionMode::NFT => {
-                if let CreateItemData::NFT(data) = data {
-                    // check sizes
-                    ensure!(ChainLimit::get().custom_data_limit >= data.const_data.len() as u32, Error::<T>::TokenConstDataLimitExceeded);
-                    ensure!(ChainLimit::get().custom_data_limit >= data.variable_data.len() as u32, Error::<T>::TokenVariableDataLimitExceeded);
-                } else {
-                    fail!(Error::<T>::NotNftDataUsedToMintNftCollectionToken);
-                }
-            },
-            CollectionMode::Fungible(_) => {
-                if let CreateItemData::Fungible(_) = data {
-                } else {
-                    fail!(Error::<T>::NotFungibleDataUsedToMintFungibleCollectionToken);
-                }
-            },
-            CollectionMode::ReFungible => {
-                if let CreateItemData::ReFungible(data) = data {
+		Ok(())
+	}
 
-                    // check sizes
-                    ensure!(ChainLimit::get().custom_data_limit >= data.const_data.len() as u32, Error::<T>::TokenConstDataLimitExceeded);
-                    ensure!(ChainLimit::get().custom_data_limit >= data.variable_data.len() as u32, Error::<T>::TokenVariableDataLimitExceeded);
+	fn validate_create_item_args(
+		target_collection: &CollectionHandle<T>,
+		data: &CreateItemData,
+	) -> DispatchResult {
+		match target_collection.mode {
+			CollectionMode::NFT => {
+				if let CreateItemData::NFT(data) = data {
+					// check sizes
+					ensure!(
+						ChainLimit::get().custom_data_limit >= data.const_data.len() as u32,
+						Error::<T>::TokenConstDataLimitExceeded
+					);
+					ensure!(
+						ChainLimit::get().custom_data_limit >= data.variable_data.len() as u32,
+						Error::<T>::TokenVariableDataLimitExceeded
+					);
+				} else {
+					fail!(Error::<T>::NotNftDataUsedToMintNftCollectionToken);
+				}
+			}
+			CollectionMode::Fungible(_) => {
+				if let CreateItemData::Fungible(_) = data {
+				} else {
+					fail!(Error::<T>::NotFungibleDataUsedToMintFungibleCollectionToken);
+				}
+			}
+			CollectionMode::ReFungible => {
+				if let CreateItemData::ReFungible(data) = data {
+					// check sizes
+					ensure!(
+						ChainLimit::get().custom_data_limit >= data.const_data.len() as u32,
+						Error::<T>::TokenConstDataLimitExceeded
+					);
+					ensure!(
+						ChainLimit::get().custom_data_limit >= data.variable_data.len() as u32,
+						Error::<T>::TokenVariableDataLimitExceeded
+					);
 
-                    // Check refungibility limits
-                    ensure!(data.pieces <= MAX_REFUNGIBLE_PIECES, Error::<T>::WrongRefungiblePieces);
-                    ensure!(data.pieces > 0, Error::<T>::WrongRefungiblePieces);
-                } else {
-                    fail!(Error::<T>::NotReFungibleDataUsedToMintReFungibleCollectionToken);
-                }
-            },
-            _ => { fail!(Error::<T>::UnexpectedCollectionType); }
-        };
+					// Check refungibility limits
+					ensure!(
+						data.pieces <= MAX_REFUNGIBLE_PIECES,
+						Error::<T>::WrongRefungiblePieces
+					);
+					ensure!(data.pieces > 0, Error::<T>::WrongRefungiblePieces);
+				} else {
+					fail!(Error::<T>::NotReFungibleDataUsedToMintReFungibleCollectionToken);
+				}
+			}
+			_ => {
+				fail!(Error::<T>::UnexpectedCollectionType);
+			}
+		};
 
-        Ok(())
-    }
+		Ok(())
+	}
 
-    fn create_item_no_validation(collection: &CollectionHandle<T>, owner: &T::CrossAccountId, data: CreateItemData) -> DispatchResult {
-        match data
-        {
-            CreateItemData::NFT(data) => {
-                let item = NftItemType {
-                    owner: owner.clone(),
-                    const_data: data.const_data,
-                    variable_data: data.variable_data
-                };
+	fn create_item_no_validation(
+		collection: &CollectionHandle<T>,
+		owner: &T::CrossAccountId,
+		data: CreateItemData,
+	) -> DispatchResult {
+		match data {
+			CreateItemData::NFT(data) => {
+				let item = NftItemType {
+					owner: owner.clone(),
+					const_data: data.const_data,
+					variable_data: data.variable_data,
+				};
 
-                Self::add_nft_item(collection, item)?;
-            },
-            CreateItemData::Fungible(data) => {
-                Self::add_fungible_item(collection, &owner, data.value)?;
-            },
-            CreateItemData::ReFungible(data) => {
-                let mut owner_list = Vec::new();
-                owner_list.push(Ownership {owner: owner.clone(), fraction: data.pieces});
+				Self::add_nft_item(collection, item)?;
+			}
+			CreateItemData::Fungible(data) => {
+				Self::add_fungible_item(collection, &owner, data.value)?;
+			}
+			CreateItemData::ReFungible(data) => {
+				let owner_list = vec![Ownership {
+					owner: owner.clone(),
+					fraction: data.pieces,
+				}];
 
-                let item = ReFungibleItemType {
-                    owner: owner_list,
-                    const_data: data.const_data,
-                    variable_data: data.variable_data
-                };
+				let item = ReFungibleItemType {
+					owner: owner_list,
+					const_data: data.const_data,
+					variable_data: data.variable_data,
+				};
 
-                Self::add_refungible_item(collection, item)?;
-            }
-        };
+				Self::add_refungible_item(collection, item)?;
+			}
+		};
 
-        Ok(())
-    }
+		Ok(())
+	}
 
-    fn add_fungible_item(collection: &CollectionHandle<T>, owner: &T::CrossAccountId, value: u128) -> DispatchResult {
-        let collection_id = collection.id;
+	fn add_fungible_item(
+		collection: &CollectionHandle<T>,
+		owner: &T::CrossAccountId,
+		value: u128,
+	) -> DispatchResult {
+		let collection_id = collection.id;
 
-        // Does new owner already have an account?
-        let balance: u128 = <FungibleItemList<T>>::get(collection_id, owner.as_sub()).value;
+		// Does new owner already have an account?
+		let balance: u128 = <FungibleItemList<T>>::get(collection_id, owner.as_sub()).value;
 
-        // Mint 
-        let item = FungibleItemType {
-            value: balance.checked_add(value).ok_or(Error::<T>::NumOverflow)?,
-        };
-        <FungibleItemList<T>>::insert(collection_id, owner.as_sub(), item);
+		// Mint
+		let item = FungibleItemType {
+			value: balance.checked_add(value).ok_or(Error::<T>::NumOverflow)?,
+		};
+		<FungibleItemList<T>>::insert(collection_id, owner.as_sub(), item);
 
-        // Update balance
-        let new_balance = <Balance<T>>::get(collection_id, owner.as_sub())
-            .checked_add(value)
-            .ok_or(Error::<T>::NumOverflow)?;
-        <Balance<T>>::insert(collection_id, owner.as_sub(), new_balance);
+		// Update balance
+		let new_balance = <Balance<T>>::get(collection_id, owner.as_sub())
+			.checked_add(value)
+			.ok_or(Error::<T>::NumOverflow)?;
+		<Balance<T>>::insert(collection_id, owner.as_sub(), new_balance);
 
-        Self::deposit_event(RawEvent::ItemCreated(collection_id, 0, owner.clone()));
-        Ok(())
-    }
+		Self::deposit_event(RawEvent::ItemCreated(collection_id, 0, owner.clone()));
+		Ok(())
+	}
 
-    fn add_refungible_item(collection: &CollectionHandle<T>, item: ReFungibleItemType<T::CrossAccountId>) -> DispatchResult {
-        let collection_id = collection.id;
+	fn add_refungible_item(
+		collection: &CollectionHandle<T>,
+		item: ReFungibleItemType<T::CrossAccountId>,
+	) -> DispatchResult {
+		let collection_id = collection.id;
 
-        let current_index = <ItemListIndex>::get(collection_id)
-            .checked_add(1)
-            .ok_or(Error::<T>::NumOverflow)?;
-        let itemcopy = item.clone();
+		let current_index = <ItemListIndex>::get(collection_id)
+			.checked_add(1)
+			.ok_or(Error::<T>::NumOverflow)?;
+		let itemcopy = item.clone();
 
-        ensure!(
-            item.owner.len() == 1,
-            Error::<T>::BadCreateRefungibleCall,
-        );
-        let item_owner = item.owner.first().expect("only one owner is defined");
+		ensure!(item.owner.len() == 1, Error::<T>::BadCreateRefungibleCall,);
+		let item_owner = item.owner.first().expect("only one owner is defined");
 
-        let value = item_owner.fraction;
-        let owner = item_owner.owner.clone();
+		let value = item_owner.fraction;
+		let owner = item_owner.owner.clone();
 
-        Self::add_token_index(collection_id, current_index, &owner)?;
+		Self::add_token_index(collection_id, current_index, &owner)?;
 
-        <ItemListIndex>::insert(collection_id, current_index);
-        <ReFungibleItemList<T>>::insert(collection_id, current_index, itemcopy);
+		<ItemListIndex>::insert(collection_id, current_index);
+		<ReFungibleItemList<T>>::insert(collection_id, current_index, itemcopy);
 
-        // Update balance
-        let new_balance = <Balance<T>>::get(collection_id, owner.as_sub())
-            .checked_add(value)
-            .ok_or(Error::<T>::NumOverflow)?;
-        <Balance<T>>::insert(collection_id, owner.as_sub(), new_balance);
+		// Update balance
+		let new_balance = <Balance<T>>::get(collection_id, owner.as_sub())
+			.checked_add(value)
+			.ok_or(Error::<T>::NumOverflow)?;
+		<Balance<T>>::insert(collection_id, owner.as_sub(), new_balance);
 
-        Self::deposit_event(RawEvent::ItemCreated(collection_id, current_index, owner));
-        Ok(())
-    }
+		Self::deposit_event(RawEvent::ItemCreated(collection_id, current_index, owner));
+		Ok(())
+	}
 
-    fn add_nft_item(collection: &CollectionHandle<T>, item: NftItemType<T::CrossAccountId>) -> DispatchResult {
-        let collection_id = collection.id;
+	fn add_nft_item(
+		collection: &CollectionHandle<T>,
+		item: NftItemType<T::CrossAccountId>,
+	) -> DispatchResult {
+		let collection_id = collection.id;
 
-        let current_index = <ItemListIndex>::get(collection_id)
-            .checked_add(1)
-            .ok_or(Error::<T>::NumOverflow)?;
+		let current_index = <ItemListIndex>::get(collection_id)
+			.checked_add(1)
+			.ok_or(Error::<T>::NumOverflow)?;
 
-        let item_owner = item.owner.clone();
-        Self::add_token_index(collection_id, current_index, &item.owner)?;
+		let item_owner = item.owner.clone();
+		Self::add_token_index(collection_id, current_index, &item.owner)?;
 
-        <ItemListIndex>::insert(collection_id, current_index);
-        <NftItemList<T>>::insert(collection_id, current_index, item);
+		<ItemListIndex>::insert(collection_id, current_index);
+		<NftItemList<T>>::insert(collection_id, current_index, item);
 
-        // Update balance
-        let new_balance = <Balance<T>>::get(collection_id, item_owner.as_sub())
-            .checked_add(1)
-            .ok_or(Error::<T>::NumOverflow)?;
-        <Balance<T>>::insert(collection_id, item_owner.as_sub(), new_balance);
+		// Update balance
+		let new_balance = <Balance<T>>::get(collection_id, item_owner.as_sub())
+			.checked_add(1)
+			.ok_or(Error::<T>::NumOverflow)?;
+		<Balance<T>>::insert(collection_id, item_owner.as_sub(), new_balance);
 
-        collection.log(ERC721Events::Transfer {
-            from: H160::default(),
-            to: *item_owner.as_eth(),
-            token_id: current_index.into(),
-        });
-        Self::deposit_event(RawEvent::ItemCreated(collection_id, current_index, item_owner));
-        Ok(())
-    }
+		collection.log(ERC721Events::Transfer {
+			from: H160::default(),
+			to: *item_owner.as_eth(),
+			token_id: current_index.into(),
+		});
+		Self::deposit_event(RawEvent::ItemCreated(
+			collection_id,
+			current_index,
+			item_owner,
+		));
+		Ok(())
+	}
 
-    fn burn_refungible_item(
-        collection: &CollectionHandle<T>,
-        item_id: TokenId,
-        owner: &T::CrossAccountId,
-    ) -> DispatchResult {
-        let collection_id = collection.id;
+	fn burn_refungible_item(
+		collection: &CollectionHandle<T>,
+		item_id: TokenId,
+		owner: &T::CrossAccountId,
+	) -> DispatchResult {
+		let collection_id = collection.id;
 
-        let mut token = <ReFungibleItemList<T>>::get(collection_id, item_id)
-            .ok_or(Error::<T>::TokenNotFound)?;
-        let rft_balance = token
-            .owner
-            .iter()
-            .find(|&i| i.owner == *owner)
-            .ok_or(Error::<T>::TokenNotFound)?;
-        Self::remove_token_index(collection_id, item_id, owner)?;
+		let mut token = <ReFungibleItemList<T>>::get(collection_id, item_id)
+			.ok_or(Error::<T>::TokenNotFound)?;
+		let rft_balance = token
+			.owner
+			.iter()
+			.find(|&i| i.owner == *owner)
+			.ok_or(Error::<T>::TokenNotFound)?;
+		Self::remove_token_index(collection_id, item_id, owner)?;
 
-        // update balance
-        let new_balance = <Balance<T>>::get(collection_id, rft_balance.owner.as_sub())
-            .checked_sub(rft_balance.fraction)
-            .ok_or(Error::<T>::NumOverflow)?;
-        <Balance<T>>::insert(collection_id, rft_balance.owner.as_sub(), new_balance);
+		// update balance
+		let new_balance = <Balance<T>>::get(collection_id, rft_balance.owner.as_sub())
+			.checked_sub(rft_balance.fraction)
+			.ok_or(Error::<T>::NumOverflow)?;
+		<Balance<T>>::insert(collection_id, rft_balance.owner.as_sub(), new_balance);
 
-        // Re-create owners list with sender removed
-        let index = token
-            .owner
-            .iter()
-            .position(|i| i.owner == *owner)
-            .expect("owned item is exists");
-        token.owner.remove(index);
-        let owner_count = token.owner.len();
+		// Re-create owners list with sender removed
+		let index = token
+			.owner
+			.iter()
+			.position(|i| i.owner == *owner)
+			.expect("owned item is exists");
+		token.owner.remove(index);
+		let owner_count = token.owner.len();
 
-        // Burn the token completely if this was the last (only) owner
-        if owner_count == 0 {
-            <ReFungibleItemList<T>>::remove(collection_id, item_id);
-            <VariableMetaDataBasket<T>>::remove(collection_id, item_id);
-        }
-        else {
-            <ReFungibleItemList<T>>::insert(collection_id, item_id, token);
-        }
+		// Burn the token completely if this was the last (only) owner
+		if owner_count == 0 {
+			<ReFungibleItemList<T>>::remove(collection_id, item_id);
+			<VariableMetaDataBasket<T>>::remove(collection_id, item_id);
+		} else {
+			<ReFungibleItemList<T>>::insert(collection_id, item_id, token);
+		}
 
-        Ok(())
-    }
+		Ok(())
+	}
 
-    fn burn_nft_item(collection: &CollectionHandle<T>, item_id: TokenId) -> DispatchResult {
-        let collection_id = collection.id;
+	fn burn_nft_item(collection: &CollectionHandle<T>, item_id: TokenId) -> DispatchResult {
+		let collection_id = collection.id;
 
-        let item = <NftItemList<T>>::get(collection_id, item_id)
-            .ok_or(Error::<T>::TokenNotFound)?;
-        Self::remove_token_index(collection_id, item_id, &item.owner)?;
+		let item =
+			<NftItemList<T>>::get(collection_id, item_id).ok_or(Error::<T>::TokenNotFound)?;
+		Self::remove_token_index(collection_id, item_id, &item.owner)?;
 
-        // update balance
-        let new_balance = <Balance<T>>::get(collection_id, item.owner.as_sub())
-            .checked_sub(1)
-            .ok_or(Error::<T>::NumOverflow)?;
-        <Balance<T>>::insert(collection_id, item.owner.as_sub(), new_balance);
-        <NftItemList<T>>::remove(collection_id, item_id);
-        <VariableMetaDataBasket<T>>::remove(collection_id, item_id);
+		// update balance
+		let new_balance = <Balance<T>>::get(collection_id, item.owner.as_sub())
+			.checked_sub(1)
+			.ok_or(Error::<T>::NumOverflow)?;
+		<Balance<T>>::insert(collection_id, item.owner.as_sub(), new_balance);
+		<NftItemList<T>>::remove(collection_id, item_id);
+		<VariableMetaDataBasket<T>>::remove(collection_id, item_id);
 
-        Self::deposit_event(RawEvent::ItemDestroyed(collection.id, item_id));
-        Ok(())
-    }
+		Self::deposit_event(RawEvent::ItemDestroyed(collection.id, item_id));
+		Ok(())
+	}
 
-    fn burn_fungible_item(owner: &T::CrossAccountId, collection: &CollectionHandle<T>, value: u128) -> DispatchResult {
-        let collection_id = collection.id;
+	fn burn_fungible_item(
+		owner: &T::CrossAccountId,
+		collection: &CollectionHandle<T>,
+		value: u128,
+	) -> DispatchResult {
+		let collection_id = collection.id;
 
-        let mut balance = <FungibleItemList<T>>::get(collection_id, owner.as_sub());
-        ensure!(balance.value >= value, Error::<T>::TokenValueNotEnough);
+		let mut balance = <FungibleItemList<T>>::get(collection_id, owner.as_sub());
+		ensure!(balance.value >= value, Error::<T>::TokenValueNotEnough);
 
-        // update balance
-        let new_balance = <Balance<T>>::get(collection_id, owner.as_sub())
-            .checked_sub(value)
-            .ok_or(Error::<T>::NumOverflow)?;
-        <Balance<T>>::insert(collection_id, owner.as_sub(), new_balance);
+		// update balance
+		let new_balance = <Balance<T>>::get(collection_id, owner.as_sub())
+			.checked_sub(value)
+			.ok_or(Error::<T>::NumOverflow)?;
+		<Balance<T>>::insert(collection_id, owner.as_sub(), new_balance);
 
-        if balance.value - value > 0 {
-            balance.value -= value;
-            <FungibleItemList<T>>::insert(collection_id, owner.as_sub(), balance);
-        }
-        else {
-            <FungibleItemList<T>>::remove(collection_id, owner.as_sub());
-        }
+		if balance.value - value > 0 {
+			balance.value -= value;
+			<FungibleItemList<T>>::insert(collection_id, owner.as_sub(), balance);
+		} else {
+			<FungibleItemList<T>>::remove(collection_id, owner.as_sub());
+		}
 
-        collection.log(ERC20Events::Transfer {
-            from: *owner.as_eth(),
-            to: H160::default(),
-            value: value.into(),
-        });
-        Ok(())
-    }
+		collection.log(ERC20Events::Transfer {
+			from: *owner.as_eth(),
+			to: H160::default(),
+			value: value.into(),
+		});
+		Ok(())
+	}
 
-    pub fn get_collection(collection_id: CollectionId) -> Result<CollectionHandle<T>, sp_runtime::DispatchError> {
-        Ok(<CollectionHandle<T>>::get(collection_id)
-            .ok_or(Error::<T>::CollectionNotFound)?)
-    }
+	pub fn get_collection(
+		collection_id: CollectionId,
+	) -> Result<CollectionHandle<T>, sp_runtime::DispatchError> {
+		Ok(<CollectionHandle<T>>::get(collection_id).ok_or(Error::<T>::CollectionNotFound)?)
+	}
 
-    fn save_collection(collection: CollectionHandle<T>) {
-        <CollectionById<T>>::insert(collection.id, collection.into_inner());
-    }
+	fn save_collection(collection: CollectionHandle<T>) {
+		<CollectionById<T>>::insert(collection.id, collection.into_inner());
+	}
 
-    pub fn submit_logs(collection: CollectionHandle<T>) -> DispatchResult {
-        if collection.logs.is_empty() {
-            return Ok(())
-        }
-        T::EthereumTransactionSender::submit_logs_transaction(
-            eth::generate_transaction(collection.id, T::EthereumChainId::get()),
-            collection.logs.retrieve_logs(),
-        )
-    }
+	pub fn submit_logs(collection: CollectionHandle<T>) -> DispatchResult {
+		if collection.logs.is_empty() {
+			return Ok(());
+		}
+		T::EthereumTransactionSender::submit_logs_transaction(
+			eth::generate_transaction(collection.id, T::EthereumChainId::get()),
+			collection.logs.retrieve_logs(),
+		)
+	}
 
-    fn check_owner_permissions(target_collection: &CollectionHandle<T>, subject: &T::AccountId) -> DispatchResult {
-        ensure!(
-            *subject == target_collection.owner,
-            Error::<T>::NoPermission
-        );
+	fn check_owner_permissions(
+		target_collection: &CollectionHandle<T>,
+		subject: &T::AccountId,
+	) -> DispatchResult {
+		ensure!(
+			*subject == target_collection.owner,
+			Error::<T>::NoPermission
+		);
 
-        Ok(())
-    }
+		Ok(())
+	}
 
-    fn is_owner_or_admin_permissions(collection: &CollectionHandle<T>, subject: &T::CrossAccountId) -> bool {
-        *subject.as_sub() == collection.owner || <AdminList<T>>::get(collection.id).contains(&subject)
-    }
+	fn is_owner_or_admin_permissions(
+		collection: &CollectionHandle<T>,
+		subject: &T::CrossAccountId,
+	) -> bool {
+		*subject.as_sub() == collection.owner
+			|| <AdminList<T>>::get(collection.id).contains(&subject)
+	}
 
-    fn check_owner_or_admin_permissions(
-        collection: &CollectionHandle<T>,
-        subject: &T::CrossAccountId,
-    ) -> DispatchResult {
-        ensure!(Self::is_owner_or_admin_permissions(collection, subject), Error::<T>::NoPermission);
+	fn check_owner_or_admin_permissions(
+		collection: &CollectionHandle<T>,
+		subject: &T::CrossAccountId,
+	) -> DispatchResult {
+		ensure!(
+			Self::is_owner_or_admin_permissions(collection, subject),
+			Error::<T>::NoPermission
+		);
 
-        Ok(())
-    }
+		Ok(())
+	}
 
-    fn owned_amount(
-        subject: &T::CrossAccountId,
-        target_collection: &CollectionHandle<T>,
-        item_id: TokenId,
-    ) -> Option<u128> {
-        let collection_id = target_collection.id;
+	fn owned_amount(
+		subject: &T::CrossAccountId,
+		target_collection: &CollectionHandle<T>,
+		item_id: TokenId,
+	) -> Option<u128> {
+		let collection_id = target_collection.id;
 
-        match target_collection.mode {
-            CollectionMode::NFT => (<NftItemList<T>>::get(collection_id, item_id)?.owner == *subject)
-                .then(|| 1),
-            CollectionMode::Fungible(_) => Some(<FungibleItemList<T>>::get(collection_id, &subject.as_sub())
-                .value),
-            CollectionMode::ReFungible => <ReFungibleItemList<T>>::get(collection_id, item_id)?
-                .owner
-                .iter()
-                .find(|i| i.owner == *subject)
-                .map(|i| i.fraction),
-            CollectionMode::Invalid => None,
-        }
-    }
+		match target_collection.mode {
+			CollectionMode::NFT => {
+				(<NftItemList<T>>::get(collection_id, item_id)?.owner == *subject).then(|| 1)
+			}
+			CollectionMode::Fungible(_) => {
+				Some(<FungibleItemList<T>>::get(collection_id, &subject.as_sub()).value)
+			}
+			CollectionMode::ReFungible => <ReFungibleItemList<T>>::get(collection_id, item_id)?
+				.owner
+				.iter()
+				.find(|i| i.owner == *subject)
+				.map(|i| i.fraction),
+			CollectionMode::Invalid => None,
+		}
+	}
 
-    fn is_item_owner(subject: &T::CrossAccountId, target_collection: &CollectionHandle<T>, item_id: TokenId) -> bool {
-        match target_collection.mode {
-            CollectionMode::Fungible(_) => true,
-            _ => Self::owned_amount(&subject, target_collection, item_id).is_some(),
-        }
-    }
+	fn is_item_owner(
+		subject: &T::CrossAccountId,
+		target_collection: &CollectionHandle<T>,
+		item_id: TokenId,
+	) -> bool {
+		match target_collection.mode {
+			CollectionMode::Fungible(_) => true,
+			_ => Self::owned_amount(&subject, target_collection, item_id).is_some(),
+		}
+	}
 
-    fn check_white_list(collection: &CollectionHandle<T>, address: &T::CrossAccountId) -> DispatchResult {
-        let collection_id = collection.id;
+	fn check_white_list(
+		collection: &CollectionHandle<T>,
+		address: &T::CrossAccountId,
+	) -> DispatchResult {
+		let collection_id = collection.id;
 
-        let mes = Error::<T>::AddresNotInWhiteList;
-        ensure!(<WhiteList<T>>::contains_key(collection_id, address.as_sub()), mes);
+		let mes = Error::<T>::AddresNotInWhiteList;
+		ensure!(
+			<WhiteList<T>>::contains_key(collection_id, address.as_sub()),
+			mes
+		);
 
-        Ok(())
-    }
+		Ok(())
+	}
 
-    /// Check if token exists. In case of Fungible, check if there is an entry for 
-    /// the owner in fungible balances double map
-    fn token_exists(
-        target_collection: &CollectionHandle<T>,
-        item_id: TokenId,
-    ) -> DispatchResult {
-        let collection_id = target_collection.id;
-        let exists = match target_collection.mode
-        {
-            CollectionMode::NFT => <NftItemList<T>>::contains_key(collection_id, item_id),
-            CollectionMode::Fungible(_)  => true,
-            CollectionMode::ReFungible  => <ReFungibleItemList<T>>::contains_key(collection_id, item_id),
-            _ => false
-        };
+	/// Check if token exists. In case of Fungible, check if there is an entry for
+	/// the owner in fungible balances double map
+	fn token_exists(target_collection: &CollectionHandle<T>, item_id: TokenId) -> DispatchResult {
+		let collection_id = target_collection.id;
+		let exists = match target_collection.mode {
+			CollectionMode::NFT => <NftItemList<T>>::contains_key(collection_id, item_id),
+			CollectionMode::Fungible(_) => true,
+			CollectionMode::ReFungible => {
+				<ReFungibleItemList<T>>::contains_key(collection_id, item_id)
+			}
+			_ => false,
+		};
 
-        ensure!(exists == true, Error::<T>::TokenNotFound);
-        Ok(())
-    }
+		ensure!(exists, Error::<T>::TokenNotFound);
+		Ok(())
+	}
 
-    fn transfer_fungible(
-        collection: &CollectionHandle<T>,
-        value: u128,
-        owner: &T::CrossAccountId,
-        recipient: &T::CrossAccountId,
-    ) -> DispatchResult {
-        let collection_id = collection.id;
+	fn transfer_fungible(
+		collection: &CollectionHandle<T>,
+		value: u128,
+		owner: &T::CrossAccountId,
+		recipient: &T::CrossAccountId,
+	) -> DispatchResult {
+		let collection_id = collection.id;
 
-        let mut balance = <FungibleItemList<T>>::get(collection_id, owner.as_sub());
-        ensure!(balance.value >= value, Error::<T>::TokenValueTooLow);
+		let mut balance = <FungibleItemList<T>>::get(collection_id, owner.as_sub());
+		ensure!(balance.value >= value, Error::<T>::TokenValueTooLow);
 
-        // Send balance to recipient (updates balanceOf of recipient)
-        Self::add_fungible_item(collection, recipient, value)?;
+		// Send balance to recipient (updates balanceOf of recipient)
+		Self::add_fungible_item(collection, recipient, value)?;
 
-        // update balanceOf of sender
-        <Balance<T>>::insert(collection_id, owner.as_sub(), balance.value - value);
+		// update balanceOf of sender
+		<Balance<T>>::insert(collection_id, owner.as_sub(), balance.value - value);
 
-        // Reduce or remove sender
-        if balance.value == value {
-            <FungibleItemList<T>>::remove(collection_id, owner.as_sub());
-        }
-        else {
-            balance.value -= value;
-            <FungibleItemList<T>>::insert(collection_id, owner.as_sub(), balance);
-        }
+		// Reduce or remove sender
+		if balance.value == value {
+			<FungibleItemList<T>>::remove(collection_id, owner.as_sub());
+		} else {
+			balance.value -= value;
+			<FungibleItemList<T>>::insert(collection_id, owner.as_sub(), balance);
+		}
 
-        collection.log(ERC20Events::Transfer {
-            from: *owner.as_eth(),
-            to: *recipient.as_eth(),
-            value: value.into(),
-        });
-        Self::deposit_event(RawEvent::Transfer(collection.id, 1, owner.clone(), recipient.clone(), value));
+		collection.log(ERC20Events::Transfer {
+			from: *owner.as_eth(),
+			to: *recipient.as_eth(),
+			value: value.into(),
+		});
+		Self::deposit_event(RawEvent::Transfer(
+			collection.id,
+			1,
+			owner.clone(),
+			recipient.clone(),
+			value,
+		));
 
-        Ok(())
-    }
+		Ok(())
+	}
 
-    fn transfer_refungible(
-        collection: &CollectionHandle<T>,
-        item_id: TokenId,
-        value: u128,
-        owner: T::CrossAccountId,
-        new_owner: T::CrossAccountId,
-    ) -> DispatchResult {
-        let collection_id = collection.id;
-        let full_item = <ReFungibleItemList<T>>::get(collection_id, item_id)
-            .ok_or(Error::<T>::TokenNotFound)?;
+	fn transfer_refungible(
+		collection: &CollectionHandle<T>,
+		item_id: TokenId,
+		value: u128,
+		owner: T::CrossAccountId,
+		new_owner: T::CrossAccountId,
+	) -> DispatchResult {
+		let collection_id = collection.id;
+		let full_item = <ReFungibleItemList<T>>::get(collection_id, item_id)
+			.ok_or(Error::<T>::TokenNotFound)?;
 
-        let item = full_item
-            .owner
-            .iter()
-            .filter(|i| i.owner == owner)
-            .next()
-            .ok_or(Error::<T>::TokenNotFound)?;
-        let amount = item.fraction;
+		let item = full_item
+			.owner
+			.iter()
+			.find(|i| i.owner == owner)
+			.ok_or(Error::<T>::TokenNotFound)?;
+		let amount = item.fraction;
 
-        ensure!(amount >= value, Error::<T>::TokenValueTooLow);
+		ensure!(amount >= value, Error::<T>::TokenValueTooLow);
 
-        // update balance
-        let balance_old_owner = <Balance<T>>::get(collection_id, item.owner.as_sub())
-            .checked_sub(value)
-            .ok_or(Error::<T>::NumOverflow)?;
-        <Balance<T>>::insert(collection_id, item.owner.as_sub(), balance_old_owner);
+		// update balance
+		let balance_old_owner = <Balance<T>>::get(collection_id, item.owner.as_sub())
+			.checked_sub(value)
+			.ok_or(Error::<T>::NumOverflow)?;
+		<Balance<T>>::insert(collection_id, item.owner.as_sub(), balance_old_owner);
 
-        let balance_new_owner = <Balance<T>>::get(collection_id, new_owner.as_sub())
-            .checked_add(value)
-            .ok_or(Error::<T>::NumOverflow)?;
-        <Balance<T>>::insert(collection_id, new_owner.as_sub(), balance_new_owner);
+		let balance_new_owner = <Balance<T>>::get(collection_id, new_owner.as_sub())
+			.checked_add(value)
+			.ok_or(Error::<T>::NumOverflow)?;
+		<Balance<T>>::insert(collection_id, new_owner.as_sub(), balance_new_owner);
 
-        let old_owner = item.owner.clone();
-        let new_owner_has_account = full_item.owner.iter().any(|i| i.owner == new_owner);
+		let old_owner = item.owner.clone();
+		let new_owner_has_account = full_item.owner.iter().any(|i| i.owner == new_owner);
 
-        // transfer
-        if amount == value && !new_owner_has_account {
-            // change owner
-            // new owner do not have account
-            let mut new_full_item = full_item.clone();
-            new_full_item
-                .owner
-                .iter_mut()
-                .find(|i| i.owner == owner)
-                .expect("old owner does present in refungible")
-                .owner = new_owner.clone();
-            <ReFungibleItemList<T>>::insert(collection_id, item_id, new_full_item);
+		let mut new_full_item = full_item.clone();
+		// transfer
+		if amount == value && !new_owner_has_account {
+			// change owner
+			// new owner do not have account
+			new_full_item
+				.owner
+				.iter_mut()
+				.find(|i| i.owner == owner)
+				.expect("old owner does present in refungible")
+				.owner = new_owner.clone();
+			<ReFungibleItemList<T>>::insert(collection_id, item_id, new_full_item);
 
-            // update index collection
-            Self::move_token_index(collection_id, item_id, &old_owner, &new_owner)?;
-        } else {
-            let mut new_full_item = full_item.clone();
-            new_full_item
-                .owner
-                .iter_mut()
-                .find(|i| i.owner == owner)
-                .expect("old owner does present in refungible")
-                .fraction -= value;
+			// update index collection
+			Self::move_token_index(collection_id, item_id, &old_owner, &new_owner)?;
+		} else {
+			new_full_item
+				.owner
+				.iter_mut()
+				.find(|i| i.owner == owner)
+				.expect("old owner does present in refungible")
+				.fraction -= value;
 
-            // separate amount
-            if new_owner_has_account {
-                // new owner has account
-                new_full_item
-                    .owner
-                    .iter_mut()
-                    .find(|i| i.owner == new_owner)
-                    .expect("new owner has account")
-                    .fraction += value;
-            } else {
-                // new owner do not have account
-                new_full_item.owner.push(Ownership {
-                    owner: new_owner.clone(),
-                    fraction: value,
-                });
-                Self::add_token_index(collection_id, item_id, &new_owner)?;
-            }
+			// separate amount
+			if new_owner_has_account {
+				// new owner has account
+				new_full_item
+					.owner
+					.iter_mut()
+					.find(|i| i.owner == new_owner)
+					.expect("new owner has account")
+					.fraction += value;
+			} else {
+				// new owner do not have account
+				new_full_item.owner.push(Ownership {
+					owner: new_owner.clone(),
+					fraction: value,
+				});
+				Self::add_token_index(collection_id, item_id, &new_owner)?;
+			}
 
-            <ReFungibleItemList<T>>::insert(collection_id, item_id, new_full_item);
-        }
+			<ReFungibleItemList<T>>::insert(collection_id, item_id, new_full_item);
+		}
 
-        Self::deposit_event(RawEvent::Transfer(collection.id, item_id, owner, new_owner, amount));
+		Self::deposit_event(RawEvent::Transfer(
+			collection.id,
+			item_id,
+			owner,
+			new_owner,
+			amount,
+		));
 
-        Ok(())
-    }
+		Ok(())
+	}
 
-    fn transfer_nft(
-        collection: &CollectionHandle<T>,
-        item_id: TokenId,
-        sender: T::CrossAccountId,
-        new_owner: T::CrossAccountId,
-    ) -> DispatchResult {
-        let collection_id = collection.id;
-        let mut item = <NftItemList<T>>::get(collection_id, item_id)
-            .ok_or(Error::<T>::TokenNotFound)?;
+	fn transfer_nft(
+		collection: &CollectionHandle<T>,
+		item_id: TokenId,
+		sender: T::CrossAccountId,
+		new_owner: T::CrossAccountId,
+	) -> DispatchResult {
+		let collection_id = collection.id;
+		let mut item =
+			<NftItemList<T>>::get(collection_id, item_id).ok_or(Error::<T>::TokenNotFound)?;
 
-        ensure!(
-            sender == item.owner,
-            Error::<T>::MustBeTokenOwner
-        );
+		ensure!(sender == item.owner, Error::<T>::MustBeTokenOwner);
 
-        // update balance
-        let balance_old_owner = <Balance<T>>::get(collection_id, item.owner.as_sub())
-            .checked_sub(1)
-            .ok_or(Error::<T>::NumOverflow)?;
-        <Balance<T>>::insert(collection_id, item.owner.as_sub(), balance_old_owner);
+		// update balance
+		let balance_old_owner = <Balance<T>>::get(collection_id, item.owner.as_sub())
+			.checked_sub(1)
+			.ok_or(Error::<T>::NumOverflow)?;
+		<Balance<T>>::insert(collection_id, item.owner.as_sub(), balance_old_owner);
 
-        let balance_new_owner = <Balance<T>>::get(collection_id, new_owner.as_sub())
-            .checked_add(1)
-            .ok_or(Error::<T>::NumOverflow)?;
-        <Balance<T>>::insert(collection_id, new_owner.as_sub(), balance_new_owner);
+		let balance_new_owner = <Balance<T>>::get(collection_id, new_owner.as_sub())
+			.checked_add(1)
+			.ok_or(Error::<T>::NumOverflow)?;
+		<Balance<T>>::insert(collection_id, new_owner.as_sub(), balance_new_owner);
 
-        // change owner
-        let old_owner = item.owner.clone();
-        item.owner = new_owner.clone();
-        <NftItemList<T>>::insert(collection_id, item_id, item);
+		// change owner
+		let old_owner = item.owner.clone();
+		item.owner = new_owner.clone();
+		<NftItemList<T>>::insert(collection_id, item_id, item);
 
-        // update index collection
-        Self::move_token_index(collection_id, item_id, &old_owner, &new_owner)?;
+		// update index collection
+		Self::move_token_index(collection_id, item_id, &old_owner, &new_owner)?;
 
-        collection.log(ERC721Events::Transfer {
-            from: *sender.as_eth(),
-            to: *new_owner.as_eth(),
-            token_id: item_id.into(),
-        });
-        Self::deposit_event(RawEvent::Transfer(collection.id, item_id, sender, new_owner, 1));
+		collection.log(ERC721Events::Transfer {
+			from: *sender.as_eth(),
+			to: *new_owner.as_eth(),
+			token_id: item_id.into(),
+		});
+		Self::deposit_event(RawEvent::Transfer(
+			collection.id,
+			item_id,
+			sender,
+			new_owner,
+			1,
+		));
 
-        Ok(())
-    }
-    
-    fn set_re_fungible_variable_data(
-        collection: &CollectionHandle<T>,
-        item_id: TokenId,
-        data: Vec<u8>
-    ) -> DispatchResult {
-        let collection_id = collection.id;
-        let mut item = <ReFungibleItemList<T>>::get(collection_id, item_id)
-            .ok_or(Error::<T>::TokenNotFound)?;
+		Ok(())
+	}
 
-        item.variable_data = data;
+	fn set_re_fungible_variable_data(
+		collection: &CollectionHandle<T>,
+		item_id: TokenId,
+		data: Vec<u8>,
+	) -> DispatchResult {
+		let collection_id = collection.id;
+		let mut item = <ReFungibleItemList<T>>::get(collection_id, item_id)
+			.ok_or(Error::<T>::TokenNotFound)?;
 
-        <ReFungibleItemList<T>>::insert(collection_id, item_id, item);
+		item.variable_data = data;
 
-        Ok(())
-    }
+		<ReFungibleItemList<T>>::insert(collection_id, item_id, item);
 
-    fn set_nft_variable_data(
-        collection: &CollectionHandle<T>,
-        item_id: TokenId,
-        data: Vec<u8>
-    ) -> DispatchResult {
-        let collection_id = collection.id;
-        let mut item = <NftItemList<T>>::get(collection_id, item_id)
-            .ok_or(Error::<T>::TokenNotFound)?;
-        
-        item.variable_data = data;
+		Ok(())
+	}
 
-        <NftItemList<T>>::insert(collection_id, item_id, item);
-        
-        Ok(())
-    }
+	fn set_nft_variable_data(
+		collection: &CollectionHandle<T>,
+		item_id: TokenId,
+		data: Vec<u8>,
+	) -> DispatchResult {
+		let collection_id = collection.id;
+		let mut item =
+			<NftItemList<T>>::get(collection_id, item_id).ok_or(Error::<T>::TokenNotFound)?;
 
-    #[allow(dead_code)]
-    fn init_collection(item: &Collection<T>) {
-        // check params
-        assert!(
-            item.decimal_points <= MAX_DECIMAL_POINTS,
-            "decimal_points parameter must be lower than MAX_DECIMAL_POINTS"
-        );
-        assert!(
-            item.name.len() <= 64,
-            "Collection name can not be longer than 63 char"
-        );
-        assert!(
-            item.name.len() <= 256,
-            "Collection description can not be longer than 255 char"
-        );
-        assert!(
-            item.token_prefix.len() <= 16,
-            "Token prefix can not be longer than 15 char"
-        );
+		item.variable_data = data;
 
-        // Generate next collection ID
-        let next_id = CreatedCollectionCount::get()
-            .checked_add(1)
-            .unwrap();
+		<NftItemList<T>>::insert(collection_id, item_id, item);
 
-        CreatedCollectionCount::put(next_id);
-    }
+		Ok(())
+	}
 
-    #[allow(dead_code)]
-    fn init_nft_token(collection_id: CollectionId, item: &NftItemType<T::CrossAccountId>) {
-        let current_index = <ItemListIndex>::get(collection_id)
-            .checked_add(1)
-            .unwrap();
+	#[allow(dead_code)]
+	fn init_collection(item: &Collection<T>) {
+		// check params
+		assert!(
+			item.decimal_points <= MAX_DECIMAL_POINTS,
+			"decimal_points parameter must be lower than MAX_DECIMAL_POINTS"
+		);
+		assert!(
+			item.name.len() <= 64,
+			"Collection name can not be longer than 63 char"
+		);
+		assert!(
+			item.name.len() <= 256,
+			"Collection description can not be longer than 255 char"
+		);
+		assert!(
+			item.token_prefix.len() <= 16,
+			"Token prefix can not be longer than 15 char"
+		);
 
-        Self::add_token_index(collection_id, current_index, &item.owner).unwrap();
+		// Generate next collection ID
+		let next_id = CreatedCollectionCount::get().checked_add(1).unwrap();
 
-        <ItemListIndex>::insert(collection_id, current_index);
+		CreatedCollectionCount::put(next_id);
+	}
 
-        // Update balance
-        let new_balance = <Balance<T>>::get(collection_id, item.owner.as_sub())
-            .checked_add(1)
-            .unwrap();
-        <Balance<T>>::insert(collection_id, item.owner.as_sub(), new_balance);
-    }
+	#[allow(dead_code)]
+	fn init_nft_token(collection_id: CollectionId, item: &NftItemType<T::CrossAccountId>) {
+		let current_index = <ItemListIndex>::get(collection_id).checked_add(1).unwrap();
 
-    #[allow(dead_code)]
-    fn init_fungible_token(collection_id: CollectionId, owner: &T::CrossAccountId, item: &FungibleItemType) {
-        let current_index = <ItemListIndex>::get(collection_id)
-            .checked_add(1)
-            .unwrap();
+		Self::add_token_index(collection_id, current_index, &item.owner).unwrap();
 
-        Self::add_token_index(collection_id, current_index, owner).unwrap();
+		<ItemListIndex>::insert(collection_id, current_index);
 
-        <ItemListIndex>::insert(collection_id, current_index);
+		// Update balance
+		let new_balance = <Balance<T>>::get(collection_id, item.owner.as_sub())
+			.checked_add(1)
+			.unwrap();
+		<Balance<T>>::insert(collection_id, item.owner.as_sub(), new_balance);
+	}
 
-        // Update balance
-        let new_balance = <Balance<T>>::get(collection_id, owner.as_sub())
-            .checked_add(item.value)
-            .unwrap();
-        <Balance<T>>::insert(collection_id, owner.as_sub(), new_balance);
-    }
+	#[allow(dead_code)]
+	fn init_fungible_token(
+		collection_id: CollectionId,
+		owner: &T::CrossAccountId,
+		item: &FungibleItemType,
+	) {
+		let current_index = <ItemListIndex>::get(collection_id).checked_add(1).unwrap();
 
-    #[allow(dead_code)]
-    fn init_refungible_token(collection_id: CollectionId, item: &ReFungibleItemType<T::CrossAccountId>) {
-        let current_index = <ItemListIndex>::get(collection_id)
-            .checked_add(1)
-            .unwrap();
+		Self::add_token_index(collection_id, current_index, owner).unwrap();
 
-        let value = item.owner.first().unwrap().fraction;
-        let owner = item.owner.first().unwrap().owner.clone();
+		<ItemListIndex>::insert(collection_id, current_index);
 
-        Self::add_token_index(collection_id, current_index, &owner).unwrap();
+		// Update balance
+		let new_balance = <Balance<T>>::get(collection_id, owner.as_sub())
+			.checked_add(item.value)
+			.unwrap();
+		<Balance<T>>::insert(collection_id, owner.as_sub(), new_balance);
+	}
 
-        <ItemListIndex>::insert(collection_id, current_index);
+	#[allow(dead_code)]
+	fn init_refungible_token(
+		collection_id: CollectionId,
+		item: &ReFungibleItemType<T::CrossAccountId>,
+	) {
+		let current_index = <ItemListIndex>::get(collection_id).checked_add(1).unwrap();
 
-        // Update balance
-        let new_balance = <Balance<T>>::get(collection_id, &owner.as_sub())
-            .checked_add(value)
-            .unwrap();
-        <Balance<T>>::insert(collection_id, owner.as_sub(), new_balance);
-    }
+		let value = item.owner.first().unwrap().fraction;
+		let owner = item.owner.first().unwrap().owner.clone();
 
-    fn add_token_index(collection_id: CollectionId, item_index: TokenId, owner: &T::CrossAccountId) -> DispatchResult {
-        // add to account limit
-        if <AccountItemCount<T>>::contains_key(owner.as_sub()) {
+		Self::add_token_index(collection_id, current_index, &owner).unwrap();
 
-            // bound Owned tokens by a single address
-            let count = <AccountItemCount<T>>::get(owner.as_sub());
-            ensure!(count < ChainLimit::get().account_token_ownership_limit, Error::<T>::AddressOwnershipLimitExceeded);
+		<ItemListIndex>::insert(collection_id, current_index);
 
-            <AccountItemCount<T>>::insert(owner.as_sub(), count
-                .checked_add(1)
-                .ok_or(Error::<T>::NumOverflow)?);
-        }
-        else {
-            <AccountItemCount<T>>::insert(owner.as_sub(), 1);
-        }
+		// Update balance
+		let new_balance = <Balance<T>>::get(collection_id, &owner.as_sub())
+			.checked_add(value)
+			.unwrap();
+		<Balance<T>>::insert(collection_id, owner.as_sub(), new_balance);
+	}
 
-        let list_exists = <AddressTokens<T>>::contains_key(collection_id, owner.as_sub());
-        if list_exists {
-            let mut list = <AddressTokens<T>>::get(collection_id, owner.as_sub());
-            let item_contains = list.contains(&item_index.clone());
+	fn add_token_index(
+		collection_id: CollectionId,
+		item_index: TokenId,
+		owner: &T::CrossAccountId,
+	) -> DispatchResult {
+		// add to account limit
+		if <AccountItemCount<T>>::contains_key(owner.as_sub()) {
+			// bound Owned tokens by a single address
+			let count = <AccountItemCount<T>>::get(owner.as_sub());
+			ensure!(
+				count < ChainLimit::get().account_token_ownership_limit,
+				Error::<T>::AddressOwnershipLimitExceeded
+			);
 
-            if !item_contains {
-                list.push(item_index.clone());
-            }
+			<AccountItemCount<T>>::insert(
+				owner.as_sub(),
+				count.checked_add(1).ok_or(Error::<T>::NumOverflow)?,
+			);
+		} else {
+			<AccountItemCount<T>>::insert(owner.as_sub(), 1);
+		}
 
-            <AddressTokens<T>>::insert(collection_id, owner.as_sub(), list);
-        } else {
-            let mut itm = Vec::new();
-            itm.push(item_index.clone());
-            <AddressTokens<T>>::insert(collection_id, owner.as_sub(), itm);
-        }
+		let list_exists = <AddressTokens<T>>::contains_key(collection_id, owner.as_sub());
+		if list_exists {
+			let mut list = <AddressTokens<T>>::get(collection_id, owner.as_sub());
+			let item_contains = list.contains(&item_index.clone());
 
-        Ok(())
-    }
+			if !item_contains {
+				list.push(item_index);
+			}
 
-    fn remove_token_index(
-        collection_id: CollectionId,
-        item_index: TokenId,
-        owner: &T::CrossAccountId,
-    ) -> DispatchResult {
+			<AddressTokens<T>>::insert(collection_id, owner.as_sub(), list);
+		} else {
+			let itm = vec![item_index];
+			<AddressTokens<T>>::insert(collection_id, owner.as_sub(), itm);
+		}
 
-        // update counter
-        <AccountItemCount<T>>::insert(owner.as_sub(), 
-            <AccountItemCount<T>>::get(owner.as_sub())
-            .checked_sub(1)
-            .ok_or(Error::<T>::NumOverflow)?);
+		Ok(())
+	}
 
+	fn remove_token_index(
+		collection_id: CollectionId,
+		item_index: TokenId,
+		owner: &T::CrossAccountId,
+	) -> DispatchResult {
+		// update counter
+		<AccountItemCount<T>>::insert(
+			owner.as_sub(),
+			<AccountItemCount<T>>::get(owner.as_sub())
+				.checked_sub(1)
+				.ok_or(Error::<T>::NumOverflow)?,
+		);
 
-        let list_exists = <AddressTokens<T>>::contains_key(collection_id, owner.as_sub());
-        if list_exists {
-            let mut list = <AddressTokens<T>>::get(collection_id, owner.as_sub());
-            let item_contains = list.contains(&item_index.clone());
+		let list_exists = <AddressTokens<T>>::contains_key(collection_id, owner.as_sub());
+		if list_exists {
+			let mut list = <AddressTokens<T>>::get(collection_id, owner.as_sub());
+			let item_contains = list.contains(&item_index.clone());
 
-            if item_contains {
-                list.retain(|&item| item != item_index);
-                <AddressTokens<T>>::insert(collection_id, owner.as_sub(), list);
-            }
-        }
+			if item_contains {
+				list.retain(|&item| item != item_index);
+				<AddressTokens<T>>::insert(collection_id, owner.as_sub(), list);
+			}
+		}
 
-        Ok(())
-    }
+		Ok(())
+	}
 
-    fn move_token_index(
-        collection_id: CollectionId,
-        item_index: TokenId,
-        old_owner: &T::CrossAccountId,
-        new_owner: &T::CrossAccountId,
-    ) -> DispatchResult {
-        Self::remove_token_index(collection_id, item_index, old_owner)?;
-        Self::add_token_index(collection_id, item_index, new_owner)?;
+	fn move_token_index(
+		collection_id: CollectionId,
+		item_index: TokenId,
+		old_owner: &T::CrossAccountId,
+		new_owner: &T::CrossAccountId,
+	) -> DispatchResult {
+		Self::remove_token_index(collection_id, item_index, old_owner)?;
+		Self::add_token_index(collection_id, item_index, new_owner)?;
 
-        Ok(())
-    }
+		Ok(())
+	}
 }
 
 sp_api::decl_runtime_apis! {
-    pub trait NftApi {
-        /// Used for ethereum integration
-        fn eth_contract_code(account: H160) -> Option<Vec<u8>>;
-    }
-}
\ No newline at end of file
+	pub trait NftApi {
+		/// Used for ethereum integration
+		fn eth_contract_code(account: H160) -> Option<Vec<u8>>;
+	}
+}
modifiedpallets/nft/src/mock.rsdiffbeforeafterboth
--- a/pallets/nft/src/mock.rs
+++ b/pallets/nft/src/mock.rs
@@ -1,22 +1,21 @@
+#![allow(clippy::from_over_into)]
+
 use crate as pallet_template;
 use sp_core::H256;
-use frame_support::{ 
-	parameter_types,
-	weights::IdentityFee,
-};
+use frame_support::{parameter_types, weights::IdentityFee};
 use sp_runtime::{
-	traits::{BlakeTwo256, IdentityLookup}, 
-	testing::Header, 
+	traits::{BlakeTwo256, IdentityLookup},
+	testing::Header,
 	Perbill,
 };
-use pallet_transaction_payment::{ CurrencyAdapter};
+use pallet_transaction_payment::{CurrencyAdapter};
 use frame_system as system;
 use pallet_evm::AddressMapping;
 use crate::{EvmBackwardsAddressMapping, CrossAccountId};
 use codec::{Encode, Decode};
 
 type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic<Test>;
-type Block = frame_system::mocking::MockBlock<Test>; 
+type Block = frame_system::mocking::MockBlock<Test>;
 
 // Configure a mock runtime to test the pallet.
 frame_support::construct_runtime!(
@@ -59,7 +58,7 @@
 	type OnKilledAccount = ();
 	type SystemWeightInfo = ();
 	type SS58Prefix = SS58Prefix;
-    type OnSetCode = ();
+	type OnSetCode = ();
 }
 
 parameter_types! {
@@ -68,10 +67,10 @@
 }
 //frame_system::Module<Test>;
 impl pallet_balances::Config for Test {
-    type AccountStore = System;
-    type Balance = u64;
-    type DustRemoval = ();
-    type Event = ();
+	type AccountStore = System;
+	type Balance = u64;
+	type DustRemoval = ();
+	type Event = ();
 	type ExistentialDeposit = ExistentialDeposit;
 	type WeightInfo = ();
 	type MaxLocks = MaxLocks;
@@ -132,70 +131,76 @@
 	type ChainExtension = ();
 	type WeightPrice = ();
 	type WeightInfo = pallet_contracts::weights::SubstrateWeight<Self>;
-    type Schedule = Schedule;
-    type CallStack = [pallet_contracts::Frame<Self>; 31];
+	type Schedule = Schedule;
+	type CallStack = [pallet_contracts::Frame<Self>; 31];
 }
 
 parameter_types! {
 	pub const CollectionCreationPrice: u32 = 0;
-    pub TreasuryAccountId: u64 = 1234;
-    pub EthereumChainId: u32 = 1111;
+	pub TreasuryAccountId: u64 = 1234;
+	pub EthereumChainId: u32 = 1111;
 }
 
 pub struct TestEvmAddressMapping;
 impl AddressMapping<u64> for TestEvmAddressMapping {
-    fn into_account_id(addr: sp_core::H160) -> u64 {
-        unimplemented!()
-    }
+	fn into_account_id(_addr: sp_core::H160) -> u64 {
+		unimplemented!()
+	}
 }
 
 pub struct TestEvmBackwardsAddressMapping;
 impl EvmBackwardsAddressMapping<u64> for TestEvmBackwardsAddressMapping {
-    fn from_account_id(account_id: u64) -> sp_core::H160 {
-        unimplemented!()
-    }
+	fn from_account_id(_account_id: u64) -> sp_core::H160 {
+		unimplemented!()
+	}
 }
 
 #[derive(Encode, Decode, Clone, PartialEq, Eq, PartialOrd, Ord, Debug)]
 pub struct TestCrossAccountId(u64, sp_core::H160);
 impl CrossAccountId<u64> for TestCrossAccountId {
-    fn from_sub(sub: u64) -> Self {
-        let mut eth = [0; 20];
-        eth[12..20].copy_from_slice(&sub.to_be_bytes());
-        Self(sub, sp_core::H160(eth))
-    }
-    fn as_sub(&self) -> &u64 {
-        &self.0
-    }
-    fn from_eth(eth: sp_core::H160) -> Self {
-        unimplemented!()
-    }
-    fn as_eth(&self) -> &sp_core::H160 {
-        &self.1
-    }
+	fn from_sub(sub: u64) -> Self {
+		let mut eth = [0; 20];
+		eth[12..20].copy_from_slice(&sub.to_be_bytes());
+		Self(sub, sp_core::H160(eth))
+	}
+	fn as_sub(&self) -> &u64 {
+		&self.0
+	}
+	fn from_eth(_eth: sp_core::H160) -> Self {
+		unimplemented!()
+	}
+	fn as_eth(&self) -> &sp_core::H160 {
+		&self.1
+	}
 }
 
 pub struct TestEtheremTransactionSender;
 impl pallet_ethereum::EthereumTransactionSender for TestEtheremTransactionSender {
-    fn submit_logs_transaction(tx: pallet_ethereum::Transaction, logs: Vec<pallet_ethereum::Log>) -> Result<(), sp_runtime::DispatchError> {
-        Ok(())
-    }
+	fn submit_logs_transaction(
+		_tx: pallet_ethereum::Transaction,
+		_logs: Vec<pallet_ethereum::Log>,
+	) -> Result<(), sp_runtime::DispatchError> {
+		Ok(())
+	}
 }
 
 impl pallet_template::Config for Test {
 	type Event = ();
 	type WeightInfo = ();
 	type CollectionCreationPrice = CollectionCreationPrice;
-    type Currency = pallet_balances::Pallet<Test>;
-    type TreasuryAccountId = TreasuryAccountId;
-    type EvmAddressMapping = TestEvmAddressMapping;
-    type EvmBackwardsAddressMapping = TestEvmBackwardsAddressMapping;
-    type CrossAccountId = TestCrossAccountId;
-    type EthereumChainId = EthereumChainId;
-    type EthereumTransactionSender = TestEtheremTransactionSender;
+	type Currency = pallet_balances::Pallet<Test>;
+	type TreasuryAccountId = TreasuryAccountId;
+	type EvmAddressMapping = TestEvmAddressMapping;
+	type EvmBackwardsAddressMapping = TestEvmBackwardsAddressMapping;
+	type CrossAccountId = TestCrossAccountId;
+	type EthereumChainId = EthereumChainId;
+	type EthereumTransactionSender = TestEtheremTransactionSender;
 }
 
 // Build genesis storage according to the mock runtime.
 pub fn new_test_ext() -> sp_io::TestExternalities {
-	system::GenesisConfig::default().build_storage::<Test>().unwrap().into()
-}
\ No newline at end of file
+	system::GenesisConfig::default()
+		.build_storage::<Test>()
+		.unwrap()
+		.into()
+}
modifiedpallets/nft/src/sponsorship.rsdiffbeforeafterboth
--- a/pallets/nft/src/sponsorship.rs
+++ b/pallets/nft/src/sponsorship.rs
@@ -1,4 +1,8 @@
-use crate::{Config, Call, CollectionById, CreateItemBasket, VariableMetaDataBasket, ReFungibleTransferBasket, FungibleTransferBasket, NftTransferBasket, ChainLimit, CreateItemData, CollectionMode};
+use crate::{
+	Config, Call, CollectionById, CreateItemBasket, VariableMetaDataBasket,
+	ReFungibleTransferBasket, FungibleTransferBasket, NftTransferBasket, ChainLimit,
+	CreateItemData, CollectionMode,
+};
 use core::marker::PhantomData;
 use up_sponsorship::SponsorshipHandler;
 use frame_support::{
@@ -6,7 +10,6 @@
 	storage::{StorageMap, StorageDoubleMap, StorageValue},
 };
 use nft_data_structs::{TokenId, CollectionId};
-use alloc::vec::Vec;
 
 pub struct NftSponsorshipHandler<T>(PhantomData<T>);
 impl<T: Config> NftSponsorshipHandler<T> {
@@ -15,7 +18,6 @@
 		collection_id: &CollectionId,
 		_properties: &CreateItemData,
 	) -> Option<T::AccountId> {
-	
 		let collection = CollectionById::<T>::get(collection_id)?;
 
 		// sponsor timeout
@@ -32,9 +34,8 @@
 		CreateItemBasket::<T>::insert((collection_id, who.clone()), block_number);
 
 		// check free create limit
-		if collection.limits.sponsored_data_size >= (_properties.len() as u32) {
-			collection.sponsorship.sponsor()
-				.cloned()
+		if collection.limits.sponsored_data_size >= (_properties.data_size() as u32) {
+			collection.sponsorship.sponsor().cloned()
 		} else {
 			None
 		}
@@ -45,13 +46,11 @@
 		collection_id: &CollectionId,
 		item_id: &TokenId,
 	) -> Option<T::AccountId> {
-
 		let collection = CollectionById::<T>::get(collection_id)?;
 		let limits = ChainLimit::get();
 
 		let mut sponsor_transfer = false;
 		if collection.sponsorship.confirmed() {
-
 			let collection_limits = collection.limits.clone();
 			let collection_mode = collection.mode.clone();
 
@@ -59,7 +58,6 @@
 			let block_number = <frame_system::Pallet<T>>::block_number() as T::BlockNumber;
 			sponsor_transfer = match collection_mode {
 				CollectionMode::NFT => {
-
 					// get correct limit
 					let limit: u32 = if collection_limits.sponsor_transfer_timeout > 0 {
 						collection_limits.sponsor_transfer_timeout
@@ -82,7 +80,6 @@
 					sponsored
 				}
 				CollectionMode::Fungible(_) => {
-
 					// get correct limit
 					let limit: u32 = if collection_limits.sponsor_transfer_timeout > 0 {
 						collection_limits.sponsor_transfer_timeout
@@ -106,7 +103,6 @@
 					sponsored
 				}
 				CollectionMode::ReFungible => {
-
 					// get correct limit
 					let limit: u32 = if collection_limits.sponsor_transfer_timeout > 0 {
 						collection_limits.sponsor_transfer_timeout
@@ -116,7 +112,8 @@
 
 					let mut sponsored = true;
 					if ReFungibleTransferBasket::<T>::contains_key(collection_id, item_id) {
-						let last_tx_block = ReFungibleTransferBasket::<T>::get(collection_id, item_id);
+						let last_tx_block =
+							ReFungibleTransferBasket::<T>::get(collection_id, item_id);
 						let limit_time = last_tx_block + limit.into();
 						if block_number <= limit_time {
 							sponsored = false;
@@ -128,32 +125,27 @@
 
 					sponsored
 				}
-				_ => {
-					false
-				},
+				_ => false,
 			};
 		}
 
 		if !sponsor_transfer {
 			None
 		} else {
-			collection.sponsorship.sponsor()
-				.cloned()
+			collection.sponsorship.sponsor().cloned()
 		}
 	}
-	
+
 	pub fn withdraw_set_variable_meta_data(
 		collection_id: &CollectionId,
 		item_id: &TokenId,
-		data: &Vec<u8>,
+		data: &[u8],
 	) -> Option<T::AccountId> {
-
 		let mut sponsor_metadata_changes = false;
 
 		let collection = CollectionById::<T>::get(collection_id)?;
 
-		if
-			collection.sponsorship.confirmed() &&
+		if collection.sponsorship.confirmed() &&
 			// Can't sponsor fungible collection, this tx will be rejected
 			// as invalid
 			!matches!(collection.mode, CollectionMode::Fungible(_)) &&
@@ -164,7 +156,7 @@
 
 				if VariableMetaDataBasket::<T>::get(collection_id, item_id)
 					.map(|last_block| block_number - last_block > rate_limit)
-					.unwrap_or(true) 
+					.unwrap_or(true)
 				{
 					sponsor_metadata_changes = true;
 					VariableMetaDataBasket::<T>::insert(collection_id, item_id, block_number);
@@ -177,27 +169,26 @@
 		} else {
 			collection.sponsorship.sponsor().cloned()
 		}
-
 	}
 }
 
 impl<T, C> SponsorshipHandler<T::AccountId, C> for NftSponsorshipHandler<T>
-where 
-    T: Config,
-    C: IsSubType<Call<T>>
+where
+	T: Config,
+	C: IsSubType<Call<T>>,
 {
-    fn get_sponsor(who: &T::AccountId, call: &C) -> Option<T::AccountId> {
-        match IsSubType::<Call<T>>::is_sub_type(call)? {
-            Call::create_item(collection_id, _owner, _properties) => {
-                Self::withdraw_create_item(who, collection_id, &_properties)
-            },
-            Call::transfer(_new_owner, collection_id, item_id, _value) => {
-                Self::withdraw_transfer(who, collection_id, item_id)
-            },
-            Call::set_variable_meta_data(collection_id, item_id, data) => {
-                Self::withdraw_set_variable_meta_data(collection_id, item_id, &data)
-			},
+	fn get_sponsor(who: &T::AccountId, call: &C) -> Option<T::AccountId> {
+		match IsSubType::<Call<T>>::is_sub_type(call)? {
+			Call::create_item(collection_id, _owner, _properties) => {
+				Self::withdraw_create_item(who, collection_id, &_properties)
+			}
+			Call::transfer(_new_owner, collection_id, item_id, _value) => {
+				Self::withdraw_transfer(who, collection_id, item_id)
+			}
+			Call::set_variable_meta_data(collection_id, item_id, data) => {
+				Self::withdraw_set_variable_meta_data(collection_id, item_id, &data)
+			}
 			_ => None,
-        }
-    }
-}
\ No newline at end of file
+		}
+	}
+}
modifiedpallets/nft/src/tests.rsdiffbeforeafterboth
--- a/pallets/nft/src/tests.rs
+++ b/pallets/nft/src/tests.rs
@@ -1,90 +1,109 @@
 // Tests to be written here
 use super::*;
 use crate::mock::*;
-use crate::{
-    AccessMode, CollectionMode,
-    Ownership, ChainLimits, CreateItemData,
-};
+use crate::{AccessMode, CollectionMode, Ownership, ChainLimits, CreateItemData};
 use nft_data_structs::{
-    CreateNftData, CreateFungibleData, CreateReFungibleData,
-    CollectionId, TokenId, MAX_DECIMAL_POINTS,
+	CreateNftData, CreateFungibleData, CreateReFungibleData, CollectionId, TokenId,
+	MAX_DECIMAL_POINTS,
 };
 use frame_support::{assert_noop, assert_ok};
-use frame_system::{ RawOrigin };
+use frame_system::{RawOrigin};
 
 fn default_collection_numbers_limit() -> u32 {
-    10
+	10
 }
 
 fn default_limits() {
-    assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits {
-            collection_numbers_limit: default_collection_numbers_limit(),
-            account_token_ownership_limit: 10,
-            collections_admins_limit: 5,
-            custom_data_limit: 2048,
-            nft_sponsor_transfer_timeout: 15,
-            fungible_sponsor_transfer_timeout: 15,
-            refungible_sponsor_transfer_timeout: 15,
-            const_on_chain_schema_limit: 1024,
-            offchain_schema_limit: 1024,
-            variable_on_chain_schema_limit: 1024,
-        }));
+	assert_ok!(TemplateModule::set_chain_limits(
+		RawOrigin::Root.into(),
+		ChainLimits {
+			collection_numbers_limit: default_collection_numbers_limit(),
+			account_token_ownership_limit: 10,
+			collections_admins_limit: 5,
+			custom_data_limit: 2048,
+			nft_sponsor_transfer_timeout: 15,
+			fungible_sponsor_transfer_timeout: 15,
+			refungible_sponsor_transfer_timeout: 15,
+			const_on_chain_schema_limit: 1024,
+			offchain_schema_limit: 1024,
+			variable_on_chain_schema_limit: 1024,
+		}
+	));
 }
 
 fn default_nft_data() -> CreateNftData {
-    CreateNftData { const_data: vec![1, 2, 3], variable_data: vec![3, 2, 1] }
+	CreateNftData {
+		const_data: vec![1, 2, 3],
+		variable_data: vec![3, 2, 1],
+	}
 }
 
-fn default_fungible_data () -> CreateFungibleData {
-    CreateFungibleData { value: 5 }
+fn default_fungible_data() -> CreateFungibleData {
+	CreateFungibleData { value: 5 }
 }
 
-fn default_re_fungible_data () -> CreateReFungibleData {
-    CreateReFungibleData { const_data: vec![1, 2, 3], variable_data: vec![3, 2, 1], pieces: 1023 }
+fn default_re_fungible_data() -> CreateReFungibleData {
+	CreateReFungibleData {
+		const_data: vec![1, 2, 3],
+		variable_data: vec![3, 2, 1],
+		pieces: 1023,
+	}
 }
 
-fn create_test_collection_for_owner(mode: &CollectionMode, owner: u64, id: CollectionId) -> CollectionId {
-    let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
-    let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
-    let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
+fn create_test_collection_for_owner(
+	mode: &CollectionMode,
+	owner: u64,
+	id: CollectionId,
+) -> CollectionId {
+	let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
+	let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
+	let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
 
-    let origin1 = Origin::signed(owner);
-    assert_ok!(TemplateModule::create_collection(
-            origin1.clone(),
-            col_name1.clone(),
-            col_desc1.clone(),
-            token_prefix1.clone(),
-            mode.clone()
-        ));
+	let origin1 = Origin::signed(owner);
+	assert_ok!(TemplateModule::create_collection(
+		origin1,
+		col_name1,
+		col_desc1,
+		token_prefix1,
+		mode.clone()
+	));
 
-    let saved_col_name: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
-    let saved_description: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
-    let saved_prefix: Vec<u8> = b"token_prefix1\0".to_vec();
-    assert_eq!(TemplateModule::collection_id(id).unwrap().owner, owner);
-    assert_eq!(TemplateModule::collection_id(id).unwrap().name, saved_col_name);
-    assert_eq!(TemplateModule::collection_id(id).unwrap().mode, *mode);
-    assert_eq!(TemplateModule::collection_id(id).unwrap().description, saved_description);
-    assert_eq!(TemplateModule::collection_id(id).unwrap().token_prefix, saved_prefix);
-    id
+	let saved_col_name: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
+	let saved_description: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
+	let saved_prefix: Vec<u8> = b"token_prefix1\0".to_vec();
+	assert_eq!(TemplateModule::collection_id(id).unwrap().owner, owner);
+	assert_eq!(
+		TemplateModule::collection_id(id).unwrap().name,
+		saved_col_name
+	);
+	assert_eq!(TemplateModule::collection_id(id).unwrap().mode, *mode);
+	assert_eq!(
+		TemplateModule::collection_id(id).unwrap().description,
+		saved_description
+	);
+	assert_eq!(
+		TemplateModule::collection_id(id).unwrap().token_prefix,
+		saved_prefix
+	);
+	id
 }
 
 fn create_test_collection(mode: &CollectionMode, id: CollectionId) -> CollectionId {
-    create_test_collection_for_owner(&mode, 1, id)
+	create_test_collection_for_owner(&mode, 1, id)
 }
 
 fn create_test_item(collection_id: CollectionId, data: &CreateItemData) {
-    let origin1 = Origin::signed(1);
-    assert_ok!(TemplateModule::create_item(
-            origin1.clone(),
-            collection_id,
-            account(1),
-            data.clone()
-        ));
-
+	let origin1 = Origin::signed(1);
+	assert_ok!(TemplateModule::create_item(
+		origin1,
+		collection_id,
+		account(1),
+		data.clone()
+	));
 }
 
 fn account(sub: u64) -> TestCrossAccountId {
-    TestCrossAccountId::from_sub(sub)
+	TestCrossAccountId::from_sub(sub)
 }
 
 // Use cases tests region
@@ -92,149 +111,166 @@
 
 #[test]
 fn set_version_schema() {
-    new_test_ext().execute_with(|| {
-        default_limits();
-        let origin1 = Origin::signed(1);
-        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
-        
-        assert_ok!(TemplateModule::set_schema_version(origin1, collection_id, SchemaVersion::Unique));
-        assert_eq!(TemplateModule::collection_id(collection_id).unwrap().schema_version, SchemaVersion::Unique);
-    });
+	new_test_ext().execute_with(|| {
+		default_limits();
+		let origin1 = Origin::signed(1);
+		let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+
+		assert_ok!(TemplateModule::set_schema_version(
+			origin1,
+			collection_id,
+			SchemaVersion::Unique
+		));
+		assert_eq!(
+			TemplateModule::collection_id(collection_id)
+				.unwrap()
+				.schema_version,
+			SchemaVersion::Unique
+		);
+	});
 }
 
 #[test]
 fn create_fungible_collection_fails_with_large_decimal_numbers() {
-    new_test_ext().execute_with(|| {
-        default_limits();
+	new_test_ext().execute_with(|| {
+		default_limits();
 
-        let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
+		let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
+		let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
+		let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
 
-        let origin1 = Origin::signed(1);
-        assert_noop!(TemplateModule::create_collection(
-            origin1,
-            col_name1,
-            col_desc1,
-            token_prefix1,
-            CollectionMode::Fungible(MAX_DECIMAL_POINTS + 1)
-        ), Error::<Test>::CollectionDecimalPointLimitExceeded);
-    });    
+		let origin1 = Origin::signed(1);
+		assert_noop!(
+			TemplateModule::create_collection(
+				origin1,
+				col_name1,
+				col_desc1,
+				token_prefix1,
+				CollectionMode::Fungible(MAX_DECIMAL_POINTS + 1)
+			),
+			Error::<Test>::CollectionDecimalPointLimitExceeded
+		);
+	});
 }
 
 #[test]
 fn create_nft_item() {
-    new_test_ext().execute_with(|| {
-        default_limits();
-        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
-        
-        let data = default_nft_data();
-        create_test_item(collection_id, &data.clone().into());
-        let item = TemplateModule::nft_item_id(collection_id, 1).unwrap();
-        assert_eq!(item.const_data, data.const_data);
-        assert_eq!(item.variable_data, data.variable_data);
-    });
+	new_test_ext().execute_with(|| {
+		default_limits();
+		let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+
+		let data = default_nft_data();
+		create_test_item(collection_id, &data.clone().into());
+		let item = TemplateModule::nft_item_id(collection_id, 1).unwrap();
+		assert_eq!(item.const_data, data.const_data);
+		assert_eq!(item.variable_data, data.variable_data);
+	});
 }
 
 // Use cases tests region
 // #region
 #[test]
 fn create_nft_multiple_items() {
-    new_test_ext().execute_with(|| {
-        default_limits();
-        
-        create_test_collection(&CollectionMode::NFT, 1);
+	new_test_ext().execute_with(|| {
+		default_limits();
 
-        let origin1 = Origin::signed(1);
+		create_test_collection(&CollectionMode::NFT, 1);
 
-        let items_data = vec![default_nft_data(), default_nft_data(), default_nft_data()];
+		let origin1 = Origin::signed(1);
+
+		let items_data = vec![default_nft_data(), default_nft_data(), default_nft_data()];
 
-        assert_ok!(TemplateModule::create_multiple_items(
-            origin1.clone(),
-            1,
-            account(1),
-            items_data.clone().into_iter().map(|d| { d.into() }).collect()
-        ));
-        for (index, data) in items_data.iter().enumerate() {
-            let item = TemplateModule::nft_item_id(1, (index + 1) as TokenId).unwrap(); 
-            assert_eq!(item.const_data.to_vec(), data.const_data);
-            assert_eq!(item.variable_data.to_vec(), data.variable_data);
-        }
-    });
+		assert_ok!(TemplateModule::create_multiple_items(
+			origin1,
+			1,
+			account(1),
+			items_data
+				.clone()
+				.into_iter()
+				.map(|d| { d.into() })
+				.collect()
+		));
+		for (index, data) in items_data.iter().enumerate() {
+			let item = TemplateModule::nft_item_id(1, (index + 1) as TokenId).unwrap();
+			assert_eq!(item.const_data.to_vec(), data.const_data);
+			assert_eq!(item.variable_data.to_vec(), data.variable_data);
+		}
+	});
 }
 
 #[test]
 fn create_refungible_item() {
-    new_test_ext().execute_with(|| {
-        default_limits();
-        let collection_id = create_test_collection(&CollectionMode::ReFungible, 1);
+	new_test_ext().execute_with(|| {
+		default_limits();
+		let collection_id = create_test_collection(&CollectionMode::ReFungible, 1);
 
-        let data = default_re_fungible_data();
-        create_test_item(collection_id, &data.clone().into());
-        let item = TemplateModule::refungible_item_id(collection_id, 1).unwrap();
-        assert_eq!(
-            item.const_data,
-            data.const_data
-        );
-        assert_eq!(
-            item.variable_data,
-            data.variable_data
-        );
-        assert_eq!(
-            item.owner[0],
-            Ownership {
-                owner: account(1),
-                fraction: 1023
-            }
-        );
-    });
+		let data = default_re_fungible_data();
+		create_test_item(collection_id, &data.clone().into());
+		let item = TemplateModule::refungible_item_id(collection_id, 1).unwrap();
+		assert_eq!(item.const_data, data.const_data);
+		assert_eq!(item.variable_data, data.variable_data);
+		assert_eq!(
+			item.owner[0],
+			Ownership {
+				owner: account(1),
+				fraction: 1023
+			}
+		);
+	});
 }
 
 #[test]
 fn create_multiple_refungible_items() {
-    new_test_ext().execute_with(|| {
-        default_limits();
-        
-        create_test_collection(&CollectionMode::ReFungible, 1);
+	new_test_ext().execute_with(|| {
+		default_limits();
 
-        let origin1 = Origin::signed(1);
+		create_test_collection(&CollectionMode::ReFungible, 1);
 
-        let items_data = vec![default_re_fungible_data(), default_re_fungible_data(), default_re_fungible_data()];
+		let origin1 = Origin::signed(1);
 
-        assert_ok!(TemplateModule::create_multiple_items(
-            origin1.clone(),
-            1,
-            account(1),
-            items_data.clone().into_iter().map(|d| { d.into() }).collect()
-        ));
-        for (index, data) in items_data.iter().enumerate() {
+		let items_data = vec![
+			default_re_fungible_data(),
+			default_re_fungible_data(),
+			default_re_fungible_data(),
+		];
 
-            let item = TemplateModule::refungible_item_id(1, (index + 1) as TokenId).unwrap();
-            assert_eq!(item.const_data.to_vec(), data.const_data);
-            assert_eq!(item.variable_data.to_vec(), data.variable_data);
-            assert_eq!(
-                item.owner[0],
-                Ownership {
-                    owner: account(1),
-                    fraction: 1023
-                }
-            );
-        }
-    });
+		assert_ok!(TemplateModule::create_multiple_items(
+			origin1,
+			1,
+			account(1),
+			items_data
+				.clone()
+				.into_iter()
+				.map(|d| { d.into() })
+				.collect()
+		));
+		for (index, data) in items_data.iter().enumerate() {
+			let item = TemplateModule::refungible_item_id(1, (index + 1) as TokenId).unwrap();
+			assert_eq!(item.const_data.to_vec(), data.const_data);
+			assert_eq!(item.variable_data.to_vec(), data.variable_data);
+			assert_eq!(
+				item.owner[0],
+				Ownership {
+					owner: account(1),
+					fraction: 1023
+				}
+			);
+		}
+	});
 }
 
 #[test]
 fn create_fungible_item() {
-    new_test_ext().execute_with(|| {
-        default_limits();
-        
-        let collection_id = create_test_collection(&CollectionMode::Fungible(3), 1);
+	new_test_ext().execute_with(|| {
+		default_limits();
 
-        let data = default_fungible_data();
-        create_test_item(collection_id, &data.into());
+		let collection_id = create_test_collection(&CollectionMode::Fungible(3), 1);
 
-        assert_eq!(TemplateModule::fungible_item_id(collection_id, 1).value, 5);
-    });
+		let data = default_fungible_data();
+		create_test_item(collection_id, &data.into());
+
+		assert_eq!(TemplateModule::fungible_item_id(collection_id, 1).value, 5);
+	});
 }
 
 //#[test]
@@ -254,7 +290,7 @@
 //             1,
 //             items_data.clone().into_iter().map(|d| { d.into() }).collect()
 //         ));
-        
+
 //         for (index, _) in items_data.iter().enumerate() {
 //             assert_eq!(TemplateModule::fungible_item_id(1, (index + 1) as TokenId).value, 5);
 //         }
@@ -265,636 +301,746 @@
 
 #[test]
 fn transfer_fungible_item() {
-    new_test_ext().execute_with(|| {
-        default_limits();
-        
-        let collection_id = create_test_collection(&CollectionMode::Fungible(3), 1);
+	new_test_ext().execute_with(|| {
+		default_limits();
 
-        let origin1 = Origin::signed(1);
-        let origin2 = Origin::signed(2);
+		let collection_id = create_test_collection(&CollectionMode::Fungible(3), 1);
+
+		let origin1 = Origin::signed(1);
+		let origin2 = Origin::signed(2);
 
-        let data = default_fungible_data();
-        create_test_item(collection_id, &data.into());
+		let data = default_fungible_data();
+		create_test_item(collection_id, &data.into());
 
-        assert_eq!(TemplateModule::fungible_item_id(1, 1).value, 5);
-        assert_eq!(TemplateModule::balance_count(1, 1), 5);
+		assert_eq!(TemplateModule::fungible_item_id(1, 1).value, 5);
+		assert_eq!(TemplateModule::balance_count(1, 1), 5);
 
-        // change owner scenario
-        assert_ok!(TemplateModule::transfer(origin1.clone(), account(2), 1, 1, 5));
-        assert_eq!(TemplateModule::fungible_item_id(1, 1).value, 0);
-        assert_eq!(TemplateModule::balance_count(1, 1), 0);
-        assert_eq!(TemplateModule::balance_count(1, 2), 5);
+		// change owner scenario
+		assert_ok!(TemplateModule::transfer(origin1, account(2), 1, 1, 5));
+		assert_eq!(TemplateModule::fungible_item_id(1, 1).value, 0);
+		assert_eq!(TemplateModule::balance_count(1, 1), 0);
+		assert_eq!(TemplateModule::balance_count(1, 2), 5);
 
-        // split item scenario
-        assert_ok!(TemplateModule::transfer(origin2.clone(), account(3), 1, 1, 3));
-        assert_eq!(TemplateModule::balance_count(1, 2), 2);
-        assert_eq!(TemplateModule::balance_count(1, 3), 3);
+		// split item scenario
+		assert_ok!(TemplateModule::transfer(
+			origin2.clone(),
+			account(3),
+			1,
+			1,
+			3
+		));
+		assert_eq!(TemplateModule::balance_count(1, 2), 2);
+		assert_eq!(TemplateModule::balance_count(1, 3), 3);
 
-        // split item and new owner has account scenario
-        assert_ok!(TemplateModule::transfer(origin2.clone(), account(3), 1, 1, 1));
-        assert_eq!(TemplateModule::fungible_item_id(1, 2).value, 1);
-        assert_eq!(TemplateModule::fungible_item_id(1, 3).value, 4);
-        assert_eq!(TemplateModule::balance_count(1, 2), 1);
-        assert_eq!(TemplateModule::balance_count(1, 3), 4);
-    });
+		// split item and new owner has account scenario
+		assert_ok!(TemplateModule::transfer(origin2, account(3), 1, 1, 1));
+		assert_eq!(TemplateModule::fungible_item_id(1, 2).value, 1);
+		assert_eq!(TemplateModule::fungible_item_id(1, 3).value, 4);
+		assert_eq!(TemplateModule::balance_count(1, 2), 1);
+		assert_eq!(TemplateModule::balance_count(1, 3), 4);
+	});
 }
 
 #[test]
 fn transfer_refungible_item() {
-    new_test_ext().execute_with(|| {
-        default_limits();
-        
-        let collection_id = create_test_collection(&CollectionMode::ReFungible, 1);
+	new_test_ext().execute_with(|| {
+		default_limits();
 
-        let data = default_re_fungible_data();
-        create_test_item(collection_id, &data.clone().into());
+		let collection_id = create_test_collection(&CollectionMode::ReFungible, 1);
 
-        let origin1 = Origin::signed(1);
-        let origin2 = Origin::signed(2);
-        {
-            let item = TemplateModule::refungible_item_id(collection_id, 1).unwrap();
-            assert_eq!(
-                item.const_data,
-                data.const_data
-            );
-            assert_eq!(
-                item.variable_data,
-                data.variable_data
-            );
-            assert_eq!(
-                item.owner[0],
-                Ownership {
-                    owner: account(1),
-                    fraction: 1023
-                }
-            );
-        }
-        assert_eq!(TemplateModule::balance_count(1, 1), 1023);
-        assert_eq!(TemplateModule::address_tokens(1, 1), [1]);
+		let data = default_re_fungible_data();
+		create_test_item(collection_id, &data.clone().into());
 
-        // change owner scenario
-        assert_ok!(TemplateModule::transfer(origin1.clone(), account(2), 1, 1, 1023));
-        assert_eq!(
-            TemplateModule::refungible_item_id(1, 1).unwrap().owner[0],
-            Ownership {
-                owner: account(2),
-                fraction: 1023
-            }
-        );
-        assert_eq!(TemplateModule::balance_count(1, 1), 0);
-        assert_eq!(TemplateModule::balance_count(1, 2), 1023);
-        // assert_eq!(TemplateModule::address_tokens(1, 1), []);
-        assert_eq!(TemplateModule::address_tokens(1, 2), [1]);
+		let origin1 = Origin::signed(1);
+		let origin2 = Origin::signed(2);
+		{
+			let item = TemplateModule::refungible_item_id(collection_id, 1).unwrap();
+			assert_eq!(item.const_data, data.const_data);
+			assert_eq!(item.variable_data, data.variable_data);
+			assert_eq!(
+				item.owner[0],
+				Ownership {
+					owner: account(1),
+					fraction: 1023
+				}
+			);
+		}
+		assert_eq!(TemplateModule::balance_count(1, 1), 1023);
+		assert_eq!(TemplateModule::address_tokens(1, 1), [1]);
+
+		// change owner scenario
+		assert_ok!(TemplateModule::transfer(origin1, account(2), 1, 1, 1023));
+		assert_eq!(
+			TemplateModule::refungible_item_id(1, 1).unwrap().owner[0],
+			Ownership {
+				owner: account(2),
+				fraction: 1023
+			}
+		);
+		assert_eq!(TemplateModule::balance_count(1, 1), 0);
+		assert_eq!(TemplateModule::balance_count(1, 2), 1023);
+		// assert_eq!(TemplateModule::address_tokens(1, 1), []);
+		assert_eq!(TemplateModule::address_tokens(1, 2), [1]);
 
-        // split item scenario
-        assert_ok!(TemplateModule::transfer(origin2.clone(), account(3), 1, 1, 500));
-        {
-            let item = TemplateModule::refungible_item_id(1, 1).unwrap();
-            assert_eq!(
-                item.owner[0],
-                Ownership {
-                    owner: account(2),
-                    fraction: 523
-                }
-            );
-            assert_eq!(
-                item.owner[1],
-                Ownership {
-                    owner: account(3),
-                    fraction: 500
-                }
-            );
-        }
-        assert_eq!(TemplateModule::balance_count(1, 2), 523);
-        assert_eq!(TemplateModule::balance_count(1, 3), 500);
-        assert_eq!(TemplateModule::address_tokens(1, 2), [1]);
-        assert_eq!(TemplateModule::address_tokens(1, 3), [1]);
+		// split item scenario
+		assert_ok!(TemplateModule::transfer(
+			origin2.clone(),
+			account(3),
+			1,
+			1,
+			500
+		));
+		{
+			let item = TemplateModule::refungible_item_id(1, 1).unwrap();
+			assert_eq!(
+				item.owner[0],
+				Ownership {
+					owner: account(2),
+					fraction: 523
+				}
+			);
+			assert_eq!(
+				item.owner[1],
+				Ownership {
+					owner: account(3),
+					fraction: 500
+				}
+			);
+		}
+		assert_eq!(TemplateModule::balance_count(1, 2), 523);
+		assert_eq!(TemplateModule::balance_count(1, 3), 500);
+		assert_eq!(TemplateModule::address_tokens(1, 2), [1]);
+		assert_eq!(TemplateModule::address_tokens(1, 3), [1]);
 
-        // split item and new owner has account scenario
-        assert_ok!(TemplateModule::transfer(origin2.clone(), account(3), 1, 1, 200));
-        {
-            let item = TemplateModule::refungible_item_id(1, 1).unwrap();
-            assert_eq!(
-                item.owner[0],
-                Ownership {
-                    owner: account(2),
-                    fraction: 323
-                }
-            );
-            assert_eq!(
-                item.owner[1],
-                Ownership {
-                    owner: account(3),
-                    fraction: 700
-                }
-            );
-        }
-        assert_eq!(TemplateModule::balance_count(1, 2), 323);
-        assert_eq!(TemplateModule::balance_count(1, 3), 700);
-        assert_eq!(TemplateModule::address_tokens(1, 2), [1]);
-        assert_eq!(TemplateModule::address_tokens(1, 3), [1]);
-    });
+		// split item and new owner has account scenario
+		assert_ok!(TemplateModule::transfer(origin2, account(3), 1, 1, 200));
+		{
+			let item = TemplateModule::refungible_item_id(1, 1).unwrap();
+			assert_eq!(
+				item.owner[0],
+				Ownership {
+					owner: account(2),
+					fraction: 323
+				}
+			);
+			assert_eq!(
+				item.owner[1],
+				Ownership {
+					owner: account(3),
+					fraction: 700
+				}
+			);
+		}
+		assert_eq!(TemplateModule::balance_count(1, 2), 323);
+		assert_eq!(TemplateModule::balance_count(1, 3), 700);
+		assert_eq!(TemplateModule::address_tokens(1, 2), [1]);
+		assert_eq!(TemplateModule::address_tokens(1, 3), [1]);
+	});
 }
 
 #[test]
 fn transfer_nft_item() {
-    new_test_ext().execute_with(|| {
-        default_limits();
-        
-        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+	new_test_ext().execute_with(|| {
+		default_limits();
+
+		let collection_id = create_test_collection(&CollectionMode::NFT, 1);
 
-        let data = default_nft_data();
-        create_test_item(collection_id, &data.into());
-        assert_eq!(TemplateModule::balance_count(1, 1), 1);
-        assert_eq!(TemplateModule::address_tokens(1, 1), [1]);
+		let data = default_nft_data();
+		create_test_item(collection_id, &data.into());
+		assert_eq!(TemplateModule::balance_count(1, 1), 1);
+		assert_eq!(TemplateModule::address_tokens(1, 1), [1]);
 
-        let origin1 = Origin::signed(1);
-        // default scenario
-        assert_ok!(TemplateModule::transfer(origin1.clone(), account(2), 1, 1, 1000));
-        assert_eq!(TemplateModule::nft_item_id(1, 1).unwrap().owner, account(2));
-        assert_eq!(TemplateModule::balance_count(1, 1), 0);
-        assert_eq!(TemplateModule::balance_count(1, 2), 1);
-        // assert_eq!(TemplateModule::address_tokens(1, 1), []);
-        assert_eq!(TemplateModule::address_tokens(1, 2), [1]);
-    });
+		let origin1 = Origin::signed(1);
+		// default scenario
+		assert_ok!(TemplateModule::transfer(origin1, account(2), 1, 1, 1000));
+		assert_eq!(TemplateModule::nft_item_id(1, 1).unwrap().owner, account(2));
+		assert_eq!(TemplateModule::balance_count(1, 1), 0);
+		assert_eq!(TemplateModule::balance_count(1, 2), 1);
+		// assert_eq!(TemplateModule::address_tokens(1, 1), []);
+		assert_eq!(TemplateModule::address_tokens(1, 2), [1]);
+	});
 }
 
 #[test]
 fn nft_approve_and_transfer_from() {
-    new_test_ext().execute_with(|| {
-        default_limits();
-        
-        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+	new_test_ext().execute_with(|| {
+		default_limits();
 
-        let data = default_nft_data();
-        create_test_item(collection_id, &data.into());
+		let collection_id = create_test_collection(&CollectionMode::NFT, 1);
 
-        let origin1 = Origin::signed(1);
-        let origin2 = Origin::signed(2);
+		let data = default_nft_data();
+		create_test_item(collection_id, &data.into());
 
-        assert_eq!(TemplateModule::balance_count(1, 1), 1);
-        assert_eq!(TemplateModule::address_tokens(1, 1), [1]);
+		let origin1 = Origin::signed(1);
+		let origin2 = Origin::signed(2);
 
-        // neg transfer
-        assert_noop!(TemplateModule::transfer_from(
-            origin2.clone(),
-            account(1),
-            account(2),
-            1,
-            1,
-            1), Error::<Test>::NoPermission);
+		assert_eq!(TemplateModule::balance_count(1, 1), 1);
+		assert_eq!(TemplateModule::address_tokens(1, 1), [1]);
 
-        // do approve
-        assert_ok!(TemplateModule::approve(origin1.clone(), account(2), 1, 1, 5));
-        assert_eq!(TemplateModule::approved(1, (1, 1, 2)), 5);
-        assert_eq!(
-            TemplateModule::approved(1, (1, 1, 2)),
-            5
-        );
+		// neg transfer
+		assert_noop!(
+			TemplateModule::transfer_from(origin2.clone(), account(1), account(2), 1, 1, 1),
+			Error::<Test>::NoPermission
+		);
 
-        assert_ok!(TemplateModule::transfer_from(
-            origin2.clone(),
-            account(1),
-            account(3),
-            1,
-            1,
-            1
-        ));
-        assert_eq!(TemplateModule::approved(1, (1, 1, 2)), 4);
-    });
+		// do approve
+		assert_ok!(TemplateModule::approve(origin1, account(2), 1, 1, 5));
+		assert_eq!(TemplateModule::approved(1, (1, 1, 2)), 5);
+		assert_eq!(TemplateModule::approved(1, (1, 1, 2)), 5);
+
+		assert_ok!(TemplateModule::transfer_from(
+			origin2,
+			account(1),
+			account(3),
+			1,
+			1,
+			1
+		));
+		assert_eq!(TemplateModule::approved(1, (1, 1, 2)), 4);
+	});
 }
 
 #[test]
 fn nft_approve_and_transfer_from_white_list() {
-    new_test_ext().execute_with(|| {
-        default_limits();
-        
-        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+	new_test_ext().execute_with(|| {
+		default_limits();
+
+		let collection_id = create_test_collection(&CollectionMode::NFT, 1);
 
-        let origin1 = Origin::signed(1);
-        let origin2 = Origin::signed(2);
+		let origin1 = Origin::signed(1);
+		let origin2 = Origin::signed(2);
 
-        let data = default_nft_data();
-        create_test_item(collection_id, &data.clone().into());
+		let data = default_nft_data();
+		create_test_item(collection_id, &data.clone().into());
 
-        assert_eq!(TemplateModule::nft_item_id(1, 1).unwrap().const_data, data.const_data);
-        assert_eq!(TemplateModule::balance_count(1, 1), 1);
-        assert_eq!(TemplateModule::address_tokens(1, 1), [1]);
+		assert_eq!(
+			TemplateModule::nft_item_id(1, 1).unwrap().const_data,
+			data.const_data
+		);
+		assert_eq!(TemplateModule::balance_count(1, 1), 1);
+		assert_eq!(TemplateModule::address_tokens(1, 1), [1]);
 
-        assert_ok!(TemplateModule::set_mint_permission(
-            origin1.clone(),
-            1,
-            true
-        ));
-        assert_ok!(TemplateModule::set_public_access_mode(
-            origin1.clone(),
-            1,
-            AccessMode::WhiteList
-        ));
-        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), 1, account(1)));
-        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), 1, account(2)));
-        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), 1, account(3)));
+		assert_ok!(TemplateModule::set_mint_permission(
+			origin1.clone(),
+			1,
+			true
+		));
+		assert_ok!(TemplateModule::set_public_access_mode(
+			origin1.clone(),
+			1,
+			AccessMode::WhiteList
+		));
+		assert_ok!(TemplateModule::add_to_white_list(
+			origin1.clone(),
+			1,
+			account(1)
+		));
+		assert_ok!(TemplateModule::add_to_white_list(
+			origin1.clone(),
+			1,
+			account(2)
+		));
+		assert_ok!(TemplateModule::add_to_white_list(
+			origin1.clone(),
+			1,
+			account(3)
+		));
 
-        // do approve
-        assert_ok!(TemplateModule::approve(origin1.clone(), account(2), 1, 1, 5));
-        assert_eq!(TemplateModule::approved(1, (1, 1, 2)), 5);
-        assert_ok!(TemplateModule::approve(origin1.clone(), account(3), 1, 1, 5));
-        assert_eq!(TemplateModule::approved(1, (1, 1, 3)), 5);
+		// do approve
+		assert_ok!(TemplateModule::approve(
+			origin1.clone(),
+			account(2),
+			1,
+			1,
+			5
+		));
+		assert_eq!(TemplateModule::approved(1, (1, 1, 2)), 5);
+		assert_ok!(TemplateModule::approve(origin1, account(3), 1, 1, 5));
+		assert_eq!(TemplateModule::approved(1, (1, 1, 3)), 5);
 
-        assert_ok!(TemplateModule::transfer_from(
-            origin2.clone(),
-            account(1),
-            account(3),
-            1,
-            1,
-            1
-        ));
-        assert_eq!(TemplateModule::approved(1, (1, 1, 2)), 4);
-    });
+		assert_ok!(TemplateModule::transfer_from(
+			origin2,
+			account(1),
+			account(3),
+			1,
+			1,
+			1
+		));
+		assert_eq!(TemplateModule::approved(1, (1, 1, 2)), 4);
+	});
 }
 
 #[test]
 fn refungible_approve_and_transfer_from() {
-    new_test_ext().execute_with(|| {
-        default_limits();
-        
-        let collection_id = create_test_collection(&CollectionMode::ReFungible, 1);
-        
-        let origin1 = Origin::signed(1);
-        let origin2 = Origin::signed(2);
+	new_test_ext().execute_with(|| {
+		default_limits();
 
-        let data = default_re_fungible_data();
-        create_test_item(collection_id, &data.into());
+		let collection_id = create_test_collection(&CollectionMode::ReFungible, 1);
 
-        assert_eq!(TemplateModule::balance_count(1, 1), 1023);
-        assert_eq!(TemplateModule::address_tokens(1, 1), [1]);
+		let origin1 = Origin::signed(1);
+		let origin2 = Origin::signed(2);
 
-        assert_ok!(TemplateModule::set_mint_permission(
-            origin1.clone(),
-            1,
-            true
-        ));
-        assert_ok!(TemplateModule::set_public_access_mode(
-            origin1.clone(),
-            1,
-            AccessMode::WhiteList
-        ));
-        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), 1, account(1)));
-        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), 1, account(2)));
-        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), 1, account(3)));
+		let data = default_re_fungible_data();
+		create_test_item(collection_id, &data.into());
 
-        // do approve
-        assert_ok!(TemplateModule::approve(origin1.clone(), account(2), 1, 1, 1023));
-        assert_eq!(TemplateModule::approved(1, (1, 1, 2)), 1023);
+		assert_eq!(TemplateModule::balance_count(1, 1), 1023);
+		assert_eq!(TemplateModule::address_tokens(1, 1), [1]);
 
-        assert_ok!(TemplateModule::transfer_from(
-            origin2.clone(),
-            account(1),
-            account(3),
-            1,
-            1,
-            100
-        ));
-        assert_eq!(TemplateModule::balance_count(1, 1), 923);
-        assert_eq!(TemplateModule::balance_count(1, 3), 100);
-        assert_eq!(TemplateModule::address_tokens(1, 1), [1]);
-        assert_eq!(TemplateModule::address_tokens(1, 3), [1]);
+		assert_ok!(TemplateModule::set_mint_permission(
+			origin1.clone(),
+			1,
+			true
+		));
+		assert_ok!(TemplateModule::set_public_access_mode(
+			origin1.clone(),
+			1,
+			AccessMode::WhiteList
+		));
+		assert_ok!(TemplateModule::add_to_white_list(
+			origin1.clone(),
+			1,
+			account(1)
+		));
+		assert_ok!(TemplateModule::add_to_white_list(
+			origin1.clone(),
+			1,
+			account(2)
+		));
+		assert_ok!(TemplateModule::add_to_white_list(
+			origin1.clone(),
+			1,
+			account(3)
+		));
 
-        assert_eq!(
-            TemplateModule::approved(1, (1, 1, 2)),
-            923
-        );
-    });
+		// do approve
+		assert_ok!(TemplateModule::approve(origin1, account(2), 1, 1, 1023));
+		assert_eq!(TemplateModule::approved(1, (1, 1, 2)), 1023);
+
+		assert_ok!(TemplateModule::transfer_from(
+			origin2,
+			account(1),
+			account(3),
+			1,
+			1,
+			100
+		));
+		assert_eq!(TemplateModule::balance_count(1, 1), 923);
+		assert_eq!(TemplateModule::balance_count(1, 3), 100);
+		assert_eq!(TemplateModule::address_tokens(1, 1), [1]);
+		assert_eq!(TemplateModule::address_tokens(1, 3), [1]);
+
+		assert_eq!(TemplateModule::approved(1, (1, 1, 2)), 923);
+	});
 }
 
 #[test]
 fn fungible_approve_and_transfer_from() {
-    new_test_ext().execute_with(|| {
-        default_limits();
-        
-        let collection_id = create_test_collection(&CollectionMode::Fungible(3), 1);
-        
-        let data = default_fungible_data();
-        create_test_item(collection_id, &data.into());
+	new_test_ext().execute_with(|| {
+		default_limits();
 
-        let origin1 = Origin::signed(1);
-        let origin2 = Origin::signed(2);
+		let collection_id = create_test_collection(&CollectionMode::Fungible(3), 1);
+
+		let data = default_fungible_data();
+		create_test_item(collection_id, &data.into());
+
+		let origin1 = Origin::signed(1);
+		let origin2 = Origin::signed(2);
 
-        assert_eq!(TemplateModule::balance_count(1, 1), 5);
+		assert_eq!(TemplateModule::balance_count(1, 1), 5);
 
-        assert_ok!(TemplateModule::set_mint_permission(
-            origin1.clone(),
-            1,
-            true
-        ));
-        assert_ok!(TemplateModule::set_public_access_mode(
-            origin1.clone(),
-            1,
-            AccessMode::WhiteList
-        ));
-        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), 1, account(1)));
-        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), 1, account(2)));
-        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), 1, account(3)));
+		assert_ok!(TemplateModule::set_mint_permission(
+			origin1.clone(),
+			1,
+			true
+		));
+		assert_ok!(TemplateModule::set_public_access_mode(
+			origin1.clone(),
+			1,
+			AccessMode::WhiteList
+		));
+		assert_ok!(TemplateModule::add_to_white_list(
+			origin1.clone(),
+			1,
+			account(1)
+		));
+		assert_ok!(TemplateModule::add_to_white_list(
+			origin1.clone(),
+			1,
+			account(2)
+		));
+		assert_ok!(TemplateModule::add_to_white_list(
+			origin1.clone(),
+			1,
+			account(3)
+		));
 
-        // do approve
-        assert_ok!(TemplateModule::approve(origin1.clone(), account(2), 1, 1, 5));
-        assert_eq!(TemplateModule::approved(1, (1, 1, 2)), 5);
-        assert_ok!(TemplateModule::approve(origin1.clone(), account(3), 1, 1, 5));
-        assert_eq!(TemplateModule::approved(1, (1, 1, 3)), 5);
-        assert_eq!(
-            TemplateModule::approved(1, (1, 1, 2)),
-            5
-        );
+		// do approve
+		assert_ok!(TemplateModule::approve(
+			origin1.clone(),
+			account(2),
+			1,
+			1,
+			5
+		));
+		assert_eq!(TemplateModule::approved(1, (1, 1, 2)), 5);
+		assert_ok!(TemplateModule::approve(origin1, account(3), 1, 1, 5));
+		assert_eq!(TemplateModule::approved(1, (1, 1, 3)), 5);
+		assert_eq!(TemplateModule::approved(1, (1, 1, 2)), 5);
 
-        assert_ok!(TemplateModule::transfer_from(
-            origin2.clone(),
-            account(1),
-            account(3),
-            1,
-            1,
-            4
-        ));
-        assert_eq!(TemplateModule::balance_count(1, 1), 1);
-        assert_eq!(TemplateModule::balance_count(1, 3), 4);
+		assert_ok!(TemplateModule::transfer_from(
+			origin2.clone(),
+			account(1),
+			account(3),
+			1,
+			1,
+			4
+		));
+		assert_eq!(TemplateModule::balance_count(1, 1), 1);
+		assert_eq!(TemplateModule::balance_count(1, 3), 4);
 
-        assert_eq!(TemplateModule::approved(1, (1, 1, 2)), 1);
+		assert_eq!(TemplateModule::approved(1, (1, 1, 2)), 1);
 
-        assert_noop!(TemplateModule::transfer_from(
-            origin2.clone(),
-            account(1),
-            account(3),
-            1,
-            1,
-            4
-        ), Error::<Test>::NoPermission);
-    });
+		assert_noop!(
+			TemplateModule::transfer_from(origin2, account(1), account(3), 1, 1, 4),
+			Error::<Test>::NoPermission
+		);
+	});
 }
 
 #[test]
 fn change_collection_owner() {
-    new_test_ext().execute_with(|| {
-        default_limits();
-        
-        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
-        
-        let origin1 = Origin::signed(1);
-        assert_ok!(TemplateModule::change_collection_owner(
-            origin1.clone(),
-            collection_id,
-            2
-        ));
-        assert_eq!(TemplateModule::collection_id(collection_id).unwrap().owner, 2);
-    });
+	new_test_ext().execute_with(|| {
+		default_limits();
+
+		let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+
+		let origin1 = Origin::signed(1);
+		assert_ok!(TemplateModule::change_collection_owner(
+			origin1,
+			collection_id,
+			2
+		));
+		assert_eq!(
+			TemplateModule::collection_id(collection_id).unwrap().owner,
+			2
+		);
+	});
 }
 
 #[test]
 fn destroy_collection() {
-    new_test_ext().execute_with(|| {
-        default_limits();
-        
-        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
-        
-        let origin1 = Origin::signed(1);
-        assert_ok!(TemplateModule::destroy_collection(origin1.clone(), collection_id));
-    });
+	new_test_ext().execute_with(|| {
+		default_limits();
+
+		let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+
+		let origin1 = Origin::signed(1);
+		assert_ok!(TemplateModule::destroy_collection(origin1, collection_id));
+	});
 }
 
 #[test]
 fn burn_nft_item() {
-    new_test_ext().execute_with(|| {
-        default_limits();
-        
-        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+	new_test_ext().execute_with(|| {
+		default_limits();
 
-        let origin1 = Origin::signed(1);
-        assert_ok!(TemplateModule::add_collection_admin(origin1.clone(), collection_id, account(2)));
-        
-        let data = default_nft_data();
-        create_test_item(collection_id, &data.into());
+		let collection_id = create_test_collection(&CollectionMode::NFT, 1);
 
-        // check balance (collection with id = 1, user id = 1)
-        assert_eq!(TemplateModule::balance_count(1, 1), 1);
+		let origin1 = Origin::signed(1);
+		assert_ok!(TemplateModule::add_collection_admin(
+			origin1.clone(),
+			collection_id,
+			account(2)
+		));
 
-        // burn item
-        assert_ok!(TemplateModule::burn_item(origin1.clone(), 1, 1, 5));
-        assert_noop!(
-            TemplateModule::burn_item(origin1.clone(), 1, 1, 5),
-            Error::<Test>::TokenNotFound
-        );
+		let data = default_nft_data();
+		create_test_item(collection_id, &data.into());
+
+		// check balance (collection with id = 1, user id = 1)
+		assert_eq!(TemplateModule::balance_count(1, 1), 1);
+
+		// burn item
+		assert_ok!(TemplateModule::burn_item(origin1.clone(), 1, 1, 5));
+		assert_noop!(
+			TemplateModule::burn_item(origin1, 1, 1, 5),
+			Error::<Test>::TokenNotFound
+		);
 
-        assert_eq!(TemplateModule::balance_count(1, 1), 0);
-    });
+		assert_eq!(TemplateModule::balance_count(1, 1), 0);
+	});
 }
 
 #[test]
 fn burn_fungible_item() {
-    new_test_ext().execute_with(|| {
-        default_limits();
-        
-        let collection_id = create_test_collection(&CollectionMode::Fungible(3), 1);
-        
-        let origin1 = Origin::signed(1);
-        assert_ok!(TemplateModule::add_collection_admin(origin1.clone(), collection_id, account(2)));
-        
-        let data = default_fungible_data();
-        create_test_item(collection_id, &data.into());
+	new_test_ext().execute_with(|| {
+		default_limits();
+
+		let collection_id = create_test_collection(&CollectionMode::Fungible(3), 1);
+
+		let origin1 = Origin::signed(1);
+		assert_ok!(TemplateModule::add_collection_admin(
+			origin1.clone(),
+			collection_id,
+			account(2)
+		));
+
+		let data = default_fungible_data();
+		create_test_item(collection_id, &data.into());
 
-        // check balance (collection with id = 1, user id = 1)
-        assert_eq!(TemplateModule::balance_count(1, 1), 5);
+		// check balance (collection with id = 1, user id = 1)
+		assert_eq!(TemplateModule::balance_count(1, 1), 5);
 
-        // burn item
-        assert_ok!(TemplateModule::burn_item(origin1.clone(), 1, 1, 5));
-        assert_noop!(
-            TemplateModule::burn_item(origin1.clone(), 1, 1, 5),
-            Error::<Test>::TokenValueNotEnough
-        );
+		// burn item
+		assert_ok!(TemplateModule::burn_item(origin1.clone(), 1, 1, 5));
+		assert_noop!(
+			TemplateModule::burn_item(origin1, 1, 1, 5),
+			Error::<Test>::TokenValueNotEnough
+		);
 
-        assert_eq!(TemplateModule::balance_count(1, 1), 0);
-    });
+		assert_eq!(TemplateModule::balance_count(1, 1), 0);
+	});
 }
 
 #[test]
 fn burn_refungible_item() {
-    new_test_ext().execute_with(|| {
-        default_limits();
-        
-        let collection_id = create_test_collection(&CollectionMode::ReFungible, 1);
-        let origin1 = Origin::signed(1);
+	new_test_ext().execute_with(|| {
+		default_limits();
 
-        assert_ok!(TemplateModule::set_mint_permission(
-            origin1.clone(),
-            collection_id,
-            true
-        ));
-        assert_ok!(TemplateModule::set_public_access_mode(
-            origin1.clone(),
-            collection_id,
-            AccessMode::WhiteList
-        ));
-        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), 1, account(1)));
+		let collection_id = create_test_collection(&CollectionMode::ReFungible, 1);
+		let origin1 = Origin::signed(1);
 
-        assert_ok!(TemplateModule::add_collection_admin(origin1.clone(), 1, account(2)));
-        
-        let data = default_re_fungible_data();
-        create_test_item(collection_id, &data.into());
+		assert_ok!(TemplateModule::set_mint_permission(
+			origin1.clone(),
+			collection_id,
+			true
+		));
+		assert_ok!(TemplateModule::set_public_access_mode(
+			origin1.clone(),
+			collection_id,
+			AccessMode::WhiteList
+		));
+		assert_ok!(TemplateModule::add_to_white_list(
+			origin1.clone(),
+			1,
+			account(1)
+		));
+
+		assert_ok!(TemplateModule::add_collection_admin(
+			origin1.clone(),
+			1,
+			account(2)
+		));
+
+		let data = default_re_fungible_data();
+		create_test_item(collection_id, &data.into());
 
-        // check balance (collection with id = 1, user id = 2)
-        assert_eq!(TemplateModule::balance_count(1, 1), 1023);
+		// check balance (collection with id = 1, user id = 2)
+		assert_eq!(TemplateModule::balance_count(1, 1), 1023);
 
-        // burn item
-        assert_ok!(TemplateModule::burn_item(origin1.clone(), 1, 1, 1023));
-        assert_noop!(
-            TemplateModule::burn_item(origin1.clone(), 1, 1, 1023),
-            Error::<Test>::TokenNotFound
-        );
+		// burn item
+		assert_ok!(TemplateModule::burn_item(origin1.clone(), 1, 1, 1023));
+		assert_noop!(
+			TemplateModule::burn_item(origin1, 1, 1, 1023),
+			Error::<Test>::TokenNotFound
+		);
 
-        assert_eq!(TemplateModule::balance_count(1, 1), 0);
-    });
+		assert_eq!(TemplateModule::balance_count(1, 1), 0);
+	});
 }
 
 #[test]
 fn add_collection_admin() {
-    new_test_ext().execute_with(|| {
-        default_limits();
-        
-        let collection1_id = create_test_collection_for_owner(&CollectionMode::NFT, 1, 1);
-        create_test_collection_for_owner(&CollectionMode::NFT, 2, 2);
-        create_test_collection_for_owner(&CollectionMode::NFT, 3, 3);
-        
-        let origin1 = Origin::signed(1);
+	new_test_ext().execute_with(|| {
+		default_limits();
 
-        // collection admin
-        assert_ok!(TemplateModule::add_collection_admin(origin1.clone(), collection1_id, account(2)));
-        assert_ok!(TemplateModule::add_collection_admin(origin1.clone(), collection1_id, account(3)));
+		let collection1_id = create_test_collection_for_owner(&CollectionMode::NFT, 1, 1);
+		create_test_collection_for_owner(&CollectionMode::NFT, 2, 2);
+		create_test_collection_for_owner(&CollectionMode::NFT, 3, 3);
+
+		let origin1 = Origin::signed(1);
+
+		// collection admin
+		assert_ok!(TemplateModule::add_collection_admin(
+			origin1.clone(),
+			collection1_id,
+			account(2)
+		));
+		assert_ok!(TemplateModule::add_collection_admin(
+			origin1,
+			collection1_id,
+			account(3)
+		));
 
-        assert_eq!(TemplateModule::admin_list_collection(collection1_id).contains(&account(2)), true);
-        assert_eq!(TemplateModule::admin_list_collection(collection1_id).contains(&account(3)), true);
-    });
+		assert!(TemplateModule::admin_list_collection(collection1_id).contains(&account(2)),);
+		assert!(TemplateModule::admin_list_collection(collection1_id).contains(&account(3)),);
+	});
 }
 
 #[test]
 fn remove_collection_admin() {
-    new_test_ext().execute_with(|| {
-        default_limits();
-        
-        let collection1_id = create_test_collection_for_owner(&CollectionMode::NFT, 1, 1);
-        create_test_collection_for_owner(&CollectionMode::NFT, 2, 2);
-        create_test_collection_for_owner(&CollectionMode::NFT, 3, 3);
+	new_test_ext().execute_with(|| {
+		default_limits();
 
-        let origin1 = Origin::signed(1);
-        let origin2 = Origin::signed(2);
+		let collection1_id = create_test_collection_for_owner(&CollectionMode::NFT, 1, 1);
+		create_test_collection_for_owner(&CollectionMode::NFT, 2, 2);
+		create_test_collection_for_owner(&CollectionMode::NFT, 3, 3);
 
-        // collection admin
-        assert_ok!(TemplateModule::add_collection_admin(origin1.clone(), collection1_id, account(2)));
-        assert_ok!(TemplateModule::add_collection_admin(origin1.clone(), collection1_id, account(3)));
+		let origin1 = Origin::signed(1);
+		let origin2 = Origin::signed(2);
 
-        assert_eq!(TemplateModule::admin_list_collection(1).contains(&account(2)), true);
-        assert_eq!(TemplateModule::admin_list_collection(1).contains(&account(3)), true);
+		// collection admin
+		assert_ok!(TemplateModule::add_collection_admin(
+			origin1.clone(),
+			collection1_id,
+			account(2)
+		));
+		assert_ok!(TemplateModule::add_collection_admin(
+			origin1,
+			collection1_id,
+			account(3)
+		));
 
-        // remove admin
-        assert_ok!(TemplateModule::remove_collection_admin(
-            origin2.clone(),
-            1,
-            account(3)
-        ));
-        assert_eq!(TemplateModule::admin_list_collection(1).contains(&account(3)), false);
-    });
+		assert!(TemplateModule::admin_list_collection(1).contains(&account(2)),);
+		assert!(TemplateModule::admin_list_collection(1).contains(&account(3)),);
+
+		// remove admin
+		assert_ok!(TemplateModule::remove_collection_admin(
+			origin2,
+			1,
+			account(3)
+		));
+		assert!(!TemplateModule::admin_list_collection(1).contains(&account(3)),);
+	});
 }
 
 #[test]
 fn balance_of() {
-    new_test_ext().execute_with(|| {
-        default_limits();
-        
-        let nft_collection_id = create_test_collection(&CollectionMode::NFT, 1);
-        let fungible_collection_id = create_test_collection(&CollectionMode::Fungible(3), 2);
-        let re_fungible_collection_id = create_test_collection(&CollectionMode::ReFungible, 3);
-        
-        // check balance before
-        assert_eq!(TemplateModule::balance_count(nft_collection_id, 1), 0);
-        assert_eq!(TemplateModule::balance_count(fungible_collection_id, 1), 0);
-        assert_eq!(TemplateModule::balance_count(re_fungible_collection_id, 1), 0);
+	new_test_ext().execute_with(|| {
+		default_limits();
+
+		let nft_collection_id = create_test_collection(&CollectionMode::NFT, 1);
+		let fungible_collection_id = create_test_collection(&CollectionMode::Fungible(3), 2);
+		let re_fungible_collection_id = create_test_collection(&CollectionMode::ReFungible, 3);
+
+		// check balance before
+		assert_eq!(TemplateModule::balance_count(nft_collection_id, 1), 0);
+		assert_eq!(TemplateModule::balance_count(fungible_collection_id, 1), 0);
+		assert_eq!(
+			TemplateModule::balance_count(re_fungible_collection_id, 1),
+			0
+		);
+
+		let nft_data = default_nft_data();
+		create_test_item(nft_collection_id, &nft_data.into());
+
+		let fungible_data = default_fungible_data();
+		create_test_item(fungible_collection_id, &fungible_data.into());
 
-        let nft_data = default_nft_data();
-        create_test_item(nft_collection_id, &nft_data.into());
-        
-        let fungible_data = default_fungible_data();
-        create_test_item(fungible_collection_id, &fungible_data.into());
-        
-        let re_fungible_data = default_re_fungible_data();
-        create_test_item(re_fungible_collection_id, &re_fungible_data.into());
+		let re_fungible_data = default_re_fungible_data();
+		create_test_item(re_fungible_collection_id, &re_fungible_data.into());
 
-        // check balance (collection with id = 1, user id = 1)
-        assert_eq!(TemplateModule::balance_count(nft_collection_id, 1), 1);
-        assert_eq!(TemplateModule::balance_count(fungible_collection_id, 1), 5);
-        assert_eq!(TemplateModule::balance_count(re_fungible_collection_id, 1), 1023);
-        assert_eq!(TemplateModule::nft_item_id(nft_collection_id, 1).unwrap().owner, account(1));
-        assert_eq!(TemplateModule::fungible_item_id(fungible_collection_id, 1).value, 5);
-        assert_eq!(TemplateModule::refungible_item_id(re_fungible_collection_id, 1).unwrap().owner[0].owner, account(1));
-    });
+		// check balance (collection with id = 1, user id = 1)
+		assert_eq!(TemplateModule::balance_count(nft_collection_id, 1), 1);
+		assert_eq!(TemplateModule::balance_count(fungible_collection_id, 1), 5);
+		assert_eq!(
+			TemplateModule::balance_count(re_fungible_collection_id, 1),
+			1023
+		);
+		assert_eq!(
+			TemplateModule::nft_item_id(nft_collection_id, 1)
+				.unwrap()
+				.owner,
+			account(1)
+		);
+		assert_eq!(
+			TemplateModule::fungible_item_id(fungible_collection_id, 1).value,
+			5
+		);
+		assert_eq!(
+			TemplateModule::refungible_item_id(re_fungible_collection_id, 1)
+				.unwrap()
+				.owner[0]
+				.owner,
+			account(1)
+		);
+	});
 }
 
 #[test]
 fn approve() {
-    new_test_ext().execute_with(|| {
-        default_limits();
-        
-        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
-        
-        let data = default_nft_data();
-        create_test_item(collection_id, &data.into());
+	new_test_ext().execute_with(|| {
+		default_limits();
 
-        let origin1 = Origin::signed(1);
-        
-        // approve
-        assert_ok!(TemplateModule::approve(origin1.clone(), account(2), 1, 1, 1));
-        assert_eq!(TemplateModule::approved(1, (1, 1, 2)), 1);
-    });
+		let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+
+		let data = default_nft_data();
+		create_test_item(collection_id, &data.into());
+
+		let origin1 = Origin::signed(1);
+
+		// approve
+		assert_ok!(TemplateModule::approve(origin1, account(2), 1, 1, 1));
+		assert_eq!(TemplateModule::approved(1, (1, 1, 2)), 1);
+	});
 }
 
 #[test]
 fn transfer_from() {
-    new_test_ext().execute_with(|| {
-        default_limits();
-        
-        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
-        let origin1 = Origin::signed(1);
-        let origin2 = Origin::signed(2);
+	new_test_ext().execute_with(|| {
+		default_limits();
 
-        let data = default_nft_data();
-        create_test_item(collection_id, &data.into());
+		let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+		let origin1 = Origin::signed(1);
+		let origin2 = Origin::signed(2);
 
-        // approve
-        assert_ok!(TemplateModule::approve(origin1.clone(), account(2), 1, 1, 1));
-        assert_eq!(TemplateModule::approved(1, (1, 1, 2)), 1);
+		let data = default_nft_data();
+		create_test_item(collection_id, &data.into());
 
-        assert_ok!(TemplateModule::set_mint_permission(
-            origin1.clone(),
-            1,
-            true
-        ));
-        assert_ok!(TemplateModule::set_public_access_mode(
-            origin1.clone(),
-            1,
-            AccessMode::WhiteList
-        ));
-        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), 1, account(1)));
-        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), 1, account(2)));
-        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), 1, account(3)));
+		// approve
+		assert_ok!(TemplateModule::approve(
+			origin1.clone(),
+			account(2),
+			1,
+			1,
+			1
+		));
+		assert_eq!(TemplateModule::approved(1, (1, 1, 2)), 1);
 
-        assert_ok!(TemplateModule::transfer_from(
-            origin2.clone(),
-            account(1),
-            account(2),
-            1,
-            1,
-            1
-        ));
+		assert_ok!(TemplateModule::set_mint_permission(
+			origin1.clone(),
+			1,
+			true
+		));
+		assert_ok!(TemplateModule::set_public_access_mode(
+			origin1.clone(),
+			1,
+			AccessMode::WhiteList
+		));
+		assert_ok!(TemplateModule::add_to_white_list(
+			origin1.clone(),
+			1,
+			account(1)
+		));
+		assert_ok!(TemplateModule::add_to_white_list(
+			origin1.clone(),
+			1,
+			account(2)
+		));
+		assert_ok!(TemplateModule::add_to_white_list(origin1, 1, account(3)));
 
-        // after transfer
-        assert_eq!(TemplateModule::balance_count(1, 1), 0);
-        assert_eq!(TemplateModule::balance_count(1, 2), 1);
-    });
+		assert_ok!(TemplateModule::transfer_from(
+			origin2,
+			account(1),
+			account(2),
+			1,
+			1,
+			1
+		));
+
+		// after transfer
+		assert_eq!(TemplateModule::balance_count(1, 1), 0);
+		assert_eq!(TemplateModule::balance_count(1, 2), 1);
+	});
 }
 
 // #endregion
@@ -904,1093 +1050,1304 @@
 
 #[test]
 fn owner_can_add_address_to_white_list() {
-    new_test_ext().execute_with(|| {
-        default_limits();
-        
-        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+	new_test_ext().execute_with(|| {
+		default_limits();
+
+		let collection_id = create_test_collection(&CollectionMode::NFT, 1);
 
-        let origin1 = Origin::signed(1);
-        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), collection_id, account(2)));
-        assert_eq!(TemplateModule::white_list(collection_id, 2), true);
-    });
+		let origin1 = Origin::signed(1);
+		assert_ok!(TemplateModule::add_to_white_list(
+			origin1,
+			collection_id,
+			account(2)
+		));
+		assert!(TemplateModule::white_list(collection_id, 2));
+	});
 }
 
 #[test]
 fn admin_can_add_address_to_white_list() {
-    new_test_ext().execute_with(|| {
-        default_limits();
-        
-        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
-        let origin1 = Origin::signed(1);
-        let origin2 = Origin::signed(2);
+	new_test_ext().execute_with(|| {
+		default_limits();
 
-        assert_ok!(TemplateModule::add_collection_admin(origin1.clone(), collection_id, account(2)));
-        assert_ok!(TemplateModule::add_to_white_list(origin2.clone(), collection_id, account(3)));
-        assert_eq!(TemplateModule::white_list(collection_id, 3), true);
-    });
+		let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+		let origin1 = Origin::signed(1);
+		let origin2 = Origin::signed(2);
+
+		assert_ok!(TemplateModule::add_collection_admin(
+			origin1,
+			collection_id,
+			account(2)
+		));
+		assert_ok!(TemplateModule::add_to_white_list(
+			origin2,
+			collection_id,
+			account(3)
+		));
+		assert!(TemplateModule::white_list(collection_id, 3));
+	});
 }
 
 #[test]
 fn nonprivileged_user_cannot_add_address_to_white_list() {
-    new_test_ext().execute_with(|| {
-        default_limits();
-        
-        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+	new_test_ext().execute_with(|| {
+		default_limits();
 
-        let origin2 = Origin::signed(2);
-        assert_noop!(
-            TemplateModule::add_to_white_list(origin2.clone(), collection_id, account(3)),
-            Error::<Test>::NoPermission
-        );
-    });
+		let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+
+		let origin2 = Origin::signed(2);
+		assert_noop!(
+			TemplateModule::add_to_white_list(origin2, collection_id, account(3)),
+			Error::<Test>::NoPermission
+		);
+	});
 }
 
 #[test]
 fn nobody_can_add_address_to_white_list_of_nonexisting_collection() {
-    new_test_ext().execute_with(|| {
-        default_limits();
+	new_test_ext().execute_with(|| {
+		default_limits();
 
-        let origin1 = Origin::signed(1);
+		let origin1 = Origin::signed(1);
 
-        assert_noop!(
-            TemplateModule::add_to_white_list(origin1.clone(), 1, account(2)),
-            Error::<Test>::CollectionNotFound
-        );
-    });
+		assert_noop!(
+			TemplateModule::add_to_white_list(origin1, 1, account(2)),
+			Error::<Test>::CollectionNotFound
+		);
+	});
 }
 
 #[test]
 fn nobody_can_add_address_to_white_list_of_deleted_collection() {
-    new_test_ext().execute_with(|| {
-        default_limits();
-        
-        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+	new_test_ext().execute_with(|| {
+		default_limits();
+
+		let collection_id = create_test_collection(&CollectionMode::NFT, 1);
 
-        let origin1 = Origin::signed(1);
-        assert_ok!(TemplateModule::destroy_collection(origin1.clone(), collection_id));
-        assert_noop!(
-            TemplateModule::add_to_white_list(origin1.clone(), collection_id, account(2)),
-            Error::<Test>::CollectionNotFound
-        );
-    });
+		let origin1 = Origin::signed(1);
+		assert_ok!(TemplateModule::destroy_collection(
+			origin1.clone(),
+			collection_id
+		));
+		assert_noop!(
+			TemplateModule::add_to_white_list(origin1, collection_id, account(2)),
+			Error::<Test>::CollectionNotFound
+		);
+	});
 }
 
 // If address is already added to white list, nothing happens
 #[test]
 fn address_is_already_added_to_white_list() {
-    new_test_ext().execute_with(|| {
-        default_limits();
-        
-        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
-        let origin1 = Origin::signed(1);
-        
-        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), collection_id, account(2)));
-        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), collection_id, account(2)));
-        assert_eq!(TemplateModule::white_list(collection_id, 2), true);
-    });
+	new_test_ext().execute_with(|| {
+		default_limits();
+
+		let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+		let origin1 = Origin::signed(1);
+
+		assert_ok!(TemplateModule::add_to_white_list(
+			origin1.clone(),
+			collection_id,
+			account(2)
+		));
+		assert_ok!(TemplateModule::add_to_white_list(
+			origin1,
+			collection_id,
+			account(2)
+		));
+		assert!(TemplateModule::white_list(collection_id, 2));
+	});
 }
 
 #[test]
 fn owner_can_remove_address_from_white_list() {
-    new_test_ext().execute_with(|| {
-        default_limits();
-        
-        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+	new_test_ext().execute_with(|| {
+		default_limits();
+
+		let collection_id = create_test_collection(&CollectionMode::NFT, 1);
 
-        let origin1 = Origin::signed(1);
-        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), collection_id, account(2)));
-        assert_ok!(TemplateModule::remove_from_white_list(
-            origin1.clone(),
-            collection_id,
-            account(2)
-        ));
-        assert_eq!(TemplateModule::white_list(collection_id, 2), false);
-    });
+		let origin1 = Origin::signed(1);
+		assert_ok!(TemplateModule::add_to_white_list(
+			origin1.clone(),
+			collection_id,
+			account(2)
+		));
+		assert_ok!(TemplateModule::remove_from_white_list(
+			origin1,
+			collection_id,
+			account(2)
+		));
+		assert!(!TemplateModule::white_list(collection_id, 2));
+	});
 }
 
 #[test]
 fn admin_can_remove_address_from_white_list() {
-    new_test_ext().execute_with(|| {
-        default_limits();
-        
-        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
-        let origin1 = Origin::signed(1);
-        let origin2 = Origin::signed(2);
+	new_test_ext().execute_with(|| {
+		default_limits();
 
-        assert_ok!(TemplateModule::add_collection_admin(origin1.clone(), collection_id, account(2)));
+		let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+		let origin1 = Origin::signed(1);
+		let origin2 = Origin::signed(2);
 
-        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), collection_id, account(3)));
-        assert_ok!(TemplateModule::remove_from_white_list(
-            origin2.clone(),
-            collection_id,
-            account(3)
-        ));
-        assert_eq!(TemplateModule::white_list(collection_id, 3), false);
-    });
+		assert_ok!(TemplateModule::add_collection_admin(
+			origin1.clone(),
+			collection_id,
+			account(2)
+		));
+
+		assert_ok!(TemplateModule::add_to_white_list(
+			origin1,
+			collection_id,
+			account(3)
+		));
+		assert_ok!(TemplateModule::remove_from_white_list(
+			origin2,
+			collection_id,
+			account(3)
+		));
+		assert!(!TemplateModule::white_list(collection_id, 3));
+	});
 }
 
 #[test]
 fn nonprivileged_user_cannot_remove_address_from_white_list() {
-    new_test_ext().execute_with(|| {
-        default_limits();
-        
-        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
-        let origin1 = Origin::signed(1);
-        let origin2 = Origin::signed(2);
+	new_test_ext().execute_with(|| {
+		default_limits();
+
+		let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+		let origin1 = Origin::signed(1);
+		let origin2 = Origin::signed(2);
 
-        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), collection_id, account(2)));
-        assert_noop!(
-            TemplateModule::remove_from_white_list(origin2.clone(), collection_id, account(2)),
-            Error::<Test>::NoPermission
-        );
-        assert_eq!(TemplateModule::white_list(collection_id, 2), true);
-    });
+		assert_ok!(TemplateModule::add_to_white_list(
+			origin1,
+			collection_id,
+			account(2)
+		));
+		assert_noop!(
+			TemplateModule::remove_from_white_list(origin2, collection_id, account(2)),
+			Error::<Test>::NoPermission
+		);
+		assert!(TemplateModule::white_list(collection_id, 2));
+	});
 }
 
 #[test]
 fn nobody_can_remove_address_from_white_list_of_nonexisting_collection() {
-    new_test_ext().execute_with(|| {
-        default_limits();
-        let origin1 = Origin::signed(1);
+	new_test_ext().execute_with(|| {
+		default_limits();
+		let origin1 = Origin::signed(1);
 
-        assert_noop!(
-            TemplateModule::remove_from_white_list(origin1.clone(), 1, account(2)),
-            Error::<Test>::CollectionNotFound
-        );
-    });
+		assert_noop!(
+			TemplateModule::remove_from_white_list(origin1, 1, account(2)),
+			Error::<Test>::CollectionNotFound
+		);
+	});
 }
 
 #[test]
 fn nobody_can_remove_address_from_white_list_of_deleted_collection() {
-    new_test_ext().execute_with(|| {
-        default_limits();
-        
-        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
-        let origin1 = Origin::signed(1);
-        let origin2 = Origin::signed(2);
+	new_test_ext().execute_with(|| {
+		default_limits();
 
-        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), collection_id, account(2)));
-        assert_ok!(TemplateModule::destroy_collection(origin1.clone(), collection_id));
-        assert_noop!(
-            TemplateModule::remove_from_white_list(origin2.clone(), collection_id, account(2)),
-            Error::<Test>::CollectionNotFound
-        );
-        assert_eq!(TemplateModule::white_list(collection_id, 2), false);
-    });
+		let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+		let origin1 = Origin::signed(1);
+		let origin2 = Origin::signed(2);
+
+		assert_ok!(TemplateModule::add_to_white_list(
+			origin1.clone(),
+			collection_id,
+			account(2)
+		));
+		assert_ok!(TemplateModule::destroy_collection(origin1, collection_id));
+		assert_noop!(
+			TemplateModule::remove_from_white_list(origin2, collection_id, account(2)),
+			Error::<Test>::CollectionNotFound
+		);
+		assert!(!TemplateModule::white_list(collection_id, 2));
+	});
 }
 
 // If address is already removed from white list, nothing happens
 #[test]
 fn address_is_already_removed_from_white_list() {
-    new_test_ext().execute_with(|| {
-        default_limits();
-        
-        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
-        let origin1 = Origin::signed(1);
+	new_test_ext().execute_with(|| {
+		default_limits();
 
-        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), collection_id, account(2)));
-        assert_ok!(TemplateModule::remove_from_white_list(
-            origin1.clone(),
-            collection_id,
-            account(2)
-        ));
-        assert_ok!(TemplateModule::remove_from_white_list(
-            origin1.clone(),
-            collection_id,
-            account(2)
-        ));
-        assert_eq!(TemplateModule::white_list(collection_id, 2), false);
-    });
+		let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+		let origin1 = Origin::signed(1);
+
+		assert_ok!(TemplateModule::add_to_white_list(
+			origin1.clone(),
+			collection_id,
+			account(2)
+		));
+		assert_ok!(TemplateModule::remove_from_white_list(
+			origin1.clone(),
+			collection_id,
+			account(2)
+		));
+		assert_ok!(TemplateModule::remove_from_white_list(
+			origin1,
+			collection_id,
+			account(2)
+		));
+		assert!(!TemplateModule::white_list(collection_id, 2));
+	});
 }
 
 // If Public Access mode is set to WhiteList, tokens can’t be transferred from a non-whitelisted address with transfer or transferFrom (2 tests)
 #[test]
 fn white_list_test_1() {
-    new_test_ext().execute_with(|| {
-        default_limits();
-        
-        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+	new_test_ext().execute_with(|| {
+		default_limits();
 
-        let origin1 = Origin::signed(1);
-        
-        let data = default_nft_data();
-        create_test_item(collection_id, &data.into());
+		let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+
+		let origin1 = Origin::signed(1);
+
+		let data = default_nft_data();
+		create_test_item(collection_id, &data.into());
 
-        assert_ok!(TemplateModule::set_public_access_mode(
-            origin1.clone(),
-            collection_id,
-            AccessMode::WhiteList
-        ));
-        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), collection_id, account(2)));
+		assert_ok!(TemplateModule::set_public_access_mode(
+			origin1.clone(),
+			collection_id,
+			AccessMode::WhiteList
+		));
+		assert_ok!(TemplateModule::add_to_white_list(
+			origin1.clone(),
+			collection_id,
+			account(2)
+		));
 
-        assert_noop!(
-            TemplateModule::transfer(origin1.clone(), account(3), 1, 1, 1),
-            Error::<Test>::AddresNotInWhiteList
-        );
-    });
+		assert_noop!(
+			TemplateModule::transfer(origin1, account(3), 1, 1, 1),
+			Error::<Test>::AddresNotInWhiteList
+		);
+	});
 }
 
 #[test]
 fn white_list_test_2() {
-    new_test_ext().execute_with(|| {
-        default_limits();
-        
-        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
-        let origin1 = Origin::signed(1);
-        
-        let data = default_nft_data();
-        create_test_item(collection_id, &data.into());
+	new_test_ext().execute_with(|| {
+		default_limits();
 
-        assert_ok!(TemplateModule::set_public_access_mode(
-            origin1.clone(),
-            collection_id,
-            AccessMode::WhiteList
-        ));
-        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), 1, account(1)));
-        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), 1, account(2)));
+		let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+		let origin1 = Origin::signed(1);
 
-        // do approve
-        assert_ok!(TemplateModule::approve(origin1.clone(), account(1), 1, 1, 1));
-        assert_eq!(TemplateModule::approved(1, (1, 1, 1)), 1);
+		let data = default_nft_data();
+		create_test_item(collection_id, &data.into());
 
-        assert_ok!(TemplateModule::remove_from_white_list(
-            origin1.clone(),
-            1,
-            account(1)
-        ));
+		assert_ok!(TemplateModule::set_public_access_mode(
+			origin1.clone(),
+			collection_id,
+			AccessMode::WhiteList
+		));
+		assert_ok!(TemplateModule::add_to_white_list(
+			origin1.clone(),
+			1,
+			account(1)
+		));
+		assert_ok!(TemplateModule::add_to_white_list(
+			origin1.clone(),
+			1,
+			account(2)
+		));
+
+		// do approve
+		assert_ok!(TemplateModule::approve(
+			origin1.clone(),
+			account(1),
+			1,
+			1,
+			1
+		));
+		assert_eq!(TemplateModule::approved(1, (1, 1, 1)), 1);
 
-        assert_noop!(
-            TemplateModule::transfer_from(origin1.clone(), account(1), account(3), 1, 1, 1),
-            Error::<Test>::AddresNotInWhiteList
-        );
-    });
+		assert_ok!(TemplateModule::remove_from_white_list(
+			origin1.clone(),
+			1,
+			account(1)
+		));
+
+		assert_noop!(
+			TemplateModule::transfer_from(origin1, account(1), account(3), 1, 1, 1),
+			Error::<Test>::AddresNotInWhiteList
+		);
+	});
 }
 
 // If Public Access mode is set to WhiteList, tokens can’t be transferred to a non-whitelisted address with transfer or transferFrom (2 tests)
 #[test]
 fn white_list_test_3() {
-    new_test_ext().execute_with(|| {
-        default_limits();
-        
-        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+	new_test_ext().execute_with(|| {
+		default_limits();
+
+		let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+
+		let origin1 = Origin::signed(1);
 
-        let origin1 = Origin::signed(1);
-        
-        let data = default_nft_data();
-        create_test_item(collection_id, &data.into());
+		let data = default_nft_data();
+		create_test_item(collection_id, &data.into());
 
-        assert_ok!(TemplateModule::set_public_access_mode(
-            origin1.clone(),
-            collection_id,
-            AccessMode::WhiteList
-        ));
-        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), 1, account(1)));
+		assert_ok!(TemplateModule::set_public_access_mode(
+			origin1.clone(),
+			collection_id,
+			AccessMode::WhiteList
+		));
+		assert_ok!(TemplateModule::add_to_white_list(
+			origin1.clone(),
+			1,
+			account(1)
+		));
 
-        assert_noop!(
-            TemplateModule::transfer(origin1.clone(), account(3), 1, 1, 1),
-            Error::<Test>::AddresNotInWhiteList
-        );
-    });
+		assert_noop!(
+			TemplateModule::transfer(origin1, account(3), 1, 1, 1),
+			Error::<Test>::AddresNotInWhiteList
+		);
+	});
 }
 
 #[test]
 fn white_list_test_4() {
-    new_test_ext().execute_with(|| {
-        default_limits();
-        
-        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+	new_test_ext().execute_with(|| {
+		default_limits();
 
-        let origin1 = Origin::signed(1);
+		let collection_id = create_test_collection(&CollectionMode::NFT, 1);
 
-        let data = default_nft_data();
-        create_test_item(collection_id, &data.into());
+		let origin1 = Origin::signed(1);
 
-        assert_ok!(TemplateModule::set_public_access_mode(
-            origin1.clone(),
-            collection_id,
-            AccessMode::WhiteList
-        ));
-        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), collection_id, account(1)));
-        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), collection_id, account(2)));
+		let data = default_nft_data();
+		create_test_item(collection_id, &data.into());
 
-        // do approve
-        assert_ok!(TemplateModule::approve(origin1.clone(), account(1), 1, 1, 1));
-        assert_eq!(TemplateModule::approved(1, (1, 1, 1)), 1);
+		assert_ok!(TemplateModule::set_public_access_mode(
+			origin1.clone(),
+			collection_id,
+			AccessMode::WhiteList
+		));
+		assert_ok!(TemplateModule::add_to_white_list(
+			origin1.clone(),
+			collection_id,
+			account(1)
+		));
+		assert_ok!(TemplateModule::add_to_white_list(
+			origin1.clone(),
+			collection_id,
+			account(2)
+		));
+
+		// do approve
+		assert_ok!(TemplateModule::approve(
+			origin1.clone(),
+			account(1),
+			1,
+			1,
+			1
+		));
+		assert_eq!(TemplateModule::approved(1, (1, 1, 1)), 1);
 
-        assert_ok!(TemplateModule::remove_from_white_list(
-            origin1.clone(),
-            collection_id,
-            account(2)
-        ));
+		assert_ok!(TemplateModule::remove_from_white_list(
+			origin1.clone(),
+			collection_id,
+			account(2)
+		));
 
-        assert_noop!(
-            TemplateModule::transfer_from(origin1.clone(), account(1), account(3), 1, 1, 1),
-            Error::<Test>::AddresNotInWhiteList
-        );
-    });
+		assert_noop!(
+			TemplateModule::transfer_from(origin1, account(1), account(3), 1, 1, 1),
+			Error::<Test>::AddresNotInWhiteList
+		);
+	});
 }
 
 // If Public Access mode is set to WhiteList, tokens can’t be destroyed by a non-whitelisted address (even if it owned them before enabling WhiteList mode)
 #[test]
 fn white_list_test_5() {
-    new_test_ext().execute_with(|| {
-        default_limits();
-        
-        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+	new_test_ext().execute_with(|| {
+		default_limits();
 
-        let origin1 = Origin::signed(1);
+		let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+
+		let origin1 = Origin::signed(1);
 
-        let data = default_nft_data();
-        create_test_item(collection_id, &data.into());
+		let data = default_nft_data();
+		create_test_item(collection_id, &data.into());
 
-        assert_ok!(TemplateModule::set_public_access_mode(
-            origin1.clone(),
-            collection_id,
-            AccessMode::WhiteList
-        ));
-        assert_noop!(
-            TemplateModule::burn_item(origin1.clone(), 1, 1, 5),
-            Error::<Test>::AddresNotInWhiteList
-        );
-    });
+		assert_ok!(TemplateModule::set_public_access_mode(
+			origin1.clone(),
+			collection_id,
+			AccessMode::WhiteList
+		));
+		assert_noop!(
+			TemplateModule::burn_item(origin1, 1, 1, 5),
+			Error::<Test>::AddresNotInWhiteList
+		);
+	});
 }
 
 // If Public Access mode is set to WhiteList, token transfers can’t be Approved by a non-whitelisted address (see Approve method).
 #[test]
 fn white_list_test_6() {
-    new_test_ext().execute_with(|| {
-        default_limits();
-        
-        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+	new_test_ext().execute_with(|| {
+		default_limits();
 
-        let origin1 = Origin::signed(1);
+		let collection_id = create_test_collection(&CollectionMode::NFT, 1);
 
-        let data = default_nft_data();
-        create_test_item(collection_id, &data.into());
+		let origin1 = Origin::signed(1);
 
-        assert_ok!(TemplateModule::set_public_access_mode(
-            origin1.clone(),
-            collection_id,
-            AccessMode::WhiteList
-        ));
+		let data = default_nft_data();
+		create_test_item(collection_id, &data.into());
+
+		assert_ok!(TemplateModule::set_public_access_mode(
+			origin1.clone(),
+			collection_id,
+			AccessMode::WhiteList
+		));
 
-        // do approve
-        assert_noop!(
-            TemplateModule::approve(origin1.clone(), account(1), 1, 1, 5),
-            Error::<Test>::AddresNotInWhiteList
-        );
-    });
+		// do approve
+		assert_noop!(
+			TemplateModule::approve(origin1, account(1), 1, 1, 5),
+			Error::<Test>::AddresNotInWhiteList
+		);
+	});
 }
 
 // If Public Access mode is set to WhiteList, tokens can be transferred from a whitelisted address with transfer or transferFrom (2 tests) and
 //          tokens can be transferred from a whitelisted address with transfer or transferFrom (2 tests)
 #[test]
 fn white_list_test_7() {
-    new_test_ext().execute_with(|| {
-        default_limits();
-        
-        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+	new_test_ext().execute_with(|| {
+		default_limits();
+
+		let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+
+		let data = default_nft_data();
+		create_test_item(collection_id, &data.into());
 
-        let data = default_nft_data();
-        create_test_item(collection_id, &data.into());
-        
-        let origin1 = Origin::signed(1);
+		let origin1 = Origin::signed(1);
 
-        assert_ok!(TemplateModule::set_public_access_mode(
-            origin1.clone(),
-            collection_id,
-            AccessMode::WhiteList
-        ));
-        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), collection_id, account(1)));
-        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), collection_id, account(2)));
+		assert_ok!(TemplateModule::set_public_access_mode(
+			origin1.clone(),
+			collection_id,
+			AccessMode::WhiteList
+		));
+		assert_ok!(TemplateModule::add_to_white_list(
+			origin1.clone(),
+			collection_id,
+			account(1)
+		));
+		assert_ok!(TemplateModule::add_to_white_list(
+			origin1.clone(),
+			collection_id,
+			account(2)
+		));
 
-        assert_ok!(TemplateModule::transfer(origin1.clone(), account(2), 1, 1, 1));
-    });
+		assert_ok!(TemplateModule::transfer(origin1, account(2), 1, 1, 1));
+	});
 }
 
 #[test]
 fn white_list_test_8() {
-    new_test_ext().execute_with(|| {
-        default_limits();
-        
-        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+	new_test_ext().execute_with(|| {
+		default_limits();
 
-        let data = default_nft_data();
-        create_test_item(collection_id, &data.into());
-        
-        let origin1 = Origin::signed(1);
+		let collection_id = create_test_collection(&CollectionMode::NFT, 1);
 
-        assert_ok!(TemplateModule::set_public_access_mode(
-            origin1.clone(),
-            collection_id,
-            AccessMode::WhiteList
-        ));
-        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), collection_id, account(1)));
-        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), collection_id, account(2)));
+		let data = default_nft_data();
+		create_test_item(collection_id, &data.into());
 
-        // do approve
-        assert_ok!(TemplateModule::approve(origin1.clone(), account(1), 1, 1, 5));
-        assert_eq!(TemplateModule::approved(1, (1, 1, 1)), 5);
+		let origin1 = Origin::signed(1);
 
-        assert_ok!(TemplateModule::transfer_from(
-            origin1.clone(),
-            account(1),
-            account(2),
-            1,
-            1,
-            1
-        ));
-    });
+		assert_ok!(TemplateModule::set_public_access_mode(
+			origin1.clone(),
+			collection_id,
+			AccessMode::WhiteList
+		));
+		assert_ok!(TemplateModule::add_to_white_list(
+			origin1.clone(),
+			collection_id,
+			account(1)
+		));
+		assert_ok!(TemplateModule::add_to_white_list(
+			origin1.clone(),
+			collection_id,
+			account(2)
+		));
+
+		// do approve
+		assert_ok!(TemplateModule::approve(
+			origin1.clone(),
+			account(1),
+			1,
+			1,
+			5
+		));
+		assert_eq!(TemplateModule::approved(1, (1, 1, 1)), 5);
+
+		assert_ok!(TemplateModule::transfer_from(
+			origin1,
+			account(1),
+			account(2),
+			1,
+			1,
+			1
+		));
+	});
 }
 
 // If Public Access mode is set to WhiteList, and Mint Permission is set to false, tokens can be created by owner.
 #[test]
 fn white_list_test_9() {
-    new_test_ext().execute_with(|| {
-        default_limits();
-        
-        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
-        let origin1 = Origin::signed(1);
+	new_test_ext().execute_with(|| {
+		default_limits();
 
-        assert_ok!(TemplateModule::set_public_access_mode(
-            origin1.clone(),
-            collection_id,
-            AccessMode::WhiteList
-        ));
-        assert_ok!(TemplateModule::set_mint_permission(
-            origin1.clone(),
-            collection_id,
-            false
-        ));
+		let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+		let origin1 = Origin::signed(1);
 
-        let data = default_nft_data();
-        create_test_item(collection_id, &data.into());
-    });
+		assert_ok!(TemplateModule::set_public_access_mode(
+			origin1.clone(),
+			collection_id,
+			AccessMode::WhiteList
+		));
+		assert_ok!(TemplateModule::set_mint_permission(
+			origin1,
+			collection_id,
+			false
+		));
+
+		let data = default_nft_data();
+		create_test_item(collection_id, &data.into());
+	});
 }
 
 // If Public Access mode is set to WhiteList, and Mint Permission is set to false, tokens can be created by admin.
 #[test]
 fn white_list_test_10() {
-    new_test_ext().execute_with(|| {
-        default_limits();
-        
-        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+	new_test_ext().execute_with(|| {
+		default_limits();
 
-        let origin1 = Origin::signed(1);
-        let origin2 = Origin::signed(2);
+		let collection_id = create_test_collection(&CollectionMode::NFT, 1);
 
-        assert_ok!(TemplateModule::set_public_access_mode(
-            origin1.clone(),
-            collection_id,
-            AccessMode::WhiteList
-        ));
-        assert_ok!(TemplateModule::set_mint_permission(
-            origin1.clone(),
-            collection_id,
-            false
-        ));
+		let origin1 = Origin::signed(1);
+		let origin2 = Origin::signed(2);
 
-        assert_ok!(TemplateModule::add_collection_admin(origin1.clone(), collection_id, account(2)));
+		assert_ok!(TemplateModule::set_public_access_mode(
+			origin1.clone(),
+			collection_id,
+			AccessMode::WhiteList
+		));
+		assert_ok!(TemplateModule::set_mint_permission(
+			origin1.clone(),
+			collection_id,
+			false
+		));
 
-        assert_ok!(TemplateModule::create_item(
-            origin2.clone(),
-            collection_id,
-            account(2),
-            default_nft_data().into()
-        ));
-    });
+		assert_ok!(TemplateModule::add_collection_admin(
+			origin1,
+			collection_id,
+			account(2)
+		));
+
+		assert_ok!(TemplateModule::create_item(
+			origin2,
+			collection_id,
+			account(2),
+			default_nft_data().into()
+		));
+	});
 }
 
 // If Public Access mode is set to WhiteList, and Mint Permission is set to false, tokens cannot be created by non-privileged and white listed address.
 #[test]
 fn white_list_test_11() {
-    new_test_ext().execute_with(|| {
-        default_limits();
-        
-        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+	new_test_ext().execute_with(|| {
+		default_limits();
 
-        let origin1 = Origin::signed(1);
-        let origin2 = Origin::signed(2);
+		let collection_id = create_test_collection(&CollectionMode::NFT, 1);
 
-        assert_ok!(TemplateModule::set_public_access_mode(
-            origin1.clone(),
-            collection_id,
-            AccessMode::WhiteList
-        ));
-        assert_ok!(TemplateModule::set_mint_permission(
-            origin1.clone(),
-            collection_id,
-            false
-        ));
-        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), collection_id, account(2)));
+		let origin1 = Origin::signed(1);
+		let origin2 = Origin::signed(2);
 
-        assert_noop!(
-            TemplateModule::create_item(origin2.clone(), 1, account(2), default_nft_data().into()),
-            Error::<Test>::PublicMintingNotAllowed
-        );
-    });
+		assert_ok!(TemplateModule::set_public_access_mode(
+			origin1.clone(),
+			collection_id,
+			AccessMode::WhiteList
+		));
+		assert_ok!(TemplateModule::set_mint_permission(
+			origin1.clone(),
+			collection_id,
+			false
+		));
+		assert_ok!(TemplateModule::add_to_white_list(
+			origin1,
+			collection_id,
+			account(2)
+		));
+
+		assert_noop!(
+			TemplateModule::create_item(origin2, 1, account(2), default_nft_data().into()),
+			Error::<Test>::PublicMintingNotAllowed
+		);
+	});
 }
 
 // If Public Access mode is set to WhiteList, and Mint Permission is set to false, tokens cannot be created by non-privileged and non-white listed address.
 #[test]
 fn white_list_test_12() {
-    new_test_ext().execute_with(|| {
-        default_limits();
-        
-        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+	new_test_ext().execute_with(|| {
+		default_limits();
+
+		let collection_id = create_test_collection(&CollectionMode::NFT, 1);
 
-        let origin1 = Origin::signed(1);
-        let origin2 = Origin::signed(2);
+		let origin1 = Origin::signed(1);
+		let origin2 = Origin::signed(2);
 
-        assert_ok!(TemplateModule::set_public_access_mode(
-            origin1.clone(),
-            collection_id,
-            AccessMode::WhiteList
-        ));
-        assert_ok!(TemplateModule::set_mint_permission(
-            origin1.clone(),
-            collection_id,
-            false
-        ));
+		assert_ok!(TemplateModule::set_public_access_mode(
+			origin1.clone(),
+			collection_id,
+			AccessMode::WhiteList
+		));
+		assert_ok!(TemplateModule::set_mint_permission(
+			origin1,
+			collection_id,
+			false
+		));
 
-        assert_noop!(
-            TemplateModule::create_item(origin2.clone(), 1, account(2), default_nft_data().into()),
-            Error::<Test>::PublicMintingNotAllowed
-        );
-    });
+		assert_noop!(
+			TemplateModule::create_item(origin2, 1, account(2), default_nft_data().into()),
+			Error::<Test>::PublicMintingNotAllowed
+		);
+	});
 }
 
 // If Public Access mode is set to WhiteList, and Mint Permission is set to true, tokens can be created by owner.
 #[test]
 fn white_list_test_13() {
-    new_test_ext().execute_with(|| {
-        default_limits();
-        
-        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+	new_test_ext().execute_with(|| {
+		default_limits();
 
-        let origin1 = Origin::signed(1);
+		let collection_id = create_test_collection(&CollectionMode::NFT, 1);
 
-        assert_ok!(TemplateModule::set_public_access_mode(
-            origin1.clone(),
-            collection_id,
-            AccessMode::WhiteList
-        ));
-        assert_ok!(TemplateModule::set_mint_permission(
-            origin1.clone(),
-            collection_id,
-            true
-        ));
+		let origin1 = Origin::signed(1);
+
+		assert_ok!(TemplateModule::set_public_access_mode(
+			origin1.clone(),
+			collection_id,
+			AccessMode::WhiteList
+		));
+		assert_ok!(TemplateModule::set_mint_permission(
+			origin1,
+			collection_id,
+			true
+		));
 
-        let data = default_nft_data();
-        create_test_item(collection_id, &data.into());
-    });
+		let data = default_nft_data();
+		create_test_item(collection_id, &data.into());
+	});
 }
 
 // If Public Access mode is set to WhiteList, and Mint Permission is set to true, tokens can be created by admin.
 #[test]
 fn white_list_test_14() {
-    new_test_ext().execute_with(|| {
-        default_limits();
-        
-        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+	new_test_ext().execute_with(|| {
+		default_limits();
+
+		let collection_id = create_test_collection(&CollectionMode::NFT, 1);
 
-        let origin1 = Origin::signed(1);
-        let origin2 = Origin::signed(2);
+		let origin1 = Origin::signed(1);
+		let origin2 = Origin::signed(2);
 
-        assert_ok!(TemplateModule::set_public_access_mode(
-            origin1.clone(),
-            collection_id,
-            AccessMode::WhiteList
-        ));
-        assert_ok!(TemplateModule::set_mint_permission(
-            origin1.clone(),
-            collection_id,
-            true
-        ));
+		assert_ok!(TemplateModule::set_public_access_mode(
+			origin1.clone(),
+			collection_id,
+			AccessMode::WhiteList
+		));
+		assert_ok!(TemplateModule::set_mint_permission(
+			origin1.clone(),
+			collection_id,
+			true
+		));
 
-        assert_ok!(TemplateModule::add_collection_admin(origin1.clone(), collection_id, account(2)));
+		assert_ok!(TemplateModule::add_collection_admin(
+			origin1,
+			collection_id,
+			account(2)
+		));
 
-        assert_ok!(TemplateModule::create_item(
-            origin2.clone(),
-            1,
-            account(2),
-            default_nft_data().into()
-        ));
-    });
+		assert_ok!(TemplateModule::create_item(
+			origin2,
+			1,
+			account(2),
+			default_nft_data().into()
+		));
+	});
 }
 
 // If Public Access mode is set to WhiteList, and Mint Permission is set to true, tokens cannot be created by non-privileged and non-white listed address.
 #[test]
 fn white_list_test_15() {
-    new_test_ext().execute_with(|| {
-        default_limits();
-        
-        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+	new_test_ext().execute_with(|| {
+		default_limits();
 
-        let origin1 = Origin::signed(1);
-        let origin2 = Origin::signed(2);
+		let collection_id = create_test_collection(&CollectionMode::NFT, 1);
 
-        assert_ok!(TemplateModule::set_public_access_mode(
-            origin1.clone(),
-            collection_id,
-            AccessMode::WhiteList
-        ));
-        assert_ok!(TemplateModule::set_mint_permission(
-            origin1.clone(),
-            collection_id,
-            true
-        ));
+		let origin1 = Origin::signed(1);
+		let origin2 = Origin::signed(2);
 
-        assert_noop!(
-            TemplateModule::create_item(origin2.clone(), 1, account(2), default_nft_data().into()),
-            Error::<Test>::AddresNotInWhiteList
-        );
-    });
+		assert_ok!(TemplateModule::set_public_access_mode(
+			origin1.clone(),
+			collection_id,
+			AccessMode::WhiteList
+		));
+		assert_ok!(TemplateModule::set_mint_permission(
+			origin1,
+			collection_id,
+			true
+		));
+
+		assert_noop!(
+			TemplateModule::create_item(origin2, 1, account(2), default_nft_data().into()),
+			Error::<Test>::AddresNotInWhiteList
+		);
+	});
 }
 
 // If Public Access mode is set to WhiteList, and Mint Permission is set to true, tokens can be created by non-privileged and white listed address.
 #[test]
 fn white_list_test_16() {
-    new_test_ext().execute_with(|| {
-        default_limits();
-        
-        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+	new_test_ext().execute_with(|| {
+		default_limits();
+
+		let collection_id = create_test_collection(&CollectionMode::NFT, 1);
 
-        let origin1 = Origin::signed(1);
-        let origin2 = Origin::signed(2);
+		let origin1 = Origin::signed(1);
+		let origin2 = Origin::signed(2);
 
-        assert_ok!(TemplateModule::set_public_access_mode(
-            origin1.clone(),
-            collection_id,
-            AccessMode::WhiteList
-        ));
-        assert_ok!(TemplateModule::set_mint_permission(
-            origin1.clone(),
-            collection_id,
-            true
-        ));
-        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), collection_id, account(2)));
+		assert_ok!(TemplateModule::set_public_access_mode(
+			origin1.clone(),
+			collection_id,
+			AccessMode::WhiteList
+		));
+		assert_ok!(TemplateModule::set_mint_permission(
+			origin1.clone(),
+			collection_id,
+			true
+		));
+		assert_ok!(TemplateModule::add_to_white_list(
+			origin1,
+			collection_id,
+			account(2)
+		));
 
-        assert_ok!(TemplateModule::create_item(
-            origin2.clone(),
-            1,
-            account(2),
-            default_nft_data().into()
-        ));
-    });
+		assert_ok!(TemplateModule::create_item(
+			origin2,
+			1,
+			account(2),
+			default_nft_data().into()
+		));
+	});
 }
 
 // Total number of collections. Positive test
 #[test]
 fn total_number_collections_bound() {
-    new_test_ext().execute_with(|| {
-        default_limits();
-        
-        create_test_collection(&CollectionMode::NFT, 1);
-    });
+	new_test_ext().execute_with(|| {
+		default_limits();
+
+		create_test_collection(&CollectionMode::NFT, 1);
+	});
 }
 
 // Total number of collections. Negotive test
 #[test]
 fn total_number_collections_bound_neg() {
-    new_test_ext().execute_with(|| {
-        default_limits();
+	new_test_ext().execute_with(|| {
+		default_limits();
 
-        let origin1 = Origin::signed(1);
+		let origin1 = Origin::signed(1);
 
-        for i in 0..default_collection_numbers_limit() {
-            create_test_collection(&CollectionMode::NFT, i + 1);
-        }
+		for i in 0..default_collection_numbers_limit() {
+			create_test_collection(&CollectionMode::NFT, i + 1);
+		}
 
-        let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
+		let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
+		let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
+		let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
 
-        // 11-th collection in chain. Expects error
-        assert_noop!(TemplateModule::create_collection(
-            origin1.clone(),
-            col_name1.clone(),
-            col_desc1.clone(),
-            token_prefix1.clone(),
-            CollectionMode::NFT
-        ), Error::<Test>::TotalCollectionsLimitExceeded);
-    });
+		// 11-th collection in chain. Expects error
+		assert_noop!(
+			TemplateModule::create_collection(
+				origin1,
+				col_name1,
+				col_desc1,
+				token_prefix1,
+				CollectionMode::NFT
+			),
+			Error::<Test>::TotalCollectionsLimitExceeded
+		);
+	});
 }
 
 // Owned tokens by a single address. Positive test
 #[test]
 fn owned_tokens_bound() {
-    new_test_ext().execute_with(|| {
-        default_limits();
-        
-        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+	new_test_ext().execute_with(|| {
+		default_limits();
+
+		let collection_id = create_test_collection(&CollectionMode::NFT, 1);
 
-        let data = default_nft_data();
-        create_test_item(collection_id, &data.clone().into());
-        create_test_item(collection_id, &data.into());
-    });
+		let data = default_nft_data();
+		create_test_item(collection_id, &data.clone().into());
+		create_test_item(collection_id, &data.into());
+	});
 }
 
 // Owned tokens by a single address. Negotive test
 #[test]
 fn owned_tokens_bound_neg() {
-    new_test_ext().execute_with(|| {
-        assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
-            collection_numbers_limit: 10,
-            account_token_ownership_limit: 1,
-            collections_admins_limit: 5,
-            custom_data_limit: 2048,
-            nft_sponsor_transfer_timeout: 15,
-            fungible_sponsor_transfer_timeout: 15,
-            refungible_sponsor_transfer_timeout: 15,
-            const_on_chain_schema_limit: 1024,
-            offchain_schema_limit: 1024,
-            variable_on_chain_schema_limit: 1024,
-        }));
-        
-        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+	new_test_ext().execute_with(|| {
+		assert_ok!(TemplateModule::set_chain_limits(
+			RawOrigin::Root.into(),
+			ChainLimits {
+				collection_numbers_limit: 10,
+				account_token_ownership_limit: 1,
+				collections_admins_limit: 5,
+				custom_data_limit: 2048,
+				nft_sponsor_transfer_timeout: 15,
+				fungible_sponsor_transfer_timeout: 15,
+				refungible_sponsor_transfer_timeout: 15,
+				const_on_chain_schema_limit: 1024,
+				offchain_schema_limit: 1024,
+				variable_on_chain_schema_limit: 1024,
+			}
+		));
 
-        let origin1 = Origin::signed(1);
-        let data = default_nft_data();
-        create_test_item(collection_id, &data.clone().into());
+		let collection_id = create_test_collection(&CollectionMode::NFT, 1);
 
-        assert_noop!(TemplateModule::create_item(
-            origin1.clone(),
-            1,
-            account(1),
-            data.into()
-        ),  Error::<Test>::AddressOwnershipLimitExceeded);
-    });
+		let origin1 = Origin::signed(1);
+		let data = default_nft_data();
+		create_test_item(collection_id, &data.clone().into());
+
+		assert_noop!(
+			TemplateModule::create_item(origin1, 1, account(1), data.into()),
+			Error::<Test>::AddressOwnershipLimitExceeded
+		);
+	});
 }
 
 // Number of collection admins. Positive test
 #[test]
 fn collection_admins_bound() {
-    new_test_ext().execute_with(|| {
-        assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
-            collection_numbers_limit: 10,
-            account_token_ownership_limit: 10,
-            collections_admins_limit: 2,
-            custom_data_limit: 2048,
-            nft_sponsor_transfer_timeout: 15,
-            fungible_sponsor_transfer_timeout: 15,
-            refungible_sponsor_transfer_timeout: 15,
-            const_on_chain_schema_limit: 1024,
-            offchain_schema_limit: 1024,
-            variable_on_chain_schema_limit: 1024,
-        }));
-        
-        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+	new_test_ext().execute_with(|| {
+		assert_ok!(TemplateModule::set_chain_limits(
+			RawOrigin::Root.into(),
+			ChainLimits {
+				collection_numbers_limit: 10,
+				account_token_ownership_limit: 10,
+				collections_admins_limit: 2,
+				custom_data_limit: 2048,
+				nft_sponsor_transfer_timeout: 15,
+				fungible_sponsor_transfer_timeout: 15,
+				refungible_sponsor_transfer_timeout: 15,
+				const_on_chain_schema_limit: 1024,
+				offchain_schema_limit: 1024,
+				variable_on_chain_schema_limit: 1024,
+			}
+		));
+
+		let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+
+		let origin1 = Origin::signed(1);
 
-        let origin1 = Origin::signed(1);
-        
-        assert_ok!(TemplateModule::add_collection_admin(origin1.clone(), collection_id, account(2)));
-        assert_ok!(TemplateModule::add_collection_admin(origin1.clone(), collection_id, account(3)));
-    });
+		assert_ok!(TemplateModule::add_collection_admin(
+			origin1.clone(),
+			collection_id,
+			account(2)
+		));
+		assert_ok!(TemplateModule::add_collection_admin(
+			origin1,
+			collection_id,
+			account(3)
+		));
+	});
 }
 
 // Number of collection admins. Negotive test
 #[test]
 fn collection_admins_bound_neg() {
-    new_test_ext().execute_with(|| {
-        assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
-            collection_numbers_limit: 10,
-            account_token_ownership_limit: 1,
-            collections_admins_limit: 1,
-            custom_data_limit: 2048,
-            nft_sponsor_transfer_timeout: 15,
-            fungible_sponsor_transfer_timeout: 15,
-            refungible_sponsor_transfer_timeout: 15,
-            const_on_chain_schema_limit: 1024,
-            offchain_schema_limit: 1024,
-            variable_on_chain_schema_limit: 1024,
-        }));
-        
-        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+	new_test_ext().execute_with(|| {
+		assert_ok!(TemplateModule::set_chain_limits(
+			RawOrigin::Root.into(),
+			ChainLimits {
+				collection_numbers_limit: 10,
+				account_token_ownership_limit: 1,
+				collections_admins_limit: 1,
+				custom_data_limit: 2048,
+				nft_sponsor_transfer_timeout: 15,
+				fungible_sponsor_transfer_timeout: 15,
+				refungible_sponsor_transfer_timeout: 15,
+				const_on_chain_schema_limit: 1024,
+				offchain_schema_limit: 1024,
+				variable_on_chain_schema_limit: 1024,
+			}
+		));
 
-        let origin1 = Origin::signed(1);
+		let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+
+		let origin1 = Origin::signed(1);
 
-        assert_ok!(TemplateModule::add_collection_admin(origin1.clone(), collection_id, account(2)));
-        assert_noop!(TemplateModule::add_collection_admin(origin1.clone(), collection_id, account(3)), Error::<Test>::CollectionAdminsLimitExceeded);
-    });
+		assert_ok!(TemplateModule::add_collection_admin(
+			origin1.clone(),
+			collection_id,
+			account(2)
+		));
+		assert_noop!(
+			TemplateModule::add_collection_admin(origin1, collection_id, account(3)),
+			Error::<Test>::CollectionAdminsLimitExceeded
+		);
+	});
 }
 
 // NFT custom data size. Negative test const_data.
 #[test]
 fn custom_data_size_nft_const_data_bound_neg() {
-    new_test_ext().execute_with(|| {
-        assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
-            collection_numbers_limit: 10,
-            account_token_ownership_limit: 10,
-            collections_admins_limit: 5,
-            custom_data_limit: 2,
-            nft_sponsor_transfer_timeout: 15,
-            fungible_sponsor_transfer_timeout: 15,
-            refungible_sponsor_transfer_timeout: 15,
-            const_on_chain_schema_limit: 1024,
-            offchain_schema_limit: 1024,
-            variable_on_chain_schema_limit: 1024,
-        }));
-        
-        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+	new_test_ext().execute_with(|| {
+		assert_ok!(TemplateModule::set_chain_limits(
+			RawOrigin::Root.into(),
+			ChainLimits {
+				collection_numbers_limit: 10,
+				account_token_ownership_limit: 10,
+				collections_admins_limit: 5,
+				custom_data_limit: 2,
+				nft_sponsor_transfer_timeout: 15,
+				fungible_sponsor_transfer_timeout: 15,
+				refungible_sponsor_transfer_timeout: 15,
+				const_on_chain_schema_limit: 1024,
+				offchain_schema_limit: 1024,
+				variable_on_chain_schema_limit: 1024,
+			}
+		));
+
+		let collection_id = create_test_collection(&CollectionMode::NFT, 1);
 
-        let origin1 = Origin::signed(1);
-        let too_big_const_data = CreateItemData::NFT(CreateNftData{
-            const_data: vec![1, 2, 3, 4],
-            variable_data: vec![]
-        });
+		let origin1 = Origin::signed(1);
+		let too_big_const_data = CreateItemData::NFT(CreateNftData {
+			const_data: vec![1, 2, 3, 4],
+			variable_data: vec![],
+		});
 
-        assert_noop!(TemplateModule::create_item(
-            origin1.clone(),
-            collection_id,
-            account(1),
-            too_big_const_data
-        ), Error::<Test>::TokenConstDataLimitExceeded);
-    });
+		assert_noop!(
+			TemplateModule::create_item(origin1, collection_id, account(1), too_big_const_data),
+			Error::<Test>::TokenConstDataLimitExceeded
+		);
+	});
 }
 
 // NFT custom data size. Negative test variable_data.
 #[test]
 fn custom_data_size_nft_variable_data_bound_neg() {
-    new_test_ext().execute_with(|| {
-        assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
-            collection_numbers_limit: 10,
-            account_token_ownership_limit: 10,
-            collections_admins_limit: 5,
-            custom_data_limit: 2,
-            nft_sponsor_transfer_timeout: 15,
-            fungible_sponsor_transfer_timeout: 15,
-            refungible_sponsor_transfer_timeout: 15,
-            const_on_chain_schema_limit: 1024,
-            offchain_schema_limit: 1024,
-            variable_on_chain_schema_limit: 1024,
-        }));
+	new_test_ext().execute_with(|| {
+		assert_ok!(TemplateModule::set_chain_limits(
+			RawOrigin::Root.into(),
+			ChainLimits {
+				collection_numbers_limit: 10,
+				account_token_ownership_limit: 10,
+				collections_admins_limit: 5,
+				custom_data_limit: 2,
+				nft_sponsor_transfer_timeout: 15,
+				fungible_sponsor_transfer_timeout: 15,
+				refungible_sponsor_transfer_timeout: 15,
+				const_on_chain_schema_limit: 1024,
+				offchain_schema_limit: 1024,
+				variable_on_chain_schema_limit: 1024,
+			}
+		));
 
-        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+		let collection_id = create_test_collection(&CollectionMode::NFT, 1);
 
-        let origin1 = Origin::signed(1);
-        let too_big_const_data = CreateItemData::NFT(CreateNftData{
-            const_data: vec![],
-            variable_data: vec![1, 2, 3, 4]
-        });
+		let origin1 = Origin::signed(1);
+		let too_big_const_data = CreateItemData::NFT(CreateNftData {
+			const_data: vec![],
+			variable_data: vec![1, 2, 3, 4],
+		});
 
-        assert_noop!(TemplateModule::create_item(
-            origin1.clone(),
-            collection_id,
-            account(1),
-            too_big_const_data
-        ), Error::<Test>::TokenVariableDataLimitExceeded);
-    });
+		assert_noop!(
+			TemplateModule::create_item(origin1, collection_id, account(1), too_big_const_data),
+			Error::<Test>::TokenVariableDataLimitExceeded
+		);
+	});
 }
 
 // Re fungible custom data size. Negative test const_data.
 #[test]
 fn custom_data_size_re_fungible_const_data_bound_neg() {
-    new_test_ext().execute_with(|| {
-        assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
-            collection_numbers_limit: 10,
-            account_token_ownership_limit: 10,
-            collections_admins_limit: 5,
-            custom_data_limit: 2,
-            nft_sponsor_transfer_timeout: 15,
-            fungible_sponsor_transfer_timeout: 15,
-            refungible_sponsor_transfer_timeout: 15,
-            const_on_chain_schema_limit: 1024,
-            offchain_schema_limit: 1024,
-            variable_on_chain_schema_limit: 1024,
-        }));
+	new_test_ext().execute_with(|| {
+		assert_ok!(TemplateModule::set_chain_limits(
+			RawOrigin::Root.into(),
+			ChainLimits {
+				collection_numbers_limit: 10,
+				account_token_ownership_limit: 10,
+				collections_admins_limit: 5,
+				custom_data_limit: 2,
+				nft_sponsor_transfer_timeout: 15,
+				fungible_sponsor_transfer_timeout: 15,
+				refungible_sponsor_transfer_timeout: 15,
+				const_on_chain_schema_limit: 1024,
+				offchain_schema_limit: 1024,
+				variable_on_chain_schema_limit: 1024,
+			}
+		));
 
-        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+		let collection_id = create_test_collection(&CollectionMode::NFT, 1);
 
-        let origin1 = Origin::signed(1);
-        let too_big_const_data = CreateItemData::NFT(CreateNftData{
-            const_data: vec![1, 2, 3, 4],
-            variable_data: vec![]
-        });
+		let origin1 = Origin::signed(1);
+		let too_big_const_data = CreateItemData::NFT(CreateNftData {
+			const_data: vec![1, 2, 3, 4],
+			variable_data: vec![],
+		});
 
-        assert_noop!(TemplateModule::create_item(
-            origin1.clone(),
-            collection_id,
-            account(1),
-            too_big_const_data
-        ), Error::<Test>::TokenConstDataLimitExceeded);
-    });
+		assert_noop!(
+			TemplateModule::create_item(origin1, collection_id, account(1), too_big_const_data),
+			Error::<Test>::TokenConstDataLimitExceeded
+		);
+	});
 }
 
 // Re fungible custom data size. Negative test variable_data.
 #[test]
 fn custom_data_size_re_fungible_variable_data_bound_neg() {
-    new_test_ext().execute_with(|| {
-        assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
-            collection_numbers_limit: 10,
-            account_token_ownership_limit: 10,
-            collections_admins_limit: 5,
-            custom_data_limit: 2,
-            nft_sponsor_transfer_timeout: 15,
-            fungible_sponsor_transfer_timeout: 15,
-            refungible_sponsor_transfer_timeout: 15,
-            const_on_chain_schema_limit: 1024,
-            offchain_schema_limit: 1024,
-            variable_on_chain_schema_limit: 1024,
-        }));
+	new_test_ext().execute_with(|| {
+		assert_ok!(TemplateModule::set_chain_limits(
+			RawOrigin::Root.into(),
+			ChainLimits {
+				collection_numbers_limit: 10,
+				account_token_ownership_limit: 10,
+				collections_admins_limit: 5,
+				custom_data_limit: 2,
+				nft_sponsor_transfer_timeout: 15,
+				fungible_sponsor_transfer_timeout: 15,
+				refungible_sponsor_transfer_timeout: 15,
+				const_on_chain_schema_limit: 1024,
+				offchain_schema_limit: 1024,
+				variable_on_chain_schema_limit: 1024,
+			}
+		));
 
-        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+		let collection_id = create_test_collection(&CollectionMode::NFT, 1);
 
-        let origin1 = Origin::signed(1);
-        let too_big_const_data = CreateItemData::NFT(CreateNftData{
-            const_data: vec![],
-            variable_data: vec![1, 2, 3, 4]
-        });
+		let origin1 = Origin::signed(1);
+		let too_big_const_data = CreateItemData::NFT(CreateNftData {
+			const_data: vec![],
+			variable_data: vec![1, 2, 3, 4],
+		});
 
-        assert_noop!(TemplateModule::create_item(
-            origin1.clone(),
-            collection_id,
-            account(1),
-            too_big_const_data
-        ), Error::<Test>::TokenVariableDataLimitExceeded);
-    });
+		assert_noop!(
+			TemplateModule::create_item(origin1, collection_id, account(1), too_big_const_data),
+			Error::<Test>::TokenVariableDataLimitExceeded
+		);
+	});
 }
 // #endregion
 
 #[test]
 fn set_const_on_chain_schema() {
-    new_test_ext().execute_with(|| {
-        default_limits();
+	new_test_ext().execute_with(|| {
+		default_limits();
 
-        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+		let collection_id = create_test_collection(&CollectionMode::NFT, 1);
 
-        let origin1 = Origin::signed(1);
-        assert_ok!(TemplateModule::set_const_on_chain_schema(origin1, collection_id, b"test const on chain schema".to_vec()));
+		let origin1 = Origin::signed(1);
+		assert_ok!(TemplateModule::set_const_on_chain_schema(
+			origin1,
+			collection_id,
+			b"test const on chain schema".to_vec()
+		));
 
-        assert_eq!(TemplateModule::collection_id(collection_id).unwrap().const_on_chain_schema, b"test const on chain schema".to_vec());
-        assert_eq!(TemplateModule::collection_id(collection_id).unwrap().variable_on_chain_schema, b"".to_vec());
-    });
+		assert_eq!(
+			TemplateModule::collection_id(collection_id)
+				.unwrap()
+				.const_on_chain_schema,
+			b"test const on chain schema".to_vec()
+		);
+		assert_eq!(
+			TemplateModule::collection_id(collection_id)
+				.unwrap()
+				.variable_on_chain_schema,
+			b"".to_vec()
+		);
+	});
 }
 
 #[test]
 fn set_variable_on_chain_schema() {
-    new_test_ext().execute_with(|| {
-        default_limits();
-        
-        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+	new_test_ext().execute_with(|| {
+		default_limits();
 
-        let origin1 = Origin::signed(1);
-        assert_ok!(TemplateModule::set_variable_on_chain_schema(origin1, collection_id, b"test variable on chain schema".to_vec()));
+		let collection_id = create_test_collection(&CollectionMode::NFT, 1);
 
-        assert_eq!(TemplateModule::collection_id(collection_id).unwrap().const_on_chain_schema, b"".to_vec());
-        assert_eq!(TemplateModule::collection_id(collection_id).unwrap().variable_on_chain_schema, b"test variable on chain schema".to_vec());
-    });
+		let origin1 = Origin::signed(1);
+		assert_ok!(TemplateModule::set_variable_on_chain_schema(
+			origin1,
+			collection_id,
+			b"test variable on chain schema".to_vec()
+		));
+
+		assert_eq!(
+			TemplateModule::collection_id(collection_id)
+				.unwrap()
+				.const_on_chain_schema,
+			b"".to_vec()
+		);
+		assert_eq!(
+			TemplateModule::collection_id(collection_id)
+				.unwrap()
+				.variable_on_chain_schema,
+			b"test variable on chain schema".to_vec()
+		);
+	});
 }
 
 #[test]
 fn set_variable_meta_data_on_nft_token_stores_variable_meta_data() {
-    new_test_ext().execute_with(|| {
-        default_limits();
+	new_test_ext().execute_with(|| {
+		default_limits();
 
-        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+		let collection_id = create_test_collection(&CollectionMode::NFT, 1);
 
-        let origin1 = Origin::signed(1);
-        
-        let data = default_nft_data();
-        create_test_item(1, &data.into());
-        
-        let variable_data = b"test set_variable_meta_data method.".to_vec();
-        assert_ok!(TemplateModule::set_variable_meta_data(origin1, collection_id, 1, variable_data.clone()));
+		let origin1 = Origin::signed(1);
 
-        assert_eq!(TemplateModule::nft_item_id(collection_id, 1).unwrap().variable_data, variable_data);
-    });
+		let data = default_nft_data();
+		create_test_item(1, &data.into());
+
+		let variable_data = b"test set_variable_meta_data method.".to_vec();
+		assert_ok!(TemplateModule::set_variable_meta_data(
+			origin1,
+			collection_id,
+			1,
+			variable_data.clone()
+		));
+
+		assert_eq!(
+			TemplateModule::nft_item_id(collection_id, 1)
+				.unwrap()
+				.variable_data,
+			variable_data
+		);
+	});
 }
 
 #[test]
 fn set_variable_meta_data_on_re_fungible_token_stores_variable_meta_data() {
-    new_test_ext().execute_with(|| {
-        default_limits();
+	new_test_ext().execute_with(|| {
+		default_limits();
 
-        let collection_id = create_test_collection(&CollectionMode::ReFungible, 1);
+		let collection_id = create_test_collection(&CollectionMode::ReFungible, 1);
 
-        let origin1 = Origin::signed(1);
+		let origin1 = Origin::signed(1);
 
-        let data = default_re_fungible_data();
-        create_test_item(1, &data.into());
+		let data = default_re_fungible_data();
+		create_test_item(1, &data.into());
 
-        let variable_data = b"test set_variable_meta_data method.".to_vec();
-        assert_ok!(TemplateModule::set_variable_meta_data(origin1, collection_id, 1, variable_data.clone()));
+		let variable_data = b"test set_variable_meta_data method.".to_vec();
+		assert_ok!(TemplateModule::set_variable_meta_data(
+			origin1,
+			collection_id,
+			1,
+			variable_data.clone()
+		));
 
-        assert_eq!(TemplateModule::refungible_item_id(collection_id, 1).unwrap().variable_data, variable_data);
-    });
+		assert_eq!(
+			TemplateModule::refungible_item_id(collection_id, 1)
+				.unwrap()
+				.variable_data,
+			variable_data
+		);
+	});
 }
 
-
 #[test]
 fn set_variable_meta_data_on_fungible_token_fails() {
-    new_test_ext().execute_with(|| {
-        default_limits();
+	new_test_ext().execute_with(|| {
+		default_limits();
 
-        let collection_id = create_test_collection(&CollectionMode::Fungible(3), 1);
+		let collection_id = create_test_collection(&CollectionMode::Fungible(3), 1);
 
-        let origin1 = Origin::signed(1);
+		let origin1 = Origin::signed(1);
 
-        let data = default_fungible_data();
-        create_test_item(1, &data.into());
+		let data = default_fungible_data();
+		create_test_item(1, &data.into());
 
-        let variable_data = b"test set_variable_meta_data method.".to_vec();
-        assert_noop!(TemplateModule::set_variable_meta_data(origin1, collection_id, 1, variable_data.clone()), Error::<Test>::CantStoreMetadataInFungibleTokens);
-    });
+		let variable_data = b"test set_variable_meta_data method.".to_vec();
+		assert_noop!(
+			TemplateModule::set_variable_meta_data(origin1, collection_id, 1, variable_data),
+			Error::<Test>::CantStoreMetadataInFungibleTokens
+		);
+	});
 }
 
 #[test]
 fn set_variable_meta_data_on_nft_token_fails_for_big_data() {
-    new_test_ext().execute_with(|| {
-        assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
-            collection_numbers_limit: default_collection_numbers_limit(),
-            account_token_ownership_limit: 10,
-            collections_admins_limit: 5,
-            custom_data_limit: 10,
-            nft_sponsor_transfer_timeout: 15,
-            fungible_sponsor_transfer_timeout: 15,
-            refungible_sponsor_transfer_timeout: 15,
-            const_on_chain_schema_limit: 1024,
-            offchain_schema_limit: 1024,
-            variable_on_chain_schema_limit: 1024,
-        }));
+	new_test_ext().execute_with(|| {
+		assert_ok!(TemplateModule::set_chain_limits(
+			RawOrigin::Root.into(),
+			ChainLimits {
+				collection_numbers_limit: default_collection_numbers_limit(),
+				account_token_ownership_limit: 10,
+				collections_admins_limit: 5,
+				custom_data_limit: 10,
+				nft_sponsor_transfer_timeout: 15,
+				fungible_sponsor_transfer_timeout: 15,
+				refungible_sponsor_transfer_timeout: 15,
+				const_on_chain_schema_limit: 1024,
+				offchain_schema_limit: 1024,
+				variable_on_chain_schema_limit: 1024,
+			}
+		));
 
-        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+		let collection_id = create_test_collection(&CollectionMode::NFT, 1);
 
-        let origin1 = Origin::signed(1);
+		let origin1 = Origin::signed(1);
 
-        let data = default_nft_data();
-        create_test_item(1, &data.into());
+		let data = default_nft_data();
+		create_test_item(1, &data.into());
 
-        let variable_data = b"test set_variable_meta_data method, bigger than limits.".to_vec();
-        assert_noop!(TemplateModule::set_variable_meta_data(origin1, collection_id, 1, variable_data), Error::<Test>::TokenVariableDataLimitExceeded);
-    });
+		let variable_data = b"test set_variable_meta_data method, bigger than limits.".to_vec();
+		assert_noop!(
+			TemplateModule::set_variable_meta_data(origin1, collection_id, 1, variable_data),
+			Error::<Test>::TokenVariableDataLimitExceeded
+		);
+	});
 }
 
 #[test]
 fn set_variable_meta_data_on_re_fungible_token_fails_for_big_data() {
-    new_test_ext().execute_with(|| {
-        assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
-            collection_numbers_limit: default_collection_numbers_limit(),
-            account_token_ownership_limit: 10,
-            collections_admins_limit: 5,
-            custom_data_limit: 10,
-            nft_sponsor_transfer_timeout: 15,
-            fungible_sponsor_transfer_timeout: 15,
-            refungible_sponsor_transfer_timeout: 15,
-            const_on_chain_schema_limit: 1024,
-            offchain_schema_limit: 1024,
-            variable_on_chain_schema_limit: 1024,
-        }));
+	new_test_ext().execute_with(|| {
+		assert_ok!(TemplateModule::set_chain_limits(
+			RawOrigin::Root.into(),
+			ChainLimits {
+				collection_numbers_limit: default_collection_numbers_limit(),
+				account_token_ownership_limit: 10,
+				collections_admins_limit: 5,
+				custom_data_limit: 10,
+				nft_sponsor_transfer_timeout: 15,
+				fungible_sponsor_transfer_timeout: 15,
+				refungible_sponsor_transfer_timeout: 15,
+				const_on_chain_schema_limit: 1024,
+				offchain_schema_limit: 1024,
+				variable_on_chain_schema_limit: 1024,
+			}
+		));
 
+		let collection_id = create_test_collection(&CollectionMode::ReFungible, 1);
 
-        let collection_id = create_test_collection(&CollectionMode::ReFungible, 1);
+		let origin1 = Origin::signed(1);
 
-        let origin1 = Origin::signed(1);
-
-        let data = default_re_fungible_data();
-        create_test_item(1, &data.into());
+		let data = default_re_fungible_data();
+		create_test_item(1, &data.into());
 
-        let variable_data = b"test set_variable_meta_data method, bigger than limits.".to_vec();
-        assert_noop!(TemplateModule::set_variable_meta_data(origin1, collection_id, 1, variable_data), Error::<Test>::TokenVariableDataLimitExceeded);
-    });
+		let variable_data = b"test set_variable_meta_data method, bigger than limits.".to_vec();
+		assert_noop!(
+			TemplateModule::set_variable_meta_data(origin1, collection_id, 1, variable_data),
+			Error::<Test>::TokenVariableDataLimitExceeded
+		);
+	});
 }
modifiedpallets/scheduler/src/benchmarking.rsdiffbeforeafterboth
--- a/pallets/scheduler/src/benchmarking.rs
+++ b/pallets/scheduler/src/benchmarking.rs
@@ -31,7 +31,7 @@
 const BLOCK_NUMBER: u32 = 2;
 
 // Add `n` named items to the schedule
-fn fill_schedule<T: Config> (when: T::BlockNumber, n: u32) -> Result<(), &'static str> {
+fn fill_schedule<T: Config>(when: T::BlockNumber, n: u32) -> Result<(), &'static str> {
 	// Essentially a no-op call.
 	let call = frame_system::Call::set_storage(vec![]);
 	for i in 0..n {
@@ -47,7 +47,10 @@
 			call.clone().into(),
 		)?;
 	}
-	ensure!(Agenda::<T>::get(when).len() == n as usize, "didn't fill schedule");
+	ensure!(
+		Agenda::<T>::get(when).len() == n as usize,
+		"didn't fill schedule"
+	);
 	Ok(())
 }
 
@@ -141,8 +144,4 @@
 	}
 }
 
-impl_benchmark_test_suite!(
-	Scheduler,
-	crate::tests::new_test_ext(),
-	crate::tests::Test,
-);
+impl_benchmark_test_suite!(Scheduler, crate::tests::new_test_ext(), crate::tests::Test,);
modifiedpallets/scheduler/src/lib.rsdiffbeforeafterboth
--- a/pallets/scheduler/src/lib.rs
+++ b/pallets/scheduler/src/lib.rs
@@ -50,17 +50,25 @@
 
 // Ensure we're `no_std` when compiling for Wasm.
 #![cfg_attr(not(feature = "std"), no_std)]
+#![allow(clippy::type_complexity, clippy::boxed_local, clippy::unused_unit)]
 
 mod benchmarking;
 pub mod weights;
 
 use sp_std::{prelude::*, marker::PhantomData, borrow::Borrow};
 use codec::{Encode, Decode, Codec};
-use sp_runtime::{RuntimeDebug, traits::{Zero, One, BadOrigin, Saturating}};
+use sp_runtime::{
+	RuntimeDebug,
+	traits::{Zero, One, BadOrigin, Saturating},
+};
 use frame_support::{
 	decl_module, decl_storage, decl_event, decl_error, IterableStorageMap,
 	dispatch::{Dispatchable, DispatchError, DispatchResult, Parameter},
-	traits::{Get, schedule::{self, DispatchTime}, OriginTrait, EnsureOrigin, IsType},
+	traits::{
+		Get,
+		schedule::{self, DispatchTime},
+		OriginTrait, EnsureOrigin, IsType,
+	},
 	weights::{GetDispatchInfo, Weight},
 };
 use frame_system::{self as system, ensure_signed};
@@ -72,22 +80,24 @@
 /// should be added to our implied traits list.
 ///
 /// `system::Config` should always be included in our implied traits.
-/// // 
-pub trait Config: system::Config
-{ 
-
+/// //
+pub trait Config: system::Config {
 	/// The overarching event type.
 	type Event: From<Event<Self>> + Into<<Self as system::Config>::Event>;
 
 	/// The aggregated origin which the dispatch will take.
 	type Origin: OriginTrait<PalletsOrigin = Self::PalletsOrigin>
-		+ From<Self::PalletsOrigin> + IsType<<Self as system::Config>::Origin>;
+		+ From<Self::PalletsOrigin>
+		+ IsType<<Self as system::Config>::Origin>;
 
 	/// The caller origin, overarching type of all pallets origins.
 	type PalletsOrigin: From<system::RawOrigin<Self::AccountId>> + Codec + Clone + Eq;
 
 	/// The aggregated call type.
-	type Call: Parameter + Dispatchable<Origin=<Self as Config>::Origin> + GetDispatchInfo + From<system::Call<Self>>;
+	type Call: Parameter
+		+ Dispatchable<Origin = <Self as Config>::Origin>
+		+ GetDispatchInfo
+		+ From<system::Call<Self>>;
 
 	/// The maximum weight that may be scheduled per block for any dispatchables of less priority
 	/// than `schedule::HARD_DEADLINE`.
@@ -141,7 +151,8 @@
 }
 
 /// The current version of Scheduled struct.
-pub type Scheduled<Call, BlockNumber, PalletsOrigin, AccountId> = ScheduledV2<Call, BlockNumber, PalletsOrigin, AccountId>;
+pub type Scheduled<Call, BlockNumber, PalletsOrigin, AccountId> =
+	ScheduledV2<Call, BlockNumber, PalletsOrigin, AccountId>;
 
 // A value placed in storage that represents the current version of the Scheduler storage.
 // This value is used by the `on_runtime_upgrade` logic to determine whether we run
@@ -160,7 +171,6 @@
 
 #[derive(Encode, Decode, Clone, PartialEq, Eq, RuntimeDebug)]
 pub struct CallSpec {
-
 	module: u32,
 	method: u32,
 }
@@ -172,7 +182,7 @@
 			=> Vec<Option<Scheduled<<T as Config>::Call, T::BlockNumber, T::PalletsOrigin, T::AccountId>>>;
 
 		pub SpecAgenda: map hasher(twox_64_concat) T::BlockNumber
-			=> Vec<Option<CallSpec>>;			
+			=> Vec<Option<CallSpec>>;
 
 		/// Lookup from identity to the block number and index of the task.
 		Lookup: map hasher(twox_64_concat) Vec<u8> => Option<TaskAddress<T::BlockNumber>>;
@@ -210,8 +220,8 @@
 
 decl_module! {
 	/// Scheduler module declaration.
-	pub struct Module<T: Config> for enum Call 
-	where 
+	pub struct Module<T: Config> for enum Call
+	where
 		origin: <T as system::Config>::Origin
 	{
 		type Error = Error<T>;
@@ -234,7 +244,7 @@
 			maybe_periodic: Option<schedule::Period<T::BlockNumber>>,
 			priority: schedule::Priority,
 			call: Box<<T as Config>::Call>,
-		) 
+		)
 		{
 			let origin = <T as Config>::Origin::from(origin);
 			Self::do_schedule(DispatchTime::At(when), maybe_periodic, priority, origin.caller().clone(), *call)?;
@@ -402,12 +412,12 @@
 						let origin = <<T as Config>::Origin as From<T::PalletsOrigin>>::from(
 							s.origin.clone()
 						).into();
-						let sender = ensure_signed(origin).unwrap_or(T::AccountId::default());
+						let sender = ensure_signed(origin).unwrap_or_default();
 						let who_will_pay = T::SponsorshipHandler::get_sponsor(&sender, &s.call).unwrap_or(sender);
 						let sponsor = T::PalletsOrigin::from(system::RawOrigin::Signed(who_will_pay));
 						let r = s.call.clone().dispatch(sponsor.into());
 						let maybe_id = s.maybe_id.clone();
-						if let &Some((period, count)) = &s.maybe_periodic {
+						if let Some((period, count)) = s.maybe_periodic {
 							if count > 1 {
 								s.maybe_periodic = Some((period, count - 1));
 							} else {
@@ -420,11 +430,9 @@
 								Lookup::<T>::insert(id, (next, next_index as u32));
 							}
 							Agenda::<T>::append(next, Some(s));
-						} else {
-							if let Some(ref id) = s.maybe_id {
-								Lookup::<T>::remove(id);
-							}
-						}
+						} else if let Some(ref id) = s.maybe_id {
+									  Lookup::<T>::remove(id);
+								  }
 						Self::deposit_event(RawEvent::Dispatched(
 							(now, index),
 							maybe_id,
@@ -454,20 +462,25 @@
 			StorageVersion::put(Releases::V2);
 
 			Agenda::<T>::translate::<
-				Vec<Option<ScheduledV1<<T as Config>::Call, T::BlockNumber>>>, _
-			>(|_, agenda| Some(
-				agenda
-					.into_iter()
-					.map(|schedule| schedule.map(|schedule| ScheduledV2 {
-						maybe_id: schedule.maybe_id,
-						priority: schedule.priority,
-						call: schedule.call,
-						maybe_periodic: schedule.maybe_periodic,
-						origin: system::RawOrigin::Root.into(),
-						_phantom: Default::default(),
-					}))
-					.collect::<Vec<_>>()
-			));
+				Vec<Option<ScheduledV1<<T as Config>::Call, T::BlockNumber>>>,
+				_,
+			>(|_, agenda| {
+				Some(
+					agenda
+						.into_iter()
+						.map(|schedule| {
+							schedule.map(|schedule| ScheduledV2 {
+								maybe_id: schedule.maybe_id,
+								priority: schedule.priority,
+								call: schedule.call,
+								maybe_periodic: schedule.maybe_periodic,
+								origin: system::RawOrigin::Root.into(),
+								_phantom: Default::default(),
+							})
+						})
+						.collect::<Vec<_>>(),
+				)
+			});
 
 			true
 		} else {
@@ -478,20 +491,25 @@
 	/// Helper to migrate scheduler when the pallet origin type has changed.
 	pub fn migrate_origin<OldOrigin: Into<T::PalletsOrigin> + codec::Decode>() {
 		Agenda::<T>::translate::<
-			Vec<Option<Scheduled<<T as Config>::Call, T::BlockNumber, OldOrigin, T::AccountId>>>, _
-		>(|_, agenda| Some(
-			agenda
-				.into_iter()
-				.map(|schedule| schedule.map(|schedule| Scheduled {
-					maybe_id: schedule.maybe_id,
-					priority: schedule.priority,
-					call: schedule.call,
-					maybe_periodic: schedule.maybe_periodic,
-					origin: schedule.origin.into(),
-					_phantom: Default::default(),
-				}))
-				.collect::<Vec<_>>()
-		));
+			Vec<Option<Scheduled<<T as Config>::Call, T::BlockNumber, OldOrigin, T::AccountId>>>,
+			_,
+		>(|_, agenda| {
+			Some(
+				agenda
+					.into_iter()
+					.map(|schedule| {
+						schedule.map(|schedule| Scheduled {
+							maybe_id: schedule.maybe_id,
+							priority: schedule.priority,
+							call: schedule.call,
+							maybe_periodic: schedule.maybe_periodic,
+							origin: schedule.origin.into(),
+							_phantom: Default::default(),
+						})
+					})
+					.collect::<Vec<_>>(),
+			)
+		});
 	}
 
 	fn resolve_time(when: DispatchTime<T::BlockNumber>) -> Result<T::BlockNumber, DispatchError> {
@@ -501,11 +519,11 @@
 			DispatchTime::At(x) => x,
 			// The current block has already completed it's scheduled tasks, so
 			// Schedule the task at lest one block after this current block.
-			DispatchTime::After(x) => now.saturating_add(x).saturating_add(One::one())
+			DispatchTime::After(x) => now.saturating_add(x).saturating_add(One::one()),
 		};
 
 		if when <= now {
-			return Err(Error::<T>::TargetBlockNumberInPast.into())
+			return Err(Error::<T>::TargetBlockNumberInPast.into());
 		}
 
 		Ok(when)
@@ -516,7 +534,7 @@
 		maybe_periodic: Option<schedule::Period<T::BlockNumber>>,
 		priority: schedule::Priority,
 		origin: T::PalletsOrigin,
-		call: <T as Config>::Call
+		call: <T as Config>::Call,
 	) -> Result<TaskAddress<T::BlockNumber>, DispatchError> {
 		let when = Self::resolve_time(when)?;
 
@@ -526,7 +544,12 @@
 			// Remove one from the number of repetitions since we will schedule one now.
 			.map(|(p, c)| (p, c - 1));
 		let s = Some(Scheduled {
-			maybe_id: None, priority, call, maybe_periodic, origin, _phantom: PhantomData::<T::AccountId>::default(),
+			maybe_id: None,
+			priority,
+			call,
+			maybe_periodic,
+			origin,
+			_phantom: PhantomData::<T::AccountId>::default(),
 		});
 		Agenda::<T>::append(when, s);
 		let index = Agenda::<T>::decode_len(when).unwrap_or(1) as u32 - 1;
@@ -544,22 +567,21 @@
 
 	fn do_cancel(
 		origin: Option<T::PalletsOrigin>,
-		(when, index): TaskAddress<T::BlockNumber>
+		(when, index): TaskAddress<T::BlockNumber>,
 	) -> Result<(), DispatchError> {
-		let scheduled = Agenda::<T>::try_mutate(
-			when,
-			|agenda| {
-				agenda.get_mut(index as usize)
-					.map_or(Ok(None), |s| -> Result<Option<Scheduled<_, _, _, _>>, DispatchError> {
-						if let (Some(ref o), Some(ref s)) = (origin, s.borrow()) {
-							if *o != s.origin {
-								return Err(BadOrigin.into());
-							}
-						};
-						Ok(s.take())
-					})
-			},
-		)?;
+		let scheduled = Agenda::<T>::try_mutate(when, |agenda| {
+			agenda.get_mut(index as usize).map_or(
+				Ok(None),
+				|s| -> Result<Option<Scheduled<_, _, _, _>>, DispatchError> {
+					if let (Some(ref o), Some(ref s)) = (origin, s.borrow()) {
+						if *o != s.origin {
+							return Err(BadOrigin.into());
+						}
+					};
+					Ok(s.take())
+				},
+			)
+		})?;
 		if let Some(s) = scheduled {
 			if let Some(id) = s.maybe_id {
 				Lookup::<T>::remove(id);
@@ -567,7 +589,7 @@
 			Self::deposit_event(RawEvent::Canceled(when, index));
 			Ok(())
 		} else {
-			Err(Error::<T>::NotFound)?
+			Err(Error::<T>::NotFound.into())
 		}
 	}
 
@@ -605,7 +627,7 @@
 	) -> Result<TaskAddress<T::BlockNumber>, DispatchError> {
 		// ensure id it is unique
 		if Lookup::<T>::contains_key(&id) {
-			return Err(Error::<T>::FailedToSchedule)?
+			return Err(Error::<T>::FailedToSchedule.into());
 		}
 
 		let when = Self::resolve_time(when)?;
@@ -617,7 +639,12 @@
 			.map(|(p, c)| (p, c - 1));
 
 		let s = Scheduled {
-			maybe_id: Some(id.clone()), priority, call, maybe_periodic, origin, _phantom: Default::default()
+			maybe_id: Some(id.clone()),
+			priority,
+			call,
+			maybe_periodic,
+			origin,
+			_phantom: Default::default(),
 		};
 		Agenda::<T>::append(when, Some(s));
 		let index = Agenda::<T>::decode_len(when).unwrap_or(1) as u32 - 1;
@@ -653,7 +680,7 @@
 				Self::deposit_event(RawEvent::Canceled(when, index));
 				Ok(())
 			} else {
-				Err(Error::<T>::NotFound)?
+				Err(Error::<T>::NotFound.into())
 			}
 		})
 	}
@@ -664,33 +691,38 @@
 	) -> Result<TaskAddress<T::BlockNumber>, DispatchError> {
 		let new_time = Self::resolve_time(new_time)?;
 
-		Lookup::<T>::try_mutate_exists(id, |lookup| -> Result<TaskAddress<T::BlockNumber>, DispatchError> {
-			let (when, index) = lookup.ok_or(Error::<T>::NotFound)?;
+		Lookup::<T>::try_mutate_exists(
+			id,
+			|lookup| -> Result<TaskAddress<T::BlockNumber>, DispatchError> {
+				let (when, index) = lookup.ok_or(Error::<T>::NotFound)?;
 
-			if new_time == when {
-				return Err(Error::<T>::RescheduleNoChange.into());
-			}
+				if new_time == when {
+					return Err(Error::<T>::RescheduleNoChange.into());
+				}
 
-			Agenda::<T>::try_mutate(when, |agenda| -> DispatchResult {
-				let task = agenda.get_mut(index as usize).ok_or(Error::<T>::NotFound)?;
-				let task = task.take().ok_or(Error::<T>::NotFound)?;
-				Agenda::<T>::append(new_time, Some(task));
+				Agenda::<T>::try_mutate(when, |agenda| -> DispatchResult {
+					let task = agenda.get_mut(index as usize).ok_or(Error::<T>::NotFound)?;
+					let task = task.take().ok_or(Error::<T>::NotFound)?;
+					Agenda::<T>::append(new_time, Some(task));
 
-				Ok(())
-			})?;
+					Ok(())
+				})?;
 
-			let new_index = Agenda::<T>::decode_len(new_time).unwrap_or(1) as u32 - 1;
-			Self::deposit_event(RawEvent::Canceled(when, index));
-			Self::deposit_event(RawEvent::Scheduled(new_time, new_index));
+				let new_index = Agenda::<T>::decode_len(new_time).unwrap_or(1) as u32 - 1;
+				Self::deposit_event(RawEvent::Canceled(when, index));
+				Self::deposit_event(RawEvent::Scheduled(new_time, new_index));
 
-			*lookup = Some((new_time, new_index));
+				*lookup = Some((new_time, new_index));
 
-			Ok((new_time, new_index))
-		})
+				Ok((new_time, new_index))
+			},
+		)
 	}
 }
 
-impl<T: Config> schedule::Anon<T::BlockNumber, <T as Config>::Call, T::PalletsOrigin> for Module<T> {
+impl<T: Config> schedule::Anon<T::BlockNumber, <T as Config>::Call, T::PalletsOrigin>
+	for Module<T>
+{
 	type Address = TaskAddress<T::BlockNumber>;
 
 	fn schedule(
@@ -698,7 +730,7 @@
 		maybe_periodic: Option<schedule::Period<T::BlockNumber>>,
 		priority: schedule::Priority,
 		origin: T::PalletsOrigin,
-		call: <T as Config>::Call
+		call: <T as Config>::Call,
 	) -> Result<Self::Address, DispatchError> {
 		Self::do_schedule(when, maybe_periodic, priority, origin, call)
 	}
@@ -715,11 +747,16 @@
 	}
 
 	fn next_dispatch_time((when, index): Self::Address) -> Result<T::BlockNumber, ()> {
-		Agenda::<T>::get(when).get(index as usize).ok_or(()).map(|_| when)
+		Agenda::<T>::get(when)
+			.get(index as usize)
+			.ok_or(())
+			.map(|_| when)
 	}
 }
 
-impl<T: Config> schedule::Named<T::BlockNumber, <T as Config>::Call, T::PalletsOrigin> for Module<T> {
+impl<T: Config> schedule::Named<T::BlockNumber, <T as Config>::Call, T::PalletsOrigin>
+	for Module<T>
+{
 	type Address = TaskAddress<T::BlockNumber>;
 
 	fn schedule_named(
@@ -745,17 +782,19 @@
 	}
 
 	fn next_dispatch_time(id: Vec<u8>) -> Result<T::BlockNumber, ()> {
-		Lookup::<T>::get(id).and_then(|(when, index)| Agenda::<T>::get(when).get(index as usize).map(|_| when)).ok_or(())
+		Lookup::<T>::get(id)
+			.and_then(|(when, index)| Agenda::<T>::get(when).get(index as usize).map(|_| when))
+			.ok_or(())
 	}
 }
 
 #[cfg(test)]
+#[allow(clippy::from_over_into)]
 mod tests {
 	use super::*;
 
 	use frame_support::{
-		parameter_types, assert_ok, ord_parameter_types,
-		assert_noop, assert_err, Hashable,
+		parameter_types, assert_ok, ord_parameter_types, assert_noop, assert_err, Hashable,
 		traits::{OnInitialize, OnFinalize, Filter},
 		weights::constants::RocksDbWeight,
 	};
@@ -887,11 +926,13 @@
 		type ScheduleOrigin = EnsureOneOf<u64, EnsureRoot<u64>, EnsureSignedBy<One, u64>>;
 		type MaxScheduledPerBlock = MaxScheduledPerBlock;
 		type WeightInfo = ();
-        type SponsorshipHandler = ();
+		type SponsorshipHandler = ();
 	}
 
 	pub fn new_test_ext() -> sp_io::TestExternalities {
-		let t = system::GenesisConfig::default().build_storage::<Test>().unwrap();
+		let t = system::GenesisConfig::default()
+			.build_storage::<Test>()
+			.unwrap();
 		t.into()
 	}
 
@@ -911,8 +952,16 @@
 	fn basic_scheduling_works() {
 		new_test_ext().execute_with(|| {
 			let call = Call::Logger(logger::Call::log(42, 1000));
-			assert!(!<Test as frame_system::Config>::BaseCallFilter::filter(&call));
-			assert_ok!(Scheduler::do_schedule(DispatchTime::At(4), None, 127, root(), call));
+			assert!(!<Test as frame_system::Config>::BaseCallFilter::filter(
+				&call
+			));
+			assert_ok!(Scheduler::do_schedule(
+				DispatchTime::At(4),
+				None,
+				127,
+				root(),
+				call
+			));
 			run_to_block(3);
 			assert!(logger::log().is_empty());
 			run_to_block(4);
@@ -927,9 +976,17 @@
 		new_test_ext().execute_with(|| {
 			run_to_block(2);
 			let call = Call::Logger(logger::Call::log(42, 1000));
-			assert!(!<Test as frame_system::Config>::BaseCallFilter::filter(&call));
+			assert!(!<Test as frame_system::Config>::BaseCallFilter::filter(
+				&call
+			));
 			// This will schedule the call 3 blocks after the next block... so block 3 + 3 = 6
-			assert_ok!(Scheduler::do_schedule(DispatchTime::After(3), None, 127, root(), call));
+			assert_ok!(Scheduler::do_schedule(
+				DispatchTime::After(3),
+				None,
+				127,
+				root(),
+				call
+			));
 			run_to_block(5);
 			assert!(logger::log().is_empty());
 			run_to_block(6);
@@ -944,8 +1001,16 @@
 		new_test_ext().execute_with(|| {
 			run_to_block(2);
 			let call = Call::Logger(logger::Call::log(42, 1000));
-			assert!(!<Test as frame_system::Config>::BaseCallFilter::filter(&call));
-			assert_ok!(Scheduler::do_schedule(DispatchTime::After(0), None, 127, root(), call));
+			assert!(!<Test as frame_system::Config>::BaseCallFilter::filter(
+				&call
+			));
+			assert_ok!(Scheduler::do_schedule(
+				DispatchTime::After(0),
+				None,
+				127,
+				root(),
+				call
+			));
 			// Will trigger on the next block.
 			run_to_block(3);
 			assert_eq!(logger::log(), vec![(root(), 42u32)]);
@@ -959,7 +1024,11 @@
 		new_test_ext().execute_with(|| {
 			// at #4, every 3 blocks, 3 times.
 			assert_ok!(Scheduler::do_schedule(
-				DispatchTime::At(4), Some((3, 3)), 127, root(), Call::Logger(logger::Call::log(42, 1000))
+				DispatchTime::At(4),
+				Some((3, 3)),
+				127,
+				root(),
+				Call::Logger(logger::Call::log(42, 1000))
 			));
 			run_to_block(3);
 			assert!(logger::log().is_empty());
@@ -972,9 +1041,15 @@
 			run_to_block(9);
 			assert_eq!(logger::log(), vec![(root(), 42u32), (root(), 42u32)]);
 			run_to_block(10);
-			assert_eq!(logger::log(), vec![(root(), 42u32), (root(), 42u32), (root(), 42u32)]);
+			assert_eq!(
+				logger::log(),
+				vec![(root(), 42u32), (root(), 42u32), (root(), 42u32)]
+			);
 			run_to_block(100);
-			assert_eq!(logger::log(), vec![(root(), 42u32), (root(), 42u32), (root(), 42u32)]);
+			assert_eq!(
+				logger::log(),
+				vec![(root(), 42u32), (root(), 42u32), (root(), 42u32)]
+			);
 		});
 	}
 
@@ -982,15 +1057,26 @@
 	fn reschedule_works() {
 		new_test_ext().execute_with(|| {
 			let call = Call::Logger(logger::Call::log(42, 1000));
-			assert!(!<Test as frame_system::Config>::BaseCallFilter::filter(&call));
-			assert_eq!(Scheduler::do_schedule(DispatchTime::At(4), None, 127, root(), call).unwrap(), (4, 0));
+			assert!(!<Test as frame_system::Config>::BaseCallFilter::filter(
+				&call
+			));
+			assert_eq!(
+				Scheduler::do_schedule(DispatchTime::At(4), None, 127, root(), call).unwrap(),
+				(4, 0)
+			);
 
 			run_to_block(3);
 			assert!(logger::log().is_empty());
 
-			assert_eq!(Scheduler::do_reschedule((4, 0), DispatchTime::At(6)).unwrap(), (6, 0));
+			assert_eq!(
+				Scheduler::do_reschedule((4, 0), DispatchTime::At(6)).unwrap(),
+				(6, 0)
+			);
 
-			assert_noop!(Scheduler::do_reschedule((6, 0), DispatchTime::At(6)), Error::<Test>::RescheduleNoChange);
+			assert_noop!(
+				Scheduler::do_reschedule((6, 0), DispatchTime::At(6)),
+				Error::<Test>::RescheduleNoChange
+			);
 
 			run_to_block(4);
 			assert!(logger::log().is_empty());
@@ -1007,17 +1093,34 @@
 	fn reschedule_named_works() {
 		new_test_ext().execute_with(|| {
 			let call = Call::Logger(logger::Call::log(42, 1000));
-			assert!(!<Test as frame_system::Config>::BaseCallFilter::filter(&call));
-			assert_eq!(Scheduler::do_schedule_named(
-				1u32.encode(), DispatchTime::At(4), None, 127, root(), call
-			).unwrap(), (4, 0));
+			assert!(!<Test as frame_system::Config>::BaseCallFilter::filter(
+				&call
+			));
+			assert_eq!(
+				Scheduler::do_schedule_named(
+					1u32.encode(),
+					DispatchTime::At(4),
+					None,
+					127,
+					root(),
+					call
+				)
+				.unwrap(),
+				(4, 0)
+			);
 
 			run_to_block(3);
 			assert!(logger::log().is_empty());
 
-			assert_eq!(Scheduler::do_reschedule_named(1u32.encode(), DispatchTime::At(6)).unwrap(), (6, 0));
+			assert_eq!(
+				Scheduler::do_reschedule_named(1u32.encode(), DispatchTime::At(6)).unwrap(),
+				(6, 0)
+			);
 
-			assert_noop!(Scheduler::do_reschedule_named(1u32.encode(), DispatchTime::At(6)), Error::<Test>::RescheduleNoChange);
+			assert_noop!(
+				Scheduler::do_reschedule_named(1u32.encode(), DispatchTime::At(6)),
+				Error::<Test>::RescheduleNoChange
+			);
 
 			run_to_block(4);
 			assert!(logger::log().is_empty());
@@ -1034,16 +1137,33 @@
 	fn reschedule_named_perodic_works() {
 		new_test_ext().execute_with(|| {
 			let call = Call::Logger(logger::Call::log(42, 1000));
-			assert!(!<Test as frame_system::Config>::BaseCallFilter::filter(&call));
-			assert_eq!(Scheduler::do_schedule_named(
-				1u32.encode(), DispatchTime::At(4), Some((3, 3)), 127, root(), call
-			).unwrap(), (4, 0));
+			assert!(!<Test as frame_system::Config>::BaseCallFilter::filter(
+				&call
+			));
+			assert_eq!(
+				Scheduler::do_schedule_named(
+					1u32.encode(),
+					DispatchTime::At(4),
+					Some((3, 3)),
+					127,
+					root(),
+					call
+				)
+				.unwrap(),
+				(4, 0)
+			);
 
 			run_to_block(3);
 			assert!(logger::log().is_empty());
 
-			assert_eq!(Scheduler::do_reschedule_named(1u32.encode(), DispatchTime::At(5)).unwrap(), (5, 0));
-			assert_eq!(Scheduler::do_reschedule_named(1u32.encode(), DispatchTime::At(6)).unwrap(), (6, 0));
+			assert_eq!(
+				Scheduler::do_reschedule_named(1u32.encode(), DispatchTime::At(5)).unwrap(),
+				(5, 0)
+			);
+			assert_eq!(
+				Scheduler::do_reschedule_named(1u32.encode(), DispatchTime::At(6)).unwrap(),
+				(6, 0)
+			);
 
 			run_to_block(5);
 			assert!(logger::log().is_empty());
@@ -1051,7 +1171,10 @@
 			run_to_block(6);
 			assert_eq!(logger::log(), vec![(root(), 42u32)]);
 
-			assert_eq!(Scheduler::do_reschedule_named(1u32.encode(), DispatchTime::At(10)).unwrap(), (10, 0));
+			assert_eq!(
+				Scheduler::do_reschedule_named(1u32.encode(), DispatchTime::At(10)).unwrap(),
+				(10, 0)
+			);
 
 			run_to_block(9);
 			assert_eq!(logger::log(), vec![(root(), 42u32)]);
@@ -1060,10 +1183,16 @@
 			assert_eq!(logger::log(), vec![(root(), 42u32), (root(), 42u32)]);
 
 			run_to_block(13);
-			assert_eq!(logger::log(), vec![(root(), 42u32), (root(), 42u32), (root(), 42u32)]);
+			assert_eq!(
+				logger::log(),
+				vec![(root(), 42u32), (root(), 42u32), (root(), 42u32)]
+			);
 
 			run_to_block(100);
-			assert_eq!(logger::log(), vec![(root(), 42u32), (root(), 42u32), (root(), 42u32)]);
+			assert_eq!(
+				logger::log(),
+				vec![(root(), 42u32), (root(), 42u32), (root(), 42u32)]
+			);
 		});
 	}
 
@@ -1072,11 +1201,22 @@
 		new_test_ext().execute_with(|| {
 			// at #4.
 			Scheduler::do_schedule_named(
-				1u32.encode(), DispatchTime::At(4), None, 127, root(), Call::Logger(logger::Call::log(69, 1000))
-			).unwrap();
+				1u32.encode(),
+				DispatchTime::At(4),
+				None,
+				127,
+				root(),
+				Call::Logger(logger::Call::log(69, 1000)),
+			)
+			.unwrap();
 			let i = Scheduler::do_schedule(
-				DispatchTime::At(4), None, 127, root(), Call::Logger(logger::Call::log(42, 1000))
-			).unwrap();
+				DispatchTime::At(4),
+				None,
+				127,
+				root(),
+				Call::Logger(logger::Call::log(42, 1000)),
+			)
+			.unwrap();
 			run_to_block(3);
 			assert!(logger::log().is_empty());
 			assert_ok!(Scheduler::do_cancel_named(None, 1u32.encode()));
@@ -1096,8 +1236,9 @@
 				Some((3, 3)),
 				127,
 				root(),
-				Call::Logger(logger::Call::log(42, 1000))
-			).unwrap();
+				Call::Logger(logger::Call::log(42, 1000)),
+			)
+			.unwrap();
 			// same id results in error.
 			assert!(Scheduler::do_schedule_named(
 				1u32.encode(),
@@ -1106,11 +1247,18 @@
 				127,
 				root(),
 				Call::Logger(logger::Call::log(69, 1000))
-			).is_err());
+			)
+			.is_err());
 			// different id is ok.
 			Scheduler::do_schedule_named(
-				2u32.encode(), DispatchTime::At(8), None, 127, root(), Call::Logger(logger::Call::log(69, 1000))
-			).unwrap();
+				2u32.encode(),
+				DispatchTime::At(8),
+				None,
+				127,
+				root(),
+				Call::Logger(logger::Call::log(69, 1000)),
+			)
+			.unwrap();
 			run_to_block(3);
 			assert!(logger::log().is_empty());
 			run_to_block(4);
@@ -1136,7 +1284,8 @@
 				DispatchTime::At(4),
 				None,
 				127,
-				root(), Call::Logger(logger::Call::log(69, MaximumSchedulerWeight::get() / 2))
+				root(),
+				Call::Logger(logger::Call::log(69, MaximumSchedulerWeight::get() / 2))
 			));
 			// 69 and 42 do not fit together
 			run_to_block(4);
@@ -1198,19 +1347,22 @@
 				DispatchTime::At(4),
 				None,
 				255,
-				root(), Call::Logger(logger::Call::log(42, MaximumSchedulerWeight::get() / 3))
+				root(),
+				Call::Logger(logger::Call::log(42, MaximumSchedulerWeight::get() / 3))
 			));
 			assert_ok!(Scheduler::do_schedule(
 				DispatchTime::At(4),
 				None,
 				127,
-				root(), Call::Logger(logger::Call::log(69, MaximumSchedulerWeight::get() / 2))
+				root(),
+				Call::Logger(logger::Call::log(69, MaximumSchedulerWeight::get() / 2))
 			));
 			assert_ok!(Scheduler::do_schedule(
 				DispatchTime::At(4),
 				None,
 				126,
-				root(), Call::Logger(logger::Call::log(2600, MaximumSchedulerWeight::get() / 2))
+				root(),
+				Call::Logger(logger::Call::log(2600, MaximumSchedulerWeight::get() / 2))
 			));
 
 			// 2600 does not fit with 69 or 42, but has higher priority, so will go through
@@ -1218,25 +1370,32 @@
 			assert_eq!(logger::log(), vec![(root(), 2600u32)]);
 			// 69 and 42 fit together
 			run_to_block(5);
-			assert_eq!(logger::log(), vec![(root(), 2600u32), (root(), 69u32), (root(), 42u32)]);
+			assert_eq!(
+				logger::log(),
+				vec![(root(), 2600u32), (root(), 69u32), (root(), 42u32)]
+			);
 		});
 	}
 
 	#[test]
 	fn on_initialize_weight_is_correct() {
 		new_test_ext().execute_with(|| {
-			let base_weight: Weight = <Test as frame_system::Config>::DbWeight::get().reads_writes(1, 2);
+			let base_weight: Weight =
+				<Test as frame_system::Config>::DbWeight::get().reads_writes(1, 2);
 			let base_multiplier = 0;
 			let named_multiplier = <Test as frame_system::Config>::DbWeight::get().writes(1);
-			let periodic_multiplier = <Test as frame_system::Config>::DbWeight::get().reads_writes(1, 1);
+			let periodic_multiplier =
+				<Test as frame_system::Config>::DbWeight::get().reads_writes(1, 1);
 
 			// Named
-			assert_ok!(
-				Scheduler::do_schedule_named(
-					1u32.encode(), DispatchTime::At(1), None, 255, root(),
-					Call::Logger(logger::Call::log(3, MaximumSchedulerWeight::get() / 3))
-				)
-			);
+			assert_ok!(Scheduler::do_schedule_named(
+				1u32.encode(),
+				DispatchTime::At(1),
+				None,
+				255,
+				root(),
+				Call::Logger(logger::Call::log(3, MaximumSchedulerWeight::get() / 3))
+			));
 			// Anon Periodic
 			assert_ok!(Scheduler::do_schedule(
 				DispatchTime::At(1),
@@ -1255,29 +1414,53 @@
 			));
 			// Named Periodic
 			assert_ok!(Scheduler::do_schedule_named(
-				2u32.encode(), DispatchTime::At(1), Some((1000, 3)), 126, root(),
-				Call::Logger(logger::Call::log(2600, MaximumSchedulerWeight::get() / 2)))
-			);
+				2u32.encode(),
+				DispatchTime::At(1),
+				Some((1000, 3)),
+				126,
+				root(),
+				Call::Logger(logger::Call::log(2600, MaximumSchedulerWeight::get() / 2))
+			));
 
 			// Will include the named periodic only
 			let actual_weight = Scheduler::on_initialize(1);
 			let call_weight = MaximumSchedulerWeight::get() / 2;
 			assert_eq!(
-				actual_weight, call_weight + base_weight + base_multiplier + named_multiplier + periodic_multiplier
+				actual_weight,
+				call_weight
+					+ base_weight + base_multiplier
+					+ named_multiplier + periodic_multiplier
 			);
 			assert_eq!(logger::log(), vec![(root(), 2600u32)]);
 
 			// Will include anon and anon periodic
 			let actual_weight = Scheduler::on_initialize(2);
 			let call_weight = MaximumSchedulerWeight::get() / 2 + MaximumSchedulerWeight::get() / 3;
-			assert_eq!(actual_weight, call_weight + base_weight + base_multiplier * 2 + periodic_multiplier);
-			assert_eq!(logger::log(), vec![(root(), 2600u32), (root(), 69u32), (root(), 42u32)]);
+			assert_eq!(
+				actual_weight,
+				call_weight + base_weight + base_multiplier * 2 + periodic_multiplier
+			);
+			assert_eq!(
+				logger::log(),
+				vec![(root(), 2600u32), (root(), 69u32), (root(), 42u32)]
+			);
 
 			// Will include named only
 			let actual_weight = Scheduler::on_initialize(3);
 			let call_weight = MaximumSchedulerWeight::get() / 3;
-			assert_eq!(actual_weight, call_weight + base_weight + base_multiplier + named_multiplier);
-			assert_eq!(logger::log(), vec![(root(), 2600u32), (root(), 69u32), (root(), 42u32), (root(), 3u32)]);
+			assert_eq!(
+				actual_weight,
+				call_weight + base_weight + base_multiplier + named_multiplier
+			);
+			assert_eq!(
+				logger::log(),
+				vec![
+					(root(), 2600u32),
+					(root(), 69u32),
+					(root(), 42u32),
+					(root(), 3u32)
+				]
+			);
 
 			// Will contain none
 			let actual_weight = Scheduler::on_initialize(4);
@@ -1290,7 +1473,14 @@
 		new_test_ext().execute_with(|| {
 			let call = Box::new(Call::Logger(logger::Call::log(69, 1000)));
 			let call2 = Box::new(Call::Logger(logger::Call::log(42, 1000)));
-			assert_ok!(Scheduler::schedule_named(Origin::root(), 1u32.encode(), 4, None, 127, call));
+			assert_ok!(Scheduler::schedule_named(
+				Origin::root(),
+				1u32.encode(),
+				4,
+				None,
+				127,
+				call
+			));
 			assert_ok!(Scheduler::schedule(Origin::root(), 4, None, 127, call2));
 			run_to_block(3);
 			// Scheduled calls are in the agenda.
@@ -1334,15 +1524,29 @@
 		new_test_ext().execute_with(|| {
 			let call = Box::new(Call::Logger(logger::Call::log(69, 1000)));
 			let call2 = Box::new(Call::Logger(logger::Call::log(42, 1000)));
-			assert_ok!(
-				Scheduler::schedule_named(system::RawOrigin::Signed(1).into(), 1u32.encode(), 4, None, 127, call)
-			);
-			assert_ok!(Scheduler::schedule(system::RawOrigin::Signed(1).into(), 4, None, 127, call2));
+			assert_ok!(Scheduler::schedule_named(
+				system::RawOrigin::Signed(1).into(),
+				1u32.encode(),
+				4,
+				None,
+				127,
+				call
+			));
+			assert_ok!(Scheduler::schedule(
+				system::RawOrigin::Signed(1).into(),
+				4,
+				None,
+				127,
+				call2
+			));
 			run_to_block(3);
 			// Scheduled calls are in the agenda.
 			assert_eq!(Agenda::<Test>::get(4).len(), 2);
 			assert!(logger::log().is_empty());
-			assert_ok!(Scheduler::cancel_named(system::RawOrigin::Signed(1).into(), 1u32.encode()));
+			assert_ok!(Scheduler::cancel_named(
+				system::RawOrigin::Signed(1).into(),
+				1u32.encode()
+			));
 			assert_ok!(Scheduler::cancel(system::RawOrigin::Signed(1).into(), 4, 1));
 			// Scheduled calls are made NONE, so should not effect state
 			run_to_block(100);
@@ -1356,10 +1560,20 @@
 			let call = Box::new(Call::Logger(logger::Call::log(69, 1000)));
 			let call2 = Box::new(Call::Logger(logger::Call::log(42, 1000)));
 			assert_noop!(
-				Scheduler::schedule_named(system::RawOrigin::Signed(2).into(), 1u32.encode(), 4, None, 127, call),
+				Scheduler::schedule_named(
+					system::RawOrigin::Signed(2).into(),
+					1u32.encode(),
+					4,
+					None,
+					127,
+					call
+				),
 				BadOrigin
 			);
-			assert_noop!(Scheduler::schedule(system::RawOrigin::Signed(2).into(), 4, None, 127, call2), BadOrigin);
+			assert_noop!(
+				Scheduler::schedule(system::RawOrigin::Signed(2).into(), 4, None, 127, call2),
+				BadOrigin
+			);
 		});
 	}
 
@@ -1368,22 +1582,48 @@
 		new_test_ext().execute_with(|| {
 			let call = Box::new(Call::Logger(logger::Call::log_without_filter(69, 1000)));
 			let call2 = Box::new(Call::Logger(logger::Call::log_without_filter(42, 1000)));
-			assert_ok!(
-				Scheduler::schedule_named(system::RawOrigin::Signed(1).into(), 1u32.encode(), 4, None, 127, call)
-			);
-			assert_ok!(Scheduler::schedule(system::RawOrigin::Signed(1).into(), 4, None, 127, call2));
+			assert_ok!(Scheduler::schedule_named(
+				system::RawOrigin::Signed(1).into(),
+				1u32.encode(),
+				4,
+				None,
+				127,
+				call
+			));
+			assert_ok!(Scheduler::schedule(
+				system::RawOrigin::Signed(1).into(),
+				4,
+				None,
+				127,
+				call2
+			));
 			run_to_block(3);
 			// Scheduled calls are in the agenda.
 			assert_eq!(Agenda::<Test>::get(4).len(), 2);
 			assert!(logger::log().is_empty());
-			assert_noop!(Scheduler::cancel_named(system::RawOrigin::Signed(2).into(), 1u32.encode()), BadOrigin);
-			assert_noop!(Scheduler::cancel(system::RawOrigin::Signed(2).into(), 4, 1), BadOrigin);
-			assert_noop!(Scheduler::cancel_named(system::RawOrigin::Root.into(), 1u32.encode()), BadOrigin);
-			assert_noop!(Scheduler::cancel(system::RawOrigin::Root.into(), 4, 1), BadOrigin);
+			assert_noop!(
+				Scheduler::cancel_named(system::RawOrigin::Signed(2).into(), 1u32.encode()),
+				BadOrigin
+			);
+			assert_noop!(
+				Scheduler::cancel(system::RawOrigin::Signed(2).into(), 4, 1),
+				BadOrigin
+			);
+			assert_noop!(
+				Scheduler::cancel_named(system::RawOrigin::Root.into(), 1u32.encode()),
+				BadOrigin
+			);
+			assert_noop!(
+				Scheduler::cancel(system::RawOrigin::Root.into(), 4, 1),
+				BadOrigin
+			);
 			run_to_block(5);
 			assert_eq!(
 				logger::log(),
-				vec![(system::RawOrigin::Signed(1).into(), 69u32), (system::RawOrigin::Signed(1).into(), 42u32)]
+				vec![
+					(system::RawOrigin::Signed(1).into(), 69u32),
+					(system::RawOrigin::Signed(1).into(), 42u32)
+				]
 			);
 		});
 	}
@@ -1408,85 +1648,84 @@
 						maybe_periodic: Some((456u64, 10)),
 					}),
 				];
-				frame_support::migration::put_storage_value(
-					b"Scheduler",
-					b"Agenda",
-					&k,
-					old,
-				);
+				frame_support::migration::put_storage_value(b"Scheduler", b"Agenda", &k, old);
 			}
 
 			assert_eq!(StorageVersion::get(), Releases::V1);
 
 			assert!(Scheduler::migrate_v1_to_t2());
 
-			assert_eq_uvec!(Agenda::<Test>::iter().collect::<Vec<_>>(), vec![
-				(
-					0,
-					vec![
-					Some(ScheduledV2 {
-						maybe_id: None,
-						priority: 10,
-						call: Call::Logger(logger::Call::log(96, 100)),
-						maybe_periodic: None,
-						origin: root(),
-						_phantom: PhantomData::<u64>::default(),
-					}),
-					None,
-					Some(ScheduledV2 {
-						maybe_id: Some(b"test".to_vec()),
-						priority: 123,
-						call: Call::Logger(logger::Call::log(69, 1000)),
-						maybe_periodic: Some((456u64, 10)),
-						origin: root(),
-						_phantom: PhantomData::<u64>::default(),
-					}),
-				]),
-				(
-					1,
-					vec![
-						Some(ScheduledV2 {
-							maybe_id: None,
-							priority: 11,
-							call: Call::Logger(logger::Call::log(96, 100)),
-							maybe_periodic: None,
-							origin: root(),
-							_phantom: PhantomData::<u64>::default(),
-						}),
-						None,
-						Some(ScheduledV2 {
-							maybe_id: Some(b"test".to_vec()),
-							priority: 123,
-							call: Call::Logger(logger::Call::log(69, 1000)),
-							maybe_periodic: Some((456u64, 10)),
-							origin: root(),
-							_phantom: PhantomData::<u64>::default(),
-						}),
-					]
-				),
-				(
-					2,
-					vec![
-						Some(ScheduledV2 {
-							maybe_id: None,
-							priority: 12,
-							call: Call::Logger(logger::Call::log(96, 100)),
-							maybe_periodic: None,
-							origin: root(),
-							_phantom: PhantomData::<u64>::default(),
-						}),
-						None,
-						Some(ScheduledV2 {
-							maybe_id: Some(b"test".to_vec()),
-							priority: 123,
-							call: Call::Logger(logger::Call::log(69, 1000)),
-							maybe_periodic: Some((456u64, 10)),
-							origin: root(),
-							_phantom: PhantomData::<u64>::default(),
-						}),
-					]
-				)
-			]);
+			assert_eq_uvec!(
+				Agenda::<Test>::iter().collect::<Vec<_>>(),
+				vec![
+					(
+						0,
+						vec![
+							Some(ScheduledV2 {
+								maybe_id: None,
+								priority: 10,
+								call: Call::Logger(logger::Call::log(96, 100)),
+								maybe_periodic: None,
+								origin: root(),
+								_phantom: PhantomData::<u64>::default(),
+							}),
+							None,
+							Some(ScheduledV2 {
+								maybe_id: Some(b"test".to_vec()),
+								priority: 123,
+								call: Call::Logger(logger::Call::log(69, 1000)),
+								maybe_periodic: Some((456u64, 10)),
+								origin: root(),
+								_phantom: PhantomData::<u64>::default(),
+							}),
+						]
+					),
+					(
+						1,
+						vec![
+							Some(ScheduledV2 {
+								maybe_id: None,
+								priority: 11,
+								call: Call::Logger(logger::Call::log(96, 100)),
+								maybe_periodic: None,
+								origin: root(),
+								_phantom: PhantomData::<u64>::default(),
+							}),
+							None,
+							Some(ScheduledV2 {
+								maybe_id: Some(b"test".to_vec()),
+								priority: 123,
+								call: Call::Logger(logger::Call::log(69, 1000)),
+								maybe_periodic: Some((456u64, 10)),
+								origin: root(),
+								_phantom: PhantomData::<u64>::default(),
+							}),
+						]
+					),
+					(
+						2,
+						vec![
+							Some(ScheduledV2 {
+								maybe_id: None,
+								priority: 12,
+								call: Call::Logger(logger::Call::log(96, 100)),
+								maybe_periodic: None,
+								origin: root(),
+								_phantom: PhantomData::<u64>::default(),
+							}),
+							None,
+							Some(ScheduledV2 {
+								maybe_id: Some(b"test".to_vec()),
+								priority: 123,
+								call: Call::Logger(logger::Call::log(69, 1000)),
+								maybe_periodic: Some((456u64, 10)),
+								origin: root(),
+								_phantom: PhantomData::<u64>::default(),
+							}),
+						]
+					)
+				]
+			);
 
 			assert_eq!(StorageVersion::get(), Releases::V2);
 		});
@@ -1516,93 +1755,92 @@
 						_phantom: Default::default(),
 					}),
 				];
-				frame_support::migration::put_storage_value(
-					b"Scheduler",
-					b"Agenda",
-					&k,
-					old,
-				);
+				frame_support::migration::put_storage_value(b"Scheduler", b"Agenda", &k, old);
 			}
 
-			impl Into<OriginCaller> for u32 {
-				fn into(self) -> OriginCaller {
-					match self {
-						3u32 => system::RawOrigin::Root.into(),
-						2u32 => system::RawOrigin::None.into(),
-						_ => unreachable!("test make no use of it"),
+			impl From<u32> for OriginCaller {
+				fn from(value: u32) -> Self {
+					match value {
+						3 => system::RawOrigin::Root.into(),
+						2 => system::RawOrigin::None.into(),
+						_ => unimplemented!(),
 					}
 				}
 			}
 
 			Scheduler::migrate_origin::<u32>();
 
-			assert_eq_uvec!(Agenda::<Test>::iter().collect::<Vec<_>>(), vec![
-				(
-					0,
-					vec![
-					Some(ScheduledV2::<_, _, OriginCaller, u64> {
-						maybe_id: None,
-						priority: 10,
-						call: Call::Logger(logger::Call::log(96, 100)),
-						maybe_periodic: None,
-						origin: system::RawOrigin::Root.into(),
-						_phantom: PhantomData::<u64>::default(),
-					}),
-					None,
-					Some(ScheduledV2 {
-						maybe_id: Some(b"test".to_vec()),
-						priority: 123,
-						call: Call::Logger(logger::Call::log(69, 1000)),
-						maybe_periodic: Some((456u64, 10)),
-						origin: system::RawOrigin::None.into(),
-						_phantom: PhantomData::<u64>::default(),
-					}),
-				]),
-				(
-					1,
-					vec![
-						Some(ScheduledV2 {
-							maybe_id: None,
-							priority: 11,
-							call: Call::Logger(logger::Call::log(96, 100)),
-							maybe_periodic: None,
-							origin: system::RawOrigin::Root.into(),
-							_phantom: PhantomData::<u64>::default(),
-						}),
-						None,
-						Some(ScheduledV2 {
-							maybe_id: Some(b"test".to_vec()),
-							priority: 123,
-							call: Call::Logger(logger::Call::log(69, 1000)),
-							maybe_periodic: Some((456u64, 10)),
-							origin: system::RawOrigin::None.into(),
-							_phantom: PhantomData::<u64>::default(),
-						}),
-					]
-				),
-				(
-					2,
-					vec![
-						Some(ScheduledV2 {
-							maybe_id: None,
-							priority: 12,
-							call: Call::Logger(logger::Call::log(96, 100)),
-							maybe_periodic: None,
-							origin: system::RawOrigin::Root.into(),
-							_phantom: PhantomData::<u64>::default(),
-						}),
-						None,
-						Some(ScheduledV2 {
-							maybe_id: Some(b"test".to_vec()),
-							priority: 123,
-							call: Call::Logger(logger::Call::log(69, 1000)),
-							maybe_periodic: Some((456u64, 10)),
-							origin: system::RawOrigin::None.into(),
-							_phantom: PhantomData::<u64>::default(),
-						}),
-					]
-				)
-			]);
+			assert_eq_uvec!(
+				Agenda::<Test>::iter().collect::<Vec<_>>(),
+				vec![
+					(
+						0,
+						vec![
+							Some(ScheduledV2::<_, _, OriginCaller, u64> {
+								maybe_id: None,
+								priority: 10,
+								call: Call::Logger(logger::Call::log(96, 100)),
+								maybe_periodic: None,
+								origin: system::RawOrigin::Root.into(),
+								_phantom: PhantomData::<u64>::default(),
+							}),
+							None,
+							Some(ScheduledV2 {
+								maybe_id: Some(b"test".to_vec()),
+								priority: 123,
+								call: Call::Logger(logger::Call::log(69, 1000)),
+								maybe_periodic: Some((456u64, 10)),
+								origin: system::RawOrigin::None.into(),
+								_phantom: PhantomData::<u64>::default(),
+							}),
+						]
+					),
+					(
+						1,
+						vec![
+							Some(ScheduledV2 {
+								maybe_id: None,
+								priority: 11,
+								call: Call::Logger(logger::Call::log(96, 100)),
+								maybe_periodic: None,
+								origin: system::RawOrigin::Root.into(),
+								_phantom: PhantomData::<u64>::default(),
+							}),
+							None,
+							Some(ScheduledV2 {
+								maybe_id: Some(b"test".to_vec()),
+								priority: 123,
+								call: Call::Logger(logger::Call::log(69, 1000)),
+								maybe_periodic: Some((456u64, 10)),
+								origin: system::RawOrigin::None.into(),
+								_phantom: PhantomData::<u64>::default(),
+							}),
+						]
+					),
+					(
+						2,
+						vec![
+							Some(ScheduledV2 {
+								maybe_id: None,
+								priority: 12,
+								call: Call::Logger(logger::Call::log(96, 100)),
+								maybe_periodic: None,
+								origin: system::RawOrigin::Root.into(),
+								_phantom: PhantomData::<u64>::default(),
+							}),
+							None,
+							Some(ScheduledV2 {
+								maybe_id: Some(b"test".to_vec()),
+								priority: 123,
+								call: Call::Logger(logger::Call::log(69, 1000)),
+								maybe_periodic: Some((456u64, 10)),
+								origin: system::RawOrigin::None.into(),
+								_phantom: PhantomData::<u64>::default(),
+							}),
+						]
+					)
+				]
+			);
 		});
 	}
 }
modifiedpallets/scheduler/src/weights.rsdiffbeforeafterboth
--- a/pallets/scheduler/src/weights.rs
+++ b/pallets/scheduler/src/weights.rs
@@ -34,85 +34,76 @@
 // --output=./frame/scheduler/src/weights.rs
 // --template=./.maintain/frame-weight-template.hbs
 
-
 #![allow(unused_parens)]
 #![allow(unused_imports)]
 
-use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
+use frame_support::{
+	traits::Get,
+	weights::{Weight, constants::RocksDbWeight},
+};
 use sp_std::marker::PhantomData;
 
 /// Weight functions needed for pallet_scheduler.
 pub trait WeightInfo {
-	fn schedule(s: u32, ) -> Weight;
-	fn cancel(s: u32, ) -> Weight;
-	fn schedule_named(s: u32, ) -> Weight;
-	fn cancel_named(s: u32, ) -> Weight;
-	
+	fn schedule(s: u32) -> Weight;
+	fn cancel(s: u32) -> Weight;
+	fn schedule_named(s: u32) -> Weight;
+	fn cancel_named(s: u32) -> Weight;
 }
 
 /// Weights for pallet_scheduler using the Substrate node and recommended hardware.
 pub struct SubstrateWeight<T>(PhantomData<T>);
 impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
-	fn schedule(s: u32, ) -> Weight {
-		(35_029_000 as Weight)
-			.saturating_add((77_000 as Weight).saturating_mul(s as Weight))
-			.saturating_add(T::DbWeight::get().reads(1 as Weight))
-			.saturating_add(T::DbWeight::get().writes(1 as Weight))
-			
+	fn schedule(s: u32) -> Weight {
+		35_029_000_u64
+			.saturating_add(77_000_u64.saturating_mul(s as Weight))
+			.saturating_add(T::DbWeight::get().reads(1_u64))
+			.saturating_add(T::DbWeight::get().writes(1_u64))
 	}
-	fn cancel(s: u32, ) -> Weight {
-		(31_419_000 as Weight)
-			.saturating_add((4_015_000 as Weight).saturating_mul(s as Weight))
-			.saturating_add(T::DbWeight::get().reads(1 as Weight))
-			.saturating_add(T::DbWeight::get().writes(2 as Weight))
-			
+	fn cancel(s: u32) -> Weight {
+		31_419_000_u64
+			.saturating_add(4_015_000_u64.saturating_mul(s as Weight))
+			.saturating_add(T::DbWeight::get().reads(1_u64))
+			.saturating_add(T::DbWeight::get().writes(2_u64))
 	}
-	fn schedule_named(s: u32, ) -> Weight {
-		(44_752_000 as Weight)
-			.saturating_add((123_000 as Weight).saturating_mul(s as Weight))
-			.saturating_add(T::DbWeight::get().reads(2 as Weight))
-			.saturating_add(T::DbWeight::get().writes(2 as Weight))
-			
+	fn schedule_named(s: u32) -> Weight {
+		44_752_000_u64
+			.saturating_add(123_000_u64.saturating_mul(s as Weight))
+			.saturating_add(T::DbWeight::get().reads(2_u64))
+			.saturating_add(T::DbWeight::get().writes(2_u64))
 	}
-	fn cancel_named(s: u32, ) -> Weight {
-		(35_712_000 as Weight)
-			.saturating_add((4_008_000 as Weight).saturating_mul(s as Weight))
-			.saturating_add(T::DbWeight::get().reads(2 as Weight))
-			.saturating_add(T::DbWeight::get().writes(2 as Weight))
-			
+	fn cancel_named(s: u32) -> Weight {
+		35_712_000_u64
+			.saturating_add(4_008_000_u64.saturating_mul(s as Weight))
+			.saturating_add(T::DbWeight::get().reads(2_u64))
+			.saturating_add(T::DbWeight::get().writes(2_u64))
 	}
-	
 }
 
 // For backwards compatibility and tests
 impl WeightInfo for () {
-	fn schedule(s: u32, ) -> Weight {
-		(35_029_000 as Weight)
-			.saturating_add((77_000 as Weight).saturating_mul(s as Weight))
-			.saturating_add(RocksDbWeight::get().reads(1 as Weight))
-			.saturating_add(RocksDbWeight::get().writes(1 as Weight))
-			
+	fn schedule(s: u32) -> Weight {
+		35_029_000_u64
+			.saturating_add(77_000_u64.saturating_mul(s as Weight))
+			.saturating_add(RocksDbWeight::get().reads(1_u64))
+			.saturating_add(RocksDbWeight::get().writes(1_u64))
 	}
-	fn cancel(s: u32, ) -> Weight {
-		(31_419_000 as Weight)
-			.saturating_add((4_015_000 as Weight).saturating_mul(s as Weight))
-			.saturating_add(RocksDbWeight::get().reads(1 as Weight))
-			.saturating_add(RocksDbWeight::get().writes(2 as Weight))
-			
+	fn cancel(s: u32) -> Weight {
+		31_419_000_u64
+			.saturating_add(4_015_000_u64.saturating_mul(s as Weight))
+			.saturating_add(RocksDbWeight::get().reads(1_u64))
+			.saturating_add(RocksDbWeight::get().writes(2_u64))
 	}
-	fn schedule_named(s: u32, ) -> Weight {
-		(44_752_000 as Weight)
-			.saturating_add((123_000 as Weight).saturating_mul(s as Weight))
-			.saturating_add(RocksDbWeight::get().reads(2 as Weight))
-			.saturating_add(RocksDbWeight::get().writes(2 as Weight))
-			
+	fn schedule_named(s: u32) -> Weight {
+		44_752_000_u64
+			.saturating_add(123_000_u64.saturating_mul(s as Weight))
+			.saturating_add(RocksDbWeight::get().reads(2_u64))
+			.saturating_add(RocksDbWeight::get().writes(2_u64))
 	}
-	fn cancel_named(s: u32, ) -> Weight {
-		(35_712_000 as Weight)
-			.saturating_add((4_008_000 as Weight).saturating_mul(s as Weight))
-			.saturating_add(RocksDbWeight::get().reads(2 as Weight))
-			.saturating_add(RocksDbWeight::get().writes(2 as Weight))
-			
+	fn cancel_named(s: u32) -> Weight {
+		35_712_000_u64
+			.saturating_add(4_008_000_u64.saturating_mul(s as Weight))
+			.saturating_add(RocksDbWeight::get().reads(2_u64))
+			.saturating_add(RocksDbWeight::get().writes(2_u64))
 	}
-	
 }
modifiedprimitives/nft/src/lib.rsdiffbeforeafterboth
--- a/primitives/nft/src/lib.rs
+++ b/primitives/nft/src/lib.rs
@@ -1,26 +1,23 @@
-
 #![cfg_attr(not(feature = "std"), no_std)]
 
 pub use serde::{Serialize, Deserialize};
 
-use frame_system;
 use sp_runtime::sp_std::prelude::Vec;
 use codec::{Decode, Encode};
 pub use frame_support::{
-    construct_runtime, decl_event, decl_module, decl_storage, decl_error,
-    dispatch::DispatchResult,
-    ensure, fail, parameter_types,
-    traits::{
-        Currency, ExistenceRequirement, Get, Imbalance, KeyOwnerProofSystem, OnUnbalanced,
-        Randomness, IsSubType, WithdrawReasons,
-    },
-    weights::{
-        constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_PER_SECOND},
-        DispatchInfo, GetDispatchInfo, IdentityFee, Pays, PostDispatchInfo, Weight,
-        WeightToFeePolynomial, DispatchClass,
-    },
-    StorageValue,
-    transactional,
+	construct_runtime, decl_event, decl_module, decl_storage, decl_error,
+	dispatch::DispatchResult,
+	ensure, fail, parameter_types,
+	traits::{
+		Currency, ExistenceRequirement, Get, Imbalance, KeyOwnerProofSystem, OnUnbalanced,
+		Randomness, IsSubType, WithdrawReasons,
+	},
+	weights::{
+		constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_PER_SECOND},
+		DispatchInfo, GetDispatchInfo, IdentityFee, Pays, PostDispatchInfo, Weight,
+		WeightToFeePolynomial, DispatchClass,
+	},
+	StorageValue, transactional,
 };
 
 pub const MAX_DECIMAL_POINTS: DecimalPoints = 30;
@@ -35,251 +32,245 @@
 #[derive(Encode, Decode, Eq, Debug, Clone, PartialEq)]
 #[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
 pub enum CollectionMode {
-    Invalid,
-    NFT,
-    // decimal points
-    Fungible(DecimalPoints),
-    ReFungible,
+	Invalid,
+	NFT,
+	// decimal points
+	Fungible(DecimalPoints),
+	ReFungible,
 }
 
 impl Default for CollectionMode {
-    fn default() -> Self {
-        Self::Invalid
-    }
+	fn default() -> Self {
+		Self::Invalid
+	}
 }
 
-impl Into<u8> for CollectionMode {
-    fn into(self) -> u8 {
-        match self {
-            CollectionMode::Invalid => 0,
-            CollectionMode::NFT => 1,
-            CollectionMode::Fungible(_) => 2,
-            CollectionMode::ReFungible => 3,
-        }
-    }
+impl CollectionMode {
+	pub fn id(&self) -> u8 {
+		match self {
+			CollectionMode::Invalid => 0,
+			CollectionMode::NFT => 1,
+			CollectionMode::Fungible(_) => 2,
+			CollectionMode::ReFungible => 3,
+		}
+	}
 }
 
 pub trait SponsoringResolve<AccountId, Call> {
-    fn resolve(
-        who: &AccountId,
-		call: &Call) -> Option<AccountId>;
+	fn resolve(who: &AccountId, call: &Call) -> Option<AccountId>;
 }
 
 #[derive(Encode, Decode, Eq, Debug, Clone, PartialEq)]
 #[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
 pub enum AccessMode {
-    Normal,
-    WhiteList,
+	Normal,
+	WhiteList,
 }
 impl Default for AccessMode {
-    fn default() -> Self {
-        Self::Normal
-    }
+	fn default() -> Self {
+		Self::Normal
+	}
 }
 
 #[derive(Encode, Decode, Eq, Debug, Clone, PartialEq)]
 #[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
 pub enum SchemaVersion {
-    ImageURL,
-    Unique,
+	ImageURL,
+	Unique,
 }
 impl Default for SchemaVersion {
-    fn default() -> Self {
-        Self::ImageURL
-    }
+	fn default() -> Self {
+		Self::ImageURL
+	}
 }
 
 #[derive(Encode, Decode, Default, Debug, Clone, PartialEq)]
 #[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
 pub struct Ownership<AccountId> {
-    pub owner: AccountId,
-    pub fraction: u128,
+	pub owner: AccountId,
+	pub fraction: u128,
 }
 
 #[derive(Encode, Decode, Debug, Clone, PartialEq)]
 #[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
 pub enum SponsorshipState<AccountId> {
-    /// The fees are applied to the transaction sender
-    Disabled,
-    Unconfirmed(AccountId),
-    /// Transactions are sponsored by specified account
-    Confirmed(AccountId),
+	/// The fees are applied to the transaction sender
+	Disabled,
+	Unconfirmed(AccountId),
+	/// Transactions are sponsored by specified account
+	Confirmed(AccountId),
 }
 
 impl<AccountId> SponsorshipState<AccountId> {
-    pub fn sponsor(&self) -> Option<&AccountId> {
-        match self {
-            Self::Confirmed(sponsor) => Some(sponsor),
-            _ => None,
-        }
-    }
+	pub fn sponsor(&self) -> Option<&AccountId> {
+		match self {
+			Self::Confirmed(sponsor) => Some(sponsor),
+			_ => None,
+		}
+	}
 
-    pub fn pending_sponsor(&self) -> Option<&AccountId> {
-        match self {
-            Self::Unconfirmed(sponsor) | Self::Confirmed(sponsor) => Some(sponsor),
-            _ => None,
-        }
-    }
+	pub fn pending_sponsor(&self) -> Option<&AccountId> {
+		match self {
+			Self::Unconfirmed(sponsor) | Self::Confirmed(sponsor) => Some(sponsor),
+			_ => None,
+		}
+	}
 
-    pub fn confirmed(&self) -> bool {
-        matches!(self, Self::Confirmed(_))
-    }
+	pub fn confirmed(&self) -> bool {
+		matches!(self, Self::Confirmed(_))
+	}
 }
 
 impl<T> Default for SponsorshipState<T> {
-    fn default() -> Self {
-        Self::Disabled
-    }
+	fn default() -> Self {
+		Self::Disabled
+	}
 }
 
 #[derive(Encode, Decode, Clone, PartialEq)]
 #[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
 pub struct Collection<T: frame_system::Config> {
-    pub owner: T::AccountId,
-    pub mode: CollectionMode,
-    pub access: AccessMode,
-    pub decimal_points: DecimalPoints,
-    pub name: Vec<u16>,        // 64 include null escape char
-    pub description: Vec<u16>, // 256 include null escape char
-    pub token_prefix: Vec<u8>, // 16 include null escape char
-    pub mint_mode: bool,
-    pub offchain_schema: Vec<u8>,
-    pub schema_version: SchemaVersion,
-    pub sponsorship: SponsorshipState<T::AccountId>,
-    pub limits: CollectionLimits<T::BlockNumber>, // Collection private restrictions 
-    pub variable_on_chain_schema: Vec<u8>, //
-    pub const_on_chain_schema: Vec<u8>, //
+	pub owner: T::AccountId,
+	pub mode: CollectionMode,
+	pub access: AccessMode,
+	pub decimal_points: DecimalPoints,
+	pub name: Vec<u16>,        // 64 include null escape char
+	pub description: Vec<u16>, // 256 include null escape char
+	pub token_prefix: Vec<u8>, // 16 include null escape char
+	pub mint_mode: bool,
+	pub offchain_schema: Vec<u8>,
+	pub schema_version: SchemaVersion,
+	pub sponsorship: SponsorshipState<T::AccountId>,
+	pub limits: CollectionLimits<T::BlockNumber>, // Collection private restrictions
+	pub variable_on_chain_schema: Vec<u8>,        //
+	pub const_on_chain_schema: Vec<u8>,           //
 }
 
 #[derive(Encode, Decode, Debug, Clone, PartialEq)]
 #[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
 pub struct NftItemType<AccountId> {
-    pub owner: AccountId,
-    pub const_data: Vec<u8>,
-    pub variable_data: Vec<u8>,
+	pub owner: AccountId,
+	pub const_data: Vec<u8>,
+	pub variable_data: Vec<u8>,
 }
 
 #[derive(Encode, Decode, Default, Debug, Clone, PartialEq)]
 #[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
 pub struct FungibleItemType {
-    pub value: u128,
+	pub value: u128,
 }
 
 #[derive(Encode, Decode, Debug, Clone, PartialEq)]
 #[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
 pub struct ReFungibleItemType<AccountId> {
-    pub owner: Vec<Ownership<AccountId>>,
-    pub const_data: Vec<u8>,
-    pub variable_data: Vec<u8>,
+	pub owner: Vec<Ownership<AccountId>>,
+	pub const_data: Vec<u8>,
+	pub variable_data: Vec<u8>,
 }
-
 
 #[derive(Encode, Decode, Debug, Clone, PartialEq)]
 #[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
 pub struct CollectionLimits<BlockNumber: Encode + Decode> {
-    pub account_token_ownership_limit: u32,
-    pub sponsored_data_size: u32,
-    /// None - setVariableMetadata is not sponsored
-    /// Some(v) - setVariableMetadata is sponsored 
-    ///           if there is v block between txs
-    pub sponsored_data_rate_limit: Option<BlockNumber>,
-    pub token_limit: u32,
+	pub account_token_ownership_limit: u32,
+	pub sponsored_data_size: u32,
+	/// None - setVariableMetadata is not sponsored
+	/// Some(v) - setVariableMetadata is sponsored
+	///           if there is v block between txs
+	pub sponsored_data_rate_limit: Option<BlockNumber>,
+	pub token_limit: u32,
 
-    // Timeouts for item types in passed blocks
-    pub sponsor_transfer_timeout: u32,
-    pub owner_can_transfer: bool,
-    pub owner_can_destroy: bool,
+	// Timeouts for item types in passed blocks
+	pub sponsor_transfer_timeout: u32,
+	pub owner_can_transfer: bool,
+	pub owner_can_destroy: bool,
 }
 
 impl<BlockNumber: Encode + Decode> Default for CollectionLimits<BlockNumber> {
-    fn default() -> Self {
-        Self { 
-            account_token_ownership_limit: 10_000_000, 
-            token_limit: u32::max_value(),
-            sponsored_data_size: u32::MAX, 
-            sponsored_data_rate_limit: None,
-            sponsor_transfer_timeout: 14400,
-            owner_can_transfer: true,
-            owner_can_destroy: true
-        }
-    }
+	fn default() -> Self {
+		Self {
+			account_token_ownership_limit: 10_000_000,
+			token_limit: u32::max_value(),
+			sponsored_data_size: u32::MAX,
+			sponsored_data_rate_limit: None,
+			sponsor_transfer_timeout: 14400,
+			owner_can_transfer: true,
+			owner_can_destroy: true,
+		}
+	}
 }
 
 #[derive(Encode, Decode, Default, Debug, Clone, PartialEq)]
 #[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
 pub struct ChainLimits {
-    pub collection_numbers_limit: u32,
-    pub account_token_ownership_limit: u32,
-    pub collections_admins_limit: u64,
-    pub custom_data_limit: u32,
+	pub collection_numbers_limit: u32,
+	pub account_token_ownership_limit: u32,
+	pub collections_admins_limit: u64,
+	pub custom_data_limit: u32,
 
-    // Timeouts for item types in passed blocks
-    pub nft_sponsor_transfer_timeout: u32,
-    pub fungible_sponsor_transfer_timeout: u32,
-    pub refungible_sponsor_transfer_timeout: u32,
+	// Timeouts for item types in passed blocks
+	pub nft_sponsor_transfer_timeout: u32,
+	pub fungible_sponsor_transfer_timeout: u32,
+	pub refungible_sponsor_transfer_timeout: u32,
 
-    // Schema limits
-    pub offchain_schema_limit: u32,
-    pub variable_on_chain_schema_limit: u32,
-    pub const_on_chain_schema_limit: u32,
+	// Schema limits
+	pub offchain_schema_limit: u32,
+	pub variable_on_chain_schema_limit: u32,
+	pub const_on_chain_schema_limit: u32,
 }
 
-
 #[derive(Encode, Decode, Default, Debug, Clone, PartialEq)]
 #[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
 pub struct CreateNftData {
-    pub const_data: Vec<u8>,
-    pub variable_data: Vec<u8>,
+	pub const_data: Vec<u8>,
+	pub variable_data: Vec<u8>,
 }
 
 #[derive(Encode, Decode, Default, Debug, Clone, PartialEq)]
 #[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
 pub struct CreateFungibleData {
-    pub value: u128,
+	pub value: u128,
 }
 
 #[derive(Encode, Decode, Default, Debug, Clone, PartialEq)]
 #[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
 pub struct CreateReFungibleData {
-    pub const_data: Vec<u8>,
-    pub variable_data: Vec<u8>,
-    pub pieces: u128,
+	pub const_data: Vec<u8>,
+	pub variable_data: Vec<u8>,
+	pub pieces: u128,
 }
 
 #[derive(Encode, Decode, Debug, Clone, PartialEq)]
 #[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
 pub enum CreateItemData {
-    NFT(CreateNftData),
-    Fungible(CreateFungibleData),
-    ReFungible(CreateReFungibleData),
+	NFT(CreateNftData),
+	Fungible(CreateFungibleData),
+	ReFungible(CreateReFungibleData),
 }
 
 impl CreateItemData {
-    pub fn len(&self) -> usize {
-        let len = match self {
-            CreateItemData::NFT(data) => data.variable_data.len() + data.const_data.len(),
-            CreateItemData::ReFungible(data) => data.variable_data.len() + data.const_data.len(),
-            _ => 0
-        };
-        
-        return len;
-    }
+	pub fn data_size(&self) -> usize {
+		match self {
+			CreateItemData::NFT(data) => data.variable_data.len() + data.const_data.len(),
+			CreateItemData::ReFungible(data) => data.variable_data.len() + data.const_data.len(),
+			_ => 0,
+		}
+	}
 }
 
 impl From<CreateNftData> for CreateItemData {
-    fn from(item: CreateNftData) -> Self {
-        CreateItemData::NFT(item)
-    }
+	fn from(item: CreateNftData) -> Self {
+		CreateItemData::NFT(item)
+	}
 }
 
 impl From<CreateReFungibleData> for CreateItemData {
-    fn from(item: CreateReFungibleData) -> Self {
-        CreateItemData::ReFungible(item)
-    }
+	fn from(item: CreateReFungibleData) -> Self {
+		CreateItemData::ReFungible(item)
+	}
 }
 
 impl From<CreateFungibleData> for CreateItemData {
-    fn from(item: CreateFungibleData) -> Self {
-        CreateItemData::Fungible(item)
-    }
+	fn from(item: CreateFungibleData) -> Self {
+		CreateItemData::Fungible(item)
+	}
 }
modifiedruntime/build.rsdiffbeforeafterboth
--- a/runtime/build.rs
+++ b/runtime/build.rs
@@ -1,9 +1,9 @@
 use substrate_wasm_builder::WasmBuilder;
 
 fn main() {
-    WasmBuilder::new()
-        .with_current_project()
-        .import_memory()
-        .export_heap_base()
-        .build()
-}
\ No newline at end of file
+	WasmBuilder::new()
+		.with_current_project()
+		.import_memory()
+		.export_heap_base()
+		.build()
+}
modifiedruntime/src/chain_extension.rsdiffbeforeafterboth
--- a/runtime/src/chain_extension.rs
+++ b/runtime/src/chain_extension.rs
@@ -9,7 +9,7 @@
 
 pub use pallet_contracts::chain_extension::RetVal;
 use pallet_contracts::chain_extension::{
-    ChainExtension, Environment, Ext, InitState, SysConfig, UncheckedFrom,
+	ChainExtension, Environment, Ext, InitState, SysConfig, UncheckedFrom,
 };
 
 pub use frame_support::debug;
@@ -25,56 +25,56 @@
 /// Create item parameters
 #[derive(Debug, PartialEq, Encode, Decode)]
 pub struct NFTExtCreateItem<E: Ext> {
-    pub owner: <E::T as SysConfig>::AccountId,
-    pub collection_id: u32,
-    pub data: CreateItemData,
+	pub owner: <E::T as SysConfig>::AccountId,
+	pub collection_id: u32,
+	pub data: CreateItemData,
 }
 
 /// Transfer parameters
 #[derive(Debug, PartialEq, Encode, Decode)]
 pub struct NFTExtTransfer<E: Ext> {
-    pub recipient: <E::T as SysConfig>::AccountId,
-    pub collection_id: u32,
-    pub token_id: u32,
-    pub amount: u128,
+	pub recipient: <E::T as SysConfig>::AccountId,
+	pub collection_id: u32,
+	pub token_id: u32,
+	pub amount: u128,
 }
 
 #[derive(Debug, PartialEq, Encode, Decode)]
 pub struct NFTExtCreateMultipleItems<E: Ext> {
-    pub owner: <E::T as SysConfig>::AccountId,
-    pub collection_id: u32,
-    pub data: Vec<CreateItemData>,
+	pub owner: <E::T as SysConfig>::AccountId,
+	pub collection_id: u32,
+	pub data: Vec<CreateItemData>,
 }
 
 #[derive(Debug, PartialEq, Encode, Decode)]
 pub struct NFTExtApprove<E: Ext> {
-    pub spender: <E::T as SysConfig>::AccountId,
-    pub collection_id: u32,
-    pub item_id: u32,
-    pub amount: u128,
+	pub spender: <E::T as SysConfig>::AccountId,
+	pub collection_id: u32,
+	pub item_id: u32,
+	pub amount: u128,
 }
 
 #[derive(Debug, PartialEq, Encode, Decode)]
 pub struct NFTExtTransferFrom<E: Ext> {
-    pub owner: <E::T as SysConfig>::AccountId,
-    pub recipient: <E::T as SysConfig>::AccountId,
-    pub collection_id: u32,
-    pub item_id: u32,
-    pub amount: u128,
+	pub owner: <E::T as SysConfig>::AccountId,
+	pub recipient: <E::T as SysConfig>::AccountId,
+	pub collection_id: u32,
+	pub item_id: u32,
+	pub amount: u128,
 }
 
 #[derive(Debug, PartialEq, Encode, Decode)]
 pub struct NFTExtSetVariableMetaData {
-    pub collection_id: u32,
-    pub item_id: u32,
-    pub data: Vec<u8>,   
+	pub collection_id: u32,
+	pub item_id: u32,
+	pub data: Vec<u8>,
 }
 
 #[derive(Debug, PartialEq, Encode, Decode)]
 pub struct NFTExtToggleWhiteList<E: Ext> {
-    pub collection_id: u32,
-    pub address: <E::T as SysConfig>::AccountId,
-    pub whitelisted: bool,
+	pub collection_id: u32,
+	pub address: <E::T as SysConfig>::AccountId,
+	pub whitelisted: bool,
 }
 
 /// The chain Extension of NFT pallet
@@ -83,150 +83,146 @@
 pub type NftWeightInfoOf<C> = <C as pallet_nft::Config>::WeightInfo;
 
 impl<C: Config + pallet_contracts::Config> ChainExtension<C> for NFTExtension {
-    fn call<E: Ext>(func_id: u32, env: Environment<E, InitState>) -> Result<RetVal, DispatchError>
-    where
-        E: Ext<T = C>,
-        C: pallet_nft::Config,
-        <E::T as SysConfig>::AccountId: UncheckedFrom<<E::T as SysConfig>::Hash> + AsRef<[u8]>,
-    {
-        // The memory of the vm stores buf in scale-codec
-        match func_id {
-            0 => {
-                let mut env = env.buf_in_buf_out();
-                let input: NFTExtTransfer<E> = env.read_as()?;
-                env.charge_weight(NftWeightInfoOf::<C>::transfer())?;
+	fn call<E: Ext>(func_id: u32, env: Environment<E, InitState>) -> Result<RetVal, DispatchError>
+	where
+		E: Ext<T = C>,
+		C: pallet_nft::Config,
+		<E::T as SysConfig>::AccountId: UncheckedFrom<<E::T as SysConfig>::Hash> + AsRef<[u8]>,
+	{
+		// The memory of the vm stores buf in scale-codec
+		match func_id {
+			0 => {
+				let mut env = env.buf_in_buf_out();
+				let input: NFTExtTransfer<E> = env.read_as()?;
+				env.charge_weight(NftWeightInfoOf::<C>::transfer())?;
 
-                let collection = pallet_nft::Module::<C>::get_collection(input.collection_id)?;
+				let collection = pallet_nft::Module::<C>::get_collection(input.collection_id)?;
 
-                pallet_nft::Module::<C>::transfer_internal(
-                    &C::CrossAccountId::from_sub(env.ext().address().clone()),
-                    &C::CrossAccountId::from_sub(input.recipient),
-                    &collection,
-                    input.token_id,
-                    input.amount,
-                )?;
+				pallet_nft::Module::<C>::transfer_internal(
+					&C::CrossAccountId::from_sub(env.ext().address().clone()),
+					&C::CrossAccountId::from_sub(input.recipient),
+					&collection,
+					input.token_id,
+					input.amount,
+				)?;
 
-                pallet_nft::Module::<C>::submit_logs(collection)?;
-                Ok(RetVal::Converging(0))
-            },
-            1 => {
-                // Create Item
-                let mut env = env.buf_in_buf_out();
-                let input: NFTExtCreateItem<E> = env.read_as()?;
-                env.charge_weight(NftWeightInfoOf::<C>::create_item(input.data.len()))?;
+				pallet_nft::Module::<C>::submit_logs(collection)?;
+				Ok(RetVal::Converging(0))
+			}
+			1 => {
+				// Create Item
+				let mut env = env.buf_in_buf_out();
+				let input: NFTExtCreateItem<E> = env.read_as()?;
+				env.charge_weight(NftWeightInfoOf::<C>::create_item(input.data.data_size()))?;
 
-                let collection = pallet_nft::Module::<C>::get_collection(input.collection_id)?;
+				let collection = pallet_nft::Module::<C>::get_collection(input.collection_id)?;
 
-                pallet_nft::Module::<C>::create_item_internal(
-                    &C::CrossAccountId::from_sub(env.ext().address().clone()),
-                    &collection,
-                    &C::CrossAccountId::from_sub(input.owner),
-                    input.data,
-                )?;
+				pallet_nft::Module::<C>::create_item_internal(
+					&C::CrossAccountId::from_sub(env.ext().address().clone()),
+					&collection,
+					&C::CrossAccountId::from_sub(input.owner),
+					input.data,
+				)?;
 
-                pallet_nft::Module::<C>::submit_logs(collection)?;
-                Ok(RetVal::Converging(0))
-            },
-            2 => {
-                // Create multiple items
-                let mut env = env.buf_in_buf_out();
-                let input: NFTExtCreateMultipleItems<E> = env.read_as()?;
-                env.charge_weight(NftWeightInfoOf::<C>::create_item(
-                    input.data.iter()
-                        .map(|i| i.len())
-                        .sum()
-                ))?;
+				pallet_nft::Module::<C>::submit_logs(collection)?;
+				Ok(RetVal::Converging(0))
+			}
+			2 => {
+				// Create multiple items
+				let mut env = env.buf_in_buf_out();
+				let input: NFTExtCreateMultipleItems<E> = env.read_as()?;
+				env.charge_weight(NftWeightInfoOf::<C>::create_item(
+					input.data.iter().map(|i| i.data_size()).sum(),
+				))?;
 
-                let collection = pallet_nft::Module::<C>::get_collection(input.collection_id)?;
+				let collection = pallet_nft::Module::<C>::get_collection(input.collection_id)?;
 
-                pallet_nft::Module::<C>::create_multiple_items_internal(
-                    &C::CrossAccountId::from_sub(env.ext().address().clone()),
-                    &collection,
-                    &C::CrossAccountId::from_sub(input.owner),
-                    input.data,
-                )?;
+				pallet_nft::Module::<C>::create_multiple_items_internal(
+					&C::CrossAccountId::from_sub(env.ext().address().clone()),
+					&collection,
+					&C::CrossAccountId::from_sub(input.owner),
+					input.data,
+				)?;
 
-                pallet_nft::Module::<C>::submit_logs(collection)?;
-                Ok(RetVal::Converging(0))
-            },
-            3 => {
-                // Approve
-                let mut env = env.buf_in_buf_out();
-                let input: NFTExtApprove<E> = env.read_as()?;
-                env.charge_weight(NftWeightInfoOf::<C>::approve())?;
+				pallet_nft::Module::<C>::submit_logs(collection)?;
+				Ok(RetVal::Converging(0))
+			}
+			3 => {
+				// Approve
+				let mut env = env.buf_in_buf_out();
+				let input: NFTExtApprove<E> = env.read_as()?;
+				env.charge_weight(NftWeightInfoOf::<C>::approve())?;
 
-                let collection = pallet_nft::Module::<C>::get_collection(input.collection_id)?;
+				let collection = pallet_nft::Module::<C>::get_collection(input.collection_id)?;
 
-                pallet_nft::Module::<C>::approve_internal(
-                    &C::CrossAccountId::from_sub(env.ext().address().clone()),
-                    &C::CrossAccountId::from_sub(input.spender),
-                    &collection,
-                    input.item_id,
-                    input.amount,
-                )?;
+				pallet_nft::Module::<C>::approve_internal(
+					&C::CrossAccountId::from_sub(env.ext().address().clone()),
+					&C::CrossAccountId::from_sub(input.spender),
+					&collection,
+					input.item_id,
+					input.amount,
+				)?;
 
-                pallet_nft::Module::<C>::submit_logs(collection)?;
-                Ok(RetVal::Converging(0))
-            },
-            4 => {
-                // Transfer from
-                let mut env = env.buf_in_buf_out();
-                let input: NFTExtTransferFrom<E> = env.read_as()?;
-                env.charge_weight(NftWeightInfoOf::<C>::transfer_from())?;
+				pallet_nft::Module::<C>::submit_logs(collection)?;
+				Ok(RetVal::Converging(0))
+			}
+			4 => {
+				// Transfer from
+				let mut env = env.buf_in_buf_out();
+				let input: NFTExtTransferFrom<E> = env.read_as()?;
+				env.charge_weight(NftWeightInfoOf::<C>::transfer_from())?;
 
-                let collection = pallet_nft::Module::<C>::get_collection(input.collection_id)?;
+				let collection = pallet_nft::Module::<C>::get_collection(input.collection_id)?;
 
-                pallet_nft::Module::<C>::transfer_from_internal(
-                    &C::CrossAccountId::from_sub(env.ext().address().clone()),
-                    &C::CrossAccountId::from_sub(input.owner),
-                    &C::CrossAccountId::from_sub(input.recipient),
-                    &collection,
-                    input.item_id,
-                    input.amount
-                )?;
+				pallet_nft::Module::<C>::transfer_from_internal(
+					&C::CrossAccountId::from_sub(env.ext().address().clone()),
+					&C::CrossAccountId::from_sub(input.owner),
+					&C::CrossAccountId::from_sub(input.recipient),
+					&collection,
+					input.item_id,
+					input.amount,
+				)?;
 
-                pallet_nft::Module::<C>::submit_logs(collection)?;
-                Ok(RetVal::Converging(0))
-            },
-            5 => {
-                // Set variable metadata
-                let mut env = env.buf_in_buf_out();
-                let input: NFTExtSetVariableMetaData = env.read_as()?;
-                env.charge_weight(NftWeightInfoOf::<C>::set_variable_meta_data())?;
+				pallet_nft::Module::<C>::submit_logs(collection)?;
+				Ok(RetVal::Converging(0))
+			}
+			5 => {
+				// Set variable metadata
+				let mut env = env.buf_in_buf_out();
+				let input: NFTExtSetVariableMetaData = env.read_as()?;
+				env.charge_weight(NftWeightInfoOf::<C>::set_variable_meta_data())?;
 
-                let collection = pallet_nft::Module::<C>::get_collection(input.collection_id)?;
+				let collection = pallet_nft::Module::<C>::get_collection(input.collection_id)?;
 
-                pallet_nft::Module::<C>::set_variable_meta_data_internal(
-                    &C::CrossAccountId::from_sub(env.ext().address().clone()),
-                    &collection,
-                    input.item_id,
-                    input.data,
-                )?;
+				pallet_nft::Module::<C>::set_variable_meta_data_internal(
+					&C::CrossAccountId::from_sub(env.ext().address().clone()),
+					&collection,
+					input.item_id,
+					input.data,
+				)?;
 
-                pallet_nft::Module::<C>::submit_logs(collection)?;
-                Ok(RetVal::Converging(0))
-            },
-            6 => {
-                // Toggle whitelist
-                let mut env = env.buf_in_buf_out();
-                let input: NFTExtToggleWhiteList<E> = env.read_as()?;
-                env.charge_weight(NftWeightInfoOf::<C>::add_to_white_list())?;
+				pallet_nft::Module::<C>::submit_logs(collection)?;
+				Ok(RetVal::Converging(0))
+			}
+			6 => {
+				// Toggle whitelist
+				let mut env = env.buf_in_buf_out();
+				let input: NFTExtToggleWhiteList<E> = env.read_as()?;
+				env.charge_weight(NftWeightInfoOf::<C>::add_to_white_list())?;
 
-                let collection = pallet_nft::Module::<C>::get_collection(input.collection_id)?;
+				let collection = pallet_nft::Module::<C>::get_collection(input.collection_id)?;
 
-                pallet_nft::Module::<C>::toggle_white_list_internal(
-                    &C::CrossAccountId::from_sub(env.ext().address().clone()),
-                    &collection,
-                    &C::CrossAccountId::from_sub(input.address),
-                    input.whitelisted,
-                )?;
+				pallet_nft::Module::<C>::toggle_white_list_internal(
+					&C::CrossAccountId::from_sub(env.ext().address().clone()),
+					&collection,
+					&C::CrossAccountId::from_sub(input.address),
+					input.whitelisted,
+				)?;
 
-                pallet_nft::Module::<C>::submit_logs(collection)?;
-                Ok(RetVal::Converging(0))
-            }
-            _ => {
-                Err(DispatchError::Other("unknown chain_extension func_id"))
-            }
-        }
-    }
+				pallet_nft::Module::<C>::submit_logs(collection)?;
+				Ok(RetVal::Converging(0))
+			}
+			_ => Err(DispatchError::Other("unknown chain_extension func_id")),
+		}
+	}
 }
modifiedruntime/src/lib.rsdiffbeforeafterboth
before · runtime/src/lib.rs
1//2// This file is subject to the terms and conditions defined in3// file 'LICENSE', which is part of this source code package.4//56//! The Substrate Node Template runtime. This can be compiled with `#[no_std]`, ready for Wasm.78#![cfg_attr(not(feature = "std"), no_std)]9// `construct_runtime!` does a lot of recursion and requires us to increase the limit to 256.10#![recursion_limit = "1024"]1112// Make the WASM binary available.13#[cfg(feature = "std")]14include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));1516use sp_api::impl_runtime_apis;17use sp_core::{ crypto::KeyTypeId, OpaqueMetadata, H256, U256, H160 };18// #[cfg(any(feature = "std", test))]19// pub use sp_runtime::BuildStorage;2021use sp_runtime::{22    Permill, Perbill, Percent,23    create_runtime_str, generic, impl_opaque_keys,24    traits::{25        AccountIdLookup, ConvertInto, BlakeTwo256, Block as BlockT, IdentifyAccount, 26		Verify, AccountIdConversion,27    },28    transaction_validity::{TransactionSource, TransactionValidity},29    ApplyExtrinsicResult, MultiSignature,30};3132use sp_std::prelude::*;3334#[cfg(feature = "std")]35use sp_version::NativeVersion;36use sp_version::RuntimeVersion;37pub use pallet_transaction_payment::{Multiplier, TargetedFeeAdjustment, FeeDetails, RuntimeDispatchInfo};38// A few exports that help ease life for downstream crates.39pub use pallet_balances::Call as BalancesCall;40pub use pallet_evm::{EnsureAddressTruncated, HashedAddressMapping, Runner};41pub use frame_support::{42    construct_runtime,43	match_type,44    dispatch::DispatchResult,45	PalletId,46    parameter_types,47    StorageValue,48	ConsensusEngineId,49    traits::{50        All, Currency, ExistenceRequirement, Get, IsInVec, KeyOwnerProofSystem, LockIdentifier, OnUnbalanced, Randomness, FindAuthor51    },52    weights::{53        constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_PER_SECOND},54        DispatchClass, DispatchInfo, GetDispatchInfo, IdentityFee, Pays, PostDispatchInfo, Weight,55        WeightToFeePolynomial, WeightToFeeCoefficient, WeightToFeeCoefficients56    },57};58use nft_data_structs::*;59use pallet_contracts::weights::WeightInfo;60// #[cfg(any(feature = "std", test))]61use frame_system::{62    self as system,63    EnsureRoot, EnsureSigned,64	limits::{BlockWeights, BlockLength},65};66use sp_arithmetic::{traits::{BaseArithmetic, Unsigned}};67use smallvec::smallvec;68use codec::{Encode, Decode};69use pallet_evm::{Account as EVMAccount, FeeCalculator, OnMethodCall};70use fp_rpc::TransactionStatus;71use sp_core::crypto::Public;72use sp_runtime::{73	traits::{ 74		Dispatchable,75	},76};77use pallet_contracts::chain_extension::UncheckedFrom;787980pub use pallet_timestamp::Call as TimestampCall;81pub use sp_consensus_aura::sr25519::AuthorityId as AuraId;8283// Polkadot imports84use pallet_xcm::XcmPassthrough;85use polkadot_parachain::primitives::Sibling;86use xcm::v0::Xcm;87use xcm::v0::{BodyId, Junction::*, MultiAsset, MultiLocation, MultiLocation::*, NetworkId};88use xcm_builder::{89	AccountId32Aliases, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, CurrencyAdapter,90	EnsureXcmOrigin, FixedWeightBounds, IsConcrete, LocationInverter, NativeAsset,91	ParentAsSuperuser, ParentIsDefault, RelayChainAsNative, SiblingParachainAsNative,92	SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32,93	SovereignSignedViaLocation, TakeWeightCredit, UsingComponents,94};95use xcm_executor::{Config, XcmExecutor};969798mod chain_extension;99use crate::chain_extension::{ NFTExtension, Imbalance };100101/// Re-export a nft pallet102/// TODO: Check this re-export. Is this safe and good style?103// extern crate pallet_nft;104// pub use pallet_nft::*;105106/// Reimport pallet inflation107// extern crate pallet_inflation;108// pub use pallet_inflation::*;109110/// An index to a block.111pub type BlockNumber = u32;112113/// Alias to 512-bit hash when used in the context of a transaction signature on the chain.114pub type Signature = MultiSignature;115116/// Some way of identifying an account on the chain. We intentionally make it equivalent117/// to the public key of our transaction signing scheme.118pub type AccountId = <<Signature as Verify>::Signer as IdentifyAccount>::AccountId;119120/// The type for looking up accounts. We don't expect more than 4 billion of them, but you121/// never know...122pub type AccountIndex = u32;123124/// Balance of an account.125pub type Balance = u128;126127/// Index of a transaction in the chain.128pub type Index = u32;129130/// A hash of some data used by the chain.131pub type Hash = sp_core::H256;132133/// Digest item type.134pub type DigestItem = generic::DigestItem<Hash>;135136mod nft_weights;137138/// Opaque types. These are used by the CLI to instantiate machinery that don't need to know139/// the specifics of the runtime. They can then be made to be agnostic over specific formats140/// of data like extrinsics, allowing for them to continue syncing the network through upgrades141/// to even the core data structures.142pub mod opaque {143	use super::*;144145	pub use sp_runtime::OpaqueExtrinsic as UncheckedExtrinsic;146147    /// Opaque block type.148    pub type Block = generic::Block<Header, UncheckedExtrinsic>;149150    pub type SessionHandlers = ();151152	impl_opaque_keys! {153        pub struct SessionKeys {154			pub aura: Aura,155		}156    }157}158159/// This runtime version.160pub const VERSION: RuntimeVersion = RuntimeVersion {161	spec_name: create_runtime_str!("nft"),162	impl_name: create_runtime_str!("nft"),163	authoring_version: 1,164	spec_version: 3,165	impl_version: 1,166	apis: RUNTIME_API_VERSIONS,167	transaction_version: 1,168};169170pub const MILLISECS_PER_BLOCK: u64 = 12000;171172pub const SLOT_DURATION: u64 = MILLISECS_PER_BLOCK;173174// These time units are defined in number of blocks.175pub const MINUTES: BlockNumber = 60_000 / (MILLISECS_PER_BLOCK as BlockNumber);176pub const HOURS: BlockNumber = MINUTES * 60;177pub const DAYS: BlockNumber = HOURS * 24;178179#[derive(codec::Encode, codec::Decode)]180pub enum XCMPMessage<XAccountId, XBalance> {181    /// Transfer tokens to the given account from the Parachain account.182    TransferToken(XAccountId, XBalance),183}184185/// The version information used to identify this runtime when compiled natively.186#[cfg(feature = "std")]187pub fn native_version() -> NativeVersion {188	NativeVersion {189		runtime_version: VERSION,190		can_author_with: Default::default(),191	}192}193194type NegativeImbalance = <Balances as Currency<AccountId>>::NegativeImbalance;195196pub struct DealWithFees;197impl OnUnbalanced<NegativeImbalance> for DealWithFees {198	fn on_unbalanceds<B>(mut fees_then_tips: impl Iterator<Item=NegativeImbalance>) {199		if let Some(fees) = fees_then_tips.next() {200			// for fees, 100% to treasury201			let mut split = fees.ration(100, 0);202			if let Some(tips) = fees_then_tips.next() {203				// for tips, if any, 100% to treasury204				tips.ration_merge_into(100, 0, &mut split);205			}206			Treasury::on_unbalanced(split.0);207			// Author::on_unbalanced(split.1);208		}209	}210}211212/// We assume that ~10% of the block weight is consumed by `on_initalize` handlers.213/// This is used to limit the maximal weight of a single extrinsic.214const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(10);215/// We allow `Normal` extrinsics to fill up the block up to 75%, the rest can be used216/// by  Operational  extrinsics.217const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75);218/// We allow for 2 seconds of compute with a 6 second average block time.219const MAXIMUM_BLOCK_WEIGHT: Weight = 2 * WEIGHT_PER_SECOND;220221parameter_types! {222	pub const BlockHashCount: BlockNumber = 2400;223	pub RuntimeBlockLength: BlockLength =224		BlockLength::max_with_normal_ratio(5 * 1024 * 1024, NORMAL_DISPATCH_RATIO);225	pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);226	pub const MaximumBlockLength: u32 = 5 * 1024 * 1024;227	pub RuntimeBlockWeights: BlockWeights = BlockWeights::builder()228		.base_block(BlockExecutionWeight::get())229		.for_class(DispatchClass::all(), |weights| {230			weights.base_extrinsic = ExtrinsicBaseWeight::get();231		})232		.for_class(DispatchClass::Normal, |weights| {233			weights.max_total = Some(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT);234		})235		.for_class(DispatchClass::Operational, |weights| {236			weights.max_total = Some(MAXIMUM_BLOCK_WEIGHT);237			// Operational transactions have some extra reserved space, so that they238			// are included even if block reached `MAXIMUM_BLOCK_WEIGHT`.239			weights.reserved = Some(240				MAXIMUM_BLOCK_WEIGHT - NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT241			);242		})243		.avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO)244		.build_or_panic();245	pub const Version: RuntimeVersion = VERSION;246	pub const SS58Prefix: u8 = 42;247}248249250parameter_types! {251	pub const ChainId: u64 = 8888;252}253254impl pallet_evm::Config for Runtime {255	type BlockGasLimit = BlockGasLimit;256	type FeeCalculator = ();257	type GasWeightMapping = ();258	type CallOrigin = EnsureAddressTruncated;259	type WithdrawOrigin = EnsureAddressTruncated;260	type AddressMapping = HashedAddressMapping<Self::Hashing>;261	type Precompiles = ();262	type Currency = Balances;263	type Event = Event;264	type OnMethodCall = pallet_nft::NftErcSupport<Self>;265	type ChainId = ChainId;266	type Runner = pallet_evm::runner::stack::Runner<Self>;267	type OnChargeTransaction = ();268}269270pub struct EthereumFindAuthor<F>(core::marker::PhantomData<F>);271impl<F: FindAuthor<u32>> FindAuthor<H160> for EthereumFindAuthor<F>272{273	fn find_author<'a, I>(digests: I) -> Option<H160> where274		I: 'a + IntoIterator<Item=(ConsensusEngineId, &'a [u8])>275	{276		if let Some(author_index) = F::find_author(digests) {277			let authority_id = Aura::authorities()[author_index as usize].clone();278			return Some(H160::from_slice(&authority_id.to_raw_vec()[4..24]));279		}280		None281	}282}283284parameter_types! {285	pub BlockGasLimit: U256 = U256::from(u32::max_value());286}287288impl pallet_ethereum::Config for Runtime {289	type Event = Event;290	type FindAuthor = EthereumFindAuthor<Aura>;291	type StateRoot = pallet_ethereum::IntermediateStateRoot;292	type EvmSubmitLog = pallet_evm::Pallet<Runtime>;293}294295impl system::Config for Runtime {296    /// The data to be stored in an account.297    type AccountData = pallet_balances::AccountData<Balance>;298    /// The identifier used to distinguish between accounts.299    type AccountId = AccountId;300    /// The basic call filter to use in dispatchable.301    type BaseCallFilter = ();302    /// Maximum number of block number to block hash mappings to keep (oldest pruned first).303    type BlockHashCount = BlockHashCount;304    /// The maximum length of a block (in bytes).305	type BlockLength = RuntimeBlockLength;306    /// The index type for blocks.307    type BlockNumber = BlockNumber;308    /// The weight of the overhead invoked on the block import process, independent of the extrinsics included in that block.309	type BlockWeights = RuntimeBlockWeights;310    /// The aggregated dispatch type that is available for extrinsics.311    type Call = Call;312    /// The weight of database operations that the runtime can invoke.313    type DbWeight = RocksDbWeight;314    /// The ubiquitous event type.315    type Event = Event;316    /// The type for hashing blocks and tries.317    type Hash = Hash;318	/// The hashing algorithm used.319    type Hashing = BlakeTwo256;320    /// The header type.321    type Header = generic::Header<BlockNumber, BlakeTwo256>;322    /// The index type for storing how many extrinsics an account has signed.323    type Index = Index;324    /// The lookup mechanism to get account ID from whatever is passed in dispatchers.325    type Lookup = AccountIdLookup<AccountId, ()>;326    /// What to do if an account is fully reaped from the system.327    type OnKilledAccount = ();328    /// What to do if a new account is created.329    type OnNewAccount = ();330    type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode<Self>;331    /// The ubiquitous origin type.332    type Origin = Origin;333 	/// This type is being generated by `construct_runtime!`.334    type PalletInfo = PalletInfo;335    /// This is used as an identifier of the chain. 42 is the generic substrate prefix.336	type SS58Prefix = SS58Prefix;337	/// Weight information for the extrinsics of this pallet.338    type SystemWeightInfo = system::weights::SubstrateWeight<Runtime>;339    /// Version of the runtime.340    type Version = Version;341}342343parameter_types! {344	pub const MinimumPeriod: u64 = SLOT_DURATION / 2;345}346347impl pallet_timestamp::Config for Runtime {348	/// A timestamp: milliseconds since the unix epoch.349	type Moment = u64;350	type OnTimestampSet = ();351	type MinimumPeriod = MinimumPeriod;352	type WeightInfo = ();353}354355parameter_types! {356	// pub const ExistentialDeposit: u128 = 500;357	pub const ExistentialDeposit: u128 = 0;358	pub const MaxLocks: u32 = 50;359}360361impl pallet_balances::Config for Runtime {362	type MaxLocks = MaxLocks;363	/// The type for recording an account's balance.364	type Balance = Balance;365	/// The ubiquitous event type.366	type Event = Event;367	type DustRemoval = Treasury;368	type ExistentialDeposit = ExistentialDeposit;369	type AccountStore = System;370	type WeightInfo = pallet_balances::weights::SubstrateWeight<Runtime>;371}372373pub const MICROUNIQUE: Balance = 1_000_000_000;374pub const MILLIUNIQUE: Balance = 1_000 * MICROUNIQUE;375pub const CENTIUNIQUE: Balance = 10 * MILLIUNIQUE;376pub const UNIQUE: Balance      = 100 * CENTIUNIQUE;377378pub const fn deposit(items: u32, bytes: u32) -> Balance {379	items as Balance * 15 * CENTIUNIQUE + (bytes as Balance) * 6 * CENTIUNIQUE380}381382parameter_types! {383	pub TombstoneDeposit: Balance = deposit(384		1,385		sp_std::mem::size_of::<pallet_contracts::Pallet<Runtime>> as u32,386	);387	pub DepositPerContract: Balance = TombstoneDeposit::get();388	pub const DepositPerStorageByte: Balance = deposit(0, 1);389	pub const DepositPerStorageItem: Balance = deposit(1, 0);390	pub RentFraction: Perbill = Perbill::from_rational(1u32, 30 * DAYS);391	pub const SurchargeReward: Balance = 150 * MILLIUNIQUE;392	pub const SignedClaimHandicap: u32 = 2;393	pub const MaxDepth: u32 = 32;394	pub const MaxValueSize: u32 = 16 * 1024;395	pub const MaxCodeSize: u32 = 1024 * 1024 * 25; // 25 Mb396	// The lazy deletion runs inside on_initialize.397	pub DeletionWeightLimit: Weight = AVERAGE_ON_INITIALIZE_RATIO *398		RuntimeBlockWeights::get().max_block;399	// The weight needed for decoding the queue should be less or equal than a fifth400	// of the overall weight dedicated to the lazy deletion.401	pub DeletionQueueDepth: u32 = ((DeletionWeightLimit::get() / (402			<Runtime as pallet_contracts::Config>::WeightInfo::on_initialize_per_queue_item(1) -403			<Runtime as pallet_contracts::Config>::WeightInfo::on_initialize_per_queue_item(0)404		)) / 5) as u32;405	pub Schedule: pallet_contracts::Schedule<Runtime> = Default::default();406}407408impl pallet_contracts::Config for Runtime {409	type Time = Timestamp;410	type Randomness = RandomnessCollectiveFlip;411	type Currency = Balances;412	type Event = Event;413	type RentPayment = ();414	type SignedClaimHandicap = SignedClaimHandicap;415	type TombstoneDeposit = TombstoneDeposit;416	type DepositPerContract = DepositPerContract;417	type DepositPerStorageByte = DepositPerStorageByte;418	type DepositPerStorageItem = DepositPerStorageItem;419	type RentFraction = RentFraction;420	type SurchargeReward = SurchargeReward;421	// type MaxDepth = MaxDepth;422	// type MaxValueSize = MaxValueSize;423	type WeightPrice = pallet_transaction_payment::Module<Self>;424	type WeightInfo = pallet_contracts::weights::SubstrateWeight<Self>;425	type ChainExtension = NFTExtension;426	type DeletionQueueDepth = DeletionQueueDepth;427	type DeletionWeightLimit = DeletionWeightLimit;428	// type MaxCodeSize = MaxCodeSize;429	type Schedule = Schedule;430	type CallStack = [pallet_contracts::Frame<Self>; 31];431}432433parameter_types! {434	pub const TransactionByteFee: Balance = 501 * MICROUNIQUE; // Targeting 0.1 Unique per NFT transfer435}436437/// Linear implementor of `WeightToFeePolynomial`438pub struct LinearFee<T>(sp_std::marker::PhantomData<T>);439440impl<T> WeightToFeePolynomial for LinearFee<T> where441	T: BaseArithmetic + From<u32> + Copy + Unsigned442{443	type Balance = T;444445	fn polynomial() -> WeightToFeeCoefficients<Self::Balance> {446		smallvec!(WeightToFeeCoefficient {447			coeff_integer: 146_700u32.into(), // Targeting 0.1 Unique per NFT transfer448			coeff_frac: Perbill::zero(),449			negative: false,450			degree: 1,451		})452	}453}454455impl pallet_transaction_payment::Config for Runtime {456	type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter<Balances, ()>;457	type TransactionByteFee = TransactionByteFee;458	type WeightToFee = LinearFee<Balance>;459	type FeeMultiplierUpdate = ();460}461462parameter_types! {463	pub const ProposalBond: Permill = Permill::from_percent(5);464	pub const ProposalBondMinimum: Balance = 1 * UNIQUE;465	pub const SpendPeriod: BlockNumber = 5 * MINUTES;466	pub const Burn: Permill = Permill::from_percent(0);467	pub const TipCountdown: BlockNumber = 1 * DAYS;468	pub const TipFindersFee: Percent = Percent::from_percent(20);469	pub const TipReportDepositBase: Balance = 1 * UNIQUE;470	pub const DataDepositPerByte: Balance = 1 * CENTIUNIQUE;471	pub const BountyDepositBase: Balance = 1 * UNIQUE;472	pub const BountyDepositPayoutDelay: BlockNumber = 1 * DAYS;473	pub const TreasuryModuleId: PalletId = PalletId(*b"py/trsry");474	pub const BountyUpdatePeriod: BlockNumber = 14 * DAYS;475	pub const MaximumReasonLength: u32 = 16384;476	pub const BountyCuratorDeposit: Permill = Permill::from_percent(50);477	pub const BountyValueMinimum: Balance = 5 * UNIQUE;478	pub const MaxApprovals: u32 = 100;479}480481impl pallet_treasury::Config for Runtime {482	type PalletId = TreasuryModuleId;483	type Currency = Balances;484	type ApproveOrigin = EnsureRoot<AccountId>;485	type RejectOrigin = EnsureRoot<AccountId>;486	type Event = Event;487	type OnSlash = ();488	type ProposalBond = ProposalBond;489	type ProposalBondMinimum = ProposalBondMinimum;490	type SpendPeriod = SpendPeriod;491	type Burn = Burn;492	type BurnDestination = ();493	type SpendFunds = ();494	type WeightInfo = pallet_treasury::weights::SubstrateWeight<Runtime>;495	type MaxApprovals = MaxApprovals;496}497498impl pallet_sudo::Config for Runtime {499	type Event = Event;500	type Call = Call;501}502503parameter_types! {504	pub const MinVestedTransfer: Balance = 10 * UNIQUE;505}506507impl pallet_vesting::Config for Runtime {508	type Event = Event;509	type Currency = Balances;510	type BlockNumberToBalance = ConvertInto;511	type MinVestedTransfer = MinVestedTransfer;512	type WeightInfo = ();513}514515parameter_types! {516	pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 4;517	pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 4;518}519520impl cumulus_pallet_parachain_system::Config for Runtime {521	type Event = Event;522	type OnValidationData = ();523	type SelfParaId = parachain_info::Pallet<Runtime>;524	// type DownwardMessageHandlers = cumulus_primitives_utility::UnqueuedDmpAsParent<525	// 	MaxDownwardMessageWeight,526	// 	XcmExecutor<XcmConfig>,527	// 	Call,528	// >;529	type OutboundXcmpMessageSource = XcmpQueue;530	type DmpMessageHandler = DmpQueue;531	type ReservedDmpWeight = ReservedDmpWeight;532	type ReservedXcmpWeight = ReservedXcmpWeight;533	type XcmpMessageHandler = XcmpQueue;534}535536impl parachain_info::Config for Runtime {}537538impl cumulus_pallet_aura_ext::Config for Runtime {}539540parameter_types! {541	pub const RelayLocation: MultiLocation = X1(Parent);542	pub const RelayNetwork: NetworkId = NetworkId::Polkadot;543	pub RelayOrigin: Origin = cumulus_pallet_xcm::Origin::Relay.into();544	pub Ancestry: MultiLocation = X1(Parachain(ParachainInfo::parachain_id().into()));545}546547/// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used548/// when determining ownership of accounts for asset transacting and when attempting to use XCM549/// `Transact` in order to determine the dispatch Origin.550pub type LocationToAccountId = (551	// The parent (Relay-chain) origin converts to the default `AccountId`.552	ParentIsDefault<AccountId>,553	// Sibling parachain origins convert to AccountId via the `ParaId::into`.554	SiblingParachainConvertsVia<Sibling, AccountId>,555	// Straight up local `AccountId32` origins just alias directly to `AccountId`.556	AccountId32Aliases<RelayNetwork, AccountId>,557);558559/// Means for transacting assets on this chain.560pub type LocalAssetTransactor = CurrencyAdapter<561	// Use this currency:562	Balances,563	// Use this currency when it is a fungible asset matching the given location or name:564	IsConcrete<RelayLocation>,565	// Do a simple punn to convert an AccountId32 MultiLocation into a native chain account ID:566	LocationToAccountId,567	// Our chain's account ID type (we can't get away without mentioning it explicitly):568	AccountId,569	// We don't track any teleports.570	(),571>;572573/// This is the type we use to convert an (incoming) XCM origin into a local `Origin` instance,574/// ready for dispatching a transaction with Xcm's `Transact`. There is an `OriginKind` which can575/// biases the kind of local `Origin` it will become.576pub type XcmOriginToTransactDispatchOrigin = (577	// Sovereign account converter; this attempts to derive an `AccountId` from the origin location578	// using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for579	// foreign chains who want to have a local sovereign account on this chain which they control.580	SovereignSignedViaLocation<LocationToAccountId, Origin>,581	// Native converter for Relay-chain (Parent) location; will converts to a `Relay` origin when582	// recognised.583	RelayChainAsNative<RelayOrigin, Origin>,584	// Native converter for sibling Parachains; will convert to a `SiblingPara` origin when585	// recognised.586	SiblingParachainAsNative<cumulus_pallet_xcm::Origin, Origin>,587	// Superuser converter for the Relay-chain (Parent) location. This will allow it to issue a588	// transaction from the Root origin.589	ParentAsSuperuser<Origin>,590	// Native signed account converter; this just converts an `AccountId32` origin into a normal591	// `Origin::Signed` origin of the same 32-byte value.592	SignedAccountId32AsNative<RelayNetwork, Origin>,593	// Xcm origins can be represented natively under the Xcm pallet's Xcm origin.594	XcmPassthrough<Origin>,595);596597parameter_types! {598	// One XCM operation is 1_000_000 weight - almost certainly a conservative estimate.599	pub UnitWeightCost: Weight = 1_000_000;600	// 1200 UNIQUEs buy 1 second of weight.601	pub const WeightPrice: (MultiLocation, u128) = (X1(Parent), 1_200 * UNIQUE);602}603604match_type! {605	pub type ParentOrParentsUnitPlurality: impl Contains<MultiLocation> = {606		X1(Parent) | X2(Parent, Plurality { id: BodyId::Unit, .. })607	};608}609610pub type Barrier = (611	TakeWeightCredit,612	AllowTopLevelPaidExecutionFrom<All<MultiLocation>>,613	AllowUnpaidExecutionFrom<ParentOrParentsUnitPlurality>,614	// ^^^ Parent & its unit plurality gets free execution615);616617pub struct XcmConfig;618impl Config for XcmConfig {619	type Call = Call;620	type XcmSender = XcmRouter;621	// How to withdraw and deposit an asset.622	type AssetTransactor = LocalAssetTransactor;623	type OriginConverter = XcmOriginToTransactDispatchOrigin;624	type IsReserve = NativeAsset;625	type IsTeleporter = NativeAsset;	// <- should be enough to allow teleportation of ROC626	type LocationInverter = LocationInverter<Ancestry>;627	type Barrier = Barrier;628	type Weigher = FixedWeightBounds<UnitWeightCost, Call>;629	type Trader = UsingComponents<IdentityFee<Balance>, RelayLocation, AccountId, Balances, ()>;630	type ResponseHandler = ();	// Don't handle responses for now.631}632633// parameter_types! {634// 	pub const MaxDownwardMessageWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 10;635// }636637/// No local origins on this chain are allowed to dispatch XCM sends/executions.638pub type LocalOriginToLocation = (SignedToAccountId32<Origin, AccountId, RelayNetwork>,);639640/// The means for routing XCM messages which are not for local execution into the right message641/// queues.642pub type XcmRouter = (643	// Two routers - use UMP to communicate with the relay chain:644	cumulus_primitives_utility::ParentAsUmp<ParachainSystem>,645	// ..and XCMP to communicate with the sibling chains.646	XcmpQueue,647);648649impl pallet_xcm::Config for Runtime {650	type Event = Event;651	type SendXcmOrigin = EnsureXcmOrigin<Origin, LocalOriginToLocation>;652	type XcmRouter = XcmRouter;653	type ExecuteXcmOrigin = EnsureXcmOrigin<Origin, LocalOriginToLocation>;654	type XcmExecuteFilter = All<(MultiLocation, Xcm<Call>)>;655	type XcmExecutor = XcmExecutor<XcmConfig>;656	type XcmTeleportFilter = All<(MultiLocation, Vec<MultiAsset>)>;657	type XcmReserveTransferFilter = ();658	type Weigher = FixedWeightBounds<UnitWeightCost, Call>;659}660661impl cumulus_pallet_xcm::Config for Runtime {662	type Event = Event;663	type XcmExecutor = XcmExecutor<XcmConfig>;664}665666impl cumulus_pallet_xcmp_queue::Config for Runtime {667	type Event = Event;668	type XcmExecutor = XcmExecutor<XcmConfig>;669	type ChannelInfo = ParachainSystem;670}671672impl cumulus_pallet_dmp_queue::Config for Runtime {673	type Event = Event;674	type XcmExecutor = XcmExecutor<XcmConfig>;675	type ExecuteOverweightOrigin = frame_system::EnsureRoot<AccountId>;676}677678impl pallet_aura::Config for Runtime {679	type AuthorityId = AuraId;680}681682parameter_types! {683	pub TreasuryAccountId: AccountId = TreasuryModuleId::get().into_account();684	pub const CollectionCreationPrice: Balance = 100 * UNIQUE;685}686687/// Used for the pallet nft in `./nft.rs`688impl pallet_nft::Config for Runtime {689	type Event = Event;690	type WeightInfo = nft_weights::WeightInfo;691692	type EvmBackwardsAddressMapping = pallet_nft::MapBackwardsAddressTruncated;693	type EvmAddressMapping = HashedAddressMapping<Self::Hashing>;694	type CrossAccountId = pallet_nft::BasicCrossAccountId<Self>;695696	type Currency = Balances;697	type CollectionCreationPrice = CollectionCreationPrice;698	type TreasuryAccountId = TreasuryAccountId;699700	type EthereumChainId = ChainId;701	type EthereumTransactionSender = pallet_ethereum::Module<Runtime>;702}703704parameter_types! {705	pub const InflationBlockInterval: BlockNumber = 100; // every time per how many blocks inflation is applied706}707708/// Used for the pallet inflation709impl pallet_inflation::Config for Runtime {710	type Currency = Balances;711	type TreasuryAccountId = TreasuryAccountId;712	type InflationBlockInterval = InflationBlockInterval;713}714715parameter_types! {716	pub MaximumSchedulerWeight: Weight = Perbill::from_percent(50) *717		RuntimeBlockWeights::get().max_block;718	pub const MaxScheduledPerBlock: u32 = 50;719}720721pub struct Sponsoring;722impl SponsoringResolve<AccountId, Call> for Sponsoring {723724	fn resolve(who: &AccountId, call: &Call) -> Option<AccountId> 725	where 726		Call: Dispatchable<Info=DispatchInfo>,727		Call: IsSubType<pallet_nft::Call<Runtime>>, 728		Call: IsSubType<pallet_contracts::Call<Runtime>>,729		AccountId: AsRef<[u8]>,730		AccountId: UncheckedFrom<Hash>731	{732		pallet_nft_transaction_payment::Module::<Runtime>::withdraw_type(who, call)733	}734}735736type SponsorshipHandler = (737	pallet_nft::NftSponsorshipHandler<Runtime>,738    pallet_contract_helpers::ContractSponsorshipHandler<Runtime>,739);740741impl pallet_scheduler::Config for Runtime {742	type Event = Event;743	type Origin = Origin;744	type PalletsOrigin = OriginCaller;745	type Call = Call;746	type MaximumWeight = MaximumSchedulerWeight;747	type ScheduleOrigin = EnsureSigned<AccountId>;748	type MaxScheduledPerBlock = MaxScheduledPerBlock;749	type SponsorshipHandler = SponsorshipHandler;750	type WeightInfo = ();751}752753impl pallet_nft_transaction_payment::Config for Runtime {754	type SponsorshipHandler = SponsorshipHandler;755}756757impl pallet_nft_charge_transaction::Config for Runtime {}758759impl pallet_contract_helpers::Config for Runtime {}760761construct_runtime!(762    pub enum Runtime where763        Block = Block,764        NodeBlock = opaque::Block,765        UncheckedExtrinsic = UncheckedExtrinsic766    {767		Balances: pallet_balances::{Pallet, Call, Storage, Config<T>, Event<T>} = 30,768		Contracts: pallet_contracts::{Pallet, Call, Storage, Event<T>},769		RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Pallet, Call, Storage},770		Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent},771		TransactionPayment: pallet_transaction_payment::{Pallet, Storage},772        Treasury: pallet_treasury::{Pallet, Call, Storage, Config, Event<T>},773		Sudo: pallet_sudo::{Pallet, Call, Storage, Config<T>, Event<T>},774		System: system::{Pallet, Call, Storage, Config, Event<T>},775        Vesting: pallet_vesting::{Pallet, Call, Config<T>, Storage, Event<T>},776777		ParachainSystem: cumulus_pallet_parachain_system::{Pallet, Call, Storage, Inherent, Event<T>, ValidateUnsigned} = 20,778		ParachainInfo: parachain_info::{Pallet, Storage, Config} = 21,779780		Aura: pallet_aura::{Pallet, Config<T>},781		AuraExt: cumulus_pallet_aura_ext::{Pallet, Config},782783		// Frontier784		EVM: pallet_evm::{Pallet, Config, Call, Storage, Event<T>},785		Ethereum: pallet_ethereum::{Pallet, Config, Call, Storage, Event, ValidateUnsigned},786787		// XCM helpers.788		XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event<T>} = 50,789		PolkadotXcm: pallet_xcm::{Pallet, Call, Event<T>, Origin} = 51,790		CumulusXcm: cumulus_pallet_xcm::{Pallet, Call, Event<T>, Origin} = 52,791		DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event<T>} = 53,792793794		// Unique Pallets795        Inflation: pallet_inflation::{Pallet, Call, Storage},796		Nft: pallet_nft::{Pallet, Call, Config<T>, Storage, Event<T>},797		Scheduler: pallet_scheduler::{Pallet, Call, Storage, Event<T>},798		NftPayment: pallet_nft_transaction_payment::{Pallet, Call, Storage},799		Charging: pallet_nft_charge_transaction::{Pallet, Call, Storage },800		ContractHelpers: pallet_contract_helpers::{Pallet, Call, Storage},801    }802);803804pub struct TransactionConverter;805806impl fp_rpc::ConvertTransaction<UncheckedExtrinsic> for TransactionConverter {807	fn convert_transaction(&self, transaction: pallet_ethereum::Transaction) -> UncheckedExtrinsic {808		UncheckedExtrinsic::new_unsigned(pallet_ethereum::Call::<Runtime>::transact(transaction).into())809	}810}811812impl fp_rpc::ConvertTransaction<opaque::UncheckedExtrinsic> for TransactionConverter {813	fn convert_transaction(&self, transaction: pallet_ethereum::Transaction) -> opaque::UncheckedExtrinsic {814		let extrinsic = UncheckedExtrinsic::new_unsigned(pallet_ethereum::Call::<Runtime>::transact(transaction).into());815		let encoded = extrinsic.encode();816		opaque::UncheckedExtrinsic::decode(&mut &encoded[..]).expect("Encoded extrinsic is always valid")817	}818}819820/// The address format for describing accounts.821pub type Address = sp_runtime::MultiAddress<AccountId, ()>;822/// Block header type as expected by this runtime.823pub type Header = generic::Header<BlockNumber, BlakeTwo256>;824/// Block type as expected by this runtime.825pub type Block = generic::Block<Header, UncheckedExtrinsic>;826/// A Block signed with a Justification827pub type SignedBlock = generic::SignedBlock<Block>;828/// BlockId type as expected by this runtime.829pub type BlockId = generic::BlockId<Block>;830/// The SignedExtension to the basic transaction logic.831pub type SignedExtra = (832    system::CheckSpecVersion<Runtime>,833    // system::CheckTxVersion<Runtime>,834    system::CheckGenesis<Runtime>,835    system::CheckEra<Runtime>,836    system::CheckNonce<Runtime>,837    system::CheckWeight<Runtime>,838    pallet_nft_charge_transaction::ChargeTransactionPayment<Runtime>,839	pallet_contract_helpers::ContractHelpersExtension<Runtime>,840);841/// Unchecked extrinsic type as expected by this runtime.842pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<Address, Call, Signature, SignedExtra>;843/// Extrinsic type that has already been checked.844pub type CheckedExtrinsic = generic::CheckedExtrinsic<AccountId, Call, SignedExtra>;845/// Executive: handles dispatch to the various modules.846pub type Executive = frame_executive::Executive<847    Runtime,848    Block,849    frame_system::ChainContext<Runtime>,850    Runtime,851    AllPallets,852>;853854impl_opaque_keys! {855	pub struct SessionKeys {856		pub aura: Aura,857	}858}859860impl_runtime_apis! {861	impl pallet_nft::NftApi<Block>862		for Runtime863	{864		fn eth_contract_code(account: H160) -> Option<Vec<u8>> {865			<pallet_nft::NftErcSupport<Runtime>>::get_code(&account)866		}867	}868869    impl sp_api::Core<Block> for Runtime {870        fn version() -> RuntimeVersion {871            VERSION872        }873874        fn execute_block(block: Block) {875            Executive::execute_block(block)876        }877878        fn initialize_block(header: &<Block as BlockT>::Header) {879            Executive::initialize_block(header)880        }881    }882883    impl sp_api::Metadata<Block> for Runtime {884        fn metadata() -> OpaqueMetadata {885            Runtime::metadata().into()886        }887    }888889    impl sp_block_builder::BlockBuilder<Block> for Runtime {890        fn apply_extrinsic(extrinsic: <Block as BlockT>::Extrinsic) -> ApplyExtrinsicResult {891            Executive::apply_extrinsic(extrinsic)892        }893894        fn finalize_block() -> <Block as BlockT>::Header {895            Executive::finalize_block()896        }897898        fn inherent_extrinsics(data: sp_inherents::InherentData) -> Vec<<Block as BlockT>::Extrinsic> {899            data.create_extrinsics()900        }901902        fn check_inherents(903            block: Block,904            data: sp_inherents::InherentData,905        ) -> sp_inherents::CheckInherentsResult {906            data.check_extrinsics(&block)907        }908909        // fn random_seed() -> <Block as BlockT>::Hash {910        //     RandomnessCollectiveFlip::random_seed().0911        // }912    }913914    impl sp_transaction_pool::runtime_api::TaggedTransactionQueue<Block> for Runtime {915        fn validate_transaction(916            source: TransactionSource,917            tx: <Block as BlockT>::Extrinsic,918        ) -> TransactionValidity {919            Executive::validate_transaction(source, tx)920        }921    }922923	impl sp_offchain::OffchainWorkerApi<Block> for Runtime {924		fn offchain_worker(header: &<Block as BlockT>::Header) {925			Executive::offchain_worker(header)926		}927	}928929	impl fp_rpc::EthereumRuntimeRPCApi<Block> for Runtime {930		fn chain_id() -> u64 {931			<Runtime as pallet_evm::Config>::ChainId::get()932		}933934		fn account_basic(address: H160) -> EVMAccount {935			EVM::account_basic(&address)936		}937938		fn gas_price() -> U256 {939			<Runtime as pallet_evm::Config>::FeeCalculator::min_gas_price()940		}941942		fn account_code_at(address: H160) -> Vec<u8> {943			EVM::account_codes(address)944		}945946		fn author() -> H160 {947			<pallet_ethereum::Module<Runtime>>::find_author()948		}949950		fn storage_at(address: H160, index: U256) -> H256 {951			let mut tmp = [0u8; 32];952			index.to_big_endian(&mut tmp);953			EVM::account_storages(address, H256::from_slice(&tmp[..]))954		}955956		fn call(957			from: H160,958			to: H160,959			data: Vec<u8>,960			value: U256,961			gas_limit: U256,962			gas_price: Option<U256>,963			nonce: Option<U256>,964			estimate: bool,965		) -> Result<pallet_evm::CallInfo, sp_runtime::DispatchError> {966			let config = if estimate {967				let mut config = <Runtime as pallet_evm::Config>::config().clone();968				config.estimate = true;969				Some(config)970			} else {971				None972			};973974			<Runtime as pallet_evm::Config>::Runner::call(975				from,976				to,977				data,978				value,979				gas_limit.low_u64(),980				gas_price,981				nonce,982				config.as_ref().unwrap_or(<Runtime as pallet_evm::Config>::config()),983			).map_err(|err| err.into())984		}985986		fn create(987			from: H160,988			data: Vec<u8>,989			value: U256,990			gas_limit: U256,991			gas_price: Option<U256>,992			nonce: Option<U256>,993			estimate: bool,994		) -> Result<pallet_evm::CreateInfo, sp_runtime::DispatchError> {995			let config = if estimate {996				let mut config = <Runtime as pallet_evm::Config>::config().clone();997				config.estimate = true;998				Some(config)999			} else {1000				None1001			};10021003			<Runtime as pallet_evm::Config>::Runner::create(1004				from,1005				data,1006				value,1007				gas_limit.low_u64(),1008				gas_price,1009				nonce,1010				config.as_ref().unwrap_or(<Runtime as pallet_evm::Config>::config()),1011			).map_err(|err| err.into())1012		}10131014		fn current_transaction_statuses() -> Option<Vec<TransactionStatus>> {1015			Ethereum::current_transaction_statuses()1016		}10171018		fn current_block() -> Option<pallet_ethereum::Block> {1019			Ethereum::current_block()1020		}10211022		fn current_receipts() -> Option<Vec<pallet_ethereum::Receipt>> {1023			Ethereum::current_receipts()1024		}10251026		fn current_all() -> (1027			Option<pallet_ethereum::Block>,1028			Option<Vec<pallet_ethereum::Receipt>>,1029			Option<Vec<TransactionStatus>>1030		) {1031			(1032				Ethereum::current_block(),1033				Ethereum::current_receipts(),1034				Ethereum::current_transaction_statuses()1035			)1036		}1037	}10381039	impl sp_session::SessionKeys<Block> for Runtime {1040		fn decode_session_keys(1041			encoded: Vec<u8>,1042		) -> Option<Vec<(Vec<u8>, KeyTypeId)>> {1043			SessionKeys::decode_into_raw_public_keys(&encoded)1044		}10451046		fn generate_session_keys(seed: Option<Vec<u8>>) -> Vec<u8> {1047			SessionKeys::generate(seed)1048		}1049	}10501051	impl sp_consensus_aura::AuraApi<Block, AuraId> for Runtime {1052		fn slot_duration() -> sp_consensus_aura::SlotDuration {1053			sp_consensus_aura::SlotDuration::from_millis(Aura::slot_duration())1054		}10551056		fn authorities() -> Vec<AuraId> {1057			Aura::authorities()1058		}1059	}10601061	impl cumulus_primitives_core::CollectCollationInfo<Block> for Runtime {1062		fn collect_collation_info() -> cumulus_primitives_core::CollationInfo {1063			ParachainSystem::collect_collation_info()1064		}1065	}10661067	impl frame_system_rpc_runtime_api::AccountNonceApi<Block, AccountId, Index> for Runtime {1068		fn account_nonce(account: AccountId) -> Index {1069			System::account_nonce(account)1070		}1071	}10721073	impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi<Block, Balance> for Runtime {1074		fn query_info(uxt: <Block as BlockT>::Extrinsic, len: u32) -> RuntimeDispatchInfo<Balance> {1075			TransactionPayment::query_info(uxt, len)1076		}1077		fn query_fee_details(uxt: <Block as BlockT>::Extrinsic, len: u32) -> FeeDetails<Balance> {1078			TransactionPayment::query_fee_details(uxt, len)1079		}1080	}10811082	impl pallet_contracts_rpc_runtime_api::ContractsApi<Block, AccountId, Balance, BlockNumber, Hash>1083		for Runtime1084	{1085		fn call(1086			origin: AccountId,1087			dest: AccountId,1088			value: Balance,1089			gas_limit: u64,1090			input_data: Vec<u8>,1091		) -> pallet_contracts_primitives::ContractExecResult {1092			Contracts::bare_call(origin, dest, value, gas_limit, input_data, false)1093		}10941095		fn instantiate(1096			origin: AccountId,1097			endowment: Balance,1098			gas_limit: u64,1099			code: pallet_contracts_primitives::Code<Hash>,1100			data: Vec<u8>,1101			salt: Vec<u8>,1102		) -> pallet_contracts_primitives::ContractInstantiateResult<AccountId, BlockNumber>1103		{1104			Contracts::bare_instantiate(origin, endowment, gas_limit, code, data, salt, true, false)1105		}11061107		fn get_storage(1108			address: AccountId,1109			key: [u8; 32],1110		) -> pallet_contracts_primitives::GetStorageResult {1111			Contracts::get_storage(address, key)1112		}11131114		fn rent_projection(1115			address: AccountId,1116		) -> pallet_contracts_primitives::RentProjectionResult<BlockNumber> {1117			Contracts::rent_projection(address)1118		}1119	}11201121    #[cfg(feature = "runtime-benchmarks")]1122	impl frame_benchmarking::Benchmark<Block> for Runtime {1123		fn dispatch_benchmark(1124			config: frame_benchmarking::BenchmarkConfig1125		) -> Result<Vec<frame_benchmarking::BenchmarkBatch>, sp_runtime::RuntimeString> {1126			use frame_benchmarking::{Benchmarking, BenchmarkBatch, add_benchmark, TrackedStorageKey};11271128			let whitelist: Vec<TrackedStorageKey> = vec![1129				// Alice account1130				hex_literal::hex!("d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d").to_vec().into(),1131				// // Total Issuance1132				// hex_literal::hex!("c2261276cc9d1f8598ea4b6a74b15c2f57c875e4cff74148e4628f264b974c80").to_vec().into(),1133				// // Execution Phase1134				// hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef7ff553b5a9862a516939d82b3d3d8661a").to_vec().into(),1135				// // Event Count1136				// hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef70a98fdbe9ce6c55837576c60c7af3850").to_vec().into(),1137				// // System Events1138				// hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef780d41e5e16056765bc8461851072c9d7").to_vec().into(),1139			];11401141			let mut batches = Vec::<BenchmarkBatch>::new();1142			let params = (&config, &whitelist);11431144			add_benchmark!(params, batches, pallet_nft, Nft);1145			add_benchmark!(params, batches, pallet_inflation, Inflation);11461147			if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) }1148			Ok(batches)1149		}1150	}1151}11521153cumulus_pallet_parachain_system::register_validate_block!(1154	Runtime,1155	cumulus_pallet_aura_ext::BlockExecutor::<Runtime, Executive>,1156);
after · runtime/src/lib.rs
1//2// This file is subject to the terms and conditions defined in3// file 'LICENSE', which is part of this source code package.4//56//! The Substrate Node Template runtime. This can be compiled with `#[no_std]`, ready for Wasm.78#![cfg_attr(not(feature = "std"), no_std)]9// `construct_runtime!` does a lot of recursion and requires us to increase the limit to 256.10#![recursion_limit = "1024"]11#![allow(clippy::from_over_into, clippy::identity_op)]12#![allow(clippy::fn_to_numeric_cast_with_truncation)]13// Make the WASM binary available.14#[cfg(feature = "std")]15include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));1617use sp_api::impl_runtime_apis;18use sp_core::{crypto::KeyTypeId, OpaqueMetadata, H256, U256, H160};19// #[cfg(any(feature = "std", test))]20// pub use sp_runtime::BuildStorage;2122use sp_runtime::{23	Permill, Perbill, Percent, create_runtime_str, generic, impl_opaque_keys,24	traits::{25		AccountIdLookup, ConvertInto, BlakeTwo256, Block as BlockT, IdentifyAccount, Verify,26		AccountIdConversion,27	},28	transaction_validity::{TransactionSource, TransactionValidity},29	ApplyExtrinsicResult, MultiSignature,30};3132use sp_std::prelude::*;3334#[cfg(feature = "std")]35use sp_version::NativeVersion;36use sp_version::RuntimeVersion;37pub use pallet_transaction_payment::{38	Multiplier, TargetedFeeAdjustment, FeeDetails, RuntimeDispatchInfo,39};40// A few exports that help ease life for downstream crates.41pub use pallet_balances::Call as BalancesCall;42pub use pallet_evm::{EnsureAddressTruncated, HashedAddressMapping, Runner};43pub use frame_support::{44	construct_runtime, match_type,45	dispatch::DispatchResult,46	PalletId, parameter_types, StorageValue, ConsensusEngineId,47	traits::{48		All, Currency, ExistenceRequirement, Get, IsInVec, KeyOwnerProofSystem, LockIdentifier,49		OnUnbalanced, Randomness, FindAuthor,50	},51	weights::{52		constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_PER_SECOND},53		DispatchClass, DispatchInfo, GetDispatchInfo, IdentityFee, Pays, PostDispatchInfo, Weight,54		WeightToFeePolynomial, WeightToFeeCoefficient, WeightToFeeCoefficients,55	},56};57use nft_data_structs::*;58use pallet_contracts::weights::WeightInfo;59// #[cfg(any(feature = "std", test))]60use frame_system::{61	self as system, EnsureRoot, EnsureSigned,62	limits::{BlockWeights, BlockLength},63};64use sp_arithmetic::{65	traits::{BaseArithmetic, Unsigned},66};67use smallvec::smallvec;68use codec::{Encode, Decode};69use pallet_evm::{Account as EVMAccount, FeeCalculator, OnMethodCall};70use fp_rpc::TransactionStatus;71use sp_core::crypto::Public;72use sp_runtime::{73	traits::{Dispatchable},74};75use pallet_contracts::chain_extension::UncheckedFrom;7677pub use pallet_timestamp::Call as TimestampCall;78pub use sp_consensus_aura::sr25519::AuthorityId as AuraId;7980// Polkadot imports81use pallet_xcm::XcmPassthrough;82use polkadot_parachain::primitives::Sibling;83use xcm::v0::Xcm;84use xcm::v0::{BodyId, Junction::*, MultiAsset, MultiLocation, MultiLocation::*, NetworkId};85use xcm_builder::{86	AccountId32Aliases, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, CurrencyAdapter,87	EnsureXcmOrigin, FixedWeightBounds, IsConcrete, LocationInverter, NativeAsset,88	ParentAsSuperuser, ParentIsDefault, RelayChainAsNative, SiblingParachainAsNative,89	SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32,90	SovereignSignedViaLocation, TakeWeightCredit, UsingComponents,91};92use xcm_executor::{Config, XcmExecutor};9394mod chain_extension;95use crate::chain_extension::{NFTExtension, Imbalance};9697/// Re-export a nft pallet98/// TODO: Check this re-export. Is this safe and good style?99// extern crate pallet_nft;100// pub use pallet_nft::*;101102/// Reimport pallet inflation103// extern crate pallet_inflation;104// pub use pallet_inflation::*;105106/// An index to a block.107pub type BlockNumber = u32;108109/// Alias to 512-bit hash when used in the context of a transaction signature on the chain.110pub type Signature = MultiSignature;111112/// Some way of identifying an account on the chain. We intentionally make it equivalent113/// to the public key of our transaction signing scheme.114pub type AccountId = <<Signature as Verify>::Signer as IdentifyAccount>::AccountId;115116/// The type for looking up accounts. We don't expect more than 4 billion of them, but you117/// never know...118pub type AccountIndex = u32;119120/// Balance of an account.121pub type Balance = u128;122123/// Index of a transaction in the chain.124pub type Index = u32;125126/// A hash of some data used by the chain.127pub type Hash = sp_core::H256;128129/// Digest item type.130pub type DigestItem = generic::DigestItem<Hash>;131132mod nft_weights;133134/// Opaque types. These are used by the CLI to instantiate machinery that don't need to know135/// the specifics of the runtime. They can then be made to be agnostic over specific formats136/// of data like extrinsics, allowing for them to continue syncing the network through upgrades137/// to even the core data structures.138pub mod opaque {139	use super::*;140141	pub use sp_runtime::OpaqueExtrinsic as UncheckedExtrinsic;142143	/// Opaque block type.144	pub type Block = generic::Block<Header, UncheckedExtrinsic>;145146	pub type SessionHandlers = ();147148	impl_opaque_keys! {149		pub struct SessionKeys {150			pub aura: Aura,151		}152	}153}154155/// This runtime version.156pub const VERSION: RuntimeVersion = RuntimeVersion {157	spec_name: create_runtime_str!("nft"),158	impl_name: create_runtime_str!("nft"),159	authoring_version: 1,160	spec_version: 3,161	impl_version: 1,162	apis: RUNTIME_API_VERSIONS,163	transaction_version: 1,164};165166pub const MILLISECS_PER_BLOCK: u64 = 12000;167168pub const SLOT_DURATION: u64 = MILLISECS_PER_BLOCK;169170// These time units are defined in number of blocks.171pub const MINUTES: BlockNumber = 60_000 / (MILLISECS_PER_BLOCK as BlockNumber);172pub const HOURS: BlockNumber = MINUTES * 60;173pub const DAYS: BlockNumber = HOURS * 24;174175#[derive(codec::Encode, codec::Decode)]176pub enum XCMPMessage<XAccountId, XBalance> {177	/// Transfer tokens to the given account from the Parachain account.178	TransferToken(XAccountId, XBalance),179}180181/// The version information used to identify this runtime when compiled natively.182#[cfg(feature = "std")]183pub fn native_version() -> NativeVersion {184	NativeVersion {185		runtime_version: VERSION,186		can_author_with: Default::default(),187	}188}189190type NegativeImbalance = <Balances as Currency<AccountId>>::NegativeImbalance;191192pub struct DealWithFees;193impl OnUnbalanced<NegativeImbalance> for DealWithFees {194	fn on_unbalanceds<B>(mut fees_then_tips: impl Iterator<Item = NegativeImbalance>) {195		if let Some(fees) = fees_then_tips.next() {196			// for fees, 100% to treasury197			let mut split = fees.ration(100, 0);198			if let Some(tips) = fees_then_tips.next() {199				// for tips, if any, 100% to treasury200				tips.ration_merge_into(100, 0, &mut split);201			}202			Treasury::on_unbalanced(split.0);203			// Author::on_unbalanced(split.1);204		}205	}206}207208/// We assume that ~10% of the block weight is consumed by `on_initalize` handlers.209/// This is used to limit the maximal weight of a single extrinsic.210const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(10);211/// We allow `Normal` extrinsics to fill up the block up to 75%, the rest can be used212/// by  Operational  extrinsics.213const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75);214/// We allow for 2 seconds of compute with a 6 second average block time.215const MAXIMUM_BLOCK_WEIGHT: Weight = 2 * WEIGHT_PER_SECOND;216217parameter_types! {218	pub const BlockHashCount: BlockNumber = 2400;219	pub RuntimeBlockLength: BlockLength =220		BlockLength::max_with_normal_ratio(5 * 1024 * 1024, NORMAL_DISPATCH_RATIO);221	pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);222	pub const MaximumBlockLength: u32 = 5 * 1024 * 1024;223	pub RuntimeBlockWeights: BlockWeights = BlockWeights::builder()224		.base_block(BlockExecutionWeight::get())225		.for_class(DispatchClass::all(), |weights| {226			weights.base_extrinsic = ExtrinsicBaseWeight::get();227		})228		.for_class(DispatchClass::Normal, |weights| {229			weights.max_total = Some(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT);230		})231		.for_class(DispatchClass::Operational, |weights| {232			weights.max_total = Some(MAXIMUM_BLOCK_WEIGHT);233			// Operational transactions have some extra reserved space, so that they234			// are included even if block reached `MAXIMUM_BLOCK_WEIGHT`.235			weights.reserved = Some(236				MAXIMUM_BLOCK_WEIGHT - NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT237			);238		})239		.avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO)240		.build_or_panic();241	pub const Version: RuntimeVersion = VERSION;242	pub const SS58Prefix: u8 = 42;243}244245parameter_types! {246	pub const ChainId: u64 = 8888;247}248249impl pallet_evm::Config for Runtime {250	type BlockGasLimit = BlockGasLimit;251	type FeeCalculator = ();252	type GasWeightMapping = ();253	type CallOrigin = EnsureAddressTruncated;254	type WithdrawOrigin = EnsureAddressTruncated;255	type AddressMapping = HashedAddressMapping<Self::Hashing>;256	type Precompiles = ();257	type Currency = Balances;258	type Event = Event;259	type OnMethodCall = pallet_nft::NftErcSupport<Self>;260	type ChainId = ChainId;261	type Runner = pallet_evm::runner::stack::Runner<Self>;262	type OnChargeTransaction = ();263}264265pub struct EthereumFindAuthor<F>(core::marker::PhantomData<F>);266impl<F: FindAuthor<u32>> FindAuthor<H160> for EthereumFindAuthor<F> {267	fn find_author<'a, I>(digests: I) -> Option<H160>268	where269		I: 'a + IntoIterator<Item = (ConsensusEngineId, &'a [u8])>,270	{271		if let Some(author_index) = F::find_author(digests) {272			let authority_id = Aura::authorities()[author_index as usize].clone();273			return Some(H160::from_slice(&authority_id.to_raw_vec()[4..24]));274		}275		None276	}277}278279parameter_types! {280	pub BlockGasLimit: U256 = U256::from(u32::max_value());281}282283impl pallet_ethereum::Config for Runtime {284	type Event = Event;285	type FindAuthor = EthereumFindAuthor<Aura>;286	type StateRoot = pallet_ethereum::IntermediateStateRoot;287	type EvmSubmitLog = pallet_evm::Pallet<Runtime>;288}289290impl system::Config for Runtime {291	/// The data to be stored in an account.292	type AccountData = pallet_balances::AccountData<Balance>;293	/// The identifier used to distinguish between accounts.294	type AccountId = AccountId;295	/// The basic call filter to use in dispatchable.296	type BaseCallFilter = ();297	/// Maximum number of block number to block hash mappings to keep (oldest pruned first).298	type BlockHashCount = BlockHashCount;299	/// The maximum length of a block (in bytes).300	type BlockLength = RuntimeBlockLength;301	/// The index type for blocks.302	type BlockNumber = BlockNumber;303	/// The weight of the overhead invoked on the block import process, independent of the extrinsics included in that block.304	type BlockWeights = RuntimeBlockWeights;305	/// The aggregated dispatch type that is available for extrinsics.306	type Call = Call;307	/// The weight of database operations that the runtime can invoke.308	type DbWeight = RocksDbWeight;309	/// The ubiquitous event type.310	type Event = Event;311	/// The type for hashing blocks and tries.312	type Hash = Hash;313	/// The hashing algorithm used.314	type Hashing = BlakeTwo256;315	/// The header type.316	type Header = generic::Header<BlockNumber, BlakeTwo256>;317	/// The index type for storing how many extrinsics an account has signed.318	type Index = Index;319	/// The lookup mechanism to get account ID from whatever is passed in dispatchers.320	type Lookup = AccountIdLookup<AccountId, ()>;321	/// What to do if an account is fully reaped from the system.322	type OnKilledAccount = ();323	/// What to do if a new account is created.324	type OnNewAccount = ();325	type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode<Self>;326	/// The ubiquitous origin type.327	type Origin = Origin;328	/// This type is being generated by `construct_runtime!`.329	type PalletInfo = PalletInfo;330	/// This is used as an identifier of the chain. 42 is the generic substrate prefix.331	type SS58Prefix = SS58Prefix;332	/// Weight information for the extrinsics of this pallet.333	type SystemWeightInfo = system::weights::SubstrateWeight<Runtime>;334	/// Version of the runtime.335	type Version = Version;336}337338parameter_types! {339	pub const MinimumPeriod: u64 = SLOT_DURATION / 2;340}341342impl pallet_timestamp::Config for Runtime {343	/// A timestamp: milliseconds since the unix epoch.344	type Moment = u64;345	type OnTimestampSet = ();346	type MinimumPeriod = MinimumPeriod;347	type WeightInfo = ();348}349350parameter_types! {351	// pub const ExistentialDeposit: u128 = 500;352	pub const ExistentialDeposit: u128 = 0;353	pub const MaxLocks: u32 = 50;354}355356impl pallet_balances::Config for Runtime {357	type MaxLocks = MaxLocks;358	/// The type for recording an account's balance.359	type Balance = Balance;360	/// The ubiquitous event type.361	type Event = Event;362	type DustRemoval = Treasury;363	type ExistentialDeposit = ExistentialDeposit;364	type AccountStore = System;365	type WeightInfo = pallet_balances::weights::SubstrateWeight<Runtime>;366}367368pub const MICROUNIQUE: Balance = 1_000_000_000;369pub const MILLIUNIQUE: Balance = 1_000 * MICROUNIQUE;370pub const CENTIUNIQUE: Balance = 10 * MILLIUNIQUE;371pub const UNIQUE: Balance = 100 * CENTIUNIQUE;372373pub const fn deposit(items: u32, bytes: u32) -> Balance {374	items as Balance * 15 * CENTIUNIQUE + (bytes as Balance) * 6 * CENTIUNIQUE375}376377parameter_types! {378	pub TombstoneDeposit: Balance = deposit(379		1,380		sp_std::mem::size_of::<pallet_contracts::Pallet<Runtime>> as u32,381	);382	pub DepositPerContract: Balance = TombstoneDeposit::get();383	pub const DepositPerStorageByte: Balance = deposit(0, 1);384	pub const DepositPerStorageItem: Balance = deposit(1, 0);385	pub RentFraction: Perbill = Perbill::from_rational(1u32, 30 * DAYS);386	pub const SurchargeReward: Balance = 150 * MILLIUNIQUE;387	pub const SignedClaimHandicap: u32 = 2;388	pub const MaxDepth: u32 = 32;389	pub const MaxValueSize: u32 = 16 * 1024;390	pub const MaxCodeSize: u32 = 1024 * 1024 * 25; // 25 Mb391	// The lazy deletion runs inside on_initialize.392	pub DeletionWeightLimit: Weight = AVERAGE_ON_INITIALIZE_RATIO *393		RuntimeBlockWeights::get().max_block;394	// The weight needed for decoding the queue should be less or equal than a fifth395	// of the overall weight dedicated to the lazy deletion.396	pub DeletionQueueDepth: u32 = ((DeletionWeightLimit::get() / (397			<Runtime as pallet_contracts::Config>::WeightInfo::on_initialize_per_queue_item(1) -398			<Runtime as pallet_contracts::Config>::WeightInfo::on_initialize_per_queue_item(0)399		)) / 5) as u32;400	pub Schedule: pallet_contracts::Schedule<Runtime> = Default::default();401}402403impl pallet_contracts::Config for Runtime {404	type Time = Timestamp;405	type Randomness = RandomnessCollectiveFlip;406	type Currency = Balances;407	type Event = Event;408	type RentPayment = ();409	type SignedClaimHandicap = SignedClaimHandicap;410	type TombstoneDeposit = TombstoneDeposit;411	type DepositPerContract = DepositPerContract;412	type DepositPerStorageByte = DepositPerStorageByte;413	type DepositPerStorageItem = DepositPerStorageItem;414	type RentFraction = RentFraction;415	type SurchargeReward = SurchargeReward;416	// type MaxDepth = MaxDepth;417	// type MaxValueSize = MaxValueSize;418	type WeightPrice = pallet_transaction_payment::Module<Self>;419	type WeightInfo = pallet_contracts::weights::SubstrateWeight<Self>;420	type ChainExtension = NFTExtension;421	type DeletionQueueDepth = DeletionQueueDepth;422	type DeletionWeightLimit = DeletionWeightLimit;423	// type MaxCodeSize = MaxCodeSize;424	type Schedule = Schedule;425	type CallStack = [pallet_contracts::Frame<Self>; 31];426}427428parameter_types! {429	pub const TransactionByteFee: Balance = 501 * MICROUNIQUE; // Targeting 0.1 Unique per NFT transfer430}431432/// Linear implementor of `WeightToFeePolynomial`433pub struct LinearFee<T>(sp_std::marker::PhantomData<T>);434435impl<T> WeightToFeePolynomial for LinearFee<T>436where437	T: BaseArithmetic + From<u32> + Copy + Unsigned,438{439	type Balance = T;440441	fn polynomial() -> WeightToFeeCoefficients<Self::Balance> {442		smallvec!(WeightToFeeCoefficient {443			coeff_integer: 146_700u32.into(), // Targeting 0.1 Unique per NFT transfer444			coeff_frac: Perbill::zero(),445			negative: false,446			degree: 1,447		})448	}449}450451impl pallet_transaction_payment::Config for Runtime {452	type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter<Balances, ()>;453	type TransactionByteFee = TransactionByteFee;454	type WeightToFee = LinearFee<Balance>;455	type FeeMultiplierUpdate = ();456}457458parameter_types! {459	pub const ProposalBond: Permill = Permill::from_percent(5);460	pub const ProposalBondMinimum: Balance = 1 * UNIQUE;461	pub const SpendPeriod: BlockNumber = 5 * MINUTES;462	pub const Burn: Permill = Permill::from_percent(0);463	pub const TipCountdown: BlockNumber = 1 * DAYS;464	pub const TipFindersFee: Percent = Percent::from_percent(20);465	pub const TipReportDepositBase: Balance = 1 * UNIQUE;466	pub const DataDepositPerByte: Balance = 1 * CENTIUNIQUE;467	pub const BountyDepositBase: Balance = 1 * UNIQUE;468	pub const BountyDepositPayoutDelay: BlockNumber = 1 * DAYS;469	pub const TreasuryModuleId: PalletId = PalletId(*b"py/trsry");470	pub const BountyUpdatePeriod: BlockNumber = 14 * DAYS;471	pub const MaximumReasonLength: u32 = 16384;472	pub const BountyCuratorDeposit: Permill = Permill::from_percent(50);473	pub const BountyValueMinimum: Balance = 5 * UNIQUE;474	pub const MaxApprovals: u32 = 100;475}476477impl pallet_treasury::Config for Runtime {478	type PalletId = TreasuryModuleId;479	type Currency = Balances;480	type ApproveOrigin = EnsureRoot<AccountId>;481	type RejectOrigin = EnsureRoot<AccountId>;482	type Event = Event;483	type OnSlash = ();484	type ProposalBond = ProposalBond;485	type ProposalBondMinimum = ProposalBondMinimum;486	type SpendPeriod = SpendPeriod;487	type Burn = Burn;488	type BurnDestination = ();489	type SpendFunds = ();490	type WeightInfo = pallet_treasury::weights::SubstrateWeight<Runtime>;491	type MaxApprovals = MaxApprovals;492}493494impl pallet_sudo::Config for Runtime {495	type Event = Event;496	type Call = Call;497}498499parameter_types! {500	pub const MinVestedTransfer: Balance = 10 * UNIQUE;501}502503impl pallet_vesting::Config for Runtime {504	type Event = Event;505	type Currency = Balances;506	type BlockNumberToBalance = ConvertInto;507	type MinVestedTransfer = MinVestedTransfer;508	type WeightInfo = ();509}510511parameter_types! {512	pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 4;513	pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 4;514}515516impl cumulus_pallet_parachain_system::Config for Runtime {517	type Event = Event;518	type OnValidationData = ();519	type SelfParaId = parachain_info::Pallet<Runtime>;520	// type DownwardMessageHandlers = cumulus_primitives_utility::UnqueuedDmpAsParent<521	// 	MaxDownwardMessageWeight,522	// 	XcmExecutor<XcmConfig>,523	// 	Call,524	// >;525	type OutboundXcmpMessageSource = XcmpQueue;526	type DmpMessageHandler = DmpQueue;527	type ReservedDmpWeight = ReservedDmpWeight;528	type ReservedXcmpWeight = ReservedXcmpWeight;529	type XcmpMessageHandler = XcmpQueue;530}531532impl parachain_info::Config for Runtime {}533534impl cumulus_pallet_aura_ext::Config for Runtime {}535536parameter_types! {537	pub const RelayLocation: MultiLocation = X1(Parent);538	pub const RelayNetwork: NetworkId = NetworkId::Polkadot;539	pub RelayOrigin: Origin = cumulus_pallet_xcm::Origin::Relay.into();540	pub Ancestry: MultiLocation = X1(Parachain(ParachainInfo::parachain_id().into()));541}542543/// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used544/// when determining ownership of accounts for asset transacting and when attempting to use XCM545/// `Transact` in order to determine the dispatch Origin.546pub type LocationToAccountId = (547	// The parent (Relay-chain) origin converts to the default `AccountId`.548	ParentIsDefault<AccountId>,549	// Sibling parachain origins convert to AccountId via the `ParaId::into`.550	SiblingParachainConvertsVia<Sibling, AccountId>,551	// Straight up local `AccountId32` origins just alias directly to `AccountId`.552	AccountId32Aliases<RelayNetwork, AccountId>,553);554555/// Means for transacting assets on this chain.556pub type LocalAssetTransactor = CurrencyAdapter<557	// Use this currency:558	Balances,559	// Use this currency when it is a fungible asset matching the given location or name:560	IsConcrete<RelayLocation>,561	// Do a simple punn to convert an AccountId32 MultiLocation into a native chain account ID:562	LocationToAccountId,563	// Our chain's account ID type (we can't get away without mentioning it explicitly):564	AccountId,565	// We don't track any teleports.566	(),567>;568569/// This is the type we use to convert an (incoming) XCM origin into a local `Origin` instance,570/// ready for dispatching a transaction with Xcm's `Transact`. There is an `OriginKind` which can571/// biases the kind of local `Origin` it will become.572pub type XcmOriginToTransactDispatchOrigin = (573	// Sovereign account converter; this attempts to derive an `AccountId` from the origin location574	// using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for575	// foreign chains who want to have a local sovereign account on this chain which they control.576	SovereignSignedViaLocation<LocationToAccountId, Origin>,577	// Native converter for Relay-chain (Parent) location; will converts to a `Relay` origin when578	// recognised.579	RelayChainAsNative<RelayOrigin, Origin>,580	// Native converter for sibling Parachains; will convert to a `SiblingPara` origin when581	// recognised.582	SiblingParachainAsNative<cumulus_pallet_xcm::Origin, Origin>,583	// Superuser converter for the Relay-chain (Parent) location. This will allow it to issue a584	// transaction from the Root origin.585	ParentAsSuperuser<Origin>,586	// Native signed account converter; this just converts an `AccountId32` origin into a normal587	// `Origin::Signed` origin of the same 32-byte value.588	SignedAccountId32AsNative<RelayNetwork, Origin>,589	// Xcm origins can be represented natively under the Xcm pallet's Xcm origin.590	XcmPassthrough<Origin>,591);592593parameter_types! {594	// One XCM operation is 1_000_000 weight - almost certainly a conservative estimate.595	pub UnitWeightCost: Weight = 1_000_000;596	// 1200 UNIQUEs buy 1 second of weight.597	pub const WeightPrice: (MultiLocation, u128) = (X1(Parent), 1_200 * UNIQUE);598}599600match_type! {601	pub type ParentOrParentsUnitPlurality: impl Contains<MultiLocation> = {602		X1(Parent) | X2(Parent, Plurality { id: BodyId::Unit, .. })603	};604}605606pub type Barrier = (607	TakeWeightCredit,608	AllowTopLevelPaidExecutionFrom<All<MultiLocation>>,609	AllowUnpaidExecutionFrom<ParentOrParentsUnitPlurality>,610	// ^^^ Parent & its unit plurality gets free execution611);612613pub struct XcmConfig;614impl Config for XcmConfig {615	type Call = Call;616	type XcmSender = XcmRouter;617	// How to withdraw and deposit an asset.618	type AssetTransactor = LocalAssetTransactor;619	type OriginConverter = XcmOriginToTransactDispatchOrigin;620	type IsReserve = NativeAsset;621	type IsTeleporter = NativeAsset; // <- should be enough to allow teleportation of ROC622	type LocationInverter = LocationInverter<Ancestry>;623	type Barrier = Barrier;624	type Weigher = FixedWeightBounds<UnitWeightCost, Call>;625	type Trader = UsingComponents<IdentityFee<Balance>, RelayLocation, AccountId, Balances, ()>;626	type ResponseHandler = (); // Don't handle responses for now.627}628629// parameter_types! {630// 	pub const MaxDownwardMessageWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 10;631// }632633/// No local origins on this chain are allowed to dispatch XCM sends/executions.634pub type LocalOriginToLocation = (SignedToAccountId32<Origin, AccountId, RelayNetwork>,);635636/// The means for routing XCM messages which are not for local execution into the right message637/// queues.638pub type XcmRouter = (639	// Two routers - use UMP to communicate with the relay chain:640	cumulus_primitives_utility::ParentAsUmp<ParachainSystem>,641	// ..and XCMP to communicate with the sibling chains.642	XcmpQueue,643);644645impl pallet_xcm::Config for Runtime {646	type Event = Event;647	type SendXcmOrigin = EnsureXcmOrigin<Origin, LocalOriginToLocation>;648	type XcmRouter = XcmRouter;649	type ExecuteXcmOrigin = EnsureXcmOrigin<Origin, LocalOriginToLocation>;650	type XcmExecuteFilter = All<(MultiLocation, Xcm<Call>)>;651	type XcmExecutor = XcmExecutor<XcmConfig>;652	type XcmTeleportFilter = All<(MultiLocation, Vec<MultiAsset>)>;653	type XcmReserveTransferFilter = ();654	type Weigher = FixedWeightBounds<UnitWeightCost, Call>;655}656657impl cumulus_pallet_xcm::Config for Runtime {658	type Event = Event;659	type XcmExecutor = XcmExecutor<XcmConfig>;660}661662impl cumulus_pallet_xcmp_queue::Config for Runtime {663	type Event = Event;664	type XcmExecutor = XcmExecutor<XcmConfig>;665	type ChannelInfo = ParachainSystem;666}667668impl cumulus_pallet_dmp_queue::Config for Runtime {669	type Event = Event;670	type XcmExecutor = XcmExecutor<XcmConfig>;671	type ExecuteOverweightOrigin = frame_system::EnsureRoot<AccountId>;672}673674impl pallet_aura::Config for Runtime {675	type AuthorityId = AuraId;676}677678parameter_types! {679	pub TreasuryAccountId: AccountId = TreasuryModuleId::get().into_account();680	pub const CollectionCreationPrice: Balance = 100 * UNIQUE;681}682683/// Used for the pallet nft in `./nft.rs`684impl pallet_nft::Config for Runtime {685	type Event = Event;686	type WeightInfo = nft_weights::WeightInfo;687688	type EvmBackwardsAddressMapping = pallet_nft::MapBackwardsAddressTruncated;689	type EvmAddressMapping = HashedAddressMapping<Self::Hashing>;690	type CrossAccountId = pallet_nft::BasicCrossAccountId<Self>;691692	type Currency = Balances;693	type CollectionCreationPrice = CollectionCreationPrice;694	type TreasuryAccountId = TreasuryAccountId;695696	type EthereumChainId = ChainId;697	type EthereumTransactionSender = pallet_ethereum::Module<Runtime>;698}699700parameter_types! {701	pub const InflationBlockInterval: BlockNumber = 100; // every time per how many blocks inflation is applied702}703704/// Used for the pallet inflation705impl pallet_inflation::Config for Runtime {706	type Currency = Balances;707	type TreasuryAccountId = TreasuryAccountId;708	type InflationBlockInterval = InflationBlockInterval;709}710711parameter_types! {712	pub MaximumSchedulerWeight: Weight = Perbill::from_percent(50) *713		RuntimeBlockWeights::get().max_block;714	pub const MaxScheduledPerBlock: u32 = 50;715}716717pub struct Sponsoring;718impl SponsoringResolve<AccountId, Call> for Sponsoring {719	fn resolve(who: &AccountId, call: &Call) -> Option<AccountId>720	where721		Call: Dispatchable<Info = DispatchInfo>,722		Call: IsSubType<pallet_nft::Call<Runtime>>,723		Call: IsSubType<pallet_contracts::Call<Runtime>>,724		AccountId: AsRef<[u8]>,725		AccountId: UncheckedFrom<Hash>,726	{727		pallet_nft_transaction_payment::Module::<Runtime>::withdraw_type(who, call)728	}729}730731type SponsorshipHandler = (732	pallet_nft::NftSponsorshipHandler<Runtime>,733	pallet_contract_helpers::ContractSponsorshipHandler<Runtime>,734);735736impl pallet_scheduler::Config for Runtime {737	type Event = Event;738	type Origin = Origin;739	type PalletsOrigin = OriginCaller;740	type Call = Call;741	type MaximumWeight = MaximumSchedulerWeight;742	type ScheduleOrigin = EnsureSigned<AccountId>;743	type MaxScheduledPerBlock = MaxScheduledPerBlock;744	type SponsorshipHandler = SponsorshipHandler;745	type WeightInfo = ();746}747748impl pallet_nft_transaction_payment::Config for Runtime {749	type SponsorshipHandler = SponsorshipHandler;750}751752impl pallet_nft_charge_transaction::Config for Runtime {}753754impl pallet_contract_helpers::Config for Runtime {}755756construct_runtime!(757	pub enum Runtime where758		Block = Block,759		NodeBlock = opaque::Block,760		UncheckedExtrinsic = UncheckedExtrinsic761	{762		Balances: pallet_balances::{Pallet, Call, Storage, Config<T>, Event<T>} = 30,763		Contracts: pallet_contracts::{Pallet, Call, Storage, Event<T>},764		RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Pallet, Call, Storage},765		Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent},766		TransactionPayment: pallet_transaction_payment::{Pallet, Storage},767		Treasury: pallet_treasury::{Pallet, Call, Storage, Config, Event<T>},768		Sudo: pallet_sudo::{Pallet, Call, Storage, Config<T>, Event<T>},769		System: system::{Pallet, Call, Storage, Config, Event<T>},770		Vesting: pallet_vesting::{Pallet, Call, Config<T>, Storage, Event<T>},771772		ParachainSystem: cumulus_pallet_parachain_system::{Pallet, Call, Storage, Inherent, Event<T>, ValidateUnsigned} = 20,773		ParachainInfo: parachain_info::{Pallet, Storage, Config} = 21,774775		Aura: pallet_aura::{Pallet, Config<T>},776		AuraExt: cumulus_pallet_aura_ext::{Pallet, Config},777778		// Frontier779		EVM: pallet_evm::{Pallet, Config, Call, Storage, Event<T>},780		Ethereum: pallet_ethereum::{Pallet, Config, Call, Storage, Event, ValidateUnsigned},781782		// XCM helpers.783		XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event<T>} = 50,784		PolkadotXcm: pallet_xcm::{Pallet, Call, Event<T>, Origin} = 51,785		CumulusXcm: cumulus_pallet_xcm::{Pallet, Call, Event<T>, Origin} = 52,786		DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event<T>} = 53,787788789		// Unique Pallets790		Inflation: pallet_inflation::{Pallet, Call, Storage},791		Nft: pallet_nft::{Pallet, Call, Config<T>, Storage, Event<T>},792		Scheduler: pallet_scheduler::{Pallet, Call, Storage, Event<T>},793		NftPayment: pallet_nft_transaction_payment::{Pallet, Call, Storage},794		Charging: pallet_nft_charge_transaction::{Pallet, Call, Storage },795		ContractHelpers: pallet_contract_helpers::{Pallet, Call, Storage},796	}797);798799pub struct TransactionConverter;800801impl fp_rpc::ConvertTransaction<UncheckedExtrinsic> for TransactionConverter {802	fn convert_transaction(&self, transaction: pallet_ethereum::Transaction) -> UncheckedExtrinsic {803		UncheckedExtrinsic::new_unsigned(804			pallet_ethereum::Call::<Runtime>::transact(transaction).into(),805		)806	}807}808809impl fp_rpc::ConvertTransaction<opaque::UncheckedExtrinsic> for TransactionConverter {810	fn convert_transaction(811		&self,812		transaction: pallet_ethereum::Transaction,813	) -> opaque::UncheckedExtrinsic {814		let extrinsic = UncheckedExtrinsic::new_unsigned(815			pallet_ethereum::Call::<Runtime>::transact(transaction).into(),816		);817		let encoded = extrinsic.encode();818		opaque::UncheckedExtrinsic::decode(&mut &encoded[..])819			.expect("Encoded extrinsic is always valid")820	}821}822823/// The address format for describing accounts.824pub type Address = sp_runtime::MultiAddress<AccountId, ()>;825/// Block header type as expected by this runtime.826pub type Header = generic::Header<BlockNumber, BlakeTwo256>;827/// Block type as expected by this runtime.828pub type Block = generic::Block<Header, UncheckedExtrinsic>;829/// A Block signed with a Justification830pub type SignedBlock = generic::SignedBlock<Block>;831/// BlockId type as expected by this runtime.832pub type BlockId = generic::BlockId<Block>;833/// The SignedExtension to the basic transaction logic.834pub type SignedExtra = (835	system::CheckSpecVersion<Runtime>,836	// system::CheckTxVersion<Runtime>,837	system::CheckGenesis<Runtime>,838	system::CheckEra<Runtime>,839	system::CheckNonce<Runtime>,840	system::CheckWeight<Runtime>,841	pallet_nft_charge_transaction::ChargeTransactionPayment<Runtime>,842	pallet_contract_helpers::ContractHelpersExtension<Runtime>,843);844/// Unchecked extrinsic type as expected by this runtime.845pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<Address, Call, Signature, SignedExtra>;846/// Extrinsic type that has already been checked.847pub type CheckedExtrinsic = generic::CheckedExtrinsic<AccountId, Call, SignedExtra>;848/// Executive: handles dispatch to the various modules.849pub type Executive = frame_executive::Executive<850	Runtime,851	Block,852	frame_system::ChainContext<Runtime>,853	Runtime,854	AllPallets,855>;856857impl_opaque_keys! {858	pub struct SessionKeys {859		pub aura: Aura,860	}861}862863impl_runtime_apis! {864	impl pallet_nft::NftApi<Block>865		for Runtime866	{867		fn eth_contract_code(account: H160) -> Option<Vec<u8>> {868			<pallet_nft::NftErcSupport<Runtime>>::get_code(&account)869		}870	}871872	impl sp_api::Core<Block> for Runtime {873		fn version() -> RuntimeVersion {874			VERSION875		}876877		fn execute_block(block: Block) {878			Executive::execute_block(block)879		}880881		fn initialize_block(header: &<Block as BlockT>::Header) {882			Executive::initialize_block(header)883		}884	}885886	impl sp_api::Metadata<Block> for Runtime {887		fn metadata() -> OpaqueMetadata {888			Runtime::metadata().into()889		}890	}891892	impl sp_block_builder::BlockBuilder<Block> for Runtime {893		fn apply_extrinsic(extrinsic: <Block as BlockT>::Extrinsic) -> ApplyExtrinsicResult {894			Executive::apply_extrinsic(extrinsic)895		}896897		fn finalize_block() -> <Block as BlockT>::Header {898			Executive::finalize_block()899		}900901		fn inherent_extrinsics(data: sp_inherents::InherentData) -> Vec<<Block as BlockT>::Extrinsic> {902			data.create_extrinsics()903		}904905		fn check_inherents(906			block: Block,907			data: sp_inherents::InherentData,908		) -> sp_inherents::CheckInherentsResult {909			data.check_extrinsics(&block)910		}911912		// fn random_seed() -> <Block as BlockT>::Hash {913		//     RandomnessCollectiveFlip::random_seed().0914		// }915	}916917	impl sp_transaction_pool::runtime_api::TaggedTransactionQueue<Block> for Runtime {918		fn validate_transaction(919			source: TransactionSource,920			tx: <Block as BlockT>::Extrinsic,921		) -> TransactionValidity {922			Executive::validate_transaction(source, tx)923		}924	}925926	impl sp_offchain::OffchainWorkerApi<Block> for Runtime {927		fn offchain_worker(header: &<Block as BlockT>::Header) {928			Executive::offchain_worker(header)929		}930	}931932	impl fp_rpc::EthereumRuntimeRPCApi<Block> for Runtime {933		fn chain_id() -> u64 {934			<Runtime as pallet_evm::Config>::ChainId::get()935		}936937		fn account_basic(address: H160) -> EVMAccount {938			EVM::account_basic(&address)939		}940941		fn gas_price() -> U256 {942			<Runtime as pallet_evm::Config>::FeeCalculator::min_gas_price()943		}944945		fn account_code_at(address: H160) -> Vec<u8> {946			EVM::account_codes(address)947		}948949		fn author() -> H160 {950			<pallet_ethereum::Module<Runtime>>::find_author()951		}952953		fn storage_at(address: H160, index: U256) -> H256 {954			let mut tmp = [0u8; 32];955			index.to_big_endian(&mut tmp);956			EVM::account_storages(address, H256::from_slice(&tmp[..]))957		}958959		fn call(960			from: H160,961			to: H160,962			data: Vec<u8>,963			value: U256,964			gas_limit: U256,965			gas_price: Option<U256>,966			nonce: Option<U256>,967			estimate: bool,968		) -> Result<pallet_evm::CallInfo, sp_runtime::DispatchError> {969			let config = if estimate {970				let mut config = <Runtime as pallet_evm::Config>::config().clone();971				config.estimate = true;972				Some(config)973			} else {974				None975			};976977			<Runtime as pallet_evm::Config>::Runner::call(978				from,979				to,980				data,981				value,982				gas_limit.low_u64(),983				gas_price,984				nonce,985				config.as_ref().unwrap_or_else(|| <Runtime as pallet_evm::Config>::config()),986			).map_err(|err| err.into())987		}988989		fn create(990			from: H160,991			data: Vec<u8>,992			value: U256,993			gas_limit: U256,994			gas_price: Option<U256>,995			nonce: Option<U256>,996			estimate: bool,997		) -> Result<pallet_evm::CreateInfo, sp_runtime::DispatchError> {998			let config = if estimate {999				let mut config = <Runtime as pallet_evm::Config>::config().clone();1000				config.estimate = true;1001				Some(config)1002			} else {1003				None1004			};10051006			<Runtime as pallet_evm::Config>::Runner::create(1007				from,1008				data,1009				value,1010				gas_limit.low_u64(),1011				gas_price,1012				nonce,1013				config.as_ref().unwrap_or_else(|| <Runtime as pallet_evm::Config>::config()),1014			).map_err(|err| err.into())1015		}10161017		fn current_transaction_statuses() -> Option<Vec<TransactionStatus>> {1018			Ethereum::current_transaction_statuses()1019		}10201021		fn current_block() -> Option<pallet_ethereum::Block> {1022			Ethereum::current_block()1023		}10241025		fn current_receipts() -> Option<Vec<pallet_ethereum::Receipt>> {1026			Ethereum::current_receipts()1027		}10281029		fn current_all() -> (1030			Option<pallet_ethereum::Block>,1031			Option<Vec<pallet_ethereum::Receipt>>,1032			Option<Vec<TransactionStatus>>1033		) {1034			(1035				Ethereum::current_block(),1036				Ethereum::current_receipts(),1037				Ethereum::current_transaction_statuses()1038			)1039		}1040	}10411042	impl sp_session::SessionKeys<Block> for Runtime {1043		fn decode_session_keys(1044			encoded: Vec<u8>,1045		) -> Option<Vec<(Vec<u8>, KeyTypeId)>> {1046			SessionKeys::decode_into_raw_public_keys(&encoded)1047		}10481049		fn generate_session_keys(seed: Option<Vec<u8>>) -> Vec<u8> {1050			SessionKeys::generate(seed)1051		}1052	}10531054	impl sp_consensus_aura::AuraApi<Block, AuraId> for Runtime {1055		fn slot_duration() -> sp_consensus_aura::SlotDuration {1056			sp_consensus_aura::SlotDuration::from_millis(Aura::slot_duration())1057		}10581059		fn authorities() -> Vec<AuraId> {1060			Aura::authorities()1061		}1062	}10631064	impl cumulus_primitives_core::CollectCollationInfo<Block> for Runtime {1065		fn collect_collation_info() -> cumulus_primitives_core::CollationInfo {1066			ParachainSystem::collect_collation_info()1067		}1068	}10691070	impl frame_system_rpc_runtime_api::AccountNonceApi<Block, AccountId, Index> for Runtime {1071		fn account_nonce(account: AccountId) -> Index {1072			System::account_nonce(account)1073		}1074	}10751076	impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi<Block, Balance> for Runtime {1077		fn query_info(uxt: <Block as BlockT>::Extrinsic, len: u32) -> RuntimeDispatchInfo<Balance> {1078			TransactionPayment::query_info(uxt, len)1079		}1080		fn query_fee_details(uxt: <Block as BlockT>::Extrinsic, len: u32) -> FeeDetails<Balance> {1081			TransactionPayment::query_fee_details(uxt, len)1082		}1083	}10841085	impl pallet_contracts_rpc_runtime_api::ContractsApi<Block, AccountId, Balance, BlockNumber, Hash>1086		for Runtime1087	{1088		fn call(1089			origin: AccountId,1090			dest: AccountId,1091			value: Balance,1092			gas_limit: u64,1093			input_data: Vec<u8>,1094		) -> pallet_contracts_primitives::ContractExecResult {1095			Contracts::bare_call(origin, dest, value, gas_limit, input_data, false)1096		}10971098		fn instantiate(1099			origin: AccountId,1100			endowment: Balance,1101			gas_limit: u64,1102			code: pallet_contracts_primitives::Code<Hash>,1103			data: Vec<u8>,1104			salt: Vec<u8>,1105		) -> pallet_contracts_primitives::ContractInstantiateResult<AccountId, BlockNumber>1106		{1107			Contracts::bare_instantiate(origin, endowment, gas_limit, code, data, salt, true, false)1108		}11091110		fn get_storage(1111			address: AccountId,1112			key: [u8; 32],1113		) -> pallet_contracts_primitives::GetStorageResult {1114			Contracts::get_storage(address, key)1115		}11161117		fn rent_projection(1118			address: AccountId,1119		) -> pallet_contracts_primitives::RentProjectionResult<BlockNumber> {1120			Contracts::rent_projection(address)1121		}1122	}11231124	#[cfg(feature = "runtime-benchmarks")]1125	impl frame_benchmarking::Benchmark<Block> for Runtime {1126		fn dispatch_benchmark(1127			config: frame_benchmarking::BenchmarkConfig1128		) -> Result<Vec<frame_benchmarking::BenchmarkBatch>, sp_runtime::RuntimeString> {1129			use frame_benchmarking::{Benchmarking, BenchmarkBatch, add_benchmark, TrackedStorageKey};11301131			let whitelist: Vec<TrackedStorageKey> = vec![1132				// Alice account1133				hex_literal::hex!("d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d").to_vec().into(),1134				// // Total Issuance1135				// hex_literal::hex!("c2261276cc9d1f8598ea4b6a74b15c2f57c875e4cff74148e4628f264b974c80").to_vec().into(),1136				// // Execution Phase1137				// hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef7ff553b5a9862a516939d82b3d3d8661a").to_vec().into(),1138				// // Event Count1139				// hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef70a98fdbe9ce6c55837576c60c7af3850").to_vec().into(),1140				// // System Events1141				// hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef780d41e5e16056765bc8461851072c9d7").to_vec().into(),1142			];11431144			let mut batches = Vec::<BenchmarkBatch>::new();1145			let params = (&config, &whitelist);11461147			add_benchmark!(params, batches, pallet_nft, Nft);1148			add_benchmark!(params, batches, pallet_inflation, Inflation);11491150			if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) }1151			Ok(batches)1152		}1153	}1154}11551156cumulus_pallet_parachain_system::register_validate_block!(1157	Runtime,1158	cumulus_pallet_aura_ext::BlockExecutor::<Runtime, Executive>,1159);
modifiedruntime/src/nft_weights.rsdiffbeforeafterboth
--- a/runtime/src/nft_weights.rs
+++ b/runtime/src/nft_weights.rs
@@ -8,154 +8,154 @@
 pub struct WeightInfo;
 impl pallet_nft::WeightInfo for WeightInfo {
 	fn create_collection() -> Weight {
-		(70_000_000 as Weight)
-			.saturating_add(DbWeight::get().reads(7 as Weight))
-			.saturating_add(DbWeight::get().writes(5 as Weight))
+		70_000_000_u64
+			.saturating_add(DbWeight::get().reads(7_u64))
+			.saturating_add(DbWeight::get().writes(5_u64))
 	}
 	fn destroy_collection() -> Weight {
-		(90_000_000 as Weight)
-			.saturating_add(DbWeight::get().reads(2 as Weight))
-			.saturating_add(DbWeight::get().writes(5 as Weight))
+		90_000_000_u64
+			.saturating_add(DbWeight::get().reads(2_u64))
+			.saturating_add(DbWeight::get().writes(5_u64))
 	}
 	fn add_to_white_list() -> Weight {
-		(30_000_000 as Weight)
-			.saturating_add(DbWeight::get().reads(3 as Weight))
-			.saturating_add(DbWeight::get().writes(1 as Weight))
-    }
-    fn remove_from_white_list() -> Weight {
-		(35_000_000 as Weight)
-			.saturating_add(DbWeight::get().reads(3 as Weight))
-			.saturating_add(DbWeight::get().writes(1 as Weight))
+		30_000_000_u64
+			.saturating_add(DbWeight::get().reads(3_u64))
+			.saturating_add(DbWeight::get().writes(1_u64))
+	}
+	fn remove_from_white_list() -> Weight {
+		35_000_000_u64
+			.saturating_add(DbWeight::get().reads(3_u64))
+			.saturating_add(DbWeight::get().writes(1_u64))
 	}
 	fn set_public_access_mode() -> Weight {
-		(27_000_000 as Weight)
-			.saturating_add(DbWeight::get().reads(1 as Weight))
-			.saturating_add(DbWeight::get().writes(1 as Weight))
+		27_000_000_u64
+			.saturating_add(DbWeight::get().reads(1_u64))
+			.saturating_add(DbWeight::get().writes(1_u64))
 	}
 	fn set_mint_permission() -> Weight {
-		(27_000_000 as Weight)
-			.saturating_add(DbWeight::get().reads(1 as Weight))
-			.saturating_add(DbWeight::get().writes(1 as Weight))
+		27_000_000_u64
+			.saturating_add(DbWeight::get().reads(1_u64))
+			.saturating_add(DbWeight::get().writes(1_u64))
 	}
 	fn change_collection_owner() -> Weight {
-		(27_000_000 as Weight)
-			.saturating_add(DbWeight::get().reads(1 as Weight))
-			.saturating_add(DbWeight::get().writes(1 as Weight))
+		27_000_000_u64
+			.saturating_add(DbWeight::get().reads(1_u64))
+			.saturating_add(DbWeight::get().writes(1_u64))
 	}
 	fn add_collection_admin() -> Weight {
-        (32_000_000 as Weight)
-            .saturating_add(DbWeight::get().reads(3 as Weight))
-            .saturating_add(DbWeight::get().writes(1 as Weight))
+		32_000_000_u64
+			.saturating_add(DbWeight::get().reads(3_u64))
+			.saturating_add(DbWeight::get().writes(1_u64))
 	}
 	fn remove_collection_admin() -> Weight {
-		(50_000_000 as Weight)
-            .saturating_add(DbWeight::get().reads(2 as Weight))
-            .saturating_add(DbWeight::get().writes(1 as Weight))
-    }
-    fn set_collection_sponsor() -> Weight {
-		(32_000_000 as Weight)
-            .saturating_add(DbWeight::get().reads(2 as Weight))
-            .saturating_add(DbWeight::get().writes(1 as Weight))
-    }  
-    fn confirm_sponsorship() -> Weight {
-		(22_000_000 as Weight)
-            .saturating_add(DbWeight::get().reads(1 as Weight))
-            .saturating_add(DbWeight::get().writes(1 as Weight))
-    }  
-    fn remove_collection_sponsor() -> Weight {
-		(24_000_000 as Weight)
-            .saturating_add(DbWeight::get().reads(1 as Weight))
-            .saturating_add(DbWeight::get().writes(1 as Weight))
-    }  
-    fn create_item(s: usize, ) -> Weight {
-        (130_000_000 as Weight)
-            .saturating_add((2135 as Weight).saturating_mul(s as Weight).saturating_mul(500 as Weight)) // 500 is temparary multiplier, fee for storage
-            .saturating_add(DbWeight::get().reads(10 as Weight))
-            .saturating_add(DbWeight::get().writes(8 as Weight))
-    }  
-    fn burn_item() -> Weight {
-		(170_000_000 as Weight)
-            .saturating_add(DbWeight::get().reads(9 as Weight))
-            .saturating_add(DbWeight::get().writes(7 as Weight))
-    }  
-    fn transfer() -> Weight {
-        (125_000_000 as Weight)
-            .saturating_add(DbWeight::get().reads(7 as Weight))
-            .saturating_add(DbWeight::get().writes(7 as Weight))
-    }  
-    fn approve() -> Weight {
-        (45_000_000 as Weight)
-            .saturating_add(DbWeight::get().reads(3 as Weight))
-            .saturating_add(DbWeight::get().writes(1 as Weight))
-    }
-    fn transfer_from() -> Weight {
-        (150_000_000 as Weight)
-            .saturating_add(DbWeight::get().reads(9 as Weight))
-            .saturating_add(DbWeight::get().writes(8 as Weight))
-    }
-    fn set_offchain_schema() -> Weight {
-        (33_000_000 as Weight)
-            .saturating_add(DbWeight::get().reads(2 as Weight))
-            .saturating_add(DbWeight::get().writes(1 as Weight))
-    }
-    fn set_const_on_chain_schema() -> Weight {
-        (11_100_000 as Weight)
-            .saturating_add(DbWeight::get().reads(2 as Weight))
-            .saturating_add(DbWeight::get().writes(1 as Weight))
-    }
-    fn set_variable_on_chain_schema() -> Weight {
-        (11_100_000 as Weight)
-            .saturating_add(DbWeight::get().reads(2 as Weight))
-            .saturating_add(DbWeight::get().writes(1 as Weight))
-    }
-    fn set_variable_meta_data() -> Weight {
-        (17_500_000 as Weight)
-            .saturating_add(DbWeight::get().reads(2 as Weight))
-            .saturating_add(DbWeight::get().writes(1 as Weight))
-    }
-    fn enable_contract_sponsoring() -> Weight {
-        (13_000_000 as Weight)
-            .saturating_add(DbWeight::get().reads(1 as Weight))
-            .saturating_add(DbWeight::get().writes(1 as Weight))
-    }
-    fn set_schema_version() -> Weight {
-        (8_500_000 as Weight)
-            .saturating_add(DbWeight::get().reads(2 as Weight))
-            .saturating_add(DbWeight::get().writes(1 as Weight))
-    }
-    fn set_chain_limits() -> Weight {
-        (1_300_000 as Weight)
-            .saturating_add(DbWeight::get().reads(0 as Weight))
-            .saturating_add(DbWeight::get().writes(1 as Weight))
-    }
-    fn set_contract_sponsoring_rate_limit() -> Weight {
-        (3_500_000 as Weight)
-            .saturating_add(DbWeight::get().reads(0 as Weight))
-            .saturating_add(DbWeight::get().writes(2 as Weight))
-    }    
-    fn set_variable_meta_data_sponsoring_rate_limit() -> Weight {
-        (3_500_000 as Weight)
-            .saturating_add(DbWeight::get().reads(1 as Weight))
-            .saturating_add(DbWeight::get().writes(2 as Weight))
-    }
-    fn toggle_contract_white_list() -> Weight {
-        (3_000_000 as Weight)
-            .saturating_add(DbWeight::get().reads(0 as Weight))
-            .saturating_add(DbWeight::get().writes(2 as Weight))
-    }    
-    fn add_to_contract_white_list() -> Weight {
-        (3_000_000 as Weight)
-            .saturating_add(DbWeight::get().reads(0 as Weight))
-            .saturating_add(DbWeight::get().writes(2 as Weight))
-    }    
-    fn remove_from_contract_white_list() -> Weight {
-        (3_200_000 as Weight)
-            .saturating_add(DbWeight::get().reads(0 as Weight))
-            .saturating_add(DbWeight::get().writes(2 as Weight))
-    }
-    fn set_collection_limits() -> Weight {
-        (8_900_000 as Weight)
-            .saturating_add(DbWeight::get().reads(2 as Weight))
-            .saturating_add(DbWeight::get().writes(1 as Weight))
-    }
+		50_000_000_u64
+			.saturating_add(DbWeight::get().reads(2_u64))
+			.saturating_add(DbWeight::get().writes(1_u64))
+	}
+	fn set_collection_sponsor() -> Weight {
+		32_000_000_u64
+			.saturating_add(DbWeight::get().reads(2_u64))
+			.saturating_add(DbWeight::get().writes(1_u64))
+	}
+	fn confirm_sponsorship() -> Weight {
+		22_000_000_u64
+			.saturating_add(DbWeight::get().reads(1_u64))
+			.saturating_add(DbWeight::get().writes(1_u64))
+	}
+	fn remove_collection_sponsor() -> Weight {
+		24_000_000_u64
+			.saturating_add(DbWeight::get().reads(1_u64))
+			.saturating_add(DbWeight::get().writes(1_u64))
+	}
+	fn create_item(s: usize) -> Weight {
+		130_000_000_u64
+			.saturating_add(2135_u64.saturating_mul(s as Weight).saturating_mul(500_u64)) // 500 is temparary multiplier, fee for storage
+			.saturating_add(DbWeight::get().reads(10_u64))
+			.saturating_add(DbWeight::get().writes(8_u64))
+	}
+	fn burn_item() -> Weight {
+		170_000_000_u64
+			.saturating_add(DbWeight::get().reads(9_u64))
+			.saturating_add(DbWeight::get().writes(7_u64))
+	}
+	fn transfer() -> Weight {
+		125_000_000_u64
+			.saturating_add(DbWeight::get().reads(7_u64))
+			.saturating_add(DbWeight::get().writes(7_u64))
+	}
+	fn approve() -> Weight {
+		45_000_000_u64
+			.saturating_add(DbWeight::get().reads(3_u64))
+			.saturating_add(DbWeight::get().writes(1_u64))
+	}
+	fn transfer_from() -> Weight {
+		150_000_000_u64
+			.saturating_add(DbWeight::get().reads(9_u64))
+			.saturating_add(DbWeight::get().writes(8_u64))
+	}
+	fn set_offchain_schema() -> Weight {
+		33_000_000_u64
+			.saturating_add(DbWeight::get().reads(2_u64))
+			.saturating_add(DbWeight::get().writes(1_u64))
+	}
+	fn set_const_on_chain_schema() -> Weight {
+		11_100_000_u64
+			.saturating_add(DbWeight::get().reads(2_u64))
+			.saturating_add(DbWeight::get().writes(1_u64))
+	}
+	fn set_variable_on_chain_schema() -> Weight {
+		11_100_000_u64
+			.saturating_add(DbWeight::get().reads(2_u64))
+			.saturating_add(DbWeight::get().writes(1_u64))
+	}
+	fn set_variable_meta_data() -> Weight {
+		17_500_000_u64
+			.saturating_add(DbWeight::get().reads(2_u64))
+			.saturating_add(DbWeight::get().writes(1_u64))
+	}
+	fn enable_contract_sponsoring() -> Weight {
+		13_000_000_u64
+			.saturating_add(DbWeight::get().reads(1_u64))
+			.saturating_add(DbWeight::get().writes(1_u64))
+	}
+	fn set_schema_version() -> Weight {
+		8_500_000_u64
+			.saturating_add(DbWeight::get().reads(2_u64))
+			.saturating_add(DbWeight::get().writes(1_u64))
+	}
+	fn set_chain_limits() -> Weight {
+		1_300_000_u64
+			.saturating_add(DbWeight::get().reads(0_u64))
+			.saturating_add(DbWeight::get().writes(1_u64))
+	}
+	fn set_contract_sponsoring_rate_limit() -> Weight {
+		3_500_000_u64
+			.saturating_add(DbWeight::get().reads(0_u64))
+			.saturating_add(DbWeight::get().writes(2_u64))
+	}
+	fn set_variable_meta_data_sponsoring_rate_limit() -> Weight {
+		3_500_000_u64
+			.saturating_add(DbWeight::get().reads(1_u64))
+			.saturating_add(DbWeight::get().writes(2_u64))
+	}
+	fn toggle_contract_white_list() -> Weight {
+		3_000_000_u64
+			.saturating_add(DbWeight::get().reads(0_u64))
+			.saturating_add(DbWeight::get().writes(2_u64))
+	}
+	fn add_to_contract_white_list() -> Weight {
+		3_000_000_u64
+			.saturating_add(DbWeight::get().reads(0_u64))
+			.saturating_add(DbWeight::get().writes(2_u64))
+	}
+	fn remove_from_contract_white_list() -> Weight {
+		3_200_000_u64
+			.saturating_add(DbWeight::get().reads(0_u64))
+			.saturating_add(DbWeight::get().writes(2_u64))
+	}
+	fn set_collection_limits() -> Weight {
+		8_900_000_u64
+			.saturating_add(DbWeight::get().reads(2_u64))
+			.saturating_add(DbWeight::get().writes(1_u64))
+	}
 }