git.delta.rocks / unique-network / refs/commits / fbd66f575db9

difftreelog

ci fix clippy warnings

Yaroslav Bolyukin2021-06-28parent: #93b1982.patch.diff
in: master

13 files changed

modifiedCargo.lockdiffbeforeafterboth
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -5996,34 +5996,34 @@
 [[package]]
 name = "pallet-scheduler"
 version = "3.0.0"
-source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7"
 dependencies = [
  "frame-benchmarking",
  "frame-support",
  "frame-system",
  "log",
  "parity-scale-codec 2.1.3",
+ "serde",
+ "sp-core",
  "sp-io",
  "sp-runtime",
  "sp-std",
+ "substrate-test-utils",
+ "up-sponsorship",
 ]
 
 [[package]]
 name = "pallet-scheduler"
 version = "3.0.0"
+source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7"
 dependencies = [
  "frame-benchmarking",
  "frame-support",
  "frame-system",
  "log",
  "parity-scale-codec 2.1.3",
- "serde",
- "sp-core",
  "sp-io",
  "sp-runtime",
  "sp-std",
- "substrate-test-utils",
- "up-sponsorship",
 ]
 
 [[package]]
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
@@ -264,7 +264,7 @@
 			ReturnType::Type(_, ty) => ty,
 			_ => return Err(syn::Error::new(value.sig.output.span(), "interface method should return Result<value>\nif there is no value to return - specify void (which is alias to unit)")),
 		};
-		let result = parse_result_ok(&result)?;
+		let result = parse_result_ok(result)?;
 
 		let camel_name = info
 			.rename_selector
@@ -285,8 +285,8 @@
 		Ok(Self {
 			name: ident.clone(),
 			camel_name,
-			pascal_name: snake_ident_to_pascal(&ident),
-			screaming_name: snake_ident_to_screaming(&ident),
+			pascal_name: snake_ident_to_pascal(ident),
+			screaming_name: snake_ident_to_screaming(ident),
 			selector_str,
 			selector,
 			args,
@@ -433,7 +433,7 @@
 						found_error = true;
 					}
 				}
-				TraitItem::Method(method) => methods.push(Method::try_from(&method)?),
+				TraitItem::Method(method) => methods.push(Method::try_from(method)?),
 				_ => {}
 			}
 		}
modifiedcrates/evm-coder-macros/src/to_log.rsdiffbeforeafterboth
--- a/crates/evm-coder-macros/src/to_log.rs
+++ b/crates/evm-coder-macros/src/to_log.rs
@@ -41,7 +41,7 @@
 impl Event {
 	fn try_from(variant: &Variant) -> syn::Result<Self> {
 		let name = &variant.ident;
-		let name_screaming = snake_ident_to_screaming(&name);
+		let name_screaming = snake_ident_to_screaming(name);
 
 		let named = match &variant.fields {
 			Fields::Named(named) => named,
@@ -54,7 +54,7 @@
 		};
 		let mut fields = Vec::new();
 		for field in &named.named {
-			fields.push(EventField::try_from(&field)?);
+			fields.push(EventField::try_from(field)?);
 		}
 		let mut selector_str = format!("{}(", name);
 		for (i, arg) in fields.iter().enumerate() {
modifiedcrates/evm-coder/src/abi.rsdiffbeforeafterboth
--- a/crates/evm-coder/src/abi.rs
+++ b/crates/evm-coder/src/abi.rs
@@ -104,7 +104,7 @@
 	fn subresult(&mut self) -> Result<AbiReader<'i>> {
 		let offset = self.read_usize()?;
 		Ok(AbiReader {
-			buf: &self.buf,
+			buf: self.buf,
 			offset: offset + self.offset,
 		})
 	}
@@ -252,7 +252,7 @@
 impl_abi_writeable!(&str, string);
 impl AbiWrite for &string {
 	fn abi_write(&self, writer: &mut AbiWriter) {
-		writer.string(&self)
+		writer.string(self)
 	}
 }
 
modifiednode/cli/src/cli.rsdiffbeforeafterboth
--- a/node/cli/src/cli.rs
+++ b/node/cli/src/cli.rs
@@ -1,6 +1,4 @@
 use crate::chain_spec;
-use cumulus_client_cli;
-use sc_cli;
 use std::path::PathBuf;
 use structopt::StructOpt;
 
modifiednode/cli/src/command.rsdiffbeforeafterboth
--- a/node/cli/src/command.rs
+++ b/node/cli/src/command.rs
@@ -120,8 +120,7 @@
 	}
 
 	fn load_spec(&self, id: &str) -> std::result::Result<Box<dyn sc_service::ChainSpec>, String> {
-		polkadot_cli::Cli::from_iter([RelayChainCli::executable_name().to_string()].iter())
-			.load_spec(id)
+		polkadot_cli::Cli::from_iter([RelayChainCli::executable_name()].iter()).load_spec(id)
 	}
 
 	fn native_runtime_version(chain_spec: &Box<dyn ChainSpec>) -> &'static RuntimeVersion {
@@ -129,6 +128,7 @@
 	}
 }
 
