git.delta.rocks / unique-network / refs/commits / 686ae3536232

difftreelog

CORE-302 Refactor collection for eth

Trubnikov Sergey2022-05-24parent: #ad8f1f0.patch.diff
in: master

20 files changed

modifiedCargo.lockdiffbeforeafterboth
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -5467,9 +5467,9 @@
 
 [[package]]
 name = "once_cell"
-version = "1.11.0"
+version = "1.12.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7b10983b38c53aebdf33f542c6275b0f58a238129d00c4ae0e6fb59738d783ca"
+checksum = "7709cef83f0c1f58f666e746a08b21e0085f7440fa6a29cc194d68aac97a4225"
 
 [[package]]
 name = "opal-runtime"
@@ -6830,7 +6830,6 @@
  "parity-scale-codec 3.1.2",
  "scale-info",
  "serde",
- "serde-json-core",
  "sp-core",
  "sp-io",
  "sp-runtime",
@@ -10735,16 +10734,6 @@
 ]
 
 [[package]]
-name = "serde-json-core"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8014aeea272bca0f0779778d43253f2f3375b414185b30e6ecc4d3e4a9994781"
-dependencies = [
- "ryu",
- "serde",
-]
-
-[[package]]
 name = "serde_derive"
 version = "1.0.137"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -12025,9 +12014,9 @@
 
 [[package]]
 name = "target-lexicon"
-version = "0.12.3"
+version = "0.12.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d7fa7e55043acb85fca6b3c01485a2eeb6b69c5d21002e273c79e465f43b7ac1"
+checksum = "c02424087780c9b71cc96799eaeddff35af2bc513278cda5c99fc1f5d026d3c1"
 
 [[package]]
 name = "tempfile"
modifiedMakefilediffbeforeafterboth
--- a/Makefile
+++ b/Makefile
@@ -15,16 +15,13 @@
 CONTRACT_HELPERS_STUBS=./pallets/evm-contract-helpers/src/stubs/
 CONTRACT_HELPERS_ABI=./tests/src/eth/util/contractHelpersAbi.json
 
-COLLECTION_STUBS=./pallets/unique/src/eth/stubs/
-COLLECTION_ABI=./tests/src/eth/collectionAbi.json
-
 COLLECTION_HELPER_STUBS=$(COLLECTION_STUBS)
 COLLECTION_HELPER_ABI=./tests/src/eth/collectionHelperAbi.json
 
 TESTS_API=./tests/src/eth/api/
 
 .PHONY: regenerate_solidity
-regenerate_solidity: UniqueFungible.sol UniqueNFT.sol ContractHelpers.sol Collection.sol CollectionHelper.sol
+regenerate_solidity: UniqueFungible.sol UniqueNFT.sol ContractHelpers.sol CollectionHelper.sol
 
 UniqueFungible.sol:
 	PACKAGE=pallet-fungible NAME=erc::gen_iface OUTPUT=$(TESTS_API)/$@ ./.maintain/scripts/generate_sol.sh
@@ -38,10 +35,6 @@
 	PACKAGE=pallet-evm-contract-helpers NAME=eth::contract_helpers_iface OUTPUT=$(TESTS_API)/$@ ./.maintain/scripts/generate_sol.sh
 	PACKAGE=pallet-evm-contract-helpers NAME=eth::contract_helpers_impl OUTPUT=$(CONTRACT_HELPERS_STUBS)/$@ ./.maintain/scripts/generate_sol.sh
 
-Collection.sol:
-	PACKAGE=pallet-unique NAME=eth::evm_collection::collection_iface OUTPUT=$(TESTS_API)/$@ ./.maintain/scripts/generate_sol.sh
-	PACKAGE=pallet-unique NAME=eth::evm_collection::collection_impl OUTPUT=$(COLLECTION_STUBS)/$@ ./.maintain/scripts/generate_sol.sh
-
 CollectionHelper.sol:
 	PACKAGE=pallet-unique NAME=eth::evm_collection::collection_helper_iface OUTPUT=$(TESTS_API)/$@ ./.maintain/scripts/generate_sol.sh
 	PACKAGE=pallet-unique NAME=eth::evm_collection::collection_helper_impl OUTPUT=$(COLLECTION_HELPER_STUBS)/$@ ./.maintain/scripts/generate_sol.sh
@@ -58,15 +51,11 @@
 	INPUT=$(CONTRACT_HELPERS_STUBS)/$< OUTPUT=$(CONTRACT_HELPERS_STUBS)/ContractHelpers.raw ./.maintain/scripts/compile_stub.sh
 	INPUT=$(CONTRACT_HELPERS_STUBS)/$< OUTPUT=$(CONTRACT_HELPERS_ABI) ./.maintain/scripts/generate_abi.sh
 
-Collection: Collection.sol
-	INPUT=$(COLLECTION_STUBS)/$< OUTPUT=$(COLLECTION_STUBS)/Collection.raw ./.maintain/scripts/compile_stub.sh
-	INPUT=$(COLLECTION_STUBS)/$< OUTPUT=$(COLLECTION_ABI) ./.maintain/scripts/generate_abi.sh
-
 CollectionHelper: CollectionHelper.sol
 	INPUT=$(COLLECTION_HELPER_STUBS)/$< OUTPUT=$(COLLECTION_HELPER_STUBS)/CollectionHelper.raw ./.maintain/scripts/compile_stub.sh
 	INPUT=$(COLLECTION_HELPER_STUBS)/$< OUTPUT=$(COLLECTION_HELPER_ABI) ./.maintain/scripts/generate_abi.sh
 
-evm_stubs: UniqueFungible UniqueNFT ContractHelpers Collection CollectionHelper
+evm_stubs: UniqueFungible UniqueNFT ContractHelpers CollectionHelper
 
 .PHONY: _bench
 _bench:
