git.delta.rocks / unique-network / refs/commits / 45404723cf23

difftreelog

refac: rename caller -> Caller

Trubnikov Sergey2023-01-18parent: #dc76967.patch.diff
in: master

11 files changed

modifiedcrates/evm-coder/procedural/src/solidity_interface.rsdiffbeforeafterboth
--- a/crates/evm-coder/procedural/src/solidity_interface.rs
+++ b/crates/evm-coder/procedural/src/solidity_interface.rs
@@ -354,7 +354,7 @@
 
 	fn is_caller(&self) -> bool {
 		if let Ok(ident) = self.plain() {
-			return ident == "caller";
+			return ident == "Caller";
 		}
 		false
 	}
modifiedcrates/evm-coder/src/lib.rsdiffbeforeafterboth
--- a/crates/evm-coder/src/lib.rs
+++ b/crates/evm-coder/src/lib.rs
@@ -147,7 +147,7 @@
 	/// Makes function payable
 	pub type Value = U256;
 	/// Makes function caller-sensitive
-	pub type caller = Address;
+	pub type Caller = Address;
 	//#endregion
 
 	/// Ethereum typed call message, similar to solidity
modifiedcrates/evm-coder/tests/random.rsdiffbeforeafterboth
--- a/crates/evm-coder/tests/random.rs
+++ b/crates/evm-coder/tests/random.rs
@@ -64,7 +64,7 @@
 		unreachable!()
 	}
 