+#[allow(clippy::borrowed_box)]
 fn extract_genesis_wasm(chain_spec: &Box<dyn sc_service::ChainSpec>) -> Result<Vec<u8>> {
 	let mut storage = chain_spec.build_storage()?;
 
@@ -189,7 +189,7 @@
 			runner.sync_run(|config| {
 				let polkadot_cli = RelayChainCli::new(
 					&config,
-					[RelayChainCli::executable_name().to_string()]
+					[RelayChainCli::executable_name()]
 						.iter()
 						.chain(cli.relaychain_args.iter()),
 				);
@@ -275,7 +275,7 @@
 
 				let polkadot_cli = RelayChainCli::new(
 					&config,
-					[RelayChainCli::executable_name().to_string()]
+					[RelayChainCli::executable_name()]
 						.iter()
 						.chain(cli.relaychain_args.iter()),
 				);
modifiednode/cli/src/service.rsdiffbeforeafterboth
--- a/node/cli/src/service.rs
+++ b/node/cli/src/service.rs
@@ -141,7 +141,7 @@
 
 	let (client, backend, keystore_container, task_manager) =
 		sc_service::new_full_parts::<Block, RuntimeApi, Executor>(
-			&config,
+			config,
 			telemetry.as_ref().map(|(_, telemetry)| telemetry.handle()),
 		)?;
 	let client = Arc::new(client);
modifiedpallets/contract-helpers/src/lib.rsdiffbeforeafterboth
before · pallets/contract-helpers/src/lib.rs
1#![cfg_attr(not(feature = "std"), no_std)]23pub use pallet::*;45#[frame_support::pallet]6pub mod pallet {7	use frame_support::sp_runtime::traits::StaticLookup;8	use frame_support::{pallet_prelude::*, traits::IsSubType};9	use frame_system::pallet_prelude::*;10	use pallet_contracts::chain_extension::UncheckedFrom;11	use sp_runtime::{12		traits::{DispatchInfoOf, Hash, PostDispatchInfoOf, SignedExtension},13		transaction_validity,14	};15	use sp_std::vec::Vec;16	use up_sponsorship::SponsorshipHandler;1718	#[pallet::error]19	pub enum Error<T> {20		/// Should be contract owner21		NoPermission,22	}2324	#[pallet::config]25	pub trait Config: frame_system::Config + pallet_contracts::Config {}2627	#[pallet::pallet]28	#[pallet::generate_store(pub(super) trait Store)]29	pub struct Pallet<T>(_);3031	#[pallet::storage]32	pub(super) type Owner<T: Config> = StorageMap<33		Hasher = Twox128,34		Key = T::AccountId,35		Value = T::AccountId,36		QueryKind = ValueQuery,37	>;3839	#[pallet::storage]40	pub(super) type AllowlistEnabled<T: Config> =41		StorageMap<Hasher = Twox128, Key = T::AccountId, Value = bool, QueryKind = ValueQuery>;4243	#[pallet::storage]44	pub(super) type Allowlist<T: Config> = StorageDoubleMap<45		Hasher1 = Twox128,46		Key1 = T::AccountId,47		Hasher2 = Twox64Concat,48		Key2 = T::AccountId,49		Value = bool,50		QueryKind = ValueQuery,51	>;5253	#[pallet::storage]54	pub(super) type SelfSponsoring<T: Config> =55		StorageMap<Hasher = Twox128, Key = T::AccountId, Value = bool, QueryKind = ValueQuery>;5657	#[pallet::storage]58	pub(super) type SponsoringRateLimit<T: Config> = StorageMap<59		Hasher = Twox128,60		Key = T::AccountId,61		Value = T::BlockNumber,62		QueryKind = ValueQuery,63	>;6465	#[pallet::storage]66	pub(super) type SponsorBasket<T: Config> = StorageDoubleMap<67		Hasher1 = Twox128,68		Key1 = T::AccountId,69		Hasher2 = Twox128,70		Key2 = T::AccountId,71		Value = T::BlockNumber,72		QueryKind = ValueQuery,73	>;7475	#[pallet::call]76	impl<T: Config> Pallet<T> {77		#[pallet::weight(0)]78		fn toggle_sponsoring(79			origin: OriginFor<T>,80			contract: T::AccountId,81			sponsoring: bool,82		) -> DispatchResult {83			let sender = ensure_signed(origin)?;84			ensure!(85				<Owner<T>>::get(&contract) == sender,86				<Error<T>>::NoPermission87			);8889			if sponsoring {90				<SelfSponsoring<T>>::insert(contract, true);91			} else {92				<SelfSponsoring<T>>::remove(contract);93			}94			Ok(())95		}9697		#[pallet::weight(0)]98		fn toggle_allowlist(99			origin: OriginFor<T>,100			contract: T::AccountId,101			enabled: bool,102		) -> DispatchResult {103			let sender = ensure_signed(origin)?;104			ensure!(105				<Owner<T>>::get(&contract) == sender,106				<Error<T>>::NoPermission107			);108109			if enabled {110				<AllowlistEnabled<T>>::insert(contract, true);111			} else {112				<AllowlistEnabled<T>>::remove(contract);113			}114			Ok(())115		}116117		#[pallet::weight(0)]118		fn toggle_allowed(119			origin: OriginFor<T>,120			contract: T::AccountId,121			user: T::AccountId,122			allowed: bool,123		) -> DispatchResult {124			let sender = ensure_signed(origin)?;125			ensure!(126				<Owner<T>>::get(&contract) == sender,127				<Error<T>>::NoPermission128			);129130			if allowed {131				<Allowlist<T>>::insert(contract, user, true);132			} else {133				<Allowlist<T>>::remove(contract, user);134			}135			Ok(())136		}137138		#[pallet::weight(0)]139		fn set_sponsoring_rate_limit(140			origin: OriginFor<T>,141			contract: T::AccountId,142			rate_limit: T::BlockNumber,143		) -> DispatchResult {144			let sender = ensure_signed(origin)?;145			ensure!(146				<Owner<T>>::get(&contract) == sender,147				<Error<T>>::NoPermission148			);149150			<SponsoringRateLimit<T>>::insert(contract, rate_limit);151			Ok(())152		}153	}154155	#[derive(Encode, Decode, Clone, PartialEq, Eq)]156	pub struct ContractHelpersExtension<T>(PhantomData<T>);157	impl<T> core::fmt::Debug for ContractHelpersExtension<T> {158		fn fmt(&self, fmt: &mut core::fmt::Formatter<'_>) -> Result<(), core::fmt::Error> {159			fmt.debug_struct("ContractHelpersExtension").finish()160		}161	}162163	type CodeHash<T> = <T as frame_system::Config>::Hash;164	impl<T> SignedExtension for ContractHelpersExtension<T>165	where166		T: Config + Send + Sync,167		T::Call: sp_runtime::traits::Dispatchable,168		T::Call: IsSubType<pallet_contracts::Call<T>>,169		T::AccountId: UncheckedFrom<T::Hash>,170		T::AccountId: AsRef<[u8]>,171	{172		const IDENTIFIER: &'static str = "ContractHelpers";173		type AccountId = T::AccountId;174		type Call = T::Call;175		type AdditionalSigned = ();176		type Pre = Option<(Self::AccountId, CodeHash<T>, Vec<u8>)>;177178		fn additional_signed(&self) -> Result<(), transaction_validity::TransactionValidityError> {179			Ok(())180		}181182		fn validate(183			&self,184			who: &T::AccountId,185			call: &Self::Call,186			_info: &DispatchInfoOf<Self::Call>,187			_len: usize,188		) -> transaction_validity::TransactionValidity {189			if let Some(pallet_contracts::Call::call(dest, _value, _gas_limit, _data)) =190				IsSubType::<pallet_contracts::Call<T>>::is_sub_type(call)191			{192				let called_contract: T::AccountId =193					T::Lookup::lookup((*dest).clone()).unwrap_or_default();194				if <AllowlistEnabled<T>>::get(&called_contract)195					&& !<Allowlist<T>>::get(&called_contract, who)196					&& &<Owner<T>>::get(&called_contract) != who197				{198					return Err(transaction_validity::InvalidTransaction::Call.into());199				}200			}201			Ok(transaction_validity::ValidTransaction::default())202		}203204		fn pre_dispatch(205			self,206			who: &Self::AccountId,207			call: &Self::Call,208			_info: &DispatchInfoOf<Self::Call>,209			_len: usize,210		) -> Result<Self::Pre, TransactionValidityError> {211			match IsSubType::<pallet_contracts::Call<T>>::is_sub_type(call) {212				Some(pallet_contracts::Call::instantiate(_, _, code_hash, _, salt)) => {213					Ok(Some((who.clone(), *code_hash, salt.clone())))214				}215				Some(pallet_contracts::Call::instantiate_with_code(_, _, code, _, salt)) => {216					let code_hash = &T::Hashing::hash(&code);217					Ok(Some((who.clone(), *code_hash, salt.clone())))218				}219				_ => Ok(None),220			}221		}222223		fn post_dispatch(224			pre: Self::Pre,225			_info: &DispatchInfoOf<Self::Call>,226			_post_info: &PostDispatchInfoOf<Self::Call>,227			_len: usize,228			_result: &DispatchResult,229		) -> Result<(), TransactionValidityError> {230			if let Some((who, code_hash, salt)) = pre {231				let new_contract_address =232					<pallet_contracts::Pallet<T>>::contract_address(&who, &code_hash, &salt);233				<Owner<T>>::insert(&new_contract_address, &who);234			}235236			Ok(())237		}238	}239240	pub struct ContractSponsorshipHandler<T>(PhantomData<T>);241	impl<T, C> SponsorshipHandler<T::AccountId, C> for ContractSponsorshipHandler<T>242	where243		T: Config,244		C: IsSubType<pallet_contracts::Call<T>>,245		T::AccountId: UncheckedFrom<T::Hash>,246		T::AccountId: AsRef<[u8]>,247	{248		fn get_sponsor(who: &T::AccountId, call: &C) -> Option<T::AccountId> {249			if let Some(pallet_contracts::Call::call(dest, _value, _gas_limit, _data)) =250				IsSubType::<pallet_contracts::Call<T>>::is_sub_type(call)251			{252				let called_contract: T::AccountId =253					T::Lookup::lookup((*dest).clone()).unwrap_or_default();254				if <SelfSponsoring<T>>::get(&called_contract) {255					let last_tx_block = SponsorBasket::<T>::get(&called_contract, &who);256					let block_number = <frame_system::Pallet<T>>::block_number() as T::BlockNumber;257					let rate_limit = SponsoringRateLimit::<T>::get(&called_contract);258					let limit_time = last_tx_block + rate_limit;259260					if block_number >= limit_time {261						SponsorBasket::<T>::insert(&called_contract, who, block_number);262						return Some(called_contract);263					}264				}265			}266			None267		}268	}269}
modifiedpallets/nft/src/eth/erc_impl.rsdiffbeforeafterboth
--- a/pallets/nft/src/eth/erc_impl.rs
+++ b/pallets/nft/src/eth/erc_impl.rs
@@ -114,7 +114,7 @@
 		let to = T::CrossAccountId::from_eth(to);
 		let token_id = token_id.try_into().map_err(|_| "token_id overflow")?;
 
-		<Module<T>>::transfer_from_internal(&caller, &from, &to, &self, token_id, 1)
+		<Module<T>>::transfer_from_internal(&caller, &from, &to, self, token_id, 1)
 			.map_err(|_| "transferFrom error")?;
 		Ok(())
 	}
@@ -130,7 +130,7 @@
 		let approved = T::CrossAccountId::from_eth(approved);
 		let token_id = token_id.try_into().map_err(|_| "token_id overflow")?;
 
-		<Module<T>>::approve_internal(&caller, &approved, &self, token_id, 1)
+		<Module<T>>::approve_internal(&caller, &approved, self, token_id, 1)
 			.map_err(|_| "approve internal")?;
 		Ok(())
 	}
@@ -176,7 +176,7 @@
 		let to = T::CrossAccountId::from_eth(to);
 		let token_id = token_id.try_into().map_err(|_| "amount overflow")?;
 
-		<Module<T>>::transfer_internal(&caller, &to, &self, token_id, 1)
+		<Module<T>>::transfer_internal(&caller, &to, self, token_id, 1)
 			.map_err(|_| "transfer error")?;
 		Ok(())
 	}