modifiedpallets/common/src/erc.rsdiffbeforeafterboth
--- a/pallets/common/src/erc.rs
+++ b/pallets/common/src/erc.rs
@@ -14,9 +14,9 @@
 // You should have received a copy of the GNU General Public License
 // along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
 
-use evm_coder::{solidity_interface, types::*, execution::Result};
+use evm_coder::{solidity_interface, types::*, execution::{Result, Error}};
 pub use pallet_evm::{PrecompileOutput, PrecompileResult, account::CrossAccountId};
-use pallet_evm_coder_substrate::dispatch_to_evm;
+use pallet_evm_coder_substrate::{dispatch_to_evm, SubstrateRecorder};
 use sp_core::{H160, U256};
 use sp_std::vec::Vec;
 use up_data_structs::Property;
@@ -31,7 +31,7 @@
 	fn call(self, source: &H160, input: &[u8], value: U256) -> Option<PrecompileResult>;
 }
 
-#[solidity_interface(name = "CollectionProperties")]
+#[solidity_interface(name = "Collection")]
 impl<T: Config> CollectionHandle<T> {
 	fn set_collection_property(&mut self, caller: caller, key: string, value: bytes) -> Result<()> {
 		let caller = T::CrossAccountId::from_eth(caller);
@@ -64,4 +64,70 @@
 
 		Ok(prop.to_vec())
 	}
+
+	fn eth_set_sponsor(
+		&mut self,
+		caller: caller,
+		sponsor: address,
+	) -> Result<void> {
+		check_is_owner(caller, self)?;
+
+		let sponsor = T::CrossAccountId::from_eth(sponsor);
+		self.set_sponsor(sponsor.as_sub().clone());
+		save(self);
+		Ok(())
+	}
+
+	fn eth_confirm_sponsorship(&mut self, caller: caller) -> Result<void> {
+		let caller = T::CrossAccountId::from_eth(caller);
+		if !self.confirm_sponsorship(caller.as_sub()) {
+			return Err(Error::Revert("Caller is not set as sponsor".into()));
+		}
+		save(self);
+		Ok(())
+	}
+
+	fn set_limits(
+		&self,
+		caller: caller,
+		limits_json: string,
+	) -> Result<void> {
+		// let mut collection = collection_from_address::<T>(self.contract_address(caller).unwrap(), self.1.gas_left())?;
+		// check_is_owner(caller, &collection)?;
+
+		// let limits = serde_json_core::from_str(limits_json.as_ref())
+		// 	.map_err(|e| Error::Revert(format!("Parse JSON error: {}", e)))?;
+		// collection.limits = limits.0;
+		// collection.save().map_err(pallet_evm_coder_substrate::dispatch_to_evm::<T>)?;
+		Ok(())
+	}
+
+	fn contract_address(&self, _caller: caller) -> Result<address> {
+		Ok(crate::eth::collection_id_to_address(self.id))
+	}
+}
+
+fn collection_from_address<T: Config>(
+	collection_address: address,
+	gas_limit: u64
+) -> Result<CollectionHandle<T>> {
+	let collection_id = crate::eth::map_eth_to_id(&collection_address)
+	.ok_or(Error::Revert("Contract is not an unique collection".into()))?;
+	let recorder = <SubstrateRecorder<T>>::new(gas_limit);
+	let collection =
+		CollectionHandle::new_with_recorder(collection_id, recorder)
+			.ok_or(Error::Revert("Create collection handle error".into()))?;
+	Ok(collection)
+}
+
+fn check_is_owner<T: Config>(caller: caller, collection: &CollectionHandle<T>) -> Result<()> {
+	let caller = T::CrossAccountId::from_eth(caller);
+	collection
+		.check_is_owner(&caller)
+		.map_err(pallet_evm_coder_substrate::dispatch_to_evm::<T>)?;
+	Ok(())
 }
+
+fn save<T: Config>(collection: &CollectionHandle<T>) {
+	<crate::CollectionById<T>>::insert(collection.id, collection.collection.clone());
+}
\ No newline at end of file
modifiedpallets/common/src/lib.rsdiffbeforeafterboth
--- a/pallets/common/src/lib.rs
+++ b/pallets/common/src/lib.rs
@@ -20,7 +20,7 @@
 
 use core::ops::{Deref, DerefMut};
 use pallet_evm_coder_substrate::{SubstrateRecorder, WithRecorder};
-use sp_std::{vec::Vec, rc::Rc};
+use sp_std::vec::Vec;
 use pallet_evm::account::CrossAccountId;
 use frame_support::{
 	dispatch::{DispatchErrorWithPostInfo, DispatchResultWithPostInfo, Weight, PostDispatchInfo},
modifiedpallets/fungible/src/erc.rsdiffbeforeafterboth
--- a/pallets/fungible/src/erc.rs
+++ b/pallets/fungible/src/erc.rs
@@ -24,7 +24,7 @@
 use pallet_evm::account::CrossAccountId;
 use pallet_evm_coder_substrate::{call, dispatch_to_evm};
 use pallet_structure::{SelfWeightOf as StructureWeight, weights::WeightInfo as _};
-use pallet_common::{CollectionHandle, erc::CollectionPropertiesCall};
+use pallet_common::{CollectionHandle, erc::CollectionCall};
 
 use crate::{
 	Allowance, Balance, Config, FungibleHandle, Pallet, SelfWeightOf, TotalSupply,
@@ -150,7 +150,7 @@
 	is(
 		ERC20,
 		ERC20UniqueExtensions,
-		via("CollectionHandle<T>", common_mut, CollectionProperties)
+		via("CollectionHandle<T>", common_mut, Collection)
 	)
 )]
 impl<T: Config> FungibleHandle<T> {}