-	fn caller_sensitive(&self, _caller: caller) -> Result<u8> {
+	fn caller_sensitive(&self, _caller: Caller) -> Result<u8> {
 		unreachable!()
 	}
 	fn payable(&mut self, _value: Value) -> Result<u8> {
modifiedcrates/evm-coder/tests/solidity_generation.rsdiffbeforeafterboth
--- a/crates/evm-coder/tests/solidity_generation.rs
+++ b/crates/evm-coder/tests/solidity_generation.rs
@@ -28,19 +28,19 @@
 	fn balance_of(&self, _owner: Address) -> Result<U256> {
 		unreachable!()
 	}
-	fn transfer(&mut self, _caller: caller, _to: Address, _value: U256) -> Result<bool> {
+	fn transfer(&mut self, _caller: Caller, _to: Address, _value: U256) -> Result<bool> {
 		unreachable!()
 	}
 	fn transfer_from(
 		&mut self,
-		_caller: caller,
+		_caller: Caller,
 		_from: Address,
 		_to: Address,
 		_value: U256,
 	) -> Result<bool> {
 		unreachable!()
 	}
-	fn approve(&mut self, _caller: caller, _spender: Address, _value: U256) -> Result<bool> {
+	fn approve(&mut self, _caller: Caller, _spender: Address, _value: U256) -> Result<bool> {
 		unreachable!()
 	}
 	fn allowance(&self, _owner: Address, _spender: Address) -> Result<U256> {
modifiedpallets/common/src/erc.rsdiffbeforeafterboth
--- a/pallets/common/src/erc.rs
+++ b/pallets/common/src/erc.rs
@@ -94,7 +94,7 @@
 	/// @param value Propery value.
 	#[solidity(hide)]
 	#[weight(<SelfWeightOf<T>>::set_collection_properties(1))]
-	fn set_collection_property(&mut self, caller: caller, key: String, value: Bytes) -> Result<()> {
+	fn set_collection_property(&mut self, caller: Caller, key: String, value: Bytes) -> Result<()> {
 		let caller = T::CrossAccountId::from_eth(caller);
 		let key = <Vec<u8>>::from(key)
 			.try_into()
@@ -111,7 +111,7 @@
 	#[weight(<SelfWeightOf<T>>::set_collection_properties(properties.len() as u32))]
 	fn set_collection_properties(
 		&mut self,
-		caller: caller,
+		caller: Caller,
 		properties: Vec<eth::Property>,
 	) -> Result<()> {
 		let caller = T::CrossAccountId::from_eth(caller);
@@ -130,7 +130,7 @@
 	/// @param key Property key.
 	#[solidity(hide)]
 	#[weight(<SelfWeightOf<T>>::delete_collection_properties(1))]
-	fn delete_collection_property(&mut self, caller: caller, key: String) -> Result<()> {
+	fn delete_collection_property(&mut self, caller: Caller, key: String) -> Result<()> {
 		let caller = T::CrossAccountId::from_eth(caller);
 		let key = <Vec<u8>>::from(key)
 			.try_into()
@@ -143,7 +143,7 @@
 	///
 	/// @param keys Properties keys.
 	#[weight(<SelfWeightOf<T>>::delete_collection_properties(keys.len() as u32))]
-	fn delete_collection_properties(&mut self, caller: caller, keys: Vec<String>) -> Result<()> {
+	fn delete_collection_properties(&mut self, caller: Caller, keys: Vec<String>) -> Result<()> {
 		let caller = T::CrossAccountId::from_eth(caller);
 		let keys = keys
 			.into_iter()
@@ -208,7 +208,7 @@
 	///
 	/// @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract.
 	#[solidity(hide)]
-	fn set_collection_sponsor(&mut self, caller: caller, sponsor: Address) -> Result<()> {
+	fn set_collection_sponsor(&mut self, caller: Caller, sponsor: Address) -> Result<()> {
 		self.consume_store_reads_and_writes(1, 1)?;
 
 		let caller = T::CrossAccountId::from_eth(caller);
@@ -225,7 +225,7 @@
 	/// @param sponsor Cross account address of the sponsor from whose account funds will be debited for operations with the contract.
 	fn set_collection_sponsor_cross(
 		&mut self,
-		caller: caller,
+		caller: Caller,
 		sponsor: eth::CrossAddress,
 	) -> Result<()> {
 		self.consume_store_reads_and_writes(1, 1)?;
@@ -248,7 +248,7 @@
 	/// Collection sponsorship confirmation.
 	///
 	/// @dev After setting the sponsor for the collection, it must be confirmed with this function.
-	fn confirm_collection_sponsorship(&mut self, caller: caller) -> Result<()> {
+	fn confirm_collection_sponsorship(&mut self, caller: Caller) -> Result<()> {
 		self.consume_store_writes(1)?;
 
 		let caller = T::CrossAccountId::from_eth(caller);
@@ -257,7 +257,7 @@
 	}
 
 	/// Remove collection sponsor.
-	fn remove_collection_sponsor(&mut self, caller: caller) -> Result<()> {
+	fn remove_collection_sponsor(&mut self, caller: Caller) -> Result<()> {
 		self.consume_store_reads_and_writes(1, 1)?;
 		let caller = T::CrossAccountId::from_eth(caller);
 		self.remove_sponsor(&caller).map_err(dispatch_to_evm::<T>)
@@ -339,7 +339,7 @@
 	/// @dev Throws error if limit not found.
 	/// @param limit Some limit.
 	#[solidity(rename_selector = "setCollectionLimit")]
-	fn set_collection_limit(&mut self, caller: caller, limit: eth::CollectionLimit) -> Result<()> {
+	fn set_collection_limit(&mut self, caller: Caller, limit: eth::CollectionLimit) -> Result<()> {
 		self.consume_store_reads_and_writes(1, 1)?;
 
 		if !limit.has_value() {
@@ -359,7 +359,7 @@
 	/// @param newAdmin Cross account administrator address.
 	fn add_collection_admin_cross(
 		&mut self,
-		caller: caller,
+		caller: Caller,
 		new_admin: eth::CrossAddress,
 	) -> Result<()> {
 		self.consume_store_reads_and_writes(2, 2)?;
@@ -374,7 +374,7 @@
 	/// @param admin Cross account administrator address.
 	fn remove_collection_admin_cross(
 		&mut self,
-		caller: caller,
+		caller: Caller,
 		admin: eth::CrossAddress,
 	) -> Result<()> {
 		self.consume_store_reads_and_writes(2, 2)?;
@@ -388,7 +388,7 @@
 	/// Add collection admin.
 	/// @param newAdmin Address of the added administrator.
 	#[solidity(hide)]
-	fn add_collection_admin(&mut self, caller: caller, new_admin: Address) -> Result<()> {
+	fn add_collection_admin(&mut self, caller: Caller, new_admin: Address) -> Result<()> {
 		self.consume_store_reads_and_writes(2, 2)?;
 
 		let caller = T::CrossAccountId::from_eth(caller);
@@ -401,7 +401,7 @@
 	///
 	/// @param admin Address of the removed administrator.
 	#[solidity(hide)]
-	fn remove_collection_admin(&mut self, caller: caller, admin: Address) -> Result<()> {
+	fn remove_collection_admin(&mut self, caller: Caller, admin: Address) -> Result<()> {
 		self.consume_store_reads_and_writes(2, 2)?;
 
 		let caller = T::CrossAccountId::from_eth(caller);
@@ -414,7 +414,7 @@
 	///
 	/// @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'
 	#[solidity(rename_selector = "setCollectionNesting")]
-	fn set_nesting_bool(&mut self, caller: caller, enable: bool) -> Result<()> {
+	fn set_nesting_bool(&mut self, caller: Caller, enable: bool) -> Result<()> {
 		self.consume_store_reads_and_writes(1, 1)?;
 
 		let caller = T::CrossAccountId::from_eth(caller);
@@ -435,7 +435,7 @@
 	#[solidity(rename_selector = "setCollectionNesting")]
 	fn set_nesting(
 		&mut self,
-		caller: caller,
+		caller: Caller,
 		enable: bool,
 		collections: Vec<Address>,
 	) -> Result<()> {
@@ -503,7 +503,7 @@
 	}
 	/// Set the collection access method.
 	/// @param mode Access mode
-	fn set_collection_access(&mut self, caller: caller, mode: eth::AccessMode) -> Result<()> {
+	fn set_collection_access(&mut self, caller: Caller, mode: eth::AccessMode) -> Result<()> {
 		self.consume_store_reads_and_writes(1, 1)?;
 
 		let caller = T::CrossAccountId::from_eth(caller);
@@ -526,7 +526,7 @@
 	///
 	/// @param user Address of a trusted user.
 	#[solidity(hide)]
-	fn add_to_collection_allow_list(&mut self, caller: caller, user: Address) -> Result<()> {
+	fn add_to_collection_allow_list(&mut self, caller: Caller, user: Address) -> Result<()> {
 		self.consume_store_writes(1)?;
 
 		let caller = T::CrossAccountId::from_eth(caller);
@@ -540,7 +540,7 @@
 	/// @param user User cross account address.
 	fn add_to_collection_allow_list_cross(
 		&mut self,
-		caller: caller,
+		caller: Caller,
 		user: eth::CrossAddress,
 	) -> Result<()> {
 		self.consume_store_writes(1)?;
@@ -555,7 +555,7 @@
 	///
 	/// @param user Address of a removed user.
 	#[solidity(hide)]
-	fn remove_from_collection_allow_list(&mut self, caller: caller, user: Address) -> Result<()> {
+	fn remove_from_collection_allow_list(&mut self, caller: Caller, user: Address) -> Result<()> {
 		self.consume_store_writes(1)?;
 
 		let caller = T::CrossAccountId::from_eth(caller);
@@ -569,7 +569,7 @@
 	/// @param user User cross account address.
 	fn remove_from_collection_allow_list_cross(
 		&mut self,
-		caller: caller,
+		caller: Caller,
 		user: eth::CrossAddress,
 	) -> Result<()> {
 		self.consume_store_writes(1)?;
@@ -583,7 +583,7 @@
 	/// Switch permission for minting.
 	///
 	/// @param mode Enable if "true".
-	fn set_collection_mint_mode(&mut self, caller: caller, mode: bool) -> Result<()> {
+	fn set_collection_mint_mode(&mut self, caller: Caller, mode: bool) -> Result<()> {
 		self.consume_store_reads_and_writes(1, 1)?;
 
 		let caller = T::CrossAccountId::from_eth(caller);
@@ -640,7 +640,7 @@
 	/// @dev Owner can be changed only by current owner
 	/// @param newOwner new owner account
 	#[solidity(hide, rename_selector = "changeCollectionOwner")]
-	fn set_owner(&mut self, caller: caller, new_owner: Address) -> Result<()> {
+	fn set_owner(&mut self, caller: Caller, new_owner: Address) -> Result<()> {
 		self.consume_store_writes(1)?;
 
 		let caller = T::CrossAccountId::from_eth(caller);
@@ -666,7 +666,7 @@
 	/// @param newOwner new owner cross account
 	fn change_collection_owner_cross(
 		&mut self,
-		caller: caller,
+		caller: Caller,
 		new_owner: eth::CrossAddress,
 	) -> Result<()> {
 		self.consume_store_writes(1)?;
modifiedpallets/evm-contract-helpers/src/eth.rsdiffbeforeafterboth
--- a/pallets/evm-contract-helpers/src/eth.rs
+++ b/pallets/evm-contract-helpers/src/eth.rs
@@ -105,7 +105,7 @@
 	/// @param sponsor User address who set as pending sponsor.
 	fn set_sponsor(
 		&mut self,
-		caller: caller,
+		caller: Caller,
 		contract_address: Address,
 		sponsor: Address,
 	) -> Result<()> {
@@ -125,7 +125,7 @@
 	/// Set contract as self sponsored.
 	///
 	/// @param contractAddress Contract for which a self sponsoring is being enabled.
-	fn self_sponsored_enable(&mut self, caller: caller, contract_address: Address) -> Result<()> {
+	fn self_sponsored_enable(&mut self, caller: Caller, contract_address: Address) -> Result<()> {
 		self.recorder().consume_sload()?;
 		self.recorder().consume_sstore()?;
 
@@ -146,7 +146,7 @@
 	/// Remove sponsor.
 	///
 	/// @param contractAddress Contract for which a sponsorship is being removed.
-	fn remove_sponsor(&mut self, caller: caller, contract_address: Address) -> Result<()> {
+	fn remove_sponsor(&mut self, caller: Caller, contract_address: Address) -> Result<()> {
 		self.recorder().consume_sload()?;
 		self.recorder().consume_sstore()?;
 
@@ -161,7 +161,7 @@
 	/// @dev Caller must be same that set via [`setSponsor`].
 	///
 	/// @param contractAddress Сontract for which need to confirm sponsorship.
-	fn confirm_sponsorship(&mut self, caller: caller, contract_address: Address) -> Result<()> {
+	fn confirm_sponsorship(&mut self, caller: Caller, contract_address: Address) -> Result<()> {
 		self.recorder().consume_sload()?;
 		self.recorder().consume_sstore()?;
 
@@ -207,7 +207,7 @@
 
 	fn set_sponsoring_mode(
 		&mut self,
-		caller: caller,
+		caller: Caller,
 		contract_address: Address,
 		mode: SponsoringModeT,
 	) -> Result<()> {
@@ -239,7 +239,7 @@
 	/// @dev Only contract owner can change this setting
 	fn set_sponsoring_rate_limit(
 		&mut self,
-		caller: caller,
+		caller: Caller,
 		contract_address: Address,
 		rate_limit: u32,
 	) -> Result<()> {
@@ -259,7 +259,7 @@
 	/// @dev Only contract owner can change this setting
 	fn set_sponsoring_fee_limit(
 		&mut self,
-		caller: caller,
+		caller: Caller,
 		contract_address: Address,
 		fee_limit: U256,
 	) -> Result<()> {
@@ -300,7 +300,7 @@
 	/// @dev Only contract owner can change this setting
 	fn toggle_allowed(
 		&mut self,
-		caller: caller,
+		caller: Caller,
 		contract_address: Address,
 		user: Address,
 		is_allowed: bool,
@@ -329,7 +329,7 @@
 	/// @param enabled Should allowlist access to be enabled?
 	fn toggle_allowlist(
 		&mut self,
-		caller: caller,
+		caller: Caller,
 		contract_address: Address,
 		enabled: bool,
 	) -> Result<()> {
modifiedpallets/fungible/src/erc.rsdiffbeforeafterboth
--- a/pallets/fungible/src/erc.rs
+++ b/pallets/fungible/src/erc.rs
@@ -86,7 +86,7 @@
 		Ok(balance.into())
 	}
 	#[weight(<SelfWeightOf<T>>::transfer())]
-	fn transfer(&mut self, caller: caller, to: Address, amount: U256) -> Result<bool> {
+	fn transfer(&mut self, caller: Caller, to: Address, amount: U256) -> Result<bool> {
 		let caller = T::CrossAccountId::from_eth(caller);
 		let to = T::CrossAccountId::from_eth(to);
 		let amount = amount.try_into().map_err(|_| "amount overflow")?;
@@ -101,7 +101,7 @@
 	#[weight(<SelfWeightOf<T>>::transfer_from())]
 	fn transfer_from(
 		&mut self,
-		caller: caller,
+		caller: Caller,
 		from: Address,
 		to: Address,
 		amount: U256,
@@ -119,7 +119,7 @@
 		Ok(true)
 	}
 	#[weight(<SelfWeightOf<T>>::approve())]
-	fn approve(&mut self, caller: caller, spender: Address, amount: U256) -> Result<bool> {
+	fn approve(&mut self, caller: Caller, spender: Address, amount: U256) -> Result<bool> {
 		let caller = T::CrossAccountId::from_eth(caller);
 		let spender = T::CrossAccountId::from_eth(spender);
 		let amount = amount.try_into().map_err(|_| "amount overflow")?;
@@ -148,7 +148,7 @@
 	/// @param to account that will receive minted tokens
 	/// @param amount amount of tokens to mint
 	#[weight(<SelfWeightOf<T>>::create_item())]
-	fn mint(&mut self, caller: caller, to: Address, amount: U256) -> Result<bool> {
+	fn mint(&mut self, caller: Caller, to: Address, amount: U256) -> Result<bool> {
 		let caller = T::CrossAccountId::from_eth(caller);
 		let to = T::CrossAccountId::from_eth(to);
 		let amount = amount.try_into().map_err(|_| "amount overflow")?;
@@ -176,7 +176,7 @@
 	#[weight(<SelfWeightOf<T>>::create_item())]
 	fn mint_cross(
 		&mut self,
-		caller: caller,
+		caller: Caller,
 		to: pallet_common::eth::CrossAddress,
 		amount: U256,
 	) -> Result<bool> {
@@ -194,7 +194,7 @@
 	#[weight(<SelfWeightOf<T>>::approve())]
 	fn approve_cross(
 		&mut self,
-		caller: caller,
+		caller: Caller,
 		spender: pallet_common::eth::CrossAddress,
 		amount: U256,
 	) -> Result<bool> {
@@ -214,7 +214,7 @@
 	/// @param amount The amount that will be burnt.
 	#[solidity(hide)]
 	#[weight(<SelfWeightOf<T>>::burn_from())]
-	fn burn_from(&mut self, caller: caller, from: Address, amount: U256) -> Result<bool> {
+	fn burn_from(&mut self, caller: Caller, from: Address, amount: U256) -> Result<bool> {
 		let caller = T::CrossAccountId::from_eth(caller);
 		let from = T::CrossAccountId::from_eth(from);
 		let amount = amount.try_into().map_err(|_| "amount overflow")?;
@@ -235,7 +235,7 @@
 	#[weight(<SelfWeightOf<T>>::burn_from())]
 	fn burn_from_cross(
 		&mut self,
-		caller: caller,
+		caller: Caller,
 		from: pallet_common::eth::CrossAddress,
 		amount: U256,
 	) -> Result<bool> {
@@ -254,7 +254,7 @@
 	/// Mint tokens for multiple accounts.
 	/// @param amounts array of pairs of account address and amount
 	#[weight(<SelfWeightOf<T>>::create_multiple_items_ex(amounts.len() as u32))]
-	fn mint_bulk(&mut self, caller: caller, amounts: Vec<(Address, U256)>) -> Result<bool> {
+	fn mint_bulk(&mut self, caller: Caller, amounts: Vec<(Address, U256)>) -> Result<bool> {
 		let caller = T::CrossAccountId::from_eth(caller);
 		let budget = self
 			.recorder
@@ -277,7 +277,7 @@
 	#[weight(<SelfWeightOf<T>>::transfer())]
 	fn transfer_cross(
 		&mut self,
-		caller: caller,
+		caller: Caller,
 		to: pallet_common::eth::CrossAddress,
 		amount: U256,
 	) -> Result<bool> {
@@ -295,7 +295,7 @@
 	#[weight(<SelfWeightOf<T>>::transfer_from())]
 	fn transfer_from_cross(
 		&mut self,
-		caller: caller,
+		caller: Caller,
 		from: pallet_common::eth::CrossAddress,
 		to: pallet_common::eth::CrossAddress,
 		amount: U256,
modifiedpallets/nonfungible/src/erc.rsdiffbeforeafterboth
63 #[solidity(hide)]63 #[solidity(hide)]
64 fn set_token_property_permission(64 fn set_token_property_permission(
65 &mut self,65 &mut self,
66 caller: caller,66 caller: Caller,
67 key: String,67 key: String,
68 is_mutable: bool,68 is_mutable: bool,
69 collection_admin: bool,69 collection_admin: bool,
93 #[weight(<SelfWeightOf<T>>::set_token_property_permissions(permissions.len() as u32))]93 #[weight(<SelfWeightOf<T>>::set_token_property_permissions(permissions.len() as u32))]
94 fn set_token_property_permissions(94 fn set_token_property_permissions(
95 &mut self,95 &mut self,
96 caller: caller,96 caller: Caller,
97 permissions: Vec<eth::TokenPropertyPermission>,97 permissions: Vec<eth::TokenPropertyPermission>,
98 ) -> Result<()> {98 ) -> Result<()> {
99 let caller = T::CrossAccountId::from_eth(caller);99 let caller = T::CrossAccountId::from_eth(caller);
121 #[weight(<SelfWeightOf<T>>::set_token_properties(1))]121 #[weight(<SelfWeightOf<T>>::set_token_properties(1))]
122 fn set_property(122 fn set_property(
123 &mut self,123 &mut self,
124 caller: caller,124 caller: Caller,
125 token_id: U256,125 token_id: U256,
126 key: String,126 key: String,
127 value: Bytes,127 value: Bytes,
154 #[weight(<SelfWeightOf<T>>::set_token_properties(properties.len() as u32))]154 #[weight(<SelfWeightOf<T>>::set_token_properties(properties.len() as u32))]
155 fn set_properties(155 fn set_properties(
156 &mut self,156 &mut self,
157 caller: caller,157 caller: Caller,
158 token_id: U256,158 token_id: U256,
159 properties: Vec<eth::Property>,159 properties: Vec<eth::Property>,
160 ) -> Result<()> {160 ) -> Result<()> {
187 /// @param key Property key.187 /// @param key Property key.
188 #[solidity(hide)]188 #[solidity(hide)]
189 #[weight(<SelfWeightOf<T>>::delete_token_properties(1))]189 #[weight(<SelfWeightOf<T>>::delete_token_properties(1))]
190 fn delete_property(&mut self, token_id: U256, caller: caller, key: String) -> Result<()> {190 fn delete_property(&mut self, token_id: U256, caller: Caller, key: String) -> Result<()> {
191 let caller = T::CrossAccountId::from_eth(caller);191 let caller = T::CrossAccountId::from_eth(caller);
192 let token_id: u32 = token_id.try_into().map_err(|_| "token id overflow")?;192 let token_id: u32 = token_id.try_into().map_err(|_| "token id overflow")?;
193 let key = <Vec<u8>>::from(key)193 let key = <Vec<u8>>::from(key)
210 fn delete_properties(210 fn delete_properties(
211 &mut self,211 &mut self,
212 token_id: U256,212 token_id: U256,
213 caller: caller,213 caller: Caller,
214 keys: Vec<String>,214 keys: Vec<String>,
215 ) -> Result<()> {215 ) -> Result<()> {
216 let caller = T::CrossAccountId::from_eth(caller);216 let caller = T::CrossAccountId::from_eth(caller);
445 #[weight(<SelfWeightOf<T>>::transfer_from())]445 #[weight(<SelfWeightOf<T>>::transfer_from())]
446 fn transfer_from(446 fn transfer_from(
447 &mut self,447 &mut self,
448 caller: caller,448 caller: Caller,
449 from: Address,449 from: Address,
450 to: Address,450 to: Address,
451 token_id: U256,451 token_id: U256,
470 /// @param approved The new approved NFT controller470 /// @param approved The new approved NFT controller
471 /// @param tokenId The NFT to approve471 /// @param tokenId The NFT to approve
472 #[weight(<SelfWeightOf<T>>::approve())]472 #[weight(<SelfWeightOf<T>>::approve())]
473 fn approve(&mut self, caller: caller, approved: Address, token_id: U256) -> Result<()> {473 fn approve(&mut self, caller: Caller, approved: Address, token_id: U256) -> Result<()> {
474 let caller = T::CrossAccountId::from_eth(caller);474 let caller = T::CrossAccountId::from_eth(caller);
475 let approved = T::CrossAccountId::from_eth(approved);475 let approved = T::CrossAccountId::from_eth(approved);
476 let token = token_id.try_into()?;476 let token = token_id.try_into()?;
487 #[weight(<SelfWeightOf<T>>::set_allowance_for_all())]487 #[weight(<SelfWeightOf<T>>::set_allowance_for_all())]
488 fn set_approval_for_all(488 fn set_approval_for_all(
489 &mut self,489 &mut self,
490 caller: caller,490 caller: Caller,
491 operator: Address,491 operator: Address,
492 approved: bool,492 approved: bool,
493 ) -> Result<()> {493 ) -> Result<()> {
523 /// operator of the current owner.523 /// operator of the current owner.
524 /// @param tokenId The NFT to approve524 /// @param tokenId The NFT to approve
525 #[weight(<SelfWeightOf<T>>::burn_item())]525 #[weight(<SelfWeightOf<T>>::burn_item())]
526 fn burn(&mut self, caller: caller, token_id: U256) -> Result<()> {526 fn burn(&mut self, caller: Caller, token_id: U256) -> Result<()> {
527 let caller = T::CrossAccountId::from_eth(caller);527 let caller = T::CrossAccountId::from_eth(caller);
528 let token = token_id.try_into()?;528 let token = token_id.try_into()?;
529529
539 /// @param to The new owner539 /// @param to The new owner
540 /// @return uint256 The id of the newly minted token540 /// @return uint256 The id of the newly minted token
541 #[weight(<SelfWeightOf<T>>::create_item())]541 #[weight(<SelfWeightOf<T>>::create_item())]
542 fn mint(&mut self, caller: caller, to: Address) -> Result<U256> {542 fn mint(&mut self, caller: Caller, to: Address) -> Result<U256> {
543 let token_id: U256 = <TokensMinted<T>>::get(self.id)543 let token_id: U256 = <TokensMinted<T>>::get(self.id)
544 .checked_add(1)544 .checked_add(1)
545 .ok_or("item id overflow")?545 .ok_or("item id overflow")?
555 /// @param tokenId ID of the minted NFT555 /// @param tokenId ID of the minted NFT
556 #[solidity(hide, rename_selector = "mint")]556 #[solidity(hide, rename_selector = "mint")]
557 #[weight(<SelfWeightOf<T>>::create_item())]557 #[weight(<SelfWeightOf<T>>::create_item())]
558 fn mint_check_id(&mut self, caller: caller, to: Address, token_id: U256) -> Result<bool> {558 fn mint_check_id(&mut self, caller: Caller, to: Address, token_id: U256) -> Result<bool> {
559 let caller = T::CrossAccountId::from_eth(caller);559 let caller = T::CrossAccountId::from_eth(caller);
560 let to = T::CrossAccountId::from_eth(to);560 let to = T::CrossAccountId::from_eth(to);
561 let token_id: u32 = token_id.try_into()?;561 let token_id: u32 = token_id.try_into()?;
593 #[weight(<SelfWeightOf<T>>::create_item())]593 #[weight(<SelfWeightOf<T>>::create_item())]
594 fn mint_with_token_uri(594 fn mint_with_token_uri(
595 &mut self,595 &mut self,
596 caller: caller,596 caller: Caller,
597 to: Address,597 to: Address,
598 token_uri: String,598 token_uri: String,
599 ) -> Result<U256> {599 ) -> Result<U256> {
615 #[weight(<SelfWeightOf<T>>::create_item())]615 #[weight(<SelfWeightOf<T>>::create_item())]
616 fn mint_with_token_uri_check_id(616 fn mint_with_token_uri_check_id(
617 &mut self,617 &mut self,
618 caller: caller,618 caller: Caller,
619 to: Address,619 to: Address,
620 token_id: U256,620 token_id: U256,
621 token_uri: String,621 token_uri: String,
765 #[weight(<SelfWeightOf<T>>::approve())]765 #[weight(<SelfWeightOf<T>>::approve())]
766 fn approve_cross(766 fn approve_cross(
767 &mut self,767 &mut self,
768 caller: caller,768 caller: Caller,
769 approved: eth::CrossAddress,769 approved: eth::CrossAddress,
770 token_id: U256,770 token_id: U256,
771 ) -> Result<()> {771 ) -> Result<()> {
784 /// @param to The new owner784 /// @param to The new owner
785 /// @param tokenId The NFT to transfer785 /// @param tokenId The NFT to transfer
786 #[weight(<SelfWeightOf<T>>::transfer())]786 #[weight(<SelfWeightOf<T>>::transfer())]
787 fn transfer(&mut self, caller: caller, to: Address, token_id: U256) -> Result<()> {787 fn transfer(&mut self, caller: Caller, to: Address, token_id: U256) -> Result<()> {
788 let caller = T::CrossAccountId::from_eth(caller);788 let caller = T::CrossAccountId::from_eth(caller);
789 let to = T::CrossAccountId::from_eth(to);789 let to = T::CrossAccountId::from_eth(to);
790 let token = token_id.try_into()?;790 let token = token_id.try_into()?;
804 #[weight(<SelfWeightOf<T>>::transfer())]804 #[weight(<SelfWeightOf<T>>::transfer())]
805 fn transfer_cross(805 fn transfer_cross(
806 &mut self,806 &mut self,
807 caller: caller,807 caller: Caller,
808 to: eth::CrossAddress,808 to: eth::CrossAddress,
809 token_id: U256,809 token_id: U256,
810 ) -> Result<()> {810 ) -> Result<()> {
828 #[weight(<SelfWeightOf<T>>::transfer())]828 #[weight(<SelfWeightOf<T>>::transfer())]
829 fn transfer_from_cross(829 fn transfer_from_cross(
830 &mut self,830 &mut self,
831 caller: caller,831 caller: Caller,
832 from: eth::CrossAddress,832 from: eth::CrossAddress,
833 to: eth::CrossAddress,833 to: eth::CrossAddress,
834 token_id: U256,834 token_id: U256,
853 /// @param tokenId The NFT to transfer853 /// @param tokenId The NFT to transfer
854 #[solidity(hide)]854 #[solidity(hide)]
855 #[weight(<SelfWeightOf<T>>::burn_from())]855 #[weight(<SelfWeightOf<T>>::burn_from())]
856 fn burn_from(&mut self, caller: caller, from: Address, token_id: U256) -> Result<()> {856 fn burn_from(&mut self, caller: Caller, from: Address, token_id: U256) -> Result<()> {
857 let caller = T::CrossAccountId::from_eth(caller);857 let caller = T::CrossAccountId::from_eth(caller);
858 let from = T::CrossAccountId::from_eth(from);858 let from = T::CrossAccountId::from_eth(from);
859 let token = token_id.try_into()?;859 let token = token_id.try_into()?;
875 #[weight(<SelfWeightOf<T>>::burn_from())]875 #[weight(<SelfWeightOf<T>>::burn_from())]
876 fn burn_from_cross(876 fn burn_from_cross(
877 &mut self,877 &mut self,
878 caller: caller,878 caller: Caller,
879 from: eth::CrossAddress,879 from: eth::CrossAddress,
880 token_id: U256,880 token_id: U256,
881 ) -> Result<()> {881 ) -> Result<()> {
907 /// @param tokenIds IDs of the minted NFTs907 /// @param tokenIds IDs of the minted NFTs
908 #[solidity(hide)]908 #[solidity(hide)]
909 #[weight(<SelfWeightOf<T>>::create_multiple_items(token_ids.len() as u32))]909 #[weight(<SelfWeightOf<T>>::create_multiple_items(token_ids.len() as u32))]
910 fn mint_bulk(&mut self, caller: caller, to: Address, token_ids: Vec<U256>) -> Result<bool> {910 fn mint_bulk(&mut self, caller: Caller, to: Address, token_ids: Vec<U256>) -> Result<bool> {
911 let caller = T::CrossAccountId::from_eth(caller);911 let caller = T::CrossAccountId::from_eth(caller);
912 let to = T::CrossAccountId::from_eth(to);912 let to = T::CrossAccountId::from_eth(to);
913 let mut expected_index = <TokensMinted<T>>::get(self.id)913 let mut expected_index = <TokensMinted<T>>::get(self.id)
946 #[weight(<SelfWeightOf<T>>::create_multiple_items(tokens.len() as u32))]946 #[weight(<SelfWeightOf<T>>::create_multiple_items(tokens.len() as u32))]
947 fn mint_bulk_with_token_uri(947 fn mint_bulk_with_token_uri(
948 &mut self,948 &mut self,
949 caller: caller,949 caller: Caller,
950 to: Address,950 to: Address,
951 tokens: Vec<(U256, String)>,951 tokens: Vec<(U256, String)>,
952 ) -> Result<bool> {952 ) -> Result<bool> {
997 #[weight(<SelfWeightOf<T>>::create_item())]997 #[weight(<SelfWeightOf<T>>::create_item())]
998 fn mint_cross(998 fn mint_cross(
999 &mut self,999 &mut self,
1000 caller: caller,1000 caller: Caller,
1001 to: eth::CrossAddress,1001 to: eth::CrossAddress,
1002 properties: Vec<eth::Property>,1002 properties: Vec<eth::Property>,
1003 ) -> Result<U256> {1003 ) -> Result<U256> {
modifiedpallets/refungible/src/erc.rsdiffbeforeafterboth
--- a/pallets/refungible/src/erc.rs
+++ b/pallets/refungible/src/erc.rs
@@ -66,7 +66,7 @@
 	#[solidity(hide)]
 	fn set_token_property_permission(
 		&mut self,
-		caller: caller,
+		caller: Caller,
 		key: String,
 		is_mutable: bool,
 		collection_admin: bool,
@@ -96,7 +96,7 @@
 	#[weight(<SelfWeightOf<T>>::set_token_property_permissions(permissions.len() as u32))]
 	fn set_token_property_permissions(
 		&mut self,
-		caller: caller,
+		caller: Caller,
 		permissions: Vec<eth::TokenPropertyPermission>,
 	) -> Result<()> {
 		let caller = T::CrossAccountId::from_eth(caller);
@@ -124,7 +124,7 @@
 	#[weight(<SelfWeightOf<T>>::set_token_properties(1))]
 	fn set_property(
 		&mut self,
-		caller: caller,
+		caller: Caller,
 		token_id: U256,
 		key: String,
 		value: Bytes,
@@ -157,7 +157,7 @@
 	#[weight(<SelfWeightOf<T>>::set_token_properties(properties.len() as u32))]
 	fn set_properties(
 		&mut self,
-		caller: caller,
+		caller: Caller,
 		token_id: U256,
 		properties: Vec<eth::Property>,
 	) -> Result<()> {
@@ -190,7 +190,7 @@
 	/// @param key Property key.
 	#[solidity(hide)]
 	#[weight(<SelfWeightOf<T>>::delete_token_properties(1))]
-	fn delete_property(&mut self, token_id: U256, caller: caller, key: String) -> Result<()> {
+	fn delete_property(&mut self, token_id: U256, caller: Caller, key: String) -> Result<()> {
 		let caller = T::CrossAccountId::from_eth(caller);
 		let token_id: u32 = token_id.try_into().map_err(|_| "token id overflow")?;
 		let key = <Vec<u8>>::from(key)
@@ -213,7 +213,7 @@
 	fn delete_properties(
 		&mut self,
 		token_id: U256,
-		caller: caller,
+		caller: Caller,
 		keys: Vec<String>,
 	) -> Result<()> {
 		let caller = T::CrossAccountId::from_eth(caller);
@@ -449,7 +449,7 @@
 	#[weight(<SelfWeightOf<T>>::transfer_from_creating_removing())]
 	fn transfer_from(
 		&mut self,
-		caller: caller,
+		caller: Caller,
 		from: Address,
 		to: Address,
 		token_id: U256,
@@ -472,7 +472,7 @@
 	}
 
 	/// @dev Not implemented
-	fn approve(&mut self, _caller: caller, _approved: Address, _token_id: U256) -> Result<()> {
+	fn approve(&mut self, _caller: Caller, _approved: Address, _token_id: U256) -> Result<()> {
 		Err("not implemented".into())
 	}
 
@@ -483,7 +483,7 @@
 	#[weight(<SelfWeightOf<T>>::set_allowance_for_all())]
 	fn set_approval_for_all(
 		&mut self,
-		caller: caller,
+		caller: Caller,
 		operator: Address,
 		approved: bool,
 	) -> Result<()> {
@@ -551,7 +551,7 @@
 	///  operator of the current owner.
 	/// @param tokenId The RFT to approve
 	#[weight(<SelfWeightOf<T>>::burn_item_fully())]
-	fn burn(&mut self, caller: caller, token_id: U256) -> Result<()> {
+	fn burn(&mut self, caller: Caller, token_id: U256) -> Result<()> {
 		let caller = T::CrossAccountId::from_eth(caller);
 		let token = token_id.try_into()?;
 
@@ -570,7 +570,7 @@
 	/// @param to The new owner
 	/// @return uint256 The id of the newly minted token
 	#[weight(<SelfWeightOf<T>>::create_item())]
-	fn mint(&mut self, caller: caller, to: Address) -> Result<U256> {
+	fn mint(&mut self, caller: Caller, to: Address) -> Result<U256> {
 		let token_id: U256 = <TokensMinted<T>>::get(self.id)
 			.checked_add(1)
 			.ok_or("item id overflow")?
@@ -586,7 +586,7 @@
 	/// @param tokenId ID of the minted RFT
 	#[solidity(hide, rename_selector = "mint")]
 	#[weight(<SelfWeightOf<T>>::create_item())]
-	fn mint_check_id(&mut self, caller: caller, to: Address, token_id: U256) -> Result<bool> {
+	fn mint_check_id(&mut self, caller: Caller, to: Address, token_id: U256) -> Result<bool> {
 		let caller = T::CrossAccountId::from_eth(caller);
 		let to = T::CrossAccountId::from_eth(to);
 		let token_id: u32 = token_id.try_into()?;
@@ -629,7 +629,7 @@
 	#[weight(<SelfWeightOf<T>>::create_item())]
 	fn mint_with_token_uri(
 		&mut self,
-		caller: caller,
+		caller: Caller,
 		to: Address,
 		token_uri: String,
 	) -> Result<U256> {
@@ -651,7 +651,7 @@
 	#[weight(<SelfWeightOf<T>>::create_item())]
 	fn mint_with_token_uri_check_id(
 		&mut self,
-		caller: caller,
+		caller: Caller,
 		to: Address,
 		token_id: U256,
 		token_uri: String,
@@ -800,7 +800,7 @@
 	/// @param to The new owner
 	/// @param tokenId The RFT to transfer
 	#[weight(<SelfWeightOf<T>>::transfer_creating_removing())]
-	fn transfer(&mut self, caller: caller, to: Address, token_id: U256) -> Result<()> {
+	fn transfer(&mut self, caller: Caller, to: Address, token_id: U256) -> Result<()> {
 		let caller = T::CrossAccountId::from_eth(caller);
 		let to = T::CrossAccountId::from_eth(to);
 		let token = token_id.try_into()?;
@@ -825,7 +825,7 @@
 	#[weight(<SelfWeightOf<T>>::transfer_creating_removing())]
 	fn transfer_cross(
 		&mut self,
-		caller: caller,
+		caller: Caller,
 		to: eth::CrossAddress,
 		token_id: U256,
 	) -> Result<()> {
@@ -853,7 +853,7 @@
 	#[weight(<SelfWeightOf<T>>::transfer_creating_removing())]
 	fn transfer_from_cross(
 		&mut self,
-		caller: caller,
+		caller: Caller,
 		from: eth::CrossAddress,
 		to: eth::CrossAddress,
 		token_id: U256,
@@ -883,7 +883,7 @@
 	/// @param tokenId The RFT to transfer
 	#[solidity(hide)]
 	#[weight(<SelfWeightOf<T>>::burn_from())]
-	fn burn_from(&mut self, caller: caller, from: Address, token_id: U256) -> Result<()> {
+	fn burn_from(&mut self, caller: Caller, from: Address, token_id: U256) -> Result<()> {
 		let caller = T::CrossAccountId::from_eth(caller);
 		let from = T::CrossAccountId::from_eth(from);
 		let token = token_id.try_into()?;
@@ -909,7 +909,7 @@
 	#[weight(<SelfWeightOf<T>>::burn_from())]
 	fn burn_from_cross(
 		&mut self,
-		caller: caller,
+		caller: Caller,
 		from: eth::CrossAddress,
 		token_id: U256,
 	) -> Result<()> {
@@ -944,7 +944,7 @@
 	/// @param tokenIds IDs of the minted RFTs
 	#[solidity(hide)]
 	#[weight(<SelfWeightOf<T>>::create_multiple_items(token_ids.len() as u32))]
-	fn mint_bulk(&mut self, caller: caller, to: Address, token_ids: Vec<U256>) -> Result<bool> {
+	fn mint_bulk(&mut self, caller: Caller, to: Address, token_ids: Vec<U256>) -> Result<bool> {
 		let caller = T::CrossAccountId::from_eth(caller);
 		let to = T::CrossAccountId::from_eth(to);
 		let mut expected_index = <TokensMinted<T>>::get(self.id)
@@ -989,7 +989,7 @@
 	#[weight(<SelfWeightOf<T>>::create_multiple_items(tokens.len() as u32))]
 	fn mint_bulk_with_token_uri(
 		&mut self,
-		caller: caller,
+		caller: Caller,
 		to: Address,
 		tokens: Vec<(U256, String)>,
 	) -> Result<bool> {
@@ -1046,7 +1046,7 @@
 	#[weight(<SelfWeightOf<T>>::create_item())]
 	fn mint_cross(
 		&mut self,
-		caller: caller,
+		caller: Caller,
 		to: eth::CrossAddress,
 		properties: Vec<eth::Property>,
 	) -> Result<U256> {
modifiedpallets/refungible/src/erc_token.rsdiffbeforeafterboth
--- a/pallets/refungible/src/erc_token.rs
+++ b/pallets/refungible/src/erc_token.rs
@@ -129,7 +129,7 @@
 	/// @param to The address to transfer to.
 	/// @param amount The amount to be transferred.
 	#[weight(<CommonWeights<T>>::transfer())]
-	fn transfer(&mut self, caller: caller, to: Address, amount: U256) -> Result<bool> {
+	fn transfer(&mut self, caller: Caller, to: Address, amount: U256) -> Result<bool> {
 		let caller = T::CrossAccountId::from_eth(caller);
 		let to = T::CrossAccountId::from_eth(to);
 		let amount = amount.try_into().map_err(|_| "amount overflow")?;
@@ -149,7 +149,7 @@
 	#[weight(<CommonWeights<T>>::transfer_from())]
 	fn transfer_from(
 		&mut self,
-		caller: caller,
+		caller: Caller,
 		from: Address,
 		to: Address,
 		amount: U256,
@@ -175,7 +175,7 @@
 	/// @param spender The address which will spend the funds.
 	/// @param amount The amount of tokens to be spent.
 	#[weight(<SelfWeightOf<T>>::approve())]
-	fn approve(&mut self, caller: caller, spender: Address, amount: U256) -> Result<bool> {
+	fn approve(&mut self, caller: Caller, spender: Address, amount: U256) -> Result<bool> {
 		let caller = T::CrossAccountId::from_eth(caller);
 		let spender = T::CrossAccountId::from_eth(spender);
 		let amount = amount.try_into().map_err(|_| "amount overflow")?;
@@ -209,7 +209,7 @@
 	/// @param amount The amount that will be burnt.
 	#[weight(<SelfWeightOf<T>>::burn_from())]
 	#[solidity(hide)]
-	fn burn_from(&mut self, caller: caller, from: Address, amount: U256) -> Result<bool> {
+	fn burn_from(&mut self, caller: Caller, from: Address, amount: U256) -> Result<bool> {
 		let caller = T::CrossAccountId::from_eth(caller);
 		let from = T::CrossAccountId::from_eth(from);
 		let amount = amount.try_into().map_err(|_| "amount overflow")?;
@@ -229,7 +229,7 @@
 	#[weight(<SelfWeightOf<T>>::burn_from())]
 	fn burn_from_cross(
 		&mut self,
-		caller: caller,
+		caller: Caller,
 		from: pallet_common::eth::CrossAddress,
 		amount: U256,
 	) -> Result<bool> {
@@ -255,7 +255,7 @@
 	#[weight(<SelfWeightOf<T>>::approve())]
 	fn approve_cross(
 		&mut self,
-		caller: caller,
+		caller: Caller,
 		spender: pallet_common::eth::CrossAddress,
 		amount: U256,
 	) -> Result<bool> {
@@ -271,7 +271,7 @@
 	///  Throws if `msg.sender` doesn't owns all of the tokens.
 	/// @param amount New total amount of the tokens.
 	#[weight(<SelfWeightOf<T>>::repartition_item())]
-	fn repartition(&mut self, caller: caller, amount: U256) -> Result<bool> {
+	fn repartition(&mut self, caller: Caller, amount: U256) -> Result<bool> {
 		let caller = T::CrossAccountId::from_eth(caller);
 		let amount = amount.try_into().map_err(|_| "amount overflow")?;
 
@@ -285,7 +285,7 @@
 	#[weight(<CommonWeights<T>>::transfer())]
 	fn transfer_cross(
 		&mut self,
-		caller: caller,
+		caller: Caller,
 		to: pallet_common::eth::CrossAddress,
 		amount: U256,
 	) -> Result<bool> {
@@ -308,7 +308,7 @@
 	#[weight(<CommonWeights<T>>::transfer_from())]
 	fn transfer_from_cross(
 		&mut self,
-		caller: caller,
+		caller: Caller,
 		from: pallet_common::eth::CrossAddress,
 		to: pallet_common::eth::CrossAddress,
 		amount: U256,
modifiedpallets/unique/src/eth/mod.rsdiffbeforeafterboth
--- a/pallets/unique/src/eth/mod.rs
+++ b/pallets/unique/src/eth/mod.rs
@@ -56,7 +56,7 @@
 }
 
 fn convert_data<T: Config>(
-	caller: caller,
+	caller: Caller,
 	name: String,
 	description: String,
 	token_prefix: String,
@@ -87,7 +87,7 @@
 
 #[inline(always)]
 fn create_collection_internal<T: Config>(
-	caller: caller,
+	caller: Caller,
 	value: Value,
 	name: String,
 	collection_mode: CollectionMode,
@@ -149,7 +149,7 @@
 	#[solidity(rename_selector = "createNFTCollection")]
 	fn create_nft_collection(
 		&mut self,
-		caller: caller,
+		caller: Caller,
 		value: Value,
 		name: String,
 		description: String,
@@ -188,7 +188,7 @@
 	#[solidity(hide)]
 	fn create_nonfungible_collection(
 		&mut self,
-		caller: caller,
+		caller: Caller,
 		value: Value,
 		name: String,
 		description: String,
@@ -208,7 +208,7 @@
 	#[solidity(rename_selector = "createRFTCollection")]
 	fn create_rft_collection(
 		&mut self,
-		caller: caller,
+		caller: Caller,
 		value: Value,
 		name: String,
 		description: String,
@@ -228,7 +228,7 @@
 	#[solidity(rename_selector = "createFTCollection")]
 	fn create_fungible_collection(
 		&mut self,
-		caller: caller,
+		caller: Caller,
 		value: Value,
 		name: String,
 		decimals: u8,
@@ -248,7 +248,7 @@
 	#[solidity(rename_selector = "makeCollectionERC721MetadataCompatible")]
 	fn make_collection_metadata_compatible(
 		&mut self,
-		caller: caller,
+		caller: Caller,
 		collection: Address,
 		base_uri: String,
 	) -> Result<()> {
@@ -334,7 +334,7 @@
 	}
 
 	#[weight(<SelfWeightOf<T>>::destroy_collection())]
-	fn destroy_collection(&mut self, caller: caller, collection_address: Address) -> Result<()> {
+	fn destroy_collection(&mut self, caller: Caller, collection_address: Address) -> Result<()> {
 		let caller = T::CrossAccountId::from_eth(caller);
 
 		let collection_id = pallet_common::eth::map_eth_to_id(&collection_address)
@@ -346,7 +346,7 @@
 	/// Check if a collection exists
 	/// @param collectionAddress Address of the collection in question
 	/// @return bool Does the collection exist?
-	fn is_collection_exist(&self, _caller: caller, collection_address: Address) -> Result<bool> {
+	fn is_collection_exist(&self, _caller: Caller, collection_address: Address) -> Result<bool> {
 		if let Some(id) = pallet_common::eth::map_eth_to_id(&collection_address) {
 			let collection_id = id;
 			return Ok(<CollectionById<T>>::contains_key(collection_id));