@@ -226,7 +226,7 @@
 		let to = T::CrossAccountId::from_eth(to);
 		let amount = amount.try_into().map_err(|_| "amount overflow")?;
 
-		<Module<T>>::transfer_internal(&caller, &to, &self, 1, amount)
+		<Module<T>>::transfer_internal(&caller, &to, self, 1, amount)
 			.map_err(|_| "transfer error")?;
 		Ok(true)
 	}
@@ -242,7 +242,7 @@
 		let to = T::CrossAccountId::from_eth(to);
 		let amount = amount.try_into().map_err(|_| "amount overflow")?;
 
-		<Module<T>>::transfer_from_internal(&caller, &from, &to, &self, 1, amount)
+		<Module<T>>::transfer_from_internal(&caller, &from, &to, self, 1, amount)
 			.map_err(|_| "transferFrom error")?;
 		Ok(true)
 	}
@@ -251,7 +251,7 @@
 		let spender = T::CrossAccountId::from_eth(spender);
 		let amount = amount.try_into().map_err(|_| "amount overflow")?;
 
-		<Module<T>>::approve_internal(&caller, &spender, &self, 1, amount)
+		<Module<T>>::approve_internal(&caller, &spender, self, 1, amount)
 			.map_err(|_| "approve internal")?;
 		Ok(true)
 	}