modifiedpallets/nonfungible/src/erc.rsdiffbeforeafterboth
--- a/pallets/nonfungible/src/erc.rs
+++ b/pallets/nonfungible/src/erc.rs
@@ -26,7 +26,7 @@
 use sp_core::{H160, U256};
 use sp_std::vec::Vec;
 use pallet_common::{
-	erc::{CommonEvmHandler, PrecompileResult, CollectionPropertiesCall},
+	erc::{CommonEvmHandler, PrecompileResult, CollectionCall},
 	CollectionHandle,
 };
 use pallet_evm::account::CrossAccountId;
@@ -513,7 +513,7 @@
 		ERC721UniqueExtensions,
 		ERC721Mintable,
 		ERC721Burnable,
-		via("CollectionHandle<T>", common_mut, CollectionProperties),
+		via("CollectionHandle<T>", common_mut, Collection),
 		TokenProperties,
 	)
 )]
modifiedpallets/nonfungible/src/stubs/UniqueNFT.rawdiffbeforeafterboth

binary blob — no preview

modifiedpallets/nonfungible/src/stubs/UniqueNFT.soldiffbeforeafterboth
--- a/pallets/nonfungible/src/stubs/UniqueNFT.sol
+++ b/pallets/nonfungible/src/stubs/UniqueNFT.sol
@@ -51,6 +51,67 @@
 	event MintingFinished();
 }
 
+// Selector: 38e33c60
+contract Collection is Dummy, ERC165 {
+	// Selector: setCollectionProperty(string,bytes) 2f073f66
+	function setCollectionProperty(string memory key, bytes memory value)
+		public
+	{
+		require(false, stub_error);
+		key;
+		value;
+		dummy = 0;
+	}
+
+	// Selector: deleteCollectionProperty(string) 7b7debce
+	function deleteCollectionProperty(string memory key) public {
+		require(false, stub_error);
+		key;
+		dummy = 0;
+	}
+
+	// Throws error if key not found
+	//
+	// Selector: collectionProperty(string) cf24fd6d
+	function collectionProperty(string memory key)
+		public
+		view
+		returns (bytes memory)
+	{
+		require(false, stub_error);
+		key;
+		dummy;
+		return hex"";
+	}
+
+	// Selector: ethSetSponsor(address) 8f9af356
+	function ethSetSponsor(address sponsor) public {
+		require(false, stub_error);
+		sponsor;
+		dummy = 0;
+	}
+
+	// Selector: ethConfirmSponsorship() a8580d1a
+	function ethConfirmSponsorship() public {
+		require(false, stub_error);
+		dummy = 0;
+	}
+
+	// Selector: setLimits(string) 72cb345d
+	function setLimits(string memory limitsJson) public view {
+		require(false, stub_error);
+		limitsJson;
+		dummy;
+	}
+
+	// Selector: contractAddress() f6b4dfb4
+	function contractAddress() public view returns (address) {
+		require(false, stub_error);
+		dummy;
+		return 0x0000000000000000000000000000000000000000;
+	}
+}
+
 // Selector: 41369377
 contract TokenProperties is Dummy, ERC165 {
 	// Selector: setTokenPropertyPermission(string,bool,bool,bool) 222d97fa
@@ -327,40 +388,6 @@
 		require(false, stub_error);
 		dummy;
 		return 0;
-	}
-}
-
-// Selector: 9b5e29c5
-contract CollectionProperties is Dummy, ERC165 {
-	// Selector: setCollectionProperty(string,bytes) 2f073f66
-	function setCollectionProperty(string memory key, bytes memory value)
-		public
-	{
-		require(false, stub_error);
-		key;
-		value;
-		dummy = 0;
-	}
-
-	// Selector: deleteCollectionProperty(string) 7b7debce
-	function deleteCollectionProperty(string memory key) public {
-		require(false, stub_error);
-		key;
-		dummy = 0;
-	}
-
-	// Throws error if key not found
-	//
-	// Selector: collectionProperty(string) cf24fd6d
-	function collectionProperty(string memory key)
-		public
-		view
-		returns (bytes memory)
-	{
-		require(false, stub_error);
-		key;
-		dummy;
-		return hex"";
 	}
 }
 
@@ -423,6 +450,6 @@
 	ERC721UniqueExtensions,
 	ERC721Mintable,
 	ERC721Burnable,
-	CollectionProperties,
+	Collection,
 	TokenProperties
 {}
modifiedpallets/unique/Cargo.tomldiffbeforeafterboth
--- a/pallets/unique/Cargo.toml
+++ b/pallets/unique/Cargo.toml
@@ -20,7 +20,6 @@
 std = [
     'codec/std',
     'serde/std',
-    'serde-json-core/std',
     'frame-support/std',
     'frame-system/std',
     'pallet-evm/std',
@@ -42,10 +41,6 @@
 default-features = false
 features = ['derive']
 version = '1.0.130'
-
-[dependencies.serde-json-core]
-default-features = false
-version = "0.4"
 
 [dependencies.ethereum]
 version = "0.12.0"
modifiedpallets/unique/src/eth/mod.rsdiffbeforeafterboth
--- a/pallets/unique/src/eth/mod.rs
+++ b/pallets/unique/src/eth/mod.rs
@@ -110,17 +110,6 @@
 		}
 	}
 	
-	struct EvmCollection<T: Config>(H160, SubstrateRecorder<T>);
-	impl<T: Config> WithRecorder<T> for EvmCollection<T> {
-		fn recorder(&self) -> &SubstrateRecorder<T> {
-			&self.1
-		}
-	
-		fn into_recorder(self) -> SubstrateRecorder<T> {
-			self.1
-		}
-	}
-	
 	#[derive(ToLog)]
 	pub enum EthCollectionEvent {
 		CollectionCreated {
@@ -129,78 +118,7 @@
 			#[indexed]
 			collection_id: address,
 		},
-	}
-	
-	#[solidity_interface(name = "Collection")]
-	impl<T: Config> EvmCollection<T> {
-		fn set_sponsor(
-			&self,
-			caller: caller,
-			sponsor: address,
-		) -> Result<void> {
-			let mut collection = collection_from_address::<T>(self.contract_address(caller).unwrap(), self.1.gas_left())?;
-			check_is_owner(caller, &collection)?;
-	
-			let sponsor = T::CrossAccountId::from_eth(sponsor);
-			collection.set_sponsor(sponsor.as_sub().clone());
-			collection.save().map_err(pallet_evm_coder_substrate::dispatch_to_evm::<T>)?;
-		Ok(())
-		}
-	
-		fn confirm_sponsorship(&self, caller: caller) -> Result<void> {
-			let mut collection = collection_from_address::<T>(self.contract_address(caller).unwrap(), self.1.gas_left())?;
-			let caller = T::CrossAccountId::from_eth(caller);
-			if !collection.confirm_sponsorship(caller.as_sub()) {
-				return Err(Error::Revert("Caller is not set as sponsor".into()));
-			}
-			collection.save().map_err(pallet_evm_coder_substrate::dispatch_to_evm::<T>)?;
-		Ok(())
-		}
-	
-		fn set_limits(
-			&self,
-			caller: caller,
-			limits_json: string,
-		) -> Result<void> {
-			let mut collection = collection_from_address::<T>(self.contract_address(caller).unwrap(), self.1.gas_left())?;
-			check_is_owner(caller, &collection)?;
-	
-			let limits = serde_json_core::from_str(limits_json.as_ref())
-				.map_err(|e| Error::Revert(format!("Parse JSON error: {}", e)))?;
-			collection.limits = limits.0;
-			collection.save().map_err(pallet_evm_coder_substrate::dispatch_to_evm::<T>)?;
-		Ok(())
-		}
-
-		fn contract_address(&self, _caller: caller) -> Result<address> {
-			Ok(self.0)
-		}
-	}
-	
-	fn error_feild_too_long(feild: &str, bound: u32) -> Error {
-		Error::Revert(format!("{} is too long. Max length is {}.", feild, bound))
 	}
-	
-	fn collection_from_address<T: Config>(
-		collection_address: address,
-		gas_limit: u64
-	) -> Result<CollectionHandle<T>> {
-		let collection_id = pallet_common::eth::map_eth_to_id(&collection_address)
-		.ok_or(Error::Revert("Contract is not an unique collection".into()))?;
-		let recorder = <SubstrateRecorder<T>>::new(gas_limit);
-		let collection =
-			pallet_common::CollectionHandle::new_with_recorder(collection_id, recorder)
-				.ok_or(Error::Revert("Create collection handle error".into()))?;
-		Ok(collection)
-	}
-	
-	fn check_is_owner<T: Config>(caller: caller, collection: &CollectionHandle<T>) -> Result<()> {
-		let caller = T::CrossAccountId::from_eth(caller);
-		collection
-			.check_is_owner(&caller)
-			.map_err(pallet_evm_coder_substrate::dispatch_to_evm::<T>)?;
-		Ok(())
-	}
 
 	pub struct CollectionHelperOnMethodCall<T: Config>(PhantomData<*const T>);
 	impl<T: Config> OnMethodCall<T> for CollectionHelperOnMethodCall<T> {
@@ -235,38 +153,8 @@
 	
 	generate_stubgen!(collection_helper_impl, CollectionHelperCall<()>, true);
 	generate_stubgen!(collection_helper_iface, CollectionHelperCall<()>, false);
-	
-	pub struct CollectionOnMethodCall<T: Config>(PhantomData<*const T>);
-	impl<T: Config> OnMethodCall<T> for CollectionOnMethodCall<T> {
-		fn is_reserved(contract: &sp_core::H160) -> bool {
-			contract == &T::ContractAddress::get()
-		}
-	
-		fn is_used(contract: &sp_core::H160) -> bool {
-			contract == &T::ContractAddress::get()
-		}
-	
-		fn call(
-			source: &sp_core::H160,
-			target: &sp_core::H160,
-			gas_left: u64,
-			input: &[u8],
-			value: sp_core::U256,
-		) -> Option<PrecompileResult> {
-			if !pallet_common::eth::is_collection(target) {
-				return None;
-			}
 
-			let helpers = EvmCollection::<T>(*target, SubstrateRecorder::<T>::new(gas_left));
-			pallet_evm_coder_substrate::call(*source, helpers, value, input)
-		}
-	
-		fn get_code(contract: &sp_core::H160) -> Option<Vec<u8>> {
-			(contract == &T::ContractAddress::get())
-				.then(|| include_bytes!("./stubs/Collection.raw").to_vec())
-		}
+	fn error_feild_too_long(feild: &str, bound: u32) -> Error {
+		Error::Revert(format!("{} is too long. Max length is {}.", feild, bound))
 	}
-	
-	generate_stubgen!(collection_impl, CollectionCall<()>, true);
-	generate_stubgen!(collection_iface, CollectionCall<()>, false);
 }
deletedpallets/unique/src/eth/stubs/Collection.rawdiffbeforeafterboth

binary blob — no preview

deletedpallets/unique/src/eth/stubs/Collection.soldiffbeforeafterboth
--- a/pallets/unique/src/eth/stubs/Collection.sol
+++ /dev/null
@@ -1,52 +0,0 @@
-// SPDX-License-Identifier: OTHER
-// This code is automatically generated
-
-pragma solidity >=0.8.0 <0.9.0;
-
-// Common stubs holder
-contract Dummy {
-	uint8 dummy;
-	string stub_error = "this contract is implemented in native";
-}
-
-contract ERC165 is Dummy {
-	function supportsInterface(bytes4 interfaceID)
-		external
-		view
-		returns (bool)
-	{
-		require(false, stub_error);
-		interfaceID;
-		return true;
-	}
-}
-
-// Selector: 15cc740e
-contract Collection is Dummy, ERC165 {
-	// Selector: setSponsor(address) 59753fb1
-	function setSponsor(address sponsor) public view {
-		require(false, stub_error);
-		sponsor;
-		dummy;
-	}
-
-	// Selector: confirmSponsorship() c8c6a056
-	function confirmSponsorship() public view {
-		require(false, stub_error);
-		dummy;
-	}
-
-	// Selector: setLimits(string) 72cb345d
-	function setLimits(string memory limitsJson) public view {
-		require(false, stub_error);
-		limitsJson;
-		dummy;
-	}
-
-	// Selector: contractAddress() f6b4dfb4
-	function contractAddress() public view returns (address) {
-		require(false, stub_error);
-		dummy;
-		return 0x0000000000000000000000000000000000000000;
-	}
-}
modifiedruntime/opal/src/lib.rsdiffbeforeafterboth
--- a/runtime/opal/src/lib.rs
+++ b/runtime/opal/src/lib.rs
@@ -307,7 +307,6 @@
 		pallet_evm_migration::OnMethodCall<Self>,
 		pallet_evm_contract_helpers::HelpersOnMethodCall<Self>,
 		CollectionDispatchT<Self>,
-		evm_collection::CollectionOnMethodCall<Self>,
 		evm_collection::CollectionHelperOnMethodCall<Self>,
 	);
 	type OnCreate = pallet_evm_contract_helpers::HelpersOnCreate<Self>;