modifiedpallets/nft/src/eth/mod.rsdiffbeforeafterboth
--- a/pallets/nft/src/eth/mod.rs
+++ b/pallets/nft/src/eth/mod.rs
@@ -108,7 +108,7 @@
 			.unwrap_or(false)
 	}
 	fn get_code(target: &H160) -> Option<Vec<u8>> {
-		map_eth_to_id(&target)
+		map_eth_to_id(target)
 			.and_then(<CollectionById<T>>::get)
 			.map(|collection| {
 				match collection.mode {
@@ -127,7 +127,7 @@
 		input: &[u8],
 		value: U256,
 	) -> Option<PrecompileOutput> {
-		let mut collection = map_eth_to_id(&target)
+		let mut collection = map_eth_to_id(target)
 			.and_then(|id| <CollectionHandle<T>>::get_with_gas_limit(id, gas_limit))?;
 		let (method_id, input) = AbiReader::new_call(input).unwrap();
 		let result = call_internal(&mut collection, *source, method_id, input, value);
modifiedpallets/nft/src/eth/sponsoring.rsdiffbeforeafterboth
--- a/pallets/nft/src/eth/sponsoring.rs
+++ b/pallets/nft/src/eth/sponsoring.rs
@@ -132,10 +132,10 @@
 	) -> 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_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() {
+						if try_sponsor(who, collection_id, &collection, input).is_ok() {
 							who_pays_fee =
 								T::EvmBackwardsAddressMapping::from_account_id(sponsor.clone());
 						}
modifiedpallets/nft/src/lib.rsdiffbeforeafterboth
--- a/pallets/nft/src/lib.rs
+++ b/pallets/nft/src/lib.rs
@@ -1232,7 +1232,7 @@
 		) -> 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())?;
+			Self::check_owner_permissions(&target_collection, sender.as_sub())?;
 			let old_limits = &target_collection.limits;
 			let chain_limits = ChainLimit::get();
 
@@ -1267,9 +1267,9 @@
 		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)?;
+		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(())
 	}