modifiedruntime/quartz/src/lib.rsdiffbeforeafterboth
--- a/runtime/quartz/src/lib.rs
+++ b/runtime/quartz/src/lib.rs
@@ -286,7 +286,6 @@
 		pallet_evm_migration::OnMethodCall<Self>,
 		pallet_evm_contract_helpers::HelpersOnMethodCall<Self>,
 		CollectionDispatchT<Self>,
-		evm_collection::CollectionOnMethodCall<Self>,
 		evm_collection::CollectionHelperOnMethodCall<Self>,
 	);
 	type OnCreate = pallet_evm_contract_helpers::HelpersOnCreate<Self>;
modifiedruntime/unique/src/lib.rsdiffbeforeafterboth
--- a/runtime/unique/src/lib.rs
+++ b/runtime/unique/src/lib.rs
@@ -291,7 +291,6 @@
 		pallet_evm_migration::OnMethodCall<Self>,
 		pallet_evm_contract_helpers::HelpersOnMethodCall<Self>,
 		CollectionDispatchT<Self>,
-		evm_collection::CollectionOnMethodCall<Self>,
 		evm_collection::CollectionHelperOnMethodCall<Self>,
 	);
 	type OnCreate = pallet_evm_contract_helpers::HelpersOnCreate<Self>;
modifiedtests/src/eth/api/UniqueNFT.soldiffbeforeafterboth
before · tests/src/eth/api/UniqueNFT.sol
1// SPDX-License-Identifier: OTHER2// This code is automatically generated34pragma solidity >=0.8.0 <0.9.0;56// Anonymous struct7struct Tuple0 {8	uint256 field_0;9	string field_1;10}1112// Common stubs holder13interface Dummy {1415}1617interface ERC165 is Dummy {18	function supportsInterface(bytes4 interfaceID) external view returns (bool);19}2021// Inline22interface ERC721Events {23	event Transfer(24		address indexed from,25		address indexed to,26		uint256 indexed tokenId27	);28	event Approval(29		address indexed owner,30		address indexed approved,31		uint256 indexed tokenId32	);33	event ApprovalForAll(34		address indexed owner,35		address indexed operator,36		bool approved37	);38}3940// Inline41interface ERC721MintableEvents {42	event MintingFinished();43}4445// Selector: 4136937746interface TokenProperties is Dummy, ERC165 {47	// Selector: setTokenPropertyPermission(string,bool,bool,bool) 222d97fa48	function setTokenPropertyPermission(49		string memory key,50		bool isMutable,51		bool collectionAdmin,52		bool tokenOwner53	) external;5455	// Selector: setProperty(uint256,string,bytes) 1752d67b56	function setProperty(57		uint256 tokenId,58		string memory key,59		bytes memory value60	) external;6162	// Selector: deleteProperty(uint256,string) 066111d163	function deleteProperty(uint256 tokenId, string memory key) external;6465	// Throws error if key not found66	//67	// Selector: property(uint256,string) 7228c32768	function property(uint256 tokenId, string memory key)69		external70		view71		returns (bytes memory);72}7374// Selector: 42966c6875interface ERC721Burnable is Dummy, ERC165 {76	// Selector: burn(uint256) 42966c6877	function burn(uint256 tokenId) external;78}7980// Selector: 5880016181interface ERC721 is Dummy, ERC165, ERC721Events {82	// Selector: balanceOf(address) 70a0823183	function balanceOf(address owner) external view returns (uint256);8485	// Selector: ownerOf(uint256) 6352211e86	function ownerOf(uint256 tokenId) external view returns (address);8788	// Not implemented89	//90	// Selector: safeTransferFromWithData(address,address,uint256,bytes) 60a1167291	function safeTransferFromWithData(92		address from,93		address to,94		uint256 tokenId,95		bytes memory data96	) external;9798	// Not implemented99	//100	// Selector: safeTransferFrom(address,address,uint256) 42842e0e101	function safeTransferFrom(102		address from,103		address to,104		uint256 tokenId105	) external;106107	// Selector: transferFrom(address,address,uint256) 23b872dd108	function transferFrom(109		address from,110		address to,111		uint256 tokenId112	) external;113114	// Selector: approve(address,uint256) 095ea7b3115	function approve(address approved, uint256 tokenId) external;116117	// Not implemented118	//119	// Selector: setApprovalForAll(address,bool) a22cb465120	function setApprovalForAll(address operator, bool approved) external;121122	// Not implemented123	//124	// Selector: getApproved(uint256) 081812fc125	function getApproved(uint256 tokenId) external view returns (address);126127	// Not implemented128	//129	// Selector: isApprovedForAll(address,address) e985e9c5130	function isApprovedForAll(address owner, address operator)131		external132		view133		returns (address);134}135136// Selector: 5b5e139f137interface ERC721Metadata is Dummy, ERC165 {138	// Selector: name() 06fdde03139	function name() external view returns (string memory);140141	// Selector: symbol() 95d89b41142	function symbol() external view returns (string memory);143144	// Returns token's const_metadata145	//146	// Selector: tokenURI(uint256) c87b56dd147	function tokenURI(uint256 tokenId) external view returns (string memory);148}149150// Selector: 68ccfe89151interface ERC721Mintable is Dummy, ERC165, ERC721MintableEvents {152	// Selector: mintingFinished() 05d2035b153	function mintingFinished() external view returns (bool);154155	// `token_id` should be obtained with `next_token_id` method,156	// unlike standard, you can't specify it manually157	//158	// Selector: mint(address,uint256) 40c10f19159	function mint(address to, uint256 tokenId) external returns (bool);160161	// `token_id` should be obtained with `next_token_id` method,162	// unlike standard, you can't specify it manually163	//164	// Selector: mintWithTokenURI(address,uint256,string) 50bb4e7f165	function mintWithTokenURI(166		address to,167		uint256 tokenId,168		string memory tokenUri169	) external returns (bool);170171	// Not implemented172	//173	// Selector: finishMinting() 7d64bcb4174	function finishMinting() external returns (bool);175}176177// Selector: 780e9d63178interface ERC721Enumerable is Dummy, ERC165 {179	// Selector: tokenByIndex(uint256) 4f6ccce7180	function tokenByIndex(uint256 index) external view returns (uint256);181182	// Not implemented183	//184	// Selector: tokenOfOwnerByIndex(address,uint256) 2f745c59185	function tokenOfOwnerByIndex(address owner, uint256 index)186		external187		view188		returns (uint256);189190	// Selector: totalSupply() 18160ddd191	function totalSupply() external view returns (uint256);192}193194// Selector: 9b5e29c5195interface CollectionProperties is Dummy, ERC165 {196	// Selector: setCollectionProperty(string,bytes) 2f073f66197	function setCollectionProperty(string memory key, bytes memory value)198		external;199200	// Selector: deleteCollectionProperty(string) 7b7debce201	function deleteCollectionProperty(string memory key) external;202203	// Throws error if key not found204	//205	// Selector: collectionProperty(string) cf24fd6d206	function collectionProperty(string memory key)207		external208		view209		returns (bytes memory);210}211212// Selector: d74d154f213interface ERC721UniqueExtensions is Dummy, ERC165 {214	// Selector: transfer(address,uint256) a9059cbb215	function transfer(address to, uint256 tokenId) external;216217	// Selector: burnFrom(address,uint256) 79cc6790218	function burnFrom(address from, uint256 tokenId) external;219220	// Selector: nextTokenId() 75794a3c221	function nextTokenId() external view returns (uint256);222223	// Selector: mintBulk(address,uint256[]) 44a9945e224	function mintBulk(address to, uint256[] memory tokenIds)225		external226		returns (bool);227228	// Selector: mintBulkWithTokenURI(address,(uint256,string)[]) 36543006229	function mintBulkWithTokenURI(address to, Tuple0[] memory tokens)230		external231		returns (bool);232}233234interface UniqueNFT is235	Dummy,236	ERC165,237	ERC721,238	ERC721Metadata,239	ERC721Enumerable,240	ERC721UniqueExtensions,241	ERC721Mintable,242	ERC721Burnable,243	CollectionProperties,244	TokenProperties245{}
after · tests/src/eth/api/UniqueNFT.sol
1// SPDX-License-Identifier: OTHER2// This code is automatically generated34pragma solidity >=0.8.0 <0.9.0;56// Anonymous struct7struct Tuple0 {8	uint256 field_0;9	string field_1;10}1112// Common stubs holder13interface Dummy {1415}1617interface ERC165 is Dummy {18	function supportsInterface(bytes4 interfaceID) external view returns (bool);19}2021// Inline22interface ERC721Events {23	event Transfer(24		address indexed from,25		address indexed to,26		uint256 indexed tokenId27	);28	event Approval(29		address indexed owner,30		address indexed approved,31		uint256 indexed tokenId32	);33	event ApprovalForAll(34		address indexed owner,35		address indexed operator,36		bool approved37	);38}3940// Inline41interface ERC721MintableEvents {42	event MintingFinished();43}4445// Selector: 38e33c6046interface Collection is Dummy, ERC165 {47	// Selector: setCollectionProperty(string,bytes) 2f073f6648	function setCollectionProperty(string memory key, bytes memory value)49		external;5051	// Selector: deleteCollectionProperty(string) 7b7debce52	function deleteCollectionProperty(string memory key) external;5354	// Throws error if key not found55	//56	// Selector: collectionProperty(string) cf24fd6d57	function collectionProperty(string memory key)58		external59		view60		returns (bytes memory);6162	// Selector: ethSetSponsor(address) 8f9af35663	function ethSetSponsor(address sponsor) external;6465	// Selector: ethConfirmSponsorship() a8580d1a66	function ethConfirmSponsorship() external;6768	// Selector: setLimits(string) 72cb345d69	function setLimits(string memory limitsJson) external view;7071	// Selector: contractAddress() f6b4dfb472	function contractAddress() external view returns (address);73}7475// Selector: 4136937776interface TokenProperties is Dummy, ERC165 {77	// Selector: setTokenPropertyPermission(string,bool,bool,bool) 222d97fa78	function setTokenPropertyPermission(79		string memory key,80		bool isMutable,81		bool collectionAdmin,82		bool tokenOwner83	) external;8485	// Selector: setProperty(uint256,string,bytes) 1752d67b86	function setProperty(87		uint256 tokenId,88		string memory key,89		bytes memory value90	) external;9192	// Selector: deleteProperty(uint256,string) 066111d193	function deleteProperty(uint256 tokenId, string memory key) external;9495	// Throws error if key not found96	//97	// Selector: property(uint256,string) 7228c32798	function property(uint256 tokenId, string memory key)99		external100		view101		returns (bytes memory);102}103104// Selector: 42966c68105interface ERC721Burnable is Dummy, ERC165 {106	// Selector: burn(uint256) 42966c68107	function burn(uint256 tokenId) external;108}109110// Selector: 58800161111interface ERC721 is Dummy, ERC165, ERC721Events {112	// Selector: balanceOf(address) 70a08231113	function balanceOf(address owner) external view returns (uint256);114115	// Selector: ownerOf(uint256) 6352211e116	function ownerOf(uint256 tokenId) external view returns (address);117118	// Not implemented119	//120	// Selector: safeTransferFromWithData(address,address,uint256,bytes) 60a11672121	function safeTransferFromWithData(122		address from,123		address to,124		uint256 tokenId,125		bytes memory data126	) external;127128	// Not implemented129	//130	// Selector: safeTransferFrom(address,address,uint256) 42842e0e131	function safeTransferFrom(132		address from,133		address to,134		uint256 tokenId135	) external;136137	// Selector: transferFrom(address,address,uint256) 23b872dd138	function transferFrom(139		address from,140		address to,141		uint256 tokenId142	) external;143144	// Selector: approve(address,uint256) 095ea7b3145	function approve(address approved, uint256 tokenId) external;146147	// Not implemented148	//149	// Selector: setApprovalForAll(address,bool) a22cb465150	function setApprovalForAll(address operator, bool approved) external;151152	// Not implemented153	//154	// Selector: getApproved(uint256) 081812fc155	function getApproved(uint256 tokenId) external view returns (address);156157	// Not implemented158	//159	// Selector: isApprovedForAll(address,address) e985e9c5160	function isApprovedForAll(address owner, address operator)161		external162		view163		returns (address);164}165166// Selector: 5b5e139f167interface ERC721Metadata is Dummy, ERC165 {168	// Selector: name() 06fdde03169	function name() external view returns (string memory);170171	// Selector: symbol() 95d89b41172	function symbol() external view returns (string memory);173174	// Returns token's const_metadata175	//176	// Selector: tokenURI(uint256) c87b56dd177	function tokenURI(uint256 tokenId) external view returns (string memory);178}179180// Selector: 68ccfe89181interface ERC721Mintable is Dummy, ERC165, ERC721MintableEvents {182	// Selector: mintingFinished() 05d2035b183	function mintingFinished() external view returns (bool);184185	// `token_id` should be obtained with `next_token_id` method,186	// unlike standard, you can't specify it manually187	//188	// Selector: mint(address,uint256) 40c10f19189	function mint(address to, uint256 tokenId) external returns (bool);190191	// `token_id` should be obtained with `next_token_id` method,192	// unlike standard, you can't specify it manually193	//194	// Selector: mintWithTokenURI(address,uint256,string) 50bb4e7f195	function mintWithTokenURI(196		address to,197		uint256 tokenId,198		string memory tokenUri199	) external returns (bool);200201	// Not implemented202	//203	// Selector: finishMinting() 7d64bcb4204	function finishMinting() external returns (bool);205}206207// Selector: 780e9d63208interface ERC721Enumerable is Dummy, ERC165 {209	// Selector: tokenByIndex(uint256) 4f6ccce7210	function tokenByIndex(uint256 index) external view returns (uint256);211212	// Not implemented213	//214	// Selector: tokenOfOwnerByIndex(address,uint256) 2f745c59215	function tokenOfOwnerByIndex(address owner, uint256 index)216		external217		view218		returns (uint256);219220	// Selector: totalSupply() 18160ddd221	function totalSupply() external view returns (uint256);222}223224// Selector: d74d154f225interface ERC721UniqueExtensions is Dummy, ERC165 {226	// Selector: transfer(address,uint256) a9059cbb227	function transfer(address to, uint256 tokenId) external;228229	// Selector: burnFrom(address,uint256) 79cc6790230	function burnFrom(address from, uint256 tokenId) external;231232	// Selector: nextTokenId() 75794a3c233	function nextTokenId() external view returns (uint256);234235	// Selector: mintBulk(address,uint256[]) 44a9945e236	function mintBulk(address to, uint256[] memory tokenIds)237		external238		returns (bool);239240	// Selector: mintBulkWithTokenURI(address,(uint256,string)[]) 36543006241	function mintBulkWithTokenURI(address to, Tuple0[] memory tokens)242		external243		returns (bool);244}245246interface UniqueNFT is247	Dummy,248	ERC165,249	ERC721,250	ERC721Metadata,251	ERC721Enumerable,252	ERC721UniqueExtensions,253	ERC721Mintable,254	ERC721Burnable,255	Collection,256	TokenProperties257{}
deletedtests/src/eth/collectionAbi.jsondiffbeforeafterboth
--- a/tests/src/eth/collectionAbi.json
+++ /dev/null
@@ -1,43 +0,0 @@
-[
-  {
-    "inputs": [],
-    "name": "confirmSponsorship",
-    "outputs": [],
-    "stateMutability": "view",
-    "type": "function"
-  },
-  {
-    "inputs": [],
-    "name": "contractAddress",
-    "outputs": [{ "internalType": "address", "name": "", "type": "address" }],
-    "stateMutability": "view",
-    "type": "function"
-  },
-  {
-    "inputs": [
-      { "internalType": "string", "name": "limitsJson", "type": "string" }
-    ],
-    "name": "setLimits",
-    "outputs": [],
-    "stateMutability": "view",
-    "type": "function"
-  },
-  {
-    "inputs": [
-      { "internalType": "address", "name": "sponsor", "type": "address" }
-    ],
-    "name": "setSponsor",
-    "outputs": [],
-    "stateMutability": "view",
-    "type": "function"
-  },
-  {
-    "inputs": [
-      { "internalType": "bytes4", "name": "interfaceID", "type": "bytes4" }
-    ],
-    "name": "supportsInterface",
-    "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
-    "stateMutability": "view",
-    "type": "function"
-  }
-]
modifiedtests/src/eth/createCollection.test.tsdiffbeforeafterboth
--- a/tests/src/eth/createCollection.test.ts
+++ b/tests/src/eth/createCollection.test.ts
@@ -88,13 +88,13 @@
     const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result);
     const sponsor = await createEthAccountWithBalance(api, web3);
     const collectionEvm = evmCollection(web3, owner, collectionIdAddress);