@@ -1283,18 +1283,18 @@
 	) -> DispatchResult {
 		target_collection.consume_gas(2000000)?;
 		// Limits check
-		Self::is_correct_transfer(target_collection, &recipient)?;
+		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),
+			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)?;
+			Self::check_white_list(target_collection, sender)?;
+			Self::check_white_list(target_collection, recipient)?;
 		}
 
 		match target_collection.mode {
@@ -1305,7 +1305,7 @@
 				recipient.clone(),
 			)?,
 			CollectionMode::Fungible(_) => {
-				Self::transfer_fungible(target_collection, value, &sender, &recipient)?
+				Self::transfer_fungible(target_collection, value, sender, recipient)?
 			}
 			CollectionMode::ReFungible => Self::transfer_refungible(
 				target_collection,
@@ -1336,23 +1336,23 @@
 		amount: u128,
 	) -> DispatchResult {
 		collection.consume_gas(2000000)?;
-		Self::token_exists(&collection, item_id)?;
+		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);
+			&& 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);
 		};
 
 		if collection.access == AccessMode::WhiteList {
-			Self::check_white_list(&collection, &sender)?;
-			Self::check_white_list(&collection, &spender)?;
+			Self::check_white_list(collection, sender)?;
+			Self::check_white_list(collection, spender)?;
 		}
 
 		let allowance: u128 = amount