-    result = await collectionEvm.methods.setSponsor(sponsor).send();
+    result = await collectionEvm.methods.ethSetSponsor(sponsor).send();
     let collectionSub = (await getDetailedCollectionInfo(api, collectionId))!;
     expect(collectionSub.sponsorship.isUnconfirmed).to.be.true;
     expect(collectionSub.sponsorship.asUnconfirmed.toHuman()).to.be.eq(evmToAddress(sponsor));
-    await expect(collectionEvm.methods.confirmSponsorship().call()).to.be.rejectedWith('Caller is not set as sponsor');
+    await expect(collectionEvm.methods.ethConfirmSponsorship().call()).to.be.rejectedWith('Caller is not set as sponsor');
     const sponsorCollection = evmCollection(web3, sponsor, collectionIdAddress);
-    await sponsorCollection.methods.confirmSponsorship().send();
+    await sponsorCollection.methods.ethConfirmSponsorship().send();
     collectionSub = (await getDetailedCollectionInfo(api, collectionId))!;
     expect(collectionSub.sponsorship.isConfirmed).to.be.true;
     expect(collectionSub.sponsorship.asConfirmed.toHuman()).to.be.eq(evmToAddress(sponsor));
modifiedtests/src/eth/nonFungibleAbi.jsondiffbeforeafterboth
--- a/tests/src/eth/nonFungibleAbi.json
+++ b/tests/src/eth/nonFungibleAbi.json
@@ -126,6 +126,13 @@
     "type": "function"
   },
   {
+    "inputs": [],
+    "name": "contractAddress",
+    "outputs": [{ "internalType": "address", "name": "", "type": "address" }],
+    "stateMutability": "view",
+    "type": "function"
+  },
+  {
     "inputs": [{ "internalType": "string", "name": "key", "type": "string" }],
     "name": "deleteCollectionProperty",
     "outputs": [],
@@ -144,6 +151,22 @@
   },
   {
     "inputs": [],
+    "name": "ethConfirmSponsorship",
+    "outputs": [],
+    "stateMutability": "nonpayable",
+    "type": "function"
+  },
+  {
+    "inputs": [
+      { "internalType": "address", "name": "sponsor", "type": "address" }
+    ],
+    "name": "ethSetSponsor",
+    "outputs": [],
+    "stateMutability": "nonpayable",
+    "type": "function"
+  },
+  {
+    "inputs": [],
     "name": "finishMinting",
     "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
     "stateMutability": "nonpayable",
@@ -302,6 +325,15 @@
   },
   {
     "inputs": [
+      { "internalType": "string", "name": "limitsJson", "type": "string" }
+    ],
+    "name": "setLimits",
+    "outputs": [],
+    "stateMutability": "view",
+    "type": "function"
+  },
+  {
+    "inputs": [
       { "internalType": "uint256", "name": "tokenId", "type": "uint256" },
       { "internalType": "string", "name": "key", "type": "string" },
       { "internalType": "bytes", "name": "value", "type": "bytes" }
modifiedtests/src/eth/util/helpers.tsdiffbeforeafterboth
--- a/tests/src/eth/util/helpers.ts
+++ b/tests/src/eth/util/helpers.ts
@@ -28,7 +28,7 @@
 import config from '../../config';
 import privateKey from '../../substrate/privateKey';
 import contractHelpersAbi from './contractHelpersAbi.json';
-import collectionAbi from '../collectionAbi.json';
+import collectionAbi from '../nonFungibleAbi.json';
 import collectionHelperAbi from '../collectionHelperAbi.json';
 import getBalance from '../../substrate/get-balance';
 import waitNewBlocks from '../../substrate/wait-new-blocks';