@@ -1412,19 +1412,19 @@
 			<Allowances<T>>::get(collection.id, (item_id, from.as_sub(), sender.as_sub()));
 
 		// Limits check
-		Self::is_correct_transfer(&collection, &recipient)?;
+		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)),
+					&& Self::is_owner_or_admin_permissions(collection, sender)),
 			Error::<T>::NoPermission
 		);
 
 		if collection.access == AccessMode::WhiteList {
-			Self::check_white_list(&collection, &sender)?;
-			Self::check_white_list(&collection, &recipient)?;
+			Self::check_white_list(collection, sender)?;
+			Self::check_white_list(collection, recipient)?;
 		}
 
 		// Reduce approval by transferred amount or remove if remaining approval drops to 0
@@ -1441,13 +1441,13 @@
 
 		match collection.mode {
 			CollectionMode::NFT => {
-				Self::transfer_nft(&collection, item_id, from.clone(), recipient.clone())?
+				Self::transfer_nft(collection, item_id, from.clone(), recipient.clone())?
 			}
 			CollectionMode::Fungible(_) => {
-				Self::transfer_fungible(&collection, amount, &from, &recipient)?
+				Self::transfer_fungible(collection, amount, from, recipient)?
 			}
 			CollectionMode::ReFungible => Self::transfer_refungible(
-				&collection,
+				collection,
 				item_id,
 				amount,
 				from.clone(),
@@ -1473,7 +1473,7 @@
 		item_id: TokenId,
 		data: Vec<u8>,
 	) -> DispatchResult {
-		Self::token_exists(&collection, item_id)?;
+		Self::token_exists(collection, item_id)?;
 
 		ensure!(
 			ChainLimit::get().custom_data_limit >= data.len() as u32,
@@ -1482,15 +1482,15 @@
 
 		// Modify permissions check
 		ensure!(
-			Self::is_item_owner(&sender, &collection, item_id)
-				|| Self::is_owner_or_admin_permissions(&collection, &sender),
+			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::NFT => Self::set_nft_variable_data(collection, item_id, data)?,
 			CollectionMode::ReFungible => {
-				Self::set_re_fungible_variable_data(&collection, item_id, data)?
+				Self::set_re_fungible_variable_data(collection, item_id, data)?
 			}
 			CollectionMode::Fungible(_) => fail!(Error::<T>::CantStoreMetadataInFungibleTokens),
 			_ => fail!(Error::<T>::UnexpectedCollectionType),
@@ -1505,18 +1505,13 @@
 		owner: &T::CrossAccountId,
 		items_data: Vec<CreateItemData>,
 	) -> DispatchResult {
-		Self::can_create_items_in_collection(
-			&collection,
-			&sender,
-			&owner,
-			items_data.len() as u32,
-		)?;
+		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)?;
+			Self::validate_create_item_args(collection, data)?;
 		}
 		for data in &items_data {
-			Self::create_item_no_validation(&collection, owner, data.clone())?;
+			Self::create_item_no_validation(collection, owner, data.clone())?;
 		}
 
 		Ok(())
@@ -1529,22 +1524,20 @@
 		value: u128,
 	) -> DispatchResult {
 		ensure!(
-			Self::is_item_owner(&sender, &collection, item_id)
+			Self::is_item_owner(sender, collection, item_id)
 				|| (collection.limits.owner_can_transfer
-					&& Self::is_owner_or_admin_permissions(&collection, &sender)),
+					&& Self::is_owner_or_admin_permissions(collection, sender)),
 			Error::<T>::NoPermission
 		);
 
 		if collection.access == AccessMode::WhiteList {
-			Self::check_white_list(&collection, &sender)?;
+			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)?
-			}
+			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)?,
 			_ => (),
 		};
 
@@ -1557,7 +1550,7 @@
 		address: &T::CrossAccountId,
 		whitelisted: bool,
 	) -> DispatchResult {
-		Self::check_owner_or_admin_permissions(&collection, &sender)?;
+		Self::check_owner_or_admin_permissions(collection, sender)?;
 
 		if whitelisted {
 			<WhiteList<T>>::insert(collection.id, address.as_sub(), true);
@@ -1610,7 +1603,7 @@
 			Error::<T>::AccountTokenLimitExceeded
 		);
 
-		if !Self::is_owner_or_admin_permissions(collection, &sender) {
+		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)?;
@@ -1691,7 +1684,7 @@
 				Self::add_nft_item(collection, item)?;
 			}
 			CreateItemData::Fungible(data) => {
-				Self::add_fungible_item(collection, &owner, data.value)?;
+				Self::add_fungible_item(collection, owner, data.value)?;
 			}
 			CreateItemData::ReFungible(data) => {
 				let owner_list = vec![Ownership {
@@ -1934,7 +1927,7 @@
 		subject: &T::CrossAccountId,
 	) -> bool {
 		*subject.as_sub() == collection.owner
-			|| <AdminList<T>>::get(collection.id).contains(&subject)
+			|| <AdminList<T>>::get(collection.id).contains(subject)
 	}
 
 	fn check_owner_or_admin_permissions(
@@ -1979,7 +1972,7 @@
 	) -> bool {
 		match target_collection.mode {
 			CollectionMode::Fungible(_) => true,
-			_ => Self::owned_amount(&subject, target_collection, item_id).is_some(),
+			_ => Self::owned_amount(subject, target_collection, item_id).is_some(),
 		}
 	}
 
modifiedpallets/nft/src/sponsorship.rsdiffbeforeafterboth
--- a/pallets/nft/src/sponsorship.rs
+++ b/pallets/nft/src/sponsorship.rs
@@ -179,14 +179,14 @@
 {
 	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::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)
+				Self::withdraw_set_variable_meta_data(collection_id, item_id, data)
 			}
 			_ => None,
 		}