git.delta.rocks / unique-network / refs/commits / 4e01cb3cfaf7

difftreelog

build upgrade to new evm-coder syntax

Yaroslav Bolyukin2022-07-12parent: #b6f414f.patch.diff
in: master

29 files changed

modifiedCargo.lockdiffbeforeafterboth
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1772,41 +1772,6 @@
 ]
 
 [[package]]
-name = "darling"
-version = "0.13.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c"
-dependencies = [
- "darling_core",
- "darling_macro",
-]
-
-[[package]]
-name = "darling_core"
-version = "0.13.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610"
-dependencies = [
- "fnv",
- "ident_case",
- "proc-macro2",
- "quote",
- "strsim",
- "syn",
-]
-
-[[package]]
-name = "darling_macro"
-version = "0.13.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835"
-dependencies = [
- "darling_core",
- "quote",
- "syn",
-]
-
-[[package]]
 name = "data-encoding"
 version = "2.3.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -2217,14 +2182,13 @@
 
 [[package]]
 name = "evm-coder-macros"
-version = "0.1.0"
+version = "0.2.0"
 dependencies = [
  "Inflector",
- "darling",
  "hex",
  "proc-macro2",
  "quote",
- "sha3 0.9.1",
+ "sha3 0.10.2",
  "syn",
 ]
 
@@ -3427,12 +3391,6 @@
  "wasm-bindgen",
  "winapi",
 ]
-
-[[package]]
-name = "ident_case"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39"
 
 [[package]]
 name = "idna"
modifiedpallets/common/src/erc.rsdiffbeforeafterboth
--- a/pallets/common/src/erc.rs
+++ b/pallets/common/src/erc.rs
@@ -60,7 +60,7 @@
 }
 
 /// @title A contract that allows you to work with collections.
-#[solidity_interface(name = "Collection")]
+#[solidity_interface(name = Collection)]
 impl<T: Config> CollectionHandle<T>
 where
 	T::AccountId: From<[u8; 32]>,
@@ -228,7 +228,7 @@
 	}
 
 	/// Add collection admin by substrate address.
-	/// @param new_admin Substrate administrator address.
+	/// @param newAdmin Substrate administrator address.
 	fn add_collection_admin_substrate(
 		&mut self,
 		caller: caller,
@@ -254,7 +254,7 @@
 	}
 
 	/// Add collection admin.
-	/// @param new_admin Address of the added administrator.
+	/// @param newAdmin Address of the added administrator.
 	fn add_collection_admin(&mut self, caller: caller, new_admin: address) -> Result<void> {
 		let caller = T::CrossAccountId::from_eth(caller);
 		let new_admin = T::CrossAccountId::from_eth(new_admin);
@@ -264,7 +264,7 @@
 
 	/// Remove collection admin.
 	///
-	/// @param new_admin Address of the removed administrator.
+	/// @param admin Address of the removed administrator.
 	fn remove_collection_admin(&mut self, caller: caller, admin: address) -> Result<void> {
 		let caller = T::CrossAccountId::from_eth(caller);
 		let admin = T::CrossAccountId::from_eth(admin);
modifiedpallets/evm-contract-helpers/src/eth.rsdiffbeforeafterboth
--- a/pallets/evm-contract-helpers/src/eth.rs
+++ b/pallets/evm-contract-helpers/src/eth.rs
@@ -42,14 +42,14 @@
 	}
 }
 
-#[solidity_interface(name = "ContractHelpers")]
+#[solidity_interface(name = ContractHelpers)]
 impl<T: Config> ContractHelpers<T>
 where
 	T::AccountId: AsRef<[u8; 32]>,
 {
 	/// Get contract ovner
 	///
-	/// @param Contract_address contract for which the owner is being determined.
+	/// @param contractAddress contract for which the owner is being determined.
 	/// @return Contract owner.
 	fn contract_owner(&self, contract_address: address) -> Result<address> {
 		Ok(<Owner<T>>::get(contract_address))
@@ -57,7 +57,7 @@
 
 	/// Set sponsor.
 	///
-	/// @param contract_address Contract for which a sponsor is being established.
+	/// @param contractAddress Contract for which a sponsor is being established.
 	/// @param sponsor User address who set as pending sponsor.
 	fn set_sponsor(
 		&mut self,
@@ -80,7 +80,7 @@
 
 	/// Set contract as self sponsored.
 	///
-	/// @param contract_address Contract for which a self sponsoring is being enabled.
+	/// @param contractAddress Contract for which a self sponsoring is being enabled.
 	fn self_sponsored_enable(&mut self, caller: caller, contract_address: address) -> Result<void> {
 		self.recorder().consume_sload()?;
 		self.recorder().consume_sstore()?;
@@ -93,7 +93,7 @@
 
 	/// Remove sponsor.
 	///
-	/// @param contract_address Contract for which a sponsorship is being removed.
+	/// @param contractAddress Contract for which a sponsorship is being removed.
 	fn remove_sponsor(&mut self, caller: caller, contract_address: address) -> Result<void> {
 		self.recorder().consume_sload()?;
 		self.recorder().consume_sstore()?;
@@ -106,9 +106,9 @@
 
 	/// Confirm sponsorship.
 	///
-	/// @dev Caller must be same that set via [`set_sponsor`].
+	/// @dev Caller must be same that set via [`setSponsor`].
 	///
-	/// @param contract_address Сontract for which need to confirm sponsorship.
+	/// @param contractAddress Сontract for which need to confirm sponsorship.
 	fn confirm_sponsorship(&mut self, caller: caller, contract_address: address) -> Result<void> {
 		self.recorder().consume_sload()?;
 		self.recorder().consume_sstore()?;
@@ -121,7 +121,7 @@
 
 	/// Get current sponsor.
 	///
-	/// @param contract_address The contract for which a sponsor is requested.
+	/// @param contractAddress The contract for which a sponsor is requested.
 	/// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.
 	fn get_sponsor(&self, contract_address: address) -> Result<(address, uint256)> {
 		let sponsor =
@@ -138,7 +138,7 @@
 
 	/// Check tat contract has confirmed sponsor.
 	///
-	/// @param contract_address The contract for which the presence of a confirmed sponsor is checked.
+	/// @param contractAddress The contract for which the presence of a confirmed sponsor is checked.
 	/// @return **true** if contract has confirmed sponsor.
 	fn has_sponsor(&self, contract_address: address) -> Result<bool> {
 		Ok(Pallet::<T>::get_sponsor(contract_address).is_some())
@@ -146,7 +146,7 @@
 
 	/// Check tat contract has pending sponsor.
 	///
-	/// @param contract_address The contract for which the presence of a pending sponsor is checked.
+	/// @param contractAddress The contract for which the presence of a pending sponsor is checked.
 	/// @return **true** if contract has pending sponsor.
 	fn has_pending_sponsor(&self, contract_address: address) -> Result<bool> {
 		Ok(match Sponsoring::<T>::get(contract_address) {
@@ -229,13 +229,13 @@
 		caller: caller,
 		contract_address: address,
 		user: address,
-		allowed: bool,
+		is_allowed: bool,
 	) -> Result<void> {
 		self.recorder().consume_sload()?;
 		self.recorder().consume_sstore()?;
 
 		<Pallet<T>>::ensure_owner(contract_address, caller).map_err(dispatch_to_evm::<T>)?;
-		<Pallet<T>>::toggle_allowed(contract_address, user, allowed);
+		<Pallet<T>>::toggle_allowed(contract_address, user, is_allowed);
 
 		Ok(())
 	}
modifiedpallets/evm-contract-helpers/src/stubs/ContractHelpers.rawdiffbeforeafterboth

binary blob — no preview

modifiedpallets/evm-contract-helpers/src/stubs/ContractHelpers.soldiffbeforeafterboth
--- a/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol
+++ b/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol
@@ -3,13 +3,13 @@
 
 pragma solidity >=0.8.0 <0.9.0;
 
-// Anonymous struct
+/// @dev anonymous struct
 struct Tuple0 {
 	address field_0;
 	uint256 field_1;
 }
 
-// Common stubs holder
+/// @dev common stubs holder
 contract Dummy {
 	uint8 dummy;
 	string stub_error = "this contract is implemented in native";
@@ -27,14 +27,14 @@
 	}
 }
 
-// Selector: 6073d917
+/// @dev the ERC-165 identifier for this interface is 0x6073d917
 contract ContractHelpers is Dummy, ERC165 {
-	// Get contract ovner
-	//
-	// @param Contract_address contract for which the owner is being determined.
-	// @return Contract owner.
-	//
-	// Selector: contractOwner(address) 5152b14c
+	/// Get contract ovner
+	///
+	/// @param contractAddress contract for which the owner is being determined.
+	/// @return Contract owner.
+	///
+	/// Selector: contractOwner(address) 5152b14c
 	function contractOwner(address contractAddress)
 		public
 		view
@@ -46,12 +46,12 @@
 		return 0x0000000000000000000000000000000000000000;
 	}
 
-	// Set sponsor.
-	//
-	// @param contract_address Contract for which a sponsor is being established.
-	// @param sponsor User address who set as pending sponsor.
-	//
-	// Selector: setSponsor(address,address) f01fba93
+	/// Set sponsor.
+	///
+	/// @param contractAddress Contract for which a sponsor is being established.
+	/// @param sponsor User address who set as pending sponsor.
+	///
+	/// Selector: setSponsor(address,address) f01fba93
 	function setSponsor(address contractAddress, address sponsor) public {
 		require(false, stub_error);
 		contractAddress;
@@ -59,47 +59,47 @@
 		dummy = 0;
 	}
 
-	// Set contract as self sponsored.
-	//
-	// @param contract_address Contract for which a self sponsoring is being enabled.
-	//
-	// Selector: selfSponsoredEnable(address) 89f7d9ae
+	/// Set contract as self sponsored.
+	///
+	/// @param contractAddress Contract for which a self sponsoring is being enabled.
+	///
+	/// Selector: selfSponsoredEnable(address) 89f7d9ae
 	function selfSponsoredEnable(address contractAddress) public {
 		require(false, stub_error);
 		contractAddress;
 		dummy = 0;
 	}
 
-	// Remove sponsor.
-	//
-	// @param contract_address Contract for which a sponsorship is being removed.
-	//
-	// Selector: removeSponsor(address) ef784250
+	/// Remove sponsor.
+	///
+	/// @param contractAddress Contract for which a sponsorship is being removed.
+	///
+	/// Selector: removeSponsor(address) ef784250
 	function removeSponsor(address contractAddress) public {
 		require(false, stub_error);
 		contractAddress;
 		dummy = 0;
 	}
 
-	// Confirm sponsorship.
-	//
-	// @dev Caller must be same that set via [`set_sponsor`].
-	//
-	// @param contract_address Сontract for which need to confirm sponsorship.
-	//
-	// Selector: confirmSponsorship(address) abc00001
+	/// Confirm sponsorship.
+	///
+	/// @dev Caller must be same that set via [`setSponsor`].
+	///
+	/// @param contractAddress Сontract for which need to confirm sponsorship.
+	///
+	/// Selector: confirmSponsorship(address) abc00001
 	function confirmSponsorship(address contractAddress) public {
 		require(false, stub_error);
 		contractAddress;
 		dummy = 0;
 	}
 
-	// Get current sponsor.
-	//
-	// @param contract_address The contract for which a sponsor is requested.
-	// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.
-	//
-	// Selector: getSponsor(address) 743fc745
+	/// Get current sponsor.
+	///
+	/// @param contractAddress The contract for which a sponsor is requested.
+	/// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.
+	///
+	/// Selector: getSponsor(address) 743fc745
 	function getSponsor(address contractAddress)
 		public
 		view
@@ -111,12 +111,12 @@
 		return Tuple0(0x0000000000000000000000000000000000000000, 0);
 	}
 
-	// Check tat contract has confirmed sponsor.
-	//
-	// @param contract_address The contract for which the presence of a confirmed sponsor is checked.
-	// @return **true** if contract has confirmed sponsor.
-	//
-	// Selector: hasSponsor(address) 97418603
+	/// Check tat contract has confirmed sponsor.
+	///
+	/// @param contractAddress The contract for which the presence of a confirmed sponsor is checked.
+	/// @return **true** if contract has confirmed sponsor.
+	///
+	/// Selector: hasSponsor(address) 97418603
 	function hasSponsor(address contractAddress) public view returns (bool) {
 		require(false, stub_error);
 		contractAddress;
@@ -124,12 +124,12 @@
 		return false;
 	}
 
-	// Check tat contract has pending sponsor.
-	//
-	// @param contract_address The contract for which the presence of a pending sponsor is checked.
-	// @return **true** if contract has pending sponsor.
-	//
-	// Selector: hasPendingSponsor(address) 39b9b242
+	/// Check tat contract has pending sponsor.
+	///
+	/// @param contractAddress The contract for which the presence of a pending sponsor is checked.
+	/// @return **true** if contract has pending sponsor.
+	///
+	/// Selector: hasPendingSponsor(address) 39b9b242
 	function hasPendingSponsor(address contractAddress)
 		public
 		view
@@ -141,7 +141,7 @@
 		return false;
 	}
 
-	// Selector: sponsoringEnabled(address) 6027dc61
+	/// Selector: sponsoringEnabled(address) 6027dc61
 	function sponsoringEnabled(address contractAddress)
 		public
 		view
@@ -153,7 +153,7 @@
 		return false;
 	}
 
-	// Selector: setSponsoringMode(address,uint8) fde8a560
+	/// Selector: setSponsoringMode(address,uint8) fde8a560
 	function setSponsoringMode(address contractAddress, uint8 mode) public {
 		require(false, stub_error);
 		contractAddress;
@@ -161,7 +161,7 @@
 		dummy = 0;
 	}
 
-	// Selector: sponsoringMode(address) b70c7267
+	/// Selector: sponsoringMode(address) b70c7267
 	function sponsoringMode(address contractAddress)
 		public
 		view
@@ -173,7 +173,7 @@
 		return 0;
 	}
 
-	// Selector: setSponsoringRateLimit(address,uint32) 77b6c908
+	/// Selector: setSponsoringRateLimit(address,uint32) 77b6c908
 	function setSponsoringRateLimit(address contractAddress, uint32 rateLimit)
 		public
 	{
@@ -183,7 +183,7 @@
 		dummy = 0;
 	}
 
-	// Selector: getSponsoringRateLimit(address) 610cfabd
+	/// Selector: getSponsoringRateLimit(address) 610cfabd
 	function getSponsoringRateLimit(address contractAddress)
 		public
 		view
@@ -195,7 +195,7 @@
 		return 0;
 	}
 
-	// Selector: allowed(address,address) 5c658165
+	/// Selector: allowed(address,address) 5c658165
 	function allowed(address contractAddress, address user)
 		public
 		view
@@ -208,7 +208,7 @@
 		return false;
 	}
 
-	// Selector: allowlistEnabled(address) c772ef6c
+	/// Selector: allowlistEnabled(address) c772ef6c
 	function allowlistEnabled(address contractAddress)
 		public
 		view
@@ -220,7 +220,7 @@
 		return false;
 	}
 
-	// Selector: toggleAllowlist(address,bool) 36de20f5
+	/// Selector: toggleAllowlist(address,bool) 36de20f5
 	function toggleAllowlist(address contractAddress, bool enabled) public {
 		require(false, stub_error);
 		contractAddress;
@@ -228,16 +228,16 @@
 		dummy = 0;
 	}
 
-	// Selector: toggleAllowed(address,address,bool) 4706cc1c
+	/// Selector: toggleAllowed(address,address,bool) 4706cc1c
 	function toggleAllowed(
 		address contractAddress,
 		address user,
-		bool allowed
+		bool isAllowed
 	) public {
 		require(false, stub_error);
 		contractAddress;
 		user;
-		allowed;
+		isAllowed;
 		dummy = 0;
 	}
 }
modifiedpallets/fungible/src/erc.rsdiffbeforeafterboth
--- a/pallets/fungible/src/erc.rs
+++ b/pallets/fungible/src/erc.rs
@@ -50,7 +50,7 @@
 	},
 }
 
-#[solidity_interface(name = "ERC20", events(ERC20Events))]
+#[solidity_interface(name = ERC20, events(ERC20Events))]
 impl<T: Config> FungibleHandle<T> {
 	fn name(&self) -> Result<string> {
 		Ok(decode_utf16(self.name.iter().copied())
@@ -129,7 +129,7 @@
 	}
 }
 
-#[solidity_interface(name = "ERC20UniqueExtensions")]
+#[solidity_interface(name = ERC20UniqueExtensions)]
 impl<T: Config> FungibleHandle<T> {
 	#[weight(<SelfWeightOf<T>>::burn_from())]
 	fn burn_from(&mut self, caller: caller, from: address, amount: uint256) -> Result<bool> {
@@ -147,11 +147,11 @@
 }
 
 #[solidity_interface(
-	name = "UniqueFungible",
+	name = UniqueFungible,
 	is(
 		ERC20,
 		ERC20UniqueExtensions,
-		via("CollectionHandle<T>", common_mut, Collection)
+		Collection(common_mut, CollectionHandle<T>),
 	)
 )]
 impl<T: Config> FungibleHandle<T> where T::AccountId: From<[u8; 32]> {}
modifiedpallets/fungible/src/stubs/UniqueFungible.rawdiffbeforeafterboth

binary blob — no preview

modifiedpallets/fungible/src/stubs/UniqueFungible.soldiffbeforeafterboth
--- a/pallets/fungible/src/stubs/UniqueFungible.sol
+++ b/pallets/fungible/src/stubs/UniqueFungible.sol
@@ -3,7 +3,7 @@
 
 pragma solidity >=0.8.0 <0.9.0;
 
-// Common stubs holder
+/// @dev common stubs holder
 contract Dummy {
 	uint8 dummy;
 	string stub_error = "this contract is implemented in native";
@@ -19,122 +19,17 @@
 		interfaceID;
 		return true;
 	}
-}
-
-// Inline
-contract ERC20Events {
-	event Transfer(address indexed from, address indexed to, uint256 value);
-	event Approval(
-		address indexed owner,
-		address indexed spender,
-		uint256 value
-	);
 }
 
-// Selector: 79cc6790
-contract ERC20UniqueExtensions is Dummy, ERC165 {
-	// Selector: burnFrom(address,uint256) 79cc6790
-	function burnFrom(address from, uint256 amount) public returns (bool) {
-		require(false, stub_error);
-		from;
-		amount;
-		dummy = 0;
-		return false;
-	}
-}
-
-// Selector: 942e8b22
-contract ERC20 is Dummy, ERC165, ERC20Events {
-	// Selector: name() 06fdde03
-	function name() public view returns (string memory) {
-		require(false, stub_error);
-		dummy;
-		return "";
-	}
-
-	// Selector: symbol() 95d89b41
-	function symbol() public view returns (string memory) {
-		require(false, stub_error);
-		dummy;
-		return "";
-	}
-
-	// Selector: totalSupply() 18160ddd
-	function totalSupply() public view returns (uint256) {
-		require(false, stub_error);
-		dummy;
-		return 0;
-	}
-
-	// Selector: decimals() 313ce567
-	function decimals() public view returns (uint8) {
-		require(false, stub_error);
-		dummy;
-		return 0;
-	}
-
-	// Selector: balanceOf(address) 70a08231
-	function balanceOf(address owner) public view returns (uint256) {
-		require(false, stub_error);
-		owner;
-		dummy;
-		return 0;
-	}
-
-	// Selector: transfer(address,uint256) a9059cbb
-	function transfer(address to, uint256 amount) public returns (bool) {
-		require(false, stub_error);
-		to;
-		amount;
-		dummy = 0;
-		return false;
-	}
-
-	// Selector: transferFrom(address,address,uint256) 23b872dd
-	function transferFrom(
-		address from,
-		address to,
-		uint256 amount
-	) public returns (bool) {
-		require(false, stub_error);
-		from;
-		to;
-		amount;
-		dummy = 0;
-		return false;
-	}
-
-	// Selector: approve(address,uint256) 095ea7b3
-	function approve(address spender, uint256 amount) public returns (bool) {
-		require(false, stub_error);
-		spender;
-		amount;
-		dummy = 0;
-		return false;
-	}
-
-	// Selector: allowance(address,address) dd62ed3e
-	function allowance(address owner, address spender)
-		public
-		view
-		returns (uint256)
-	{
-		require(false, stub_error);
-		owner;
-		spender;
-		dummy;
-		return 0;
-	}
-}
-
-// Selector: ffe4da23
+/// @title A contract that allows you to work with collections.
+/// @dev the ERC-165 identifier for this interface is 0xffe4da23
 contract Collection is Dummy, ERC165 {
-	// Set collection property.
-	//
-	// @param key Property key.
-	// @param value Propery value.
-	//
-	// Selector: setCollectionProperty(string,bytes) 2f073f66
+	/// Set collection property.
+	///
+	/// @param key Property key.
+	/// @param value Propery value.
+	/// @dev EVM selector for this function is: 0x2f073f66,
+	///  or in textual repr: setCollectionProperty(string,bytes)
 	function setCollectionProperty(string memory key, bytes memory value)
 		public
 	{
@@ -144,25 +39,25 @@
 		dummy = 0;
 	}
 
-	// Delete collection property.
-	//
-	// @param key Property key.
-	//
-	// Selector: deleteCollectionProperty(string) 7b7debce
+	/// Delete collection property.
+	///
+	/// @param key Property key.
+	/// @dev EVM selector for this function is: 0x7b7debce,
+	///  or in textual repr: deleteCollectionProperty(string)
 	function deleteCollectionProperty(string memory key) public {
 		require(false, stub_error);
 		key;
 		dummy = 0;
 	}
 
-	// Get collection property.
-	//
-	// @dev Throws error if key not found.
-	//
-	// @param key Property key.
-	// @return bytes The property corresponding to the key.
-	//
-	// Selector: collectionProperty(string) cf24fd6d
+	/// Get collection property.
+	///
+	/// @dev Throws error if key not found.
+	///
+	/// @param key Property key.
+	/// @return bytes The property corresponding to the key.
+	/// @dev EVM selector for this function is: 0xcf24fd6d,
+	///  or in textual repr: collectionProperty(string)
 	function collectionProperty(string memory key)
 		public
 		view
@@ -174,41 +69,41 @@
 		return hex"";
 	}
 
-	// Set the sponsor of the collection.
-	//
-	// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor.
-	//
-	// @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract.
-	//
-	// Selector: setCollectionSponsor(address) 7623402e
+	/// Set the sponsor of the collection.
+	///
+	/// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor.
+	///
+	/// @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract.
+	/// @dev EVM selector for this function is: 0x7623402e,
+	///  or in textual repr: setCollectionSponsor(address)
 	function setCollectionSponsor(address sponsor) public {
 		require(false, stub_error);
 		sponsor;
 		dummy = 0;
 	}
 
-	// Collection sponsorship confirmation.
-	//
-	// @dev After setting the sponsor for the collection, it must be confirmed with this function.
-	//
-	// Selector: confirmCollectionSponsorship() 3c50e97a
+	/// Collection sponsorship confirmation.
+	///
+	/// @dev After setting the sponsor for the collection, it must be confirmed with this function.
+	/// @dev EVM selector for this function is: 0x3c50e97a,
+	///  or in textual repr: confirmCollectionSponsorship()
 	function confirmCollectionSponsorship() public {
 		require(false, stub_error);
 		dummy = 0;
 	}
 
-	// Set limits for the collection.
-	// @dev Throws error if limit not found.
-	// @param limit Name of the limit. Valid names:
-	// 	"accountTokenOwnershipLimit",
-	// 	"sponsoredDataSize",
-	// 	"sponsoredDataRateLimit",
-	// 	"tokenLimit",
-	// 	"sponsorTransferTimeout",
-	// 	"sponsorApproveTimeout"
-	// @param value Value of the limit.
-	//
-	// Selector: setCollectionLimit(string,uint32) 6a3841db
+	/// Set limits for the collection.
+	/// @dev Throws error if limit not found.
+	/// @param limit Name of the limit. Valid names:
+	/// 	"accountTokenOwnershipLimit",
+	/// 	"sponsoredDataSize",
+	/// 	"sponsoredDataRateLimit",
+	/// 	"tokenLimit",
+	/// 	"sponsorTransferTimeout",
+	/// 	"sponsorApproveTimeout"
+	/// @param value Value of the limit.
+	/// @dev EVM selector for this function is: 0x6a3841db,
+	///  or in textual repr: setCollectionLimit(string,uint32)
 	function setCollectionLimit(string memory limit, uint32 value) public {
 		require(false, stub_error);
 		limit;
@@ -216,15 +111,15 @@
 		dummy = 0;
 	}
 
-	// Set limits for the collection.
-	// @dev Throws error if limit not found.
-	// @param limit Name of the limit. Valid names:
-	// 	"ownerCanTransfer",
-	// 	"ownerCanDestroy",
-	// 	"transfersEnabled"
-	// @param value Value of the limit.
-	//
-	// Selector: setCollectionLimit(string,bool) 993b7fba
+	/// Set limits for the collection.
+	/// @dev Throws error if limit not found.
+	/// @param limit Name of the limit. Valid names:
+	/// 	"ownerCanTransfer",
+	/// 	"ownerCanDestroy",
+	/// 	"transfersEnabled"
+	/// @param value Value of the limit.
+	/// @dev EVM selector for this function is: 0x993b7fba,
+	///  or in textual repr: setCollectionLimit(string,bool)
 	function setCollectionLimit(string memory limit, bool value) public {
 		require(false, stub_error);
 		limit;
@@ -232,73 +127,73 @@
 		dummy = 0;
 	}
 
-	// Get contract address.
-	//
-	// Selector: contractAddress() f6b4dfb4
+	/// Get contract address.
+	/// @dev EVM selector for this function is: 0xf6b4dfb4,
+	///  or in textual repr: contractAddress()
 	function contractAddress() public view returns (address) {
 		require(false, stub_error);
 		dummy;
 		return 0x0000000000000000000000000000000000000000;
 	}
 
-	// Add collection admin by substrate address.
-	// @param new_admin Substrate administrator address.
-	//
-	// Selector: addCollectionAdminSubstrate(uint256) 5730062b
+	/// Add collection admin by substrate address.
+	/// @param newAdmin Substrate administrator address.
+	/// @dev EVM selector for this function is: 0x5730062b,
+	///  or in textual repr: addCollectionAdminSubstrate(uint256)
 	function addCollectionAdminSubstrate(uint256 newAdmin) public {
 		require(false, stub_error);
 		newAdmin;
 		dummy = 0;
 	}
 
-	// Remove collection admin by substrate address.
-	// @param admin Substrate administrator address.
-	//
-	// Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9
+	/// Remove collection admin by substrate address.
+	/// @param admin Substrate administrator address.
+	/// @dev EVM selector for this function is: 0x4048fcf9,
+	///  or in textual repr: removeCollectionAdminSubstrate(uint256)
 	function removeCollectionAdminSubstrate(uint256 admin) public {
 		require(false, stub_error);
 		admin;
 		dummy = 0;
 	}
 
-	// Add collection admin.
-	// @param new_admin Address of the added administrator.
-	//
-	// Selector: addCollectionAdmin(address) 92e462c7
+	/// Add collection admin.
+	/// @param newAdmin Address of the added administrator.
+	/// @dev EVM selector for this function is: 0x92e462c7,
+	///  or in textual repr: addCollectionAdmin(address)
 	function addCollectionAdmin(address newAdmin) public {
 		require(false, stub_error);
 		newAdmin;
 		dummy = 0;
 	}
 
-	// Remove collection admin.
-	//
-	// @param new_admin Address of the removed administrator.
-	//
-	// Selector: removeCollectionAdmin(address) fafd7b42
+	/// Remove collection admin.
+	///
+	/// @param admin Address of the removed administrator.
+	/// @dev EVM selector for this function is: 0xfafd7b42,
+	///  or in textual repr: removeCollectionAdmin(address)
 	function removeCollectionAdmin(address admin) public {
 		require(false, stub_error);
 		admin;
 		dummy = 0;
 	}
 
-	// Toggle accessibility of collection nesting.
-	//
-	// @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'
-	//
-	// Selector: setCollectionNesting(bool) 112d4586
+	/// Toggle accessibility of collection nesting.
+	///
+	/// @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'
+	/// @dev EVM selector for this function is: 0x112d4586,
+	///  or in textual repr: setCollectionNesting(bool)
 	function setCollectionNesting(bool enable) public {
 		require(false, stub_error);
 		enable;
 		dummy = 0;
 	}
 
-	// Toggle accessibility of collection nesting.
-	//
-	// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'
-	// @param collections Addresses of collections that will be available for nesting.
-	//
-	// Selector: setCollectionNesting(bool,address[]) 64872396
+	/// Toggle accessibility of collection nesting.
+	///
+	/// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'
+	/// @param collections Addresses of collections that will be available for nesting.
+	/// @dev EVM selector for this function is: 0x64872396,
+	///  or in textual repr: setCollectionNesting(bool,address[])
 	function setCollectionNesting(bool enable, address[] memory collections)
 		public
 	{
@@ -308,57 +203,57 @@
 		dummy = 0;
 	}
 
-	// Set the collection access method.
-	// @param mode Access mode
-	// 	0 for Normal
-	// 	1 for AllowList
-	//
-	// Selector: setCollectionAccess(uint8) 41835d4c
+	/// Set the collection access method.
+	/// @param mode Access mode
+	/// 	0 for Normal
+	/// 	1 for AllowList
+	/// @dev EVM selector for this function is: 0x41835d4c,
+	///  or in textual repr: setCollectionAccess(uint8)
 	function setCollectionAccess(uint8 mode) public {
 		require(false, stub_error);
 		mode;
 		dummy = 0;
 	}
 
-	// Add the user to the allowed list.
-	//
-	// @param user Address of a trusted user.
-	//
-	// Selector: addToCollectionAllowList(address) 67844fe6
+	/// Add the user to the allowed list.
+	///
+	/// @param user Address of a trusted user.
+	/// @dev EVM selector for this function is: 0x67844fe6,
+	///  or in textual repr: addToCollectionAllowList(address)
 	function addToCollectionAllowList(address user) public {
 		require(false, stub_error);
 		user;
 		dummy = 0;
 	}
 
-	// Remove the user from the allowed list.
-	//
-	// @param user Address of a removed user.
-	//
-	// Selector: removeFromCollectionAllowList(address) 85c51acb
+	/// Remove the user from the allowed list.
+	///
+	/// @param user Address of a removed user.
+	/// @dev EVM selector for this function is: 0x85c51acb,
+	///  or in textual repr: removeFromCollectionAllowList(address)
 	function removeFromCollectionAllowList(address user) public {
 		require(false, stub_error);
 		user;
 		dummy = 0;
 	}
 
-	// Switch permission for minting.
-	//
-	// @param mode Enable if "true".
-	//
-	// Selector: setCollectionMintMode(bool) 00018e84
+	/// Switch permission for minting.
+	///
+	/// @param mode Enable if "true".
+	/// @dev EVM selector for this function is: 0x00018e84,
+	///  or in textual repr: setCollectionMintMode(bool)
 	function setCollectionMintMode(bool mode) public {
 		require(false, stub_error);
 		mode;
 		dummy = 0;
 	}
 
-	// Check that account is the owner or admin of the collection
-	//
-	// @param user account to verify
-	// @return "true" if account is the owner or admin
-	//
-	// Selector: isOwnerOrAdmin(address) 9811b0c7
+	/// Check that account is the owner or admin of the collection
+	///
+	/// @param user account to verify
+	/// @return "true" if account is the owner or admin
+	/// @dev EVM selector for this function is: 0x9811b0c7,
+	///  or in textual repr: isOwnerOrAdmin(address)
 	function isOwnerOrAdmin(address user) public view returns (bool) {
 		require(false, stub_error);
 		user;
@@ -366,12 +261,12 @@
 		return false;
 	}
 
-	// Check that substrate account is the owner or admin of the collection
-	//
-	// @param user account to verify
-	// @return "true" if account is the owner or admin
-	//
-	// Selector: isOwnerOrAdminSubstrate(uint256) 68910e00
+	/// Check that substrate account is the owner or admin of the collection
+	///
+	/// @param user account to verify
+	/// @return "true" if account is the owner or admin
+	/// @dev EVM selector for this function is: 0x68910e00,
+	///  or in textual repr: isOwnerOrAdminSubstrate(uint256)
 	function isOwnerOrAdminSubstrate(uint256 user) public view returns (bool) {
 		require(false, stub_error);
 		user;
@@ -379,35 +274,35 @@
 		return false;
 	}
 
-	// Returns collection type
-	//
-	// @return `Fungible` or `NFT` or `ReFungible`
-	//
-	// Selector: uniqueCollectionType() d34b55b8
+	/// Returns collection type
+	///
+	/// @return `Fungible` or `NFT` or `ReFungible`
+	/// @dev EVM selector for this function is: 0xd34b55b8,
+	///  or in textual repr: uniqueCollectionType()
 	function uniqueCollectionType() public returns (string memory) {
 		require(false, stub_error);
 		dummy = 0;
 		return "";
 	}
 
-	// Changes collection owner to another account
-	//
-	// @dev Owner can be changed only by current owner
-	// @param newOwner new owner account
-	//
-	// Selector: setOwner(address) 13af4035
+	/// Changes collection owner to another account
+	///
+	/// @dev Owner can be changed only by current owner
+	/// @param newOwner new owner account
+	/// @dev EVM selector for this function is: 0x13af4035,
+	///  or in textual repr: setOwner(address)
 	function setOwner(address newOwner) public {
 		require(false, stub_error);
 		newOwner;
 		dummy = 0;
 	}
 
-	// Changes collection owner to another substrate account
-	//
-	// @dev Owner can be changed only by current owner
-	// @param newOwner new owner substrate account
-	//
-	// Selector: setOwnerSubstrate(uint256) b212138f
+	/// Changes collection owner to another substrate account
+	///
+	/// @dev Owner can be changed only by current owner
+	/// @param newOwner new owner substrate account
+	/// @dev EVM selector for this function is: 0xb212138f,
+	///  or in textual repr: setOwnerSubstrate(uint256)
 	function setOwnerSubstrate(uint256 newOwner) public {
 		require(false, stub_error);
 		newOwner;
@@ -415,6 +310,122 @@
 	}
 }
 
+/// @dev the ERC-165 identifier for this interface is 0x79cc6790
+contract ERC20UniqueExtensions is Dummy, ERC165 {
+	/// @dev EVM selector for this function is: 0x79cc6790,
+	///  or in textual repr: burnFrom(address,uint256)
+	function burnFrom(address from, uint256 amount) public returns (bool) {
+		require(false, stub_error);
+		from;
+		amount;
+		dummy = 0;
+		return false;
+	}
+}
+
+/// @dev inlined interface
+contract ERC20Events {
+	event Transfer(address indexed from, address indexed to, uint256 value);
+	event Approval(
+		address indexed owner,
+		address indexed spender,
+		uint256 value
+	);
+}
+
+/// @dev the ERC-165 identifier for this interface is 0x942e8b22
+contract ERC20 is Dummy, ERC165, ERC20Events {
+	/// @dev EVM selector for this function is: 0x06fdde03,
+	///  or in textual repr: name()
+	function name() public view returns (string memory) {
+		require(false, stub_error);
+		dummy;
+		return "";
+	}
+
+	/// @dev EVM selector for this function is: 0x95d89b41,
+	///  or in textual repr: symbol()
+	function symbol() public view returns (string memory) {
+		require(false, stub_error);
+		dummy;
+		return "";
+	}
+
+	/// @dev EVM selector for this function is: 0x18160ddd,
+	///  or in textual repr: totalSupply()
+	function totalSupply() public view returns (uint256) {
+		require(false, stub_error);
+		dummy;
+		return 0;
+	}
+
+	/// @dev EVM selector for this function is: 0x313ce567,
+	///  or in textual repr: decimals()
+	function decimals() public view returns (uint8) {
+		require(false, stub_error);
+		dummy;
+		return 0;
+	}
+
+	/// @dev EVM selector for this function is: 0x70a08231,
+	///  or in textual repr: balanceOf(address)
+	function balanceOf(address owner) public view returns (uint256) {
+		require(false, stub_error);
+		owner;
+		dummy;
+		return 0;
+	}
+
+	/// @dev EVM selector for this function is: 0xa9059cbb,
+	///  or in textual repr: transfer(address,uint256)
+	function transfer(address to, uint256 amount) public returns (bool) {
+		require(false, stub_error);
+		to;
+		amount;
+		dummy = 0;
+		return false;
+	}
+
+	/// @dev EVM selector for this function is: 0x23b872dd,
+	///  or in textual repr: transferFrom(address,address,uint256)
+	function transferFrom(
+		address from,
+		address to,
+		uint256 amount
+	) public returns (bool) {
+		require(false, stub_error);
+		from;
+		to;
+		amount;
+		dummy = 0;
+		return false;
+	}
+
+	/// @dev EVM selector for this function is: 0x095ea7b3,
+	///  or in textual repr: approve(address,uint256)
+	function approve(address spender, uint256 amount) public returns (bool) {
+		require(false, stub_error);
+		spender;
+		amount;
+		dummy = 0;
+		return false;
+	}
+
+	/// @dev EVM selector for this function is: 0xdd62ed3e,
+	///  or in textual repr: allowance(address,address)
+	function allowance(address owner, address spender)
+		public
+		view
+		returns (uint256)
+	{
+		require(false, stub_error);
+		owner;
+		spender;
+		dummy;
+		return 0;
+	}
+}
+
 contract UniqueFungible is
 	Dummy,
 	ERC165,
modifiedpallets/nonfungible/src/erc.rsdiffbeforeafterboth
before · pallets/nonfungible/src/erc.rs
1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617//! # Nonfungible Pallet EVM API18//!19//! Provides ERC-721 standart support implementation and EVM API for unique extensions for Nonfungible Pallet.20//! Method implementations are mostly doing parameter conversion and calling Nonfungible Pallet methods.2122extern crate alloc;23use core::{24	char::{REPLACEMENT_CHARACTER, decode_utf16},25	convert::TryInto,26};27use evm_coder::{ToLog, execution::*, generate_stubgen, solidity, solidity_interface, types::*, weight};28use frame_support::BoundedVec;29use up_data_structs::{30	TokenId, PropertyPermission, PropertyKeyPermission, Property, CollectionId, PropertyKey,31	CollectionPropertiesVec,32};33use pallet_evm_coder_substrate::dispatch_to_evm;34use sp_std::vec::Vec;35use pallet_common::{36	erc::{37		CommonEvmHandler, PrecompileResult, CollectionCall,38		static_property::{key, value as property_value},39	},40	CollectionHandle, CollectionPropertyPermissions,41};42use pallet_evm::{account::CrossAccountId, PrecompileHandle};43use pallet_evm_coder_substrate::call;44use pallet_structure::{SelfWeightOf as StructureWeight, weights::WeightInfo as _};45use alloc::string::ToString;4647use crate::{48	AccountBalance, Config, CreateItemData, NonfungibleHandle, Pallet, TokenData, TokensMinted,49	SelfWeightOf, weights::WeightInfo, TokenProperties,50};5152/// @title A contract that allows to set and delete token properties and change token property permissions.53#[solidity_interface(name = "TokenProperties")]54impl<T: Config> NonfungibleHandle<T> {55	/// @notice Set permissions for token property.56	/// @dev Throws error if `msg.sender` is not admin or owner of the collection.57	/// @param key Property key.58	/// @param is_mutable Permission to mutate property.59	/// @param collection_admin Permission to mutate property by collection admin if property is mutable.60	/// @param token_owner Permission to mutate property by token owner if property is mutable.61	fn set_token_property_permission(62		&mut self,63		caller: caller,64		key: string,65		is_mutable: bool,66		collection_admin: bool,67		token_owner: bool,68	) -> Result<()> {69		let caller = T::CrossAccountId::from_eth(caller);70		<Pallet<T>>::set_property_permission(71			self,72			&caller,73			PropertyKeyPermission {74				key: <Vec<u8>>::from(key)75					.try_into()76					.map_err(|_| "too long key")?,77				permission: PropertyPermission {78					mutable: is_mutable,79					collection_admin,80					token_owner,81				},82			},83		)84		.map_err(dispatch_to_evm::<T>)85	}8687	/// @notice Set token property value.88	/// @dev Throws error if `msg.sender` has no permission to edit the property.89	/// @param tokenId ID of the token.90	/// @param key Property key.91	/// @param value Property value.92	fn set_property(93		&mut self,94		caller: caller,95		token_id: uint256,96		key: string,97		value: bytes,98	) -> Result<()> {99		let caller = T::CrossAccountId::from_eth(caller);100		let token_id: u32 = token_id.try_into().map_err(|_| "token id overflow")?;101		let key = <Vec<u8>>::from(key)102			.try_into()103			.map_err(|_| "key too long")?;104		let value = value.try_into().map_err(|_| "value too long")?;105106		let nesting_budget = self107			.recorder108			.weight_calls_budget(<StructureWeight<T>>::find_parent());109110		<Pallet<T>>::set_token_property(111			self,112			&caller,113			TokenId(token_id),114			Property { key, value },115			&nesting_budget,116		)117		.map_err(dispatch_to_evm::<T>)118	}119120	/// @notice Delete token property value.121	/// @dev Throws error if `msg.sender` has no permission to edit the property.122	/// @param tokenId ID of the token.123	/// @param key Property key.124	fn delete_property(&mut self, token_id: uint256, caller: caller, key: string) -> Result<()> {125		let caller = T::CrossAccountId::from_eth(caller);126		let token_id: u32 = token_id.try_into().map_err(|_| "token id overflow")?;127		let key = <Vec<u8>>::from(key)128			.try_into()129			.map_err(|_| "key too long")?;130131		let nesting_budget = self132			.recorder133			.weight_calls_budget(<StructureWeight<T>>::find_parent());134135		<Pallet<T>>::delete_token_property(self, &caller, TokenId(token_id), key, &nesting_budget)136			.map_err(dispatch_to_evm::<T>)137	}138139	/// @notice Get token property value.140	/// @dev Throws error if key not found141	/// @param tokenId ID of the token.142	/// @param key Property key.143	/// @return Property value bytes144	fn property(&self, token_id: uint256, key: string) -> Result<bytes> {145		let token_id: u32 = token_id.try_into().map_err(|_| "token id overflow")?;146		let key = <Vec<u8>>::from(key)147			.try_into()148			.map_err(|_| "key too long")?;149150		let props = <TokenProperties<T>>::get((self.id, token_id));151		let prop = props.get(&key).ok_or("key not found")?;152153		Ok(prop.to_vec())154	}155}156157#[derive(ToLog)]158pub enum ERC721Events {159	/// @dev This emits when ownership of any NFT changes by any mechanism.160	///  This event emits when NFTs are created (`from` == 0) and destroyed161	///  (`to` == 0). Exception: during contract creation, any number of NFTs162	///  may be created and assigned without emitting Transfer. At the time of163	///  any transfer, the approved address for that NFT (if any) is reset to none.164	Transfer {165		#[indexed]166		from: address,167		#[indexed]168		to: address,169		#[indexed]170		token_id: uint256,171	},172	/// @dev This emits when the approved address for an NFT is changed or173	///  reaffirmed. The zero address indicates there is no approved address.174	///  When a Transfer event emits, this also indicates that the approved175	///  address for that NFT (if any) is reset to none.176	Approval {177		#[indexed]178		owner: address,179		#[indexed]180		approved: address,181		#[indexed]182		token_id: uint256,183	},184	/// @dev This emits when an operator is enabled or disabled for an owner.185	///  The operator can manage all NFTs of the owner.186	#[allow(dead_code)]187	ApprovalForAll {188		#[indexed]189		owner: address,190		#[indexed]191		operator: address,192		approved: bool,193	},194}195196#[derive(ToLog)]197pub enum ERC721MintableEvents {198	#[allow(dead_code)]199	MintingFinished {},200}201202/// @title ERC-721 Non-Fungible Token Standard, optional metadata extension203/// @dev See https://eips.ethereum.org/EIPS/eip-721204#[solidity_interface(name = "ERC721Metadata")]205impl<T: Config> NonfungibleHandle<T> {206	/// @notice A descriptive name for a collection of NFTs in this contract207	fn name(&self) -> Result<string> {208		Ok(decode_utf16(self.name.iter().copied())209			.map(|r| r.unwrap_or(REPLACEMENT_CHARACTER))210			.collect::<string>())211	}212213	/// @notice An abbreviated name for NFTs in this contract214	fn symbol(&self) -> Result<string> {215		Ok(string::from_utf8_lossy(&self.token_prefix).into())216	}217218	/// @notice A distinct Uniform Resource Identifier (URI) for a given asset.219	///220	/// @dev If the token has a `url` property and it is not empty, it is returned.221	///  Else If the collection does not have a property with key `schemaName` or its value is not equal to `ERC721Metadata`, it return an error `tokenURI not set`.222	///  If the collection property `baseURI` is empty or absent, return "" (empty string)223	///  otherwise, if token property `suffix` present and is non-empty, return concatenation of baseURI and suffix224	///  otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings).225	///226	/// @return token's const_metadata227	#[solidity(rename_selector = "tokenURI")]228	fn token_uri(&self, token_id: uint256) -> Result<string> {229		let token_id_u32: u32 = token_id.try_into().map_err(|_| "token id overflow")?;230231		if let Ok(url) = get_token_property(self, token_id_u32, &key::url()) {232			if !url.is_empty() {233				return Ok(url);234			}235		} else if !is_erc721_metadata_compatible::<T>(self.id) {236			return Err("tokenURI not set".into());237		}238239		if let Some(base_uri) =240			pallet_common::Pallet::<T>::get_collection_property(self.id, &key::base_uri())241		{242			if !base_uri.is_empty() {243				let base_uri = string::from_utf8(base_uri.into_inner()).map_err(|e| {244					Error::Revert(alloc::format!(245						"Can not convert value \"baseURI\" to string with error \"{}\"",246						e247					))248				})?;249				if let Ok(suffix) = get_token_property(self, token_id_u32, &key::suffix()) {250					if !suffix.is_empty() {251						return Ok(base_uri + suffix.as_str());252					}253				}254255				return Ok(base_uri + token_id.to_string().as_str());256			}257		}258259		Ok("".into())260	}261}262263/// @title ERC-721 Non-Fungible Token Standard, optional enumeration extension264/// @dev See https://eips.ethereum.org/EIPS/eip-721265#[solidity_interface(name = "ERC721Enumerable")]266impl<T: Config> NonfungibleHandle<T> {267	/// @notice Enumerate valid NFTs268	/// @param index A counter less than `totalSupply()`269	/// @return The token identifier for the `index`th NFT,270	///  (sort order not specified)271	fn token_by_index(&self, index: uint256) -> Result<uint256> {272		Ok(index)273	}274275	/// @dev Not implemented276	fn token_of_owner_by_index(&self, _owner: address, _index: uint256) -> Result<uint256> {277		// TODO: Not implemetable278		Err("not implemented".into())279	}280281	/// @notice Count NFTs tracked by this contract282	/// @return A count of valid NFTs tracked by this contract, where each one of283	///  them has an assigned and queryable owner not equal to the zero address284	fn total_supply(&self) -> Result<uint256> {285		self.consume_store_reads(1)?;286		Ok(<Pallet<T>>::total_supply(self).into())287	}288}289290/// @title ERC-721 Non-Fungible Token Standard291/// @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md292#[solidity_interface(name = "ERC721", events(ERC721Events))]293impl<T: Config> NonfungibleHandle<T> {294	/// @notice Count all NFTs assigned to an owner295	/// @dev NFTs assigned to the zero address are considered invalid, and this296	///  function throws for queries about the zero address.297	/// @param owner An address for whom to query the balance298	/// @return The number of NFTs owned by `owner`, possibly zero299	fn balance_of(&self, owner: address) -> Result<uint256> {300		self.consume_store_reads(1)?;301		let owner = T::CrossAccountId::from_eth(owner);302		let balance = <AccountBalance<T>>::get((self.id, owner));303		Ok(balance.into())304	}305	/// @notice Find the owner of an NFT306	/// @dev NFTs assigned to zero address are considered invalid, and queries307	///  about them do throw.308	/// @param tokenId The identifier for an NFT309	/// @return The address of the owner of the NFT310	fn owner_of(&self, token_id: uint256) -> Result<address> {311		self.consume_store_reads(1)?;312		let token: TokenId = token_id.try_into()?;313		Ok(*<TokenData<T>>::get((self.id, token))314			.ok_or("token not found")?315			.owner316			.as_eth())317	}318	/// @dev Not implemented319	fn safe_transfer_from_with_data(320		&mut self,321		_from: address,322		_to: address,323		_token_id: uint256,324		_data: bytes,325		_value: value,326	) -> Result<void> {327		// TODO: Not implemetable328		Err("not implemented".into())329	}330	/// @dev Not implemented331	fn safe_transfer_from(332		&mut self,333		_from: address,334		_to: address,335		_token_id: uint256,336		_value: value,337	) -> Result<void> {338		// TODO: Not implemetable339		Err("not implemented".into())340	}341342	/// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE343	///  TO CONFIRM THAT `to` IS CAPABLE OF RECEIVING NFTS OR ELSE344	///  THEY MAY BE PERMANENTLY LOST345	/// @dev Throws unless `msg.sender` is the current owner or an authorized346	///  operator for this NFT. Throws if `from` is not the current owner. Throws347	///  if `to` is the zero address. Throws if `tokenId` is not a valid NFT.348	/// @param from The current owner of the NFT349	/// @param to The new owner350	/// @param tokenId The NFT to transfer351	/// @param _value Not used for an NFT352	#[weight(<SelfWeightOf<T>>::transfer_from())]353	fn transfer_from(354		&mut self,355		caller: caller,356		from: address,357		to: address,358		token_id: uint256,359		_value: value,360	) -> Result<void> {361		let caller = T::CrossAccountId::from_eth(caller);362		let from = T::CrossAccountId::from_eth(from);363		let to = T::CrossAccountId::from_eth(to);364		let token = token_id.try_into()?;365		let budget = self366			.recorder367			.weight_calls_budget(<StructureWeight<T>>::find_parent());368369		<Pallet<T>>::transfer_from(self, &caller, &from, &to, token, &budget)370			.map_err(dispatch_to_evm::<T>)?;371		Ok(())372	}373374	/// @notice Set or reaffirm the approved address for an NFT375	/// @dev The zero address indicates there is no approved address.376	/// @dev Throws unless `msg.sender` is the current NFT owner, or an authorized377	///  operator of the current owner.378	/// @param approved The new approved NFT controller379	/// @param tokenId The NFT to approve380	#[weight(<SelfWeightOf<T>>::approve())]381	fn approve(382		&mut self,383		caller: caller,384		approved: address,385		token_id: uint256,386		_value: value,387	) -> Result<void> {388		let caller = T::CrossAccountId::from_eth(caller);389		let approved = T::CrossAccountId::from_eth(approved);390		let token = token_id.try_into()?;391392		<Pallet<T>>::set_allowance(self, &caller, token, Some(&approved))393			.map_err(dispatch_to_evm::<T>)?;394		Ok(())395	}396397	/// @dev Not implemented398	fn set_approval_for_all(399		&mut self,400		_caller: caller,401		_operator: address,402		_approved: bool,403	) -> Result<void> {404		// TODO: Not implemetable405		Err("not implemented".into())406	}407408	/// @dev Not implemented409	fn get_approved(&self, _token_id: uint256) -> Result<address> {410		// TODO: Not implemetable411		Err("not implemented".into())412	}413414	/// @dev Not implemented415	fn is_approved_for_all(&self, _owner: address, _operator: address) -> Result<address> {416		// TODO: Not implemetable417		Err("not implemented".into())418	}419}420421/// @title ERC721 Token that can be irreversibly burned (destroyed).422#[solidity_interface(name = "ERC721Burnable")]423impl<T: Config> NonfungibleHandle<T> {424	/// @notice Burns a specific ERC721 token.425	/// @dev Throws unless `msg.sender` is the current NFT owner, or an authorized426	///  operator of the current owner.427	/// @param tokenId The NFT to approve428	#[weight(<SelfWeightOf<T>>::burn_item())]429	fn burn(&mut self, caller: caller, token_id: uint256) -> Result<void> {430		let caller = T::CrossAccountId::from_eth(caller);431		let token = token_id.try_into()?;432433		<Pallet<T>>::burn(self, &caller, token).map_err(dispatch_to_evm::<T>)?;434		Ok(())435	}436}437438/// @title ERC721 minting logic.439#[solidity_interface(name = "ERC721Mintable", events(ERC721MintableEvents))]440impl<T: Config> NonfungibleHandle<T> {441	fn minting_finished(&self) -> Result<bool> {442		Ok(false)443	}444445	/// @notice Function to mint token.446	/// @dev `tokenId` should be obtained with `nextTokenId` method,447	///  unlike standard, you can't specify it manually448	/// @param to The new owner449	/// @param tokenId ID of the minted NFT450	#[weight(<SelfWeightOf<T>>::create_item())]451	fn mint(&mut self, caller: caller, to: address, token_id: uint256) -> Result<bool> {452		let caller = T::CrossAccountId::from_eth(caller);453		let to = T::CrossAccountId::from_eth(to);454		let token_id: u32 = token_id.try_into()?;455		let budget = self456			.recorder457			.weight_calls_budget(<StructureWeight<T>>::find_parent());458459		if <TokensMinted<T>>::get(self.id)460			.checked_add(1)461			.ok_or("item id overflow")?462			!= token_id463		{464			return Err("item id should be next".into());465		}466467		<Pallet<T>>::create_item(468			self,469			&caller,470			CreateItemData::<T> {471				properties: BoundedVec::default(),472				owner: to,473			},474			&budget,475		)476		.map_err(dispatch_to_evm::<T>)?;477478		Ok(true)479	}480481	/// @notice Function to mint token with the given tokenUri.482	/// @dev `tokenId` should be obtained with `nextTokenId` method,483	///  unlike standard, you can't specify it manually484	/// @param to The new owner485	/// @param tokenId ID of the minted NFT486	/// @param tokenUri Token URI that would be stored in the NFT properties487	#[solidity(rename_selector = "mintWithTokenURI")]488	#[weight(<SelfWeightOf<T>>::create_item())]489	fn mint_with_token_uri(490		&mut self,491		caller: caller,492		to: address,493		token_id: uint256,494		token_uri: string,495	) -> Result<bool> {496		let key = key::url();497		let permission = get_token_permission::<T>(self.id, &key)?;498		if !permission.collection_admin {499			return Err("Operation is not allowed".into());500		}501502		let caller = T::CrossAccountId::from_eth(caller);503		let to = T::CrossAccountId::from_eth(to);504		let token_id: u32 = token_id.try_into().map_err(|_| "amount overflow")?;505		let budget = self506			.recorder507			.weight_calls_budget(<StructureWeight<T>>::find_parent());508509		if <TokensMinted<T>>::get(self.id)510			.checked_add(1)511			.ok_or("item id overflow")?512			!= token_id513		{514			return Err("item id should be next".into());515		}516517		let mut properties = CollectionPropertiesVec::default();518		properties519			.try_push(Property {520				key,521				value: token_uri522					.into_bytes()523					.try_into()524					.map_err(|_| "token uri is too long")?,525			})526			.map_err(|e| Error::Revert(alloc::format!("Can't add property: {:?}", e)))?;527528		<Pallet<T>>::create_item(529			self,530			&caller,531			CreateItemData::<T> {532				properties,533				owner: to,534			},535			&budget,536		)537		.map_err(dispatch_to_evm::<T>)?;538		Ok(true)539	}540541	/// @dev Not implemented542	fn finish_minting(&mut self, _caller: caller) -> Result<bool> {543		Err("not implementable".into())544	}545}546547fn get_token_property<T: Config>(548	collection: &CollectionHandle<T>,549	token_id: u32,550	key: &up_data_structs::PropertyKey,551) -> Result<string> {552	collection.consume_store_reads(1)?;553	let properties = <TokenProperties<T>>::try_get((collection.id, token_id))554		.map_err(|_| Error::Revert("Token properties not found".into()))?;555	if let Some(property) = properties.get(key) {556		return Ok(string::from_utf8_lossy(property).into());557	}558559	Err("Property tokenURI not found".into())560}561562fn is_erc721_metadata_compatible<T: Config>(collection_id: CollectionId) -> bool {563	if let Some(shema_name) =564		pallet_common::Pallet::<T>::get_collection_property(collection_id, &key::schema_name())565	{566		let shema_name = shema_name.into_inner();567		shema_name == property_value::ERC721_METADATA568	} else {569		false570	}571}572573fn get_token_permission<T: Config>(574	collection_id: CollectionId,575	key: &PropertyKey,576) -> Result<PropertyPermission> {577	let token_property_permissions = CollectionPropertyPermissions::<T>::try_get(collection_id)578		.map_err(|_| Error::Revert("No permissions for collection".into()))?;579	let a = token_property_permissions580		.get(key)581		.map(Clone::clone)582		.ok_or_else(|| {583			let key = string::from_utf8(key.clone().into_inner()).unwrap_or_default();584			Error::Revert(alloc::format!("No permission for key {}", key))585		})?;586	Ok(a)587}588589fn has_token_permission<T: Config>(collection_id: CollectionId, key: &PropertyKey) -> bool {590	if let Ok(token_property_permissions) =591		CollectionPropertyPermissions::<T>::try_get(collection_id)592	{593		return token_property_permissions.contains_key(key);594	}595596	false597}598599/// @title Unique extensions for ERC721.600#[solidity_interface(name = "ERC721UniqueExtensions")]601impl<T: Config> NonfungibleHandle<T> {602	/// @notice Transfer ownership of an NFT603	/// @dev Throws unless `msg.sender` is the current owner. Throws if `to`604	///  is the zero address. Throws if `tokenId` is not a valid NFT.605	/// @param to The new owner606	/// @param tokenId The NFT to transfer607	/// @param _value Not used for an NFT608	#[weight(<SelfWeightOf<T>>::transfer())]609	fn transfer(610		&mut self,611		caller: caller,612		to: address,613		token_id: uint256,614		_value: value,615	) -> Result<void> {616		let caller = T::CrossAccountId::from_eth(caller);617		let to = T::CrossAccountId::from_eth(to);618		let token = token_id.try_into()?;619		let budget = self620			.recorder621			.weight_calls_budget(<StructureWeight<T>>::find_parent());622623		<Pallet<T>>::transfer(self, &caller, &to, token, &budget).map_err(dispatch_to_evm::<T>)?;624		Ok(())625	}626627	/// @notice Burns a specific ERC721 token.628	/// @dev Throws unless `msg.sender` is the current owner or an authorized629	///  operator for this NFT. Throws if `from` is not the current owner. Throws630	///  if `to` is the zero address. Throws if `tokenId` is not a valid NFT.631	/// @param from The current owner of the NFT632	/// @param tokenId The NFT to transfer633	/// @param _value Not used for an NFT634	#[weight(<SelfWeightOf<T>>::burn_from())]635	fn burn_from(636		&mut self,637		caller: caller,638		from: address,639		token_id: uint256,640		_value: value,641	) -> Result<void> {642		let caller = T::CrossAccountId::from_eth(caller);643		let from = T::CrossAccountId::from_eth(from);644		let token = token_id.try_into()?;645		let budget = self646			.recorder647			.weight_calls_budget(<StructureWeight<T>>::find_parent());648649		<Pallet<T>>::burn_from(self, &caller, &from, token, &budget)650			.map_err(dispatch_to_evm::<T>)?;651		Ok(())652	}653654	/// @notice Returns next free NFT ID.655	fn next_token_id(&self) -> Result<uint256> {656		self.consume_store_reads(1)?;657		Ok(<TokensMinted<T>>::get(self.id)658			.checked_add(1)659			.ok_or("item id overflow")?660			.into())661	}662663	/// @notice Function to mint multiple tokens.664	/// @dev `tokenIds` should be an array of consecutive numbers and first number665	///  should be obtained with `nextTokenId` method666	/// @param to The new owner667	/// @param tokenIds IDs of the minted NFTs668	#[weight(<SelfWeightOf<T>>::create_multiple_items(token_ids.len() as u32))]669	fn mint_bulk(&mut self, caller: caller, to: address, token_ids: Vec<uint256>) -> Result<bool> {670		let caller = T::CrossAccountId::from_eth(caller);671		let to = T::CrossAccountId::from_eth(to);672		let mut expected_index = <TokensMinted<T>>::get(self.id)673			.checked_add(1)674			.ok_or("item id overflow")?;675		let budget = self676			.recorder677			.weight_calls_budget(<StructureWeight<T>>::find_parent());678679		let total_tokens = token_ids.len();680		for id in token_ids.into_iter() {681			let id: u32 = id.try_into().map_err(|_| "token id overflow")?;682			if id != expected_index {683				return Err("item id should be next".into());684			}685			expected_index = expected_index.checked_add(1).ok_or("item id overflow")?;686		}687		let data = (0..total_tokens)688			.map(|_| CreateItemData::<T> {689				properties: BoundedVec::default(),690				owner: to.clone(),691			})692			.collect();693694		<Pallet<T>>::create_multiple_items(self, &caller, data, &budget)695			.map_err(dispatch_to_evm::<T>)?;696		Ok(true)697	}698699	/// @notice Function to mint multiple tokens with the given tokenUris.700	/// @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive701	///  numbers and first number should be obtained with `nextTokenId` method702	/// @param to The new owner703	/// @param tokens array of pairs of token ID and token URI for minted tokens704	#[solidity(rename_selector = "mintBulkWithTokenURI")]705	#[weight(<SelfWeightOf<T>>::create_multiple_items(tokens.len() as u32))]706	fn mint_bulk_with_token_uri(707		&mut self,708		caller: caller,709		to: address,710		tokens: Vec<(uint256, string)>,711	) -> Result<bool> {712		let key = key::url();713		let caller = T::CrossAccountId::from_eth(caller);714		let to = T::CrossAccountId::from_eth(to);715		let mut expected_index = <TokensMinted<T>>::get(self.id)716			.checked_add(1)717			.ok_or("item id overflow")?;718		let budget = self719			.recorder720			.weight_calls_budget(<StructureWeight<T>>::find_parent());721722		let mut data = Vec::with_capacity(tokens.len());723		for (id, token_uri) in tokens {724			let id: u32 = id.try_into().map_err(|_| "token id overflow")?;725			if id != expected_index {726				return Err("item id should be next".into());727			}728			expected_index = expected_index.checked_add(1).ok_or("item id overflow")?;729730			let mut properties = CollectionPropertiesVec::default();731			properties732				.try_push(Property {733					key: key.clone(),734					value: token_uri735						.into_bytes()736						.try_into()737						.map_err(|_| "token uri is too long")?,738				})739				.map_err(|e| Error::Revert(alloc::format!("Can't add property: {:?}", e)))?;740741			data.push(CreateItemData::<T> {742				properties,743				owner: to.clone(),744			});745		}746747		<Pallet<T>>::create_multiple_items(self, &caller, data, &budget)748			.map_err(dispatch_to_evm::<T>)?;749		Ok(true)750	}751}752753#[solidity_interface(754	name = "UniqueNFT",755	is(756		ERC721,757		ERC721Metadata,758		ERC721Enumerable,759		ERC721UniqueExtensions,760		ERC721Mintable,761		ERC721Burnable,762		via("CollectionHandle<T>", common_mut, Collection),763		TokenProperties,764	)765)]766impl<T: Config> NonfungibleHandle<T> where T::AccountId: From<[u8; 32]> {}767768// Not a tests, but code generators769generate_stubgen!(gen_impl, UniqueNFTCall<()>, true);770generate_stubgen!(gen_iface, UniqueNFTCall<()>, false);771772impl<T: Config> CommonEvmHandler for NonfungibleHandle<T>773where774	T::AccountId: From<[u8; 32]>,775{776	const CODE: &'static [u8] = include_bytes!("./stubs/UniqueNFT.raw");777778	fn call(self, handle: &mut impl PrecompileHandle) -> Option<PrecompileResult> {779		call::<T, UniqueNFTCall<T>, _, _>(handle, self)780	}781}
after · pallets/nonfungible/src/erc.rs
1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617//! # Nonfungible Pallet EVM API18//!19//! Provides ERC-721 standart support implementation and EVM API for unique extensions for Nonfungible Pallet.20//! Method implementations are mostly doing parameter conversion and calling Nonfungible Pallet methods.2122extern crate alloc;23use core::{24	char::{REPLACEMENT_CHARACTER, decode_utf16},25	convert::TryInto,26};27use evm_coder::{ToLog, execution::*, generate_stubgen, solidity, solidity_interface, types::*, weight};28use frame_support::BoundedVec;29use up_data_structs::{30	TokenId, PropertyPermission, PropertyKeyPermission, Property, CollectionId, PropertyKey,31	CollectionPropertiesVec,32};33use pallet_evm_coder_substrate::dispatch_to_evm;34use sp_std::vec::Vec;35use pallet_common::{36	erc::{37		CommonEvmHandler, PrecompileResult, CollectionCall,38		static_property::{key, value as property_value},39	},40	CollectionHandle, CollectionPropertyPermissions,41};42use pallet_evm::{account::CrossAccountId, PrecompileHandle};43use pallet_evm_coder_substrate::call;44use pallet_structure::{SelfWeightOf as StructureWeight, weights::WeightInfo as _};45use alloc::string::ToString;4647use crate::{48	AccountBalance, Config, CreateItemData, NonfungibleHandle, Pallet, TokenData, TokensMinted,49	SelfWeightOf, weights::WeightInfo, TokenProperties,50};5152/// @title A contract that allows to set and delete token properties and change token property permissions.53#[solidity_interface(name = TokenProperties)]54impl<T: Config> NonfungibleHandle<T> {55	/// @notice Set permissions for token property.56	/// @dev Throws error if `msg.sender` is not admin or owner of the collection.57	/// @param key Property key.58	/// @param isMutable Permission to mutate property.59	/// @param collectionAdmin Permission to mutate property by collection admin if property is mutable.60	/// @param tokenOwner Permission to mutate property by token owner if property is mutable.61	fn set_token_property_permission(62		&mut self,63		caller: caller,64		key: string,65		is_mutable: bool,66		collection_admin: bool,67		token_owner: bool,68	) -> Result<()> {69		let caller = T::CrossAccountId::from_eth(caller);70		<Pallet<T>>::set_property_permission(71			self,72			&caller,73			PropertyKeyPermission {74				key: <Vec<u8>>::from(key)75					.try_into()76					.map_err(|_| "too long key")?,77				permission: PropertyPermission {78					mutable: is_mutable,79					collection_admin,80					token_owner,81				},82			},83		)84		.map_err(dispatch_to_evm::<T>)85	}8687	/// @notice Set token property value.88	/// @dev Throws error if `msg.sender` has no permission to edit the property.89	/// @param tokenId ID of the token.90	/// @param key Property key.91	/// @param value Property value.92	fn set_property(93		&mut self,94		caller: caller,95		token_id: uint256,96		key: string,97		value: bytes,98	) -> Result<()> {99		let caller = T::CrossAccountId::from_eth(caller);100		let token_id: u32 = token_id.try_into().map_err(|_| "token id overflow")?;101		let key = <Vec<u8>>::from(key)102			.try_into()103			.map_err(|_| "key too long")?;104		let value = value.try_into().map_err(|_| "value too long")?;105106		let nesting_budget = self107			.recorder108			.weight_calls_budget(<StructureWeight<T>>::find_parent());109110		<Pallet<T>>::set_token_property(111			self,112			&caller,113			TokenId(token_id),114			Property { key, value },115			&nesting_budget,116		)117		.map_err(dispatch_to_evm::<T>)118	}119120	/// @notice Delete token property value.121	/// @dev Throws error if `msg.sender` has no permission to edit the property.122	/// @param tokenId ID of the token.123	/// @param key Property key.124	fn delete_property(&mut self, token_id: uint256, caller: caller, key: string) -> Result<()> {125		let caller = T::CrossAccountId::from_eth(caller);126		let token_id: u32 = token_id.try_into().map_err(|_| "token id overflow")?;127		let key = <Vec<u8>>::from(key)128			.try_into()129			.map_err(|_| "key too long")?;130131		let nesting_budget = self132			.recorder133			.weight_calls_budget(<StructureWeight<T>>::find_parent());134135		<Pallet<T>>::delete_token_property(self, &caller, TokenId(token_id), key, &nesting_budget)136			.map_err(dispatch_to_evm::<T>)137	}138139	/// @notice Get token property value.140	/// @dev Throws error if key not found141	/// @param tokenId ID of the token.142	/// @param key Property key.143	/// @return Property value bytes144	fn property(&self, token_id: uint256, key: string) -> Result<bytes> {145		let token_id: u32 = token_id.try_into().map_err(|_| "token id overflow")?;146		let key = <Vec<u8>>::from(key)147			.try_into()148			.map_err(|_| "key too long")?;149150		let props = <TokenProperties<T>>::get((self.id, token_id));151		let prop = props.get(&key).ok_or("key not found")?;152153		Ok(prop.to_vec())154	}155}156157#[derive(ToLog)]158pub enum ERC721Events {159	/// @dev This emits when ownership of any NFT changes by any mechanism.160	///  This event emits when NFTs are created (`from` == 0) and destroyed161	///  (`to` == 0). Exception: during contract creation, any number of NFTs162	///  may be created and assigned without emitting Transfer. At the time of163	///  any transfer, the approved address for that NFT (if any) is reset to none.164	Transfer {165		#[indexed]166		from: address,167		#[indexed]168		to: address,169		#[indexed]170		token_id: uint256,171	},172	/// @dev This emits when the approved address for an NFT is changed or173	///  reaffirmed. The zero address indicates there is no approved address.174	///  When a Transfer event emits, this also indicates that the approved175	///  address for that NFT (if any) is reset to none.176	Approval {177		#[indexed]178		owner: address,179		#[indexed]180		approved: address,181		#[indexed]182		token_id: uint256,183	},184	/// @dev This emits when an operator is enabled or disabled for an owner.185	///  The operator can manage all NFTs of the owner.186	#[allow(dead_code)]187	ApprovalForAll {188		#[indexed]189		owner: address,190		#[indexed]191		operator: address,192		approved: bool,193	},194}195196#[derive(ToLog)]197pub enum ERC721MintableEvents {198	#[allow(dead_code)]199	MintingFinished {},200}201202/// @title ERC-721 Non-Fungible Token Standard, optional metadata extension203/// @dev See https://eips.ethereum.org/EIPS/eip-721204#[solidity_interface(name = ERC721Metadata, expect_selector = 0x5b5e139f)]205impl<T: Config> NonfungibleHandle<T> {206	/// @notice A descriptive name for a collection of NFTs in this contract207	fn name(&self) -> Result<string> {208		Ok(decode_utf16(self.name.iter().copied())209			.map(|r| r.unwrap_or(REPLACEMENT_CHARACTER))210			.collect::<string>())211	}212213	/// @notice An abbreviated name for NFTs in this contract214	fn symbol(&self) -> Result<string> {215		Ok(string::from_utf8_lossy(&self.token_prefix).into())216	}217218	/// @notice A distinct Uniform Resource Identifier (URI) for a given asset.219	///220	/// @dev If the token has a `url` property and it is not empty, it is returned.221	///  Else If the collection does not have a property with key `schemaName` or its value is not equal to `ERC721Metadata`, it return an error `tokenURI not set`.222	///  If the collection property `baseURI` is empty or absent, return "" (empty string)223	///  otherwise, if token property `suffix` present and is non-empty, return concatenation of baseURI and suffix224	///  otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings).225	///226	/// @return token's const_metadata227	#[solidity(rename_selector = "tokenURI")]228	fn token_uri(&self, token_id: uint256) -> Result<string> {229		let token_id_u32: u32 = token_id.try_into().map_err(|_| "token id overflow")?;230231		if let Ok(url) = get_token_property(self, token_id_u32, &key::url()) {232			if !url.is_empty() {233				return Ok(url);234			}235		} else if !is_erc721_metadata_compatible::<T>(self.id) {236			return Err("tokenURI not set".into());237		}238239		if let Some(base_uri) =240			pallet_common::Pallet::<T>::get_collection_property(self.id, &key::base_uri())241		{242			if !base_uri.is_empty() {243				let base_uri = string::from_utf8(base_uri.into_inner()).map_err(|e| {244					Error::Revert(alloc::format!(245						"Can not convert value \"baseURI\" to string with error \"{}\"",246						e247					))248				})?;249				if let Ok(suffix) = get_token_property(self, token_id_u32, &key::suffix()) {250					if !suffix.is_empty() {251						return Ok(base_uri + suffix.as_str());252					}253				}254255				return Ok(base_uri + token_id.to_string().as_str());256			}257		}258259		Ok("".into())260	}261}262263/// @title ERC-721 Non-Fungible Token Standard, optional enumeration extension264/// @dev See https://eips.ethereum.org/EIPS/eip-721265#[solidity_interface(name = ERC721Enumerable, expect_selector = 0x780e9d63)]266impl<T: Config> NonfungibleHandle<T> {267	/// @notice Enumerate valid NFTs268	/// @param index A counter less than `totalSupply()`269	/// @return The token identifier for the `index`th NFT,270	///  (sort order not specified)271	fn token_by_index(&self, index: uint256) -> Result<uint256> {272		Ok(index)273	}274275	/// @dev Not implemented276	fn token_of_owner_by_index(&self, _owner: address, _index: uint256) -> Result<uint256> {277		// TODO: Not implemetable278		Err("not implemented".into())279	}280281	/// @notice Count NFTs tracked by this contract282	/// @return A count of valid NFTs tracked by this contract, where each one of283	///  them has an assigned and queryable owner not equal to the zero address284	fn total_supply(&self) -> Result<uint256> {285		self.consume_store_reads(1)?;286		Ok(<Pallet<T>>::total_supply(self).into())287	}288}289290/// @title ERC-721 Non-Fungible Token Standard291/// @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md292#[solidity_interface(name = ERC721, events(ERC721Events), expect_selector = 0x80ac58cd)]293impl<T: Config> NonfungibleHandle<T> {294	/// @notice Count all NFTs assigned to an owner295	/// @dev NFTs assigned to the zero address are considered invalid, and this296	///  function throws for queries about the zero address.297	/// @param owner An address for whom to query the balance298	/// @return The number of NFTs owned by `owner`, possibly zero299	fn balance_of(&self, owner: address) -> Result<uint256> {300		self.consume_store_reads(1)?;301		let owner = T::CrossAccountId::from_eth(owner);302		let balance = <AccountBalance<T>>::get((self.id, owner));303		Ok(balance.into())304	}305	/// @notice Find the owner of an NFT306	/// @dev NFTs assigned to zero address are considered invalid, and queries307	///  about them do throw.308	/// @param tokenId The identifier for an NFT309	/// @return The address of the owner of the NFT310	fn owner_of(&self, token_id: uint256) -> Result<address> {311		self.consume_store_reads(1)?;312		let token: TokenId = token_id.try_into()?;313		Ok(*<TokenData<T>>::get((self.id, token))314			.ok_or("token not found")?315			.owner316			.as_eth())317	}318	/// @dev Not implemented319	#[solidity(rename_selector = "safeTransferFrom")]320	fn safe_transfer_from_with_data(321		&mut self,322		_from: address,323		_to: address,324		_token_id: uint256,325		_data: bytes,326	) -> Result<void> {327		// TODO: Not implemetable328		Err("not implemented".into())329	}330	/// @dev Not implemented331	fn safe_transfer_from(332		&mut self,333		_from: address,334		_to: address,335		_token_id: uint256,336	) -> Result<void> {337		// TODO: Not implemetable338		Err("not implemented".into())339	}340341	/// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE342	///  TO CONFIRM THAT `to` IS CAPABLE OF RECEIVING NFTS OR ELSE343	///  THEY MAY BE PERMANENTLY LOST344	/// @dev Throws unless `msg.sender` is the current owner or an authorized345	///  operator for this NFT. Throws if `from` is not the current owner. Throws346	///  if `to` is the zero address. Throws if `tokenId` is not a valid NFT.347	/// @param from The current owner of the NFT348	/// @param to The new owner349	/// @param tokenId The NFT to transfer350	#[weight(<SelfWeightOf<T>>::transfer_from())]351	fn transfer_from(352		&mut self,353		caller: caller,354		from: address,355		to: address,356		token_id: uint256,357	) -> Result<void> {358		let caller = T::CrossAccountId::from_eth(caller);359		let from = T::CrossAccountId::from_eth(from);360		let to = T::CrossAccountId::from_eth(to);361		let token = token_id.try_into()?;362		let budget = self363			.recorder364			.weight_calls_budget(<StructureWeight<T>>::find_parent());365366		<Pallet<T>>::transfer_from(self, &caller, &from, &to, token, &budget)367			.map_err(dispatch_to_evm::<T>)?;368		Ok(())369	}370371	/// @notice Set or reaffirm the approved address for an NFT372	/// @dev The zero address indicates there is no approved address.373	/// @dev Throws unless `msg.sender` is the current NFT owner, or an authorized374	///  operator of the current owner.375	/// @param approved The new approved NFT controller376	/// @param tokenId The NFT to approve377	#[weight(<SelfWeightOf<T>>::approve())]378	fn approve(&mut self, caller: caller, approved: address, token_id: uint256) -> Result<void> {379		let caller = T::CrossAccountId::from_eth(caller);380		let approved = T::CrossAccountId::from_eth(approved);381		let token = token_id.try_into()?;382383		<Pallet<T>>::set_allowance(self, &caller, token, Some(&approved))384			.map_err(dispatch_to_evm::<T>)?;385		Ok(())386	}387388	/// @dev Not implemented389	fn set_approval_for_all(390		&mut self,391		_caller: caller,392		_operator: address,393		_approved: bool,394	) -> Result<void> {395		// TODO: Not implemetable396		Err("not implemented".into())397	}398399	/// @dev Not implemented400	fn get_approved(&self, _token_id: uint256) -> Result<address> {401		// TODO: Not implemetable402		Err("not implemented".into())403	}404405	/// @dev Not implemented406	fn is_approved_for_all(&self, _owner: address, _operator: address) -> Result<address> {407		// TODO: Not implemetable408		Err("not implemented".into())409	}410}411412/// @title ERC721 Token that can be irreversibly burned (destroyed).413#[solidity_interface(name = ERC721Burnable)]414impl<T: Config> NonfungibleHandle<T> {415	/// @notice Burns a specific ERC721 token.416	/// @dev Throws unless `msg.sender` is the current NFT owner, or an authorized417	///  operator of the current owner.418	/// @param tokenId The NFT to approve419	#[weight(<SelfWeightOf<T>>::burn_item())]420	fn burn(&mut self, caller: caller, token_id: uint256) -> Result<void> {421		let caller = T::CrossAccountId::from_eth(caller);422		let token = token_id.try_into()?;423424		<Pallet<T>>::burn(self, &caller, token).map_err(dispatch_to_evm::<T>)?;425		Ok(())426	}427}428429/// @title ERC721 minting logic.430#[solidity_interface(name = ERC721Mintable, events(ERC721MintableEvents))]431impl<T: Config> NonfungibleHandle<T> {432	fn minting_finished(&self) -> Result<bool> {433		Ok(false)434	}435436	/// @notice Function to mint token.437	/// @dev `tokenId` should be obtained with `nextTokenId` method,438	///  unlike standard, you can't specify it manually439	/// @param to The new owner440	/// @param tokenId ID of the minted NFT441	#[weight(<SelfWeightOf<T>>::create_item())]442	fn mint(&mut self, caller: caller, to: address, token_id: uint256) -> Result<bool> {443		let caller = T::CrossAccountId::from_eth(caller);444		let to = T::CrossAccountId::from_eth(to);445		let token_id: u32 = token_id.try_into()?;446		let budget = self447			.recorder448			.weight_calls_budget(<StructureWeight<T>>::find_parent());449450		if <TokensMinted<T>>::get(self.id)451			.checked_add(1)452			.ok_or("item id overflow")?453			!= token_id454		{455			return Err("item id should be next".into());456		}457458		<Pallet<T>>::create_item(459			self,460			&caller,461			CreateItemData::<T> {462				properties: BoundedVec::default(),463				owner: to,464			},465			&budget,466		)467		.map_err(dispatch_to_evm::<T>)?;468469		Ok(true)470	}471472	/// @notice Function to mint token with the given tokenUri.473	/// @dev `tokenId` should be obtained with `nextTokenId` method,474	///  unlike standard, you can't specify it manually475	/// @param to The new owner476	/// @param tokenId ID of the minted NFT477	/// @param tokenUri Token URI that would be stored in the NFT properties478	#[solidity(rename_selector = "mintWithTokenURI")]479	#[weight(<SelfWeightOf<T>>::create_item())]480	fn mint_with_token_uri(481		&mut self,482		caller: caller,483		to: address,484		token_id: uint256,485		token_uri: string,486	) -> Result<bool> {487		let key = key::url();488		let permission = get_token_permission::<T>(self.id, &key)?;489		if !permission.collection_admin {490			return Err("Operation is not allowed".into());491		}492493		let caller = T::CrossAccountId::from_eth(caller);494		let to = T::CrossAccountId::from_eth(to);495		let token_id: u32 = token_id.try_into().map_err(|_| "amount overflow")?;496		let budget = self497			.recorder498			.weight_calls_budget(<StructureWeight<T>>::find_parent());499500		if <TokensMinted<T>>::get(self.id)501			.checked_add(1)502			.ok_or("item id overflow")?503			!= token_id504		{505			return Err("item id should be next".into());506		}507508		let mut properties = CollectionPropertiesVec::default();509		properties510			.try_push(Property {511				key,512				value: token_uri513					.into_bytes()514					.try_into()515					.map_err(|_| "token uri is too long")?,516			})517			.map_err(|e| Error::Revert(alloc::format!("Can't add property: {:?}", e)))?;518519		<Pallet<T>>::create_item(520			self,521			&caller,522			CreateItemData::<T> {523				properties,524				owner: to,525			},526			&budget,527		)528		.map_err(dispatch_to_evm::<T>)?;529		Ok(true)530	}531532	/// @dev Not implemented533	fn finish_minting(&mut self, _caller: caller) -> Result<bool> {534		Err("not implementable".into())535	}536}537538fn get_token_property<T: Config>(539	collection: &CollectionHandle<T>,540	token_id: u32,541	key: &up_data_structs::PropertyKey,542) -> Result<string> {543	collection.consume_store_reads(1)?;544	let properties = <TokenProperties<T>>::try_get((collection.id, token_id))545		.map_err(|_| Error::Revert("Token properties not found".into()))?;546	if let Some(property) = properties.get(key) {547		return Ok(string::from_utf8_lossy(property).into());548	}549550	Err("Property tokenURI not found".into())551}552553fn is_erc721_metadata_compatible<T: Config>(collection_id: CollectionId) -> bool {554	if let Some(shema_name) =555		pallet_common::Pallet::<T>::get_collection_property(collection_id, &key::schema_name())556	{557		let shema_name = shema_name.into_inner();558		shema_name == property_value::ERC721_METADATA559	} else {560		false561	}562}563564fn get_token_permission<T: Config>(565	collection_id: CollectionId,566	key: &PropertyKey,567) -> Result<PropertyPermission> {568	let token_property_permissions = CollectionPropertyPermissions::<T>::try_get(collection_id)569		.map_err(|_| Error::Revert("No permissions for collection".into()))?;570	let a = token_property_permissions571		.get(key)572		.map(Clone::clone)573		.ok_or_else(|| {574			let key = string::from_utf8(key.clone().into_inner()).unwrap_or_default();575			Error::Revert(alloc::format!("No permission for key {}", key))576		})?;577	Ok(a)578}579580fn has_token_permission<T: Config>(collection_id: CollectionId, key: &PropertyKey) -> bool {581	if let Ok(token_property_permissions) =582		CollectionPropertyPermissions::<T>::try_get(collection_id)583	{584		return token_property_permissions.contains_key(key);585	}586587	false588}589590/// @title Unique extensions for ERC721.591#[solidity_interface(name = ERC721UniqueExtensions)]592impl<T: Config> NonfungibleHandle<T> {593	/// @notice Transfer ownership of an NFT594	/// @dev Throws unless `msg.sender` is the current owner. Throws if `to`595	///  is the zero address. Throws if `tokenId` is not a valid NFT.596	/// @param to The new owner597	/// @param tokenId The NFT to transfer598	#[weight(<SelfWeightOf<T>>::transfer())]599	fn transfer(&mut self, caller: caller, to: address, token_id: uint256) -> Result<void> {600		let caller = T::CrossAccountId::from_eth(caller);601		let to = T::CrossAccountId::from_eth(to);602		let token = token_id.try_into()?;603		let budget = self604			.recorder605			.weight_calls_budget(<StructureWeight<T>>::find_parent());606607		<Pallet<T>>::transfer(self, &caller, &to, token, &budget).map_err(dispatch_to_evm::<T>)?;608		Ok(())609	}610611	/// @notice Burns a specific ERC721 token.612	/// @dev Throws unless `msg.sender` is the current owner or an authorized613	///  operator for this NFT. Throws if `from` is not the current owner. Throws614	///  if `to` is the zero address. Throws if `tokenId` is not a valid NFT.615	/// @param from The current owner of the NFT616	/// @param tokenId The NFT to transfer617	#[weight(<SelfWeightOf<T>>::burn_from())]618	fn burn_from(&mut self, caller: caller, from: address, token_id: uint256) -> Result<void> {619		let caller = T::CrossAccountId::from_eth(caller);620		let from = T::CrossAccountId::from_eth(from);621		let token = token_id.try_into()?;622		let budget = self623			.recorder624			.weight_calls_budget(<StructureWeight<T>>::find_parent());625626		<Pallet<T>>::burn_from(self, &caller, &from, token, &budget)627			.map_err(dispatch_to_evm::<T>)?;628		Ok(())629	}630631	/// @notice Returns next free NFT ID.632	fn next_token_id(&self) -> Result<uint256> {633		self.consume_store_reads(1)?;634		Ok(<TokensMinted<T>>::get(self.id)635			.checked_add(1)636			.ok_or("item id overflow")?637			.into())638	}639640	/// @notice Function to mint multiple tokens.641	/// @dev `tokenIds` should be an array of consecutive numbers and first number642	///  should be obtained with `nextTokenId` method643	/// @param to The new owner644	/// @param tokenIds IDs of the minted NFTs645	#[weight(<SelfWeightOf<T>>::create_multiple_items(token_ids.len() as u32))]646	fn mint_bulk(&mut self, caller: caller, to: address, token_ids: Vec<uint256>) -> Result<bool> {647		let caller = T::CrossAccountId::from_eth(caller);648		let to = T::CrossAccountId::from_eth(to);649		let mut expected_index = <TokensMinted<T>>::get(self.id)650			.checked_add(1)651			.ok_or("item id overflow")?;652		let budget = self653			.recorder654			.weight_calls_budget(<StructureWeight<T>>::find_parent());655656		let total_tokens = token_ids.len();657		for id in token_ids.into_iter() {658			let id: u32 = id.try_into().map_err(|_| "token id overflow")?;659			if id != expected_index {660				return Err("item id should be next".into());661			}662			expected_index = expected_index.checked_add(1).ok_or("item id overflow")?;663		}664		let data = (0..total_tokens)665			.map(|_| CreateItemData::<T> {666				properties: BoundedVec::default(),667				owner: to.clone(),668			})669			.collect();670671		<Pallet<T>>::create_multiple_items(self, &caller, data, &budget)672			.map_err(dispatch_to_evm::<T>)?;673		Ok(true)674	}675676	/// @notice Function to mint multiple tokens with the given tokenUris.677	/// @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive678	///  numbers and first number should be obtained with `nextTokenId` method679	/// @param to The new owner680	/// @param tokens array of pairs of token ID and token URI for minted tokens681	#[solidity(rename_selector = "mintBulkWithTokenURI")]682	#[weight(<SelfWeightOf<T>>::create_multiple_items(tokens.len() as u32))]683	fn mint_bulk_with_token_uri(684		&mut self,685		caller: caller,686		to: address,687		tokens: Vec<(uint256, string)>,688	) -> Result<bool> {689		let key = key::url();690		let caller = T::CrossAccountId::from_eth(caller);691		let to = T::CrossAccountId::from_eth(to);692		let mut expected_index = <TokensMinted<T>>::get(self.id)693			.checked_add(1)694			.ok_or("item id overflow")?;695		let budget = self696			.recorder697			.weight_calls_budget(<StructureWeight<T>>::find_parent());698699		let mut data = Vec::with_capacity(tokens.len());700		for (id, token_uri) in tokens {701			let id: u32 = id.try_into().map_err(|_| "token id overflow")?;702			if id != expected_index {703				return Err("item id should be next".into());704			}705			expected_index = expected_index.checked_add(1).ok_or("item id overflow")?;706707			let mut properties = CollectionPropertiesVec::default();708			properties709				.try_push(Property {710					key: key.clone(),711					value: token_uri712						.into_bytes()713						.try_into()714						.map_err(|_| "token uri is too long")?,715				})716				.map_err(|e| Error::Revert(alloc::format!("Can't add property: {:?}", e)))?;717718			data.push(CreateItemData::<T> {719				properties,720				owner: to.clone(),721			});722		}723724		<Pallet<T>>::create_multiple_items(self, &caller, data, &budget)725			.map_err(dispatch_to_evm::<T>)?;726		Ok(true)727	}728}729730#[solidity_interface(731	name = UniqueNFT,732	is(733		ERC721,734		ERC721Metadata,735		ERC721Enumerable,736		ERC721UniqueExtensions,737		ERC721Mintable,738		ERC721Burnable,739		Collection(common_mut, CollectionHandle<T>),740		TokenProperties,741	)742)]743impl<T: Config> NonfungibleHandle<T> where T::AccountId: From<[u8; 32]> {}744745// Not a tests, but code generators746generate_stubgen!(gen_impl, UniqueNFTCall<()>, true);747generate_stubgen!(gen_iface, UniqueNFTCall<()>, false);748749impl<T: Config> CommonEvmHandler for NonfungibleHandle<T>750where751	T::AccountId: From<[u8; 32]>,752{753	const CODE: &'static [u8] = include_bytes!("./stubs/UniqueNFT.raw");754755	fn call(self, handle: &mut impl PrecompileHandle) -> Option<PrecompileResult> {756		call::<T, UniqueNFTCall<T>, _, _>(handle, self)757	}758}
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
@@ -3,13 +3,7 @@
 
 pragma solidity >=0.8.0 <0.9.0;
 
-// Anonymous struct
-struct Tuple0 {
-	uint256 field_0;
-	string field_1;
-}
-
-// Common stubs holder
+/// @dev common stubs holder
 contract Dummy {
 	uint8 dummy;
 	string stub_error = "this contract is implemented in native";
@@ -27,40 +21,17 @@
 	}
 }
 
-// Inline
-contract ERC721Events {
-	event Transfer(
-		address indexed from,
-		address indexed to,
-		uint256 indexed tokenId
-	);
-	event Approval(
-		address indexed owner,
-		address indexed approved,
-		uint256 indexed tokenId
-	);
-	event ApprovalForAll(
-		address indexed owner,
-		address indexed operator,
-		bool approved
-	);
-}
-
-// Inline
-contract ERC721MintableEvents {
-	event MintingFinished();
-}
-
-// Selector: 41369377
+/// @title A contract that allows to set and delete token properties and change token property permissions.
+/// @dev the ERC-165 identifier for this interface is 0x41369377
 contract TokenProperties is Dummy, ERC165 {
-	// @notice Set permissions for token property.
-	// @dev Throws error if `msg.sender` is not admin or owner of the collection.
-	// @param key Property key.
-	// @param is_mutable Permission to mutate property.
-	// @param collection_admin Permission to mutate property by collection admin if property is mutable.
-	// @param token_owner Permission to mutate property by token owner if property is mutable.
-	//
-	// Selector: setTokenPropertyPermission(string,bool,bool,bool) 222d97fa
+	/// @notice Set permissions for token property.
+	/// @dev Throws error if `msg.sender` is not admin or owner of the collection.
+	/// @param key Property key.
+	/// @param isMutable Permission to mutate property.
+	/// @param collectionAdmin Permission to mutate property by collection admin if property is mutable.
+	/// @param tokenOwner Permission to mutate property by token owner if property is mutable.
+	/// @dev EVM selector for this function is: 0x222d97fa,
+	///  or in textual repr: setTokenPropertyPermission(string,bool,bool,bool)
 	function setTokenPropertyPermission(
 		string memory key,
 		bool isMutable,
@@ -75,13 +46,13 @@
 		dummy = 0;
 	}
 
-	// @notice Set token property value.
-	// @dev Throws error if `msg.sender` has no permission to edit the property.
-	// @param tokenId ID of the token.
-	// @param key Property key.
-	// @param value Property value.
-	//
-	// Selector: setProperty(uint256,string,bytes) 1752d67b
+	/// @notice Set token property value.
+	/// @dev Throws error if `msg.sender` has no permission to edit the property.
+	/// @param tokenId ID of the token.
+	/// @param key Property key.
+	/// @param value Property value.
+	/// @dev EVM selector for this function is: 0x1752d67b,
+	///  or in textual repr: setProperty(uint256,string,bytes)
 	function setProperty(
 		uint256 tokenId,
 		string memory key,
@@ -94,12 +65,12 @@
 		dummy = 0;
 	}
 
-	// @notice Delete token property value.
-	// @dev Throws error if `msg.sender` has no permission to edit the property.
-	// @param tokenId ID of the token.
-	// @param key Property key.
-	//
-	// Selector: deleteProperty(uint256,string) 066111d1
+	/// @notice Delete token property value.
+	/// @dev Throws error if `msg.sender` has no permission to edit the property.
+	/// @param tokenId ID of the token.
+	/// @param key Property key.
+	/// @dev EVM selector for this function is: 0x066111d1,
+	///  or in textual repr: deleteProperty(uint256,string)
 	function deleteProperty(uint256 tokenId, string memory key) public {
 		require(false, stub_error);
 		tokenId;
@@ -107,13 +78,13 @@
 		dummy = 0;
 	}
 
-	// @notice Get token property value.
-	// @dev Throws error if key not found
-	// @param tokenId ID of the token.
-	// @param key Property key.
-	// @return Property value bytes
-	//
-	// Selector: property(uint256,string) 7228c327
+	/// @notice Get token property value.
+	/// @dev Throws error if key not found
+	/// @param tokenId ID of the token.
+	/// @param key Property key.
+	/// @return Property value bytes
+	/// @dev EVM selector for this function is: 0x7228c327,
+	///  or in textual repr: property(uint256,string)
 	function property(uint256 tokenId, string memory key)
 		public
 		view
@@ -127,213 +98,334 @@
 	}
 }
 
-// Selector: 42966c68
-contract ERC721Burnable is Dummy, ERC165 {
-	// @notice Burns a specific ERC721 token.
-	// @dev Throws unless `msg.sender` is the current NFT owner, or an authorized
-	//  operator of the current owner.
-	// @param tokenId The NFT to approve
-	//
-	// Selector: burn(uint256) 42966c68
-	function burn(uint256 tokenId) public {
+/// @title A contract that allows you to work with collections.
+/// @dev the ERC-165 identifier for this interface is 0xffe4da23
+contract Collection is Dummy, ERC165 {
+	/// Set collection property.
+	///
+	/// @param key Property key.
+	/// @param value Propery value.
+	/// @dev EVM selector for this function is: 0x2f073f66,
+	///  or in textual repr: setCollectionProperty(string,bytes)
+	function setCollectionProperty(string memory key, bytes memory value)
+		public
+	{
 		require(false, stub_error);
-		tokenId;
+		key;
+		value;
 		dummy = 0;
 	}
-}
 
-// Selector: 58800161
-contract ERC721 is Dummy, ERC165, ERC721Events {
-	// @notice Count all NFTs assigned to an owner
-	// @dev NFTs assigned to the zero address are considered invalid, and this
-	//  function throws for queries about the zero address.
-	// @param owner An address for whom to query the balance
-	// @return The number of NFTs owned by `owner`, possibly zero
-	//
-	// Selector: balanceOf(address) 70a08231
-	function balanceOf(address owner) public view returns (uint256) {
+	/// Delete collection property.
+	///
+	/// @param key Property key.
+	/// @dev EVM selector for this function is: 0x7b7debce,
+	///  or in textual repr: deleteCollectionProperty(string)
+	function deleteCollectionProperty(string memory key) public {
 		require(false, stub_error);
-		owner;
-		dummy;
-		return 0;
+		key;
+		dummy = 0;
 	}
 
-	// @notice Find the owner of an NFT
-	// @dev NFTs assigned to zero address are considered invalid, and queries
-	//  about them do throw.
-	// @param tokenId The identifier for an NFT
-	// @return The address of the owner of the NFT
-	//
-	// Selector: ownerOf(uint256) 6352211e
-	function ownerOf(uint256 tokenId) public view returns (address) {
+	/// Get collection property.
+	///
+	/// @dev Throws error if key not found.
+	///
+	/// @param key Property key.
+	/// @return bytes The property corresponding to the key.
+	/// @dev EVM selector for this function is: 0xcf24fd6d,
+	///  or in textual repr: collectionProperty(string)
+	function collectionProperty(string memory key)
+		public
+		view
+		returns (bytes memory)
+	{
 		require(false, stub_error);
-		tokenId;
+		key;
 		dummy;
-		return 0x0000000000000000000000000000000000000000;
+		return hex"";
 	}
 
-	// @dev Not implemented
-	//
-	// Selector: safeTransferFromWithData(address,address,uint256,bytes) 60a11672
-	function safeTransferFromWithData(
-		address from,
-		address to,
-		uint256 tokenId,
-		bytes memory data
-	) public {
+	/// Set the sponsor of the collection.
+	///
+	/// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor.
+	///
+	/// @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract.
+	/// @dev EVM selector for this function is: 0x7623402e,
+	///  or in textual repr: setCollectionSponsor(address)
+	function setCollectionSponsor(address sponsor) public {
 		require(false, stub_error);
-		from;
-		to;
-		tokenId;
-		data;
+		sponsor;
 		dummy = 0;
 	}
 
-	// @dev Not implemented
-	//
-	// Selector: safeTransferFrom(address,address,uint256) 42842e0e
-	function safeTransferFrom(
-		address from,
-		address to,
-		uint256 tokenId
-	) public {
+	/// Collection sponsorship confirmation.
+	///
+	/// @dev After setting the sponsor for the collection, it must be confirmed with this function.
+	/// @dev EVM selector for this function is: 0x3c50e97a,
+	///  or in textual repr: confirmCollectionSponsorship()
+	function confirmCollectionSponsorship() public {
 		require(false, stub_error);
-		from;
-		to;
-		tokenId;
 		dummy = 0;
 	}
 
-	// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE
-	//  TO CONFIRM THAT `to` IS CAPABLE OF RECEIVING NFTS OR ELSE
-	//  THEY MAY BE PERMANENTLY LOST
-	// @dev Throws unless `msg.sender` is the current owner or an authorized
-	//  operator for this NFT. Throws if `from` is not the current owner. Throws
-	//  if `to` is the zero address. Throws if `tokenId` is not a valid NFT.
-	// @param from The current owner of the NFT
-	// @param to The new owner
-	// @param tokenId The NFT to transfer
-	// @param _value Not used for an NFT
-	//
-	// Selector: transferFrom(address,address,uint256) 23b872dd
-	function transferFrom(
-		address from,
-		address to,
-		uint256 tokenId
-	) public {
+	/// Set limits for the collection.
+	/// @dev Throws error if limit not found.
+	/// @param limit Name of the limit. Valid names:
+	/// 	"accountTokenOwnershipLimit",
+	/// 	"sponsoredDataSize",
+	/// 	"sponsoredDataRateLimit",
+	/// 	"tokenLimit",
+	/// 	"sponsorTransferTimeout",
+	/// 	"sponsorApproveTimeout"
+	/// @param value Value of the limit.
+	/// @dev EVM selector for this function is: 0x6a3841db,
+	///  or in textual repr: setCollectionLimit(string,uint32)
+	function setCollectionLimit(string memory limit, uint32 value) public {
 		require(false, stub_error);
-		from;
-		to;
-		tokenId;
+		limit;
+		value;
 		dummy = 0;
 	}
 
-	// @notice Set or reaffirm the approved address for an NFT
-	// @dev The zero address indicates there is no approved address.
-	// @dev Throws unless `msg.sender` is the current NFT owner, or an authorized
-	//  operator of the current owner.
-	// @param approved The new approved NFT controller
-	// @param tokenId The NFT to approve
-	//
-	// Selector: approve(address,uint256) 095ea7b3
-	function approve(address approved, uint256 tokenId) public {
+	/// Set limits for the collection.
+	/// @dev Throws error if limit not found.
+	/// @param limit Name of the limit. Valid names:
+	/// 	"ownerCanTransfer",
+	/// 	"ownerCanDestroy",
+	/// 	"transfersEnabled"
+	/// @param value Value of the limit.
+	/// @dev EVM selector for this function is: 0x993b7fba,
+	///  or in textual repr: setCollectionLimit(string,bool)
+	function setCollectionLimit(string memory limit, bool value) public {
 		require(false, stub_error);
-		approved;
-		tokenId;
+		limit;
+		value;
 		dummy = 0;
 	}
 
-	// @dev Not implemented
-	//
-	// Selector: setApprovalForAll(address,bool) a22cb465
-	function setApprovalForAll(address operator, bool approved) public {
+	/// Get contract address.
+	/// @dev EVM selector for this function is: 0xf6b4dfb4,
+	///  or in textual repr: contractAddress()
+	function contractAddress() public view returns (address) {
+		require(false, stub_error);
+		dummy;
+		return 0x0000000000000000000000000000000000000000;
+	}
+
+	/// Add collection admin by substrate address.
+	/// @param newAdmin Substrate administrator address.
+	/// @dev EVM selector for this function is: 0x5730062b,
+	///  or in textual repr: addCollectionAdminSubstrate(uint256)
+	function addCollectionAdminSubstrate(uint256 newAdmin) public {
+		require(false, stub_error);
+		newAdmin;
+		dummy = 0;
+	}
+
+	/// Remove collection admin by substrate address.
+	/// @param admin Substrate administrator address.
+	/// @dev EVM selector for this function is: 0x4048fcf9,
+	///  or in textual repr: removeCollectionAdminSubstrate(uint256)
+	function removeCollectionAdminSubstrate(uint256 admin) public {
+		require(false, stub_error);
+		admin;
+		dummy = 0;
+	}
+
+	/// Add collection admin.
+	/// @param newAdmin Address of the added administrator.
+	/// @dev EVM selector for this function is: 0x92e462c7,
+	///  or in textual repr: addCollectionAdmin(address)
+	function addCollectionAdmin(address newAdmin) public {
+		require(false, stub_error);
+		newAdmin;
+		dummy = 0;
+	}
+
+	/// Remove collection admin.
+	///
+	/// @param admin Address of the removed administrator.
+	/// @dev EVM selector for this function is: 0xfafd7b42,
+	///  or in textual repr: removeCollectionAdmin(address)
+	function removeCollectionAdmin(address admin) public {
 		require(false, stub_error);
-		operator;
-		approved;
+		admin;
 		dummy = 0;
 	}
 
-	// @dev Not implemented
-	//
-	// Selector: getApproved(uint256) 081812fc
-	function getApproved(uint256 tokenId) public view returns (address) {
+	/// Toggle accessibility of collection nesting.
+	///
+	/// @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'
+	/// @dev EVM selector for this function is: 0x112d4586,
+	///  or in textual repr: setCollectionNesting(bool)
+	function setCollectionNesting(bool enable) public {
 		require(false, stub_error);
-		tokenId;
-		dummy;
-		return 0x0000000000000000000000000000000000000000;
+		enable;
+		dummy = 0;
 	}
 
-	// @dev Not implemented
-	//
-	// Selector: isApprovedForAll(address,address) e985e9c5
-	function isApprovedForAll(address owner, address operator)
+	/// Toggle accessibility of collection nesting.
+	///
+	/// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'
+	/// @param collections Addresses of collections that will be available for nesting.
+	/// @dev EVM selector for this function is: 0x64872396,
+	///  or in textual repr: setCollectionNesting(bool,address[])
+	function setCollectionNesting(bool enable, address[] memory collections)
 		public
-		view
-		returns (address)
 	{
 		require(false, stub_error);
-		owner;
-		operator;
+		enable;
+		collections;
+		dummy = 0;
+	}
+
+	/// Set the collection access method.
+	/// @param mode Access mode
+	/// 	0 for Normal
+	/// 	1 for AllowList
+	/// @dev EVM selector for this function is: 0x41835d4c,
+	///  or in textual repr: setCollectionAccess(uint8)
+	function setCollectionAccess(uint8 mode) public {
+		require(false, stub_error);
+		mode;
+		dummy = 0;
+	}
+
+	/// Add the user to the allowed list.
+	///
+	/// @param user Address of a trusted user.
+	/// @dev EVM selector for this function is: 0x67844fe6,
+	///  or in textual repr: addToCollectionAllowList(address)
+	function addToCollectionAllowList(address user) public {
+		require(false, stub_error);
+		user;
+		dummy = 0;
+	}
+
+	/// Remove the user from the allowed list.
+	///
+	/// @param user Address of a removed user.
+	/// @dev EVM selector for this function is: 0x85c51acb,
+	///  or in textual repr: removeFromCollectionAllowList(address)
+	function removeFromCollectionAllowList(address user) public {
+		require(false, stub_error);
+		user;
+		dummy = 0;
+	}
+
+	/// Switch permission for minting.
+	///
+	/// @param mode Enable if "true".
+	/// @dev EVM selector for this function is: 0x00018e84,
+	///  or in textual repr: setCollectionMintMode(bool)
+	function setCollectionMintMode(bool mode) public {
+		require(false, stub_error);
+		mode;
+		dummy = 0;
+	}
+
+	/// Check that account is the owner or admin of the collection
+	///
+	/// @param user account to verify
+	/// @return "true" if account is the owner or admin
+	/// @dev EVM selector for this function is: 0x9811b0c7,
+	///  or in textual repr: isOwnerOrAdmin(address)
+	function isOwnerOrAdmin(address user) public view returns (bool) {
+		require(false, stub_error);
+		user;
 		dummy;
-		return 0x0000000000000000000000000000000000000000;
+		return false;
 	}
-}
 
-// Selector: 5b5e139f
-contract ERC721Metadata is Dummy, ERC165 {
-	// @notice A descriptive name for a collection of NFTs in this contract
-	//
-	// Selector: name() 06fdde03
-	function name() public view returns (string memory) {
+	/// Check that substrate account is the owner or admin of the collection
+	///
+	/// @param user account to verify
+	/// @return "true" if account is the owner or admin
+	/// @dev EVM selector for this function is: 0x68910e00,
+	///  or in textual repr: isOwnerOrAdminSubstrate(uint256)
+	function isOwnerOrAdminSubstrate(uint256 user) public view returns (bool) {
 		require(false, stub_error);
+		user;
 		dummy;
+		return false;
+	}
+
+	/// Returns collection type
+	///
+	/// @return `Fungible` or `NFT` or `ReFungible`
+	/// @dev EVM selector for this function is: 0xd34b55b8,
+	///  or in textual repr: uniqueCollectionType()
+	function uniqueCollectionType() public returns (string memory) {
+		require(false, stub_error);
+		dummy = 0;
 		return "";
 	}
 
-	// @notice An abbreviated name for NFTs in this contract
-	//
-	// Selector: symbol() 95d89b41
-	function symbol() public view returns (string memory) {
+	/// Changes collection owner to another account
+	///
+	/// @dev Owner can be changed only by current owner
+	/// @param newOwner new owner account
+	/// @dev EVM selector for this function is: 0x13af4035,
+	///  or in textual repr: setOwner(address)
+	function setOwner(address newOwner) public {
+		require(false, stub_error);
+		newOwner;
+		dummy = 0;
+	}
+
+	/// Changes collection owner to another substrate account
+	///
+	/// @dev Owner can be changed only by current owner
+	/// @param newOwner new owner substrate account
+	/// @dev EVM selector for this function is: 0xb212138f,
+	///  or in textual repr: setOwnerSubstrate(uint256)
+	function setOwnerSubstrate(uint256 newOwner) public {
 		require(false, stub_error);
-		dummy;
-		return "";
+		newOwner;
+		dummy = 0;
 	}
+}
 
-	// @notice A distinct Uniform Resource Identifier (URI) for a given asset.
-	//
-	// @dev If the token has a `url` property and it is not empty, it is returned.
-	//  Else If the collection does not have a property with key `schemaName` or its value is not equal to `ERC721Metadata`, it return an error `tokenURI not set`.
-	//  If the collection property `baseURI` is empty or absent, return "" (empty string)
-	//  otherwise, if token property `suffix` present and is non-empty, return concatenation of baseURI and suffix
-	//  otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings).
-	//
-	// @return token's const_metadata
-	//
-	// Selector: tokenURI(uint256) c87b56dd
-	function tokenURI(uint256 tokenId) public view returns (string memory) {
+/// @title ERC721 Token that can be irreversibly burned (destroyed).
+/// @dev the ERC-165 identifier for this interface is 0x42966c68
+contract ERC721Burnable is Dummy, ERC165 {
+	/// @notice Burns a specific ERC721 token.
+	/// @dev Throws unless `msg.sender` is the current NFT owner, or an authorized
+	///  operator of the current owner.
+	/// @param tokenId The NFT to approve
+	/// @dev EVM selector for this function is: 0x42966c68,
+	///  or in textual repr: burn(uint256)
+	function burn(uint256 tokenId) public {
 		require(false, stub_error);
 		tokenId;
-		dummy;
-		return "";
+		dummy = 0;
 	}
 }
 
-// Selector: 68ccfe89
+/// @dev inlined interface
+contract ERC721MintableEvents {
+	event MintingFinished();
+}
+
+/// @title ERC721 minting logic.
+/// @dev the ERC-165 identifier for this interface is 0x68ccfe89
 contract ERC721Mintable is Dummy, ERC165, ERC721MintableEvents {
-	// Selector: mintingFinished() 05d2035b
+	/// @dev EVM selector for this function is: 0x05d2035b,
+	///  or in textual repr: mintingFinished()
 	function mintingFinished() public view returns (bool) {
 		require(false, stub_error);
 		dummy;
 		return false;
 	}
 
-	// @notice Function to mint token.
-	// @dev `tokenId` should be obtained with `nextTokenId` method,
-	//  unlike standard, you can't specify it manually
-	// @param to The new owner
-	// @param tokenId ID of the minted NFT
-	//
-	// Selector: mint(address,uint256) 40c10f19
+	/// @notice Function to mint token.
+	/// @dev `tokenId` should be obtained with `nextTokenId` method,
+	///  unlike standard, you can't specify it manually
+	/// @param to The new owner
+	/// @param tokenId ID of the minted NFT
+	/// @dev EVM selector for this function is: 0x40c10f19,
+	///  or in textual repr: mint(address,uint256)
 	function mint(address to, uint256 tokenId) public returns (bool) {
 		require(false, stub_error);
 		to;
@@ -342,14 +434,14 @@
 		return false;
 	}
 
-	// @notice Function to mint token with the given tokenUri.
-	// @dev `tokenId` should be obtained with `nextTokenId` method,
-	//  unlike standard, you can't specify it manually
-	// @param to The new owner
-	// @param tokenId ID of the minted NFT
-	// @param tokenUri Token URI that would be stored in the NFT properties
-	//
-	// Selector: mintWithTokenURI(address,uint256,string) 50bb4e7f
+	/// @notice Function to mint token with the given tokenUri.
+	/// @dev `tokenId` should be obtained with `nextTokenId` method,
+	///  unlike standard, you can't specify it manually
+	/// @param to The new owner
+	/// @param tokenId ID of the minted NFT
+	/// @param tokenUri Token URI that would be stored in the NFT properties
+	/// @dev EVM selector for this function is: 0x50bb4e7f,
+	///  or in textual repr: mintWithTokenURI(address,uint256,string)
 	function mintWithTokenURI(
 		address to,
 		uint256 tokenId,
@@ -363,9 +455,9 @@
 		return false;
 	}
 
-	// @dev Not implemented
-	//
-	// Selector: finishMinting() 7d64bcb4
+	/// @dev Not implemented
+	/// @dev EVM selector for this function is: 0x7d64bcb4,
+	///  or in textual repr: finishMinting()
 	function finishMinting() public returns (bool) {
 		require(false, stub_error);
 		dummy = 0;
@@ -373,58 +465,16 @@
 	}
 }
 
-// Selector: 780e9d63
-contract ERC721Enumerable is Dummy, ERC165 {
-	// @notice Enumerate valid NFTs
-	// @param index A counter less than `totalSupply()`
-	// @return The token identifier for the `index`th NFT,
-	//  (sort order not specified)
-	//
-	// Selector: tokenByIndex(uint256) 4f6ccce7
-	function tokenByIndex(uint256 index) public view returns (uint256) {
-		require(false, stub_error);
-		index;
-		dummy;
-		return 0;
-	}
-
-	// @dev Not implemented
-	//
-	// Selector: tokenOfOwnerByIndex(address,uint256) 2f745c59
-	function tokenOfOwnerByIndex(address owner, uint256 index)
-		public
-		view
-		returns (uint256)
-	{
-		require(false, stub_error);
-		owner;
-		index;
-		dummy;
-		return 0;
-	}
-
-	// @notice Count NFTs tracked by this contract
-	// @return A count of valid NFTs tracked by this contract, where each one of
-	//  them has an assigned and queryable owner not equal to the zero address
-	//
-	// Selector: totalSupply() 18160ddd
-	function totalSupply() public view returns (uint256) {
-		require(false, stub_error);
-		dummy;
-		return 0;
-	}
-}
-
-// Selector: d74d154f
+/// @title Unique extensions for ERC721.
+/// @dev the ERC-165 identifier for this interface is 0xd74d154f
 contract ERC721UniqueExtensions is Dummy, ERC165 {
-	// @notice Transfer ownership of an NFT
-	// @dev Throws unless `msg.sender` is the current owner. Throws if `to`
-	//  is the zero address. Throws if `tokenId` is not a valid NFT.
-	// @param to The new owner
-	// @param tokenId The NFT to transfer
-	// @param _value Not used for an NFT
-	//
-	// Selector: transfer(address,uint256) a9059cbb
+	/// @notice Transfer ownership of an NFT
+	/// @dev Throws unless `msg.sender` is the current owner. Throws if `to`
+	///  is the zero address. Throws if `tokenId` is not a valid NFT.
+	/// @param to The new owner
+	/// @param tokenId The NFT to transfer
+	/// @dev EVM selector for this function is: 0xa9059cbb,
+	///  or in textual repr: transfer(address,uint256)
 	function transfer(address to, uint256 tokenId) public {
 		require(false, stub_error);
 		to;
@@ -432,15 +482,14 @@
 		dummy = 0;
 	}
 
-	// @notice Burns a specific ERC721 token.
-	// @dev Throws unless `msg.sender` is the current owner or an authorized
-	//  operator for this NFT. Throws if `from` is not the current owner. Throws
-	//  if `to` is the zero address. Throws if `tokenId` is not a valid NFT.
-	// @param from The current owner of the NFT
-	// @param tokenId The NFT to transfer
-	// @param _value Not used for an NFT
-	//
-	// Selector: burnFrom(address,uint256) 79cc6790
+	/// @notice Burns a specific ERC721 token.
+	/// @dev Throws unless `msg.sender` is the current owner or an authorized
+	///  operator for this NFT. Throws if `from` is not the current owner. Throws
+	///  if `to` is the zero address. Throws if `tokenId` is not a valid NFT.
+	/// @param from The current owner of the NFT
+	/// @param tokenId The NFT to transfer
+	/// @dev EVM selector for this function is: 0x79cc6790,
+	///  or in textual repr: burnFrom(address,uint256)
 	function burnFrom(address from, uint256 tokenId) public {
 		require(false, stub_error);
 		from;
@@ -448,22 +497,22 @@
 		dummy = 0;
 	}
 
-	// @notice Returns next free NFT ID.
-	//
-	// Selector: nextTokenId() 75794a3c
+	/// @notice Returns next free NFT ID.
+	/// @dev EVM selector for this function is: 0x75794a3c,
+	///  or in textual repr: nextTokenId()
 	function nextTokenId() public view returns (uint256) {
 		require(false, stub_error);
 		dummy;
 		return 0;
 	}
 
-	// @notice Function to mint multiple tokens.
-	// @dev `tokenIds` should be an array of consecutive numbers and first number
-	//  should be obtained with `nextTokenId` method
-	// @param to The new owner
-	// @param tokenIds IDs of the minted NFTs
-	//
-	// Selector: mintBulk(address,uint256[]) 44a9945e
+	/// @notice Function to mint multiple tokens.
+	/// @dev `tokenIds` should be an array of consecutive numbers and first number
+	///  should be obtained with `nextTokenId` method
+	/// @param to The new owner
+	/// @param tokenIds IDs of the minted NFTs
+	/// @dev EVM selector for this function is: 0x44a9945e,
+	///  or in textual repr: mintBulk(address,uint256[])
 	function mintBulk(address to, uint256[] memory tokenIds)
 		public
 		returns (bool)
@@ -475,14 +524,14 @@
 		return false;
 	}
 
-	// @notice Function to mint multiple tokens with the given tokenUris.
-	// @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive
-	//  numbers and first number should be obtained with `nextTokenId` method
-	// @param to The new owner
-	// @param tokens array of pairs of token ID and token URI for minted tokens
-	//
-	// Selector: mintBulkWithTokenURI(address,(uint256,string)[]) 36543006
-	function mintBulkWithTokenURI(address to, Tuple0[] memory tokens)
+	/// @notice Function to mint multiple tokens with the given tokenUris.
+	/// @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive
+	///  numbers and first number should be obtained with `nextTokenId` method
+	/// @param to The new owner
+	/// @param tokens array of pairs of token ID and token URI for minted tokens
+	/// @dev EVM selector for this function is: 0x36543006,
+	///  or in textual repr: mintBulkWithTokenURI(address,(uint256,string)[])
+	function mintBulkWithTokenURI(address to, Tuple8[] memory tokens)
 		public
 		returns (bool)
 	{
@@ -494,291 +543,251 @@
 	}
 }
 
-// Selector: ffe4da23
-contract Collection is Dummy, ERC165 {
-	// Set collection property.
-	//
-	// @param key Property key.
-	// @param value Propery value.
-	//
-	// Selector: setCollectionProperty(string,bytes) 2f073f66
-	function setCollectionProperty(string memory key, bytes memory value)
-		public
-	{
-		require(false, stub_error);
-		key;
-		value;
-		dummy = 0;
-	}
+/// @dev anonymous struct
+struct Tuple8 {
+	uint256 field_0;
+	string field_1;
+}
 
-	// Delete collection property.
-	//
-	// @param key Property key.
-	//
-	// Selector: deleteCollectionProperty(string) 7b7debce
-	function deleteCollectionProperty(string memory key) public {
+/// @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
+/// @dev See https://eips.ethereum.org/EIPS/eip-721
+/// @dev the ERC-165 identifier for this interface is 0x780e9d63
+contract ERC721Enumerable is Dummy, ERC165 {
+	/// @notice Enumerate valid NFTs
+	/// @param index A counter less than `totalSupply()`
+	/// @return The token identifier for the `index`th NFT,
+	///  (sort order not specified)
+	/// @dev EVM selector for this function is: 0x4f6ccce7,
+	///  or in textual repr: tokenByIndex(uint256)
+	function tokenByIndex(uint256 index) public view returns (uint256) {
 		require(false, stub_error);
-		key;
-		dummy = 0;
+		index;
+		dummy;
+		return 0;
 	}
 
-	// Get collection property.
-	//
-	// @dev Throws error if key not found.
-	//
-	// @param key Property key.
-	// @return bytes The property corresponding to the key.
-	//
-	// Selector: collectionProperty(string) cf24fd6d
-	function collectionProperty(string memory key)
+	/// @dev Not implemented
+	/// @dev EVM selector for this function is: 0x2f745c59,
+	///  or in textual repr: tokenOfOwnerByIndex(address,uint256)
+	function tokenOfOwnerByIndex(address owner, uint256 index)
 		public
 		view
-		returns (bytes memory)
+		returns (uint256)
 	{
 		require(false, stub_error);
-		key;
+		owner;
+		index;
 		dummy;
-		return hex"";
+		return 0;
 	}
 
-	// Set the sponsor of the collection.
-	//
-	// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor.
-	//
-	// @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract.
-	//
-	// Selector: setCollectionSponsor(address) 7623402e
-	function setCollectionSponsor(address sponsor) public {
+	/// @notice Count NFTs tracked by this contract
+	/// @return A count of valid NFTs tracked by this contract, where each one of
+	///  them has an assigned and queryable owner not equal to the zero address
+	/// @dev EVM selector for this function is: 0x18160ddd,
+	///  or in textual repr: totalSupply()
+	function totalSupply() public view returns (uint256) {
 		require(false, stub_error);
-		sponsor;
-		dummy = 0;
+		dummy;
+		return 0;
 	}
+}
 
-	// Collection sponsorship confirmation.
-	//
-	// @dev After setting the sponsor for the collection, it must be confirmed with this function.
-	//
-	// Selector: confirmCollectionSponsorship() 3c50e97a
-	function confirmCollectionSponsorship() public {
+/// @title ERC-721 Non-Fungible Token Standard, optional metadata extension
+/// @dev See https://eips.ethereum.org/EIPS/eip-721
+/// @dev the ERC-165 identifier for this interface is 0x5b5e139f
+contract ERC721Metadata is Dummy, ERC165 {
+	/// @notice A descriptive name for a collection of NFTs in this contract
+	/// @dev EVM selector for this function is: 0x06fdde03,
+	///  or in textual repr: name()
+	function name() public view returns (string memory) {
 		require(false, stub_error);
-		dummy = 0;
+		dummy;
+		return "";
 	}
 
-	// Set limits for the collection.
-	// @dev Throws error if limit not found.
-	// @param limit Name of the limit. Valid names:
-	// 	"accountTokenOwnershipLimit",
-	// 	"sponsoredDataSize",
-	// 	"sponsoredDataRateLimit",
-	// 	"tokenLimit",
-	// 	"sponsorTransferTimeout",
-	// 	"sponsorApproveTimeout"
-	// @param value Value of the limit.
-	//
-	// Selector: setCollectionLimit(string,uint32) 6a3841db
-	function setCollectionLimit(string memory limit, uint32 value) public {
+	/// @notice An abbreviated name for NFTs in this contract
+	/// @dev EVM selector for this function is: 0x95d89b41,
+	///  or in textual repr: symbol()
+	function symbol() public view returns (string memory) {
 		require(false, stub_error);
-		limit;
-		value;
-		dummy = 0;
+		dummy;
+		return "";
 	}
 
-	// Set limits for the collection.
-	// @dev Throws error if limit not found.
-	// @param limit Name of the limit. Valid names:
-	// 	"ownerCanTransfer",
-	// 	"ownerCanDestroy",
-	// 	"transfersEnabled"
-	// @param value Value of the limit.
-	//
-	// Selector: setCollectionLimit(string,bool) 993b7fba
-	function setCollectionLimit(string memory limit, bool value) public {
+	/// @notice A distinct Uniform Resource Identifier (URI) for a given asset.
+	///
+	/// @dev If the token has a `url` property and it is not empty, it is returned.
+	///  Else If the collection does not have a property with key `schemaName` or its value is not equal to `ERC721Metadata`, it return an error `tokenURI not set`.
+	///  If the collection property `baseURI` is empty or absent, return "" (empty string)
+	///  otherwise, if token property `suffix` present and is non-empty, return concatenation of baseURI and suffix
+	///  otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings).
+	///
+	/// @return token's const_metadata
+	/// @dev EVM selector for this function is: 0xc87b56dd,
+	///  or in textual repr: tokenURI(uint256)
+	function tokenURI(uint256 tokenId) public view returns (string memory) {
 		require(false, stub_error);
-		limit;
-		value;
-		dummy = 0;
-	}
-
-	// Get contract address.
-	//
-	// Selector: contractAddress() f6b4dfb4
-	function contractAddress() public view returns (address) {
-		require(false, stub_error);
+		tokenId;
 		dummy;
-		return 0x0000000000000000000000000000000000000000;
+		return "";
 	}
+}
 
-	// Add collection admin by substrate address.
-	// @param new_admin Substrate administrator address.
-	//
-	// Selector: addCollectionAdminSubstrate(uint256) 5730062b
-	function addCollectionAdminSubstrate(uint256 newAdmin) public {
-		require(false, stub_error);
-		newAdmin;
-		dummy = 0;
-	}
+/// @dev inlined interface
+contract ERC721Events {
+	event Transfer(
+		address indexed from,
+		address indexed to,
+		uint256 indexed tokenId
+	);
+	event Approval(
+		address indexed owner,
+		address indexed approved,
+		uint256 indexed tokenId
+	);
+	event ApprovalForAll(
+		address indexed owner,
+		address indexed operator,
+		bool approved
+	);
+}
 
-	// Remove collection admin by substrate address.
-	// @param admin Substrate administrator address.
-	//
-	// Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9
-	function removeCollectionAdminSubstrate(uint256 admin) public {
+/// @title ERC-721 Non-Fungible Token Standard
+/// @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md
+/// @dev the ERC-165 identifier for this interface is 0x80ac58cd
+contract ERC721 is Dummy, ERC165, ERC721Events {
+	/// @notice Count all NFTs assigned to an owner
+	/// @dev NFTs assigned to the zero address are considered invalid, and this
+	///  function throws for queries about the zero address.
+	/// @param owner An address for whom to query the balance
+	/// @return The number of NFTs owned by `owner`, possibly zero
+	/// @dev EVM selector for this function is: 0x70a08231,
+	///  or in textual repr: balanceOf(address)
+	function balanceOf(address owner) public view returns (uint256) {
 		require(false, stub_error);
-		admin;
-		dummy = 0;
+		owner;
+		dummy;
+		return 0;
 	}
 
-	// Add collection admin.
-	// @param new_admin Address of the added administrator.
-	//
-	// Selector: addCollectionAdmin(address) 92e462c7
-	function addCollectionAdmin(address newAdmin) public {
+	/// @notice Find the owner of an NFT
+	/// @dev NFTs assigned to zero address are considered invalid, and queries
+	///  about them do throw.
+	/// @param tokenId The identifier for an NFT
+	/// @return The address of the owner of the NFT
+	/// @dev EVM selector for this function is: 0x6352211e,
+	///  or in textual repr: ownerOf(uint256)
+	function ownerOf(uint256 tokenId) public view returns (address) {
 		require(false, stub_error);
-		newAdmin;
-		dummy = 0;
+		tokenId;
+		dummy;
+		return 0x0000000000000000000000000000000000000000;
 	}
 
-	// Remove collection admin.
-	//
-	// @param new_admin Address of the removed administrator.
-	//
-	// Selector: removeCollectionAdmin(address) fafd7b42
-	function removeCollectionAdmin(address admin) public {
+	/// @dev Not implemented
+	/// @dev EVM selector for this function is: 0xb88d4fde,
+	///  or in textual repr: safeTransferFrom(address,address,uint256,bytes)
+	function safeTransferFrom(
+		address from,
+		address to,
+		uint256 tokenId,
+		bytes memory data
+	) public {
 		require(false, stub_error);
-		admin;
+		from;
+		to;
+		tokenId;
+		data;
 		dummy = 0;
 	}
 
-	// Toggle accessibility of collection nesting.
-	//
-	// @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'
-	//
-	// Selector: setCollectionNesting(bool) 112d4586
-	function setCollectionNesting(bool enable) public {
+	/// @dev Not implemented
+	/// @dev EVM selector for this function is: 0x42842e0e,
+	///  or in textual repr: safeTransferFrom(address,address,uint256)
+	function safeTransferFrom(
+		address from,
+		address to,
+		uint256 tokenId
+	) public {
 		require(false, stub_error);
-		enable;
+		from;
+		to;
+		tokenId;
 		dummy = 0;
 	}
 
-	// Toggle accessibility of collection nesting.
-	//
-	// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'
-	// @param collections Addresses of collections that will be available for nesting.
-	//
-	// Selector: setCollectionNesting(bool,address[]) 64872396
-	function setCollectionNesting(bool enable, address[] memory collections)
-		public
-	{
+	/// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE
+	///  TO CONFIRM THAT `to` IS CAPABLE OF RECEIVING NFTS OR ELSE
+	///  THEY MAY BE PERMANENTLY LOST
+	/// @dev Throws unless `msg.sender` is the current owner or an authorized
+	///  operator for this NFT. Throws if `from` is not the current owner. Throws
+	///  if `to` is the zero address. Throws if `tokenId` is not a valid NFT.
+	/// @param from The current owner of the NFT
+	/// @param to The new owner
+	/// @param tokenId The NFT to transfer
+	/// @dev EVM selector for this function is: 0x23b872dd,
+	///  or in textual repr: transferFrom(address,address,uint256)
+	function transferFrom(
+		address from,
+		address to,
+		uint256 tokenId
+	) public {
 		require(false, stub_error);
-		enable;
-		collections;
+		from;
+		to;
+		tokenId;
 		dummy = 0;
 	}
 
-	// Set the collection access method.
-	// @param mode Access mode
-	// 	0 for Normal
-	// 	1 for AllowList
-	//
-	// Selector: setCollectionAccess(uint8) 41835d4c
-	function setCollectionAccess(uint8 mode) public {
+	/// @notice Set or reaffirm the approved address for an NFT
+	/// @dev The zero address indicates there is no approved address.
+	/// @dev Throws unless `msg.sender` is the current NFT owner, or an authorized
+	///  operator of the current owner.
+	/// @param approved The new approved NFT controller
+	/// @param tokenId The NFT to approve
+	/// @dev EVM selector for this function is: 0x095ea7b3,
+	///  or in textual repr: approve(address,uint256)
+	function approve(address approved, uint256 tokenId) public {
 		require(false, stub_error);
-		mode;
+		approved;
+		tokenId;
 		dummy = 0;
 	}
 
-	// Add the user to the allowed list.
-	//
-	// @param user Address of a trusted user.
-	//
-	// Selector: addToCollectionAllowList(address) 67844fe6
-	function addToCollectionAllowList(address user) public {
+	/// @dev Not implemented
+	/// @dev EVM selector for this function is: 0xa22cb465,
+	///  or in textual repr: setApprovalForAll(address,bool)
+	function setApprovalForAll(address operator, bool approved) public {
 		require(false, stub_error);
-		user;
-		dummy = 0;
-	}
-
-	// Remove the user from the allowed list.
-	//
-	// @param user Address of a removed user.
-	//
-	// Selector: removeFromCollectionAllowList(address) 85c51acb
-	function removeFromCollectionAllowList(address user) public {
-		require(false, stub_error);
-		user;
+		operator;
+		approved;
 		dummy = 0;
 	}
 
-	// Switch permission for minting.
-	//
-	// @param mode Enable if "true".
-	//
-	// Selector: setCollectionMintMode(bool) 00018e84
-	function setCollectionMintMode(bool mode) public {
+	/// @dev Not implemented
+	/// @dev EVM selector for this function is: 0x081812fc,
+	///  or in textual repr: getApproved(uint256)
+	function getApproved(uint256 tokenId) public view returns (address) {
 		require(false, stub_error);
-		mode;
-		dummy = 0;
-	}
-
-	// Check that account is the owner or admin of the collection
-	//
-	// @param user account to verify
-	// @return "true" if account is the owner or admin
-	//
-	// Selector: isOwnerOrAdmin(address) 9811b0c7
-	function isOwnerOrAdmin(address user) public view returns (bool) {
-		require(false, stub_error);
-		user;
+		tokenId;
 		dummy;
-		return false;
+		return 0x0000000000000000000000000000000000000000;
 	}
 
-	// Check that substrate account is the owner or admin of the collection
-	//
-	// @param user account to verify
-	// @return "true" if account is the owner or admin
-	//
-	// Selector: isOwnerOrAdminSubstrate(uint256) 68910e00
-	function isOwnerOrAdminSubstrate(uint256 user) public view returns (bool) {
+	/// @dev Not implemented
+	/// @dev EVM selector for this function is: 0xe985e9c5,
+	///  or in textual repr: isApprovedForAll(address,address)
+	function isApprovedForAll(address owner, address operator)
+		public
+		view
+		returns (address)
+	{
 		require(false, stub_error);
-		user;
+		owner;
+		operator;
 		dummy;
-		return false;
-	}
-
-	// Returns collection type
-	//
-	// @return `Fungible` or `NFT` or `ReFungible`
-	//
-	// Selector: uniqueCollectionType() d34b55b8
-	function uniqueCollectionType() public returns (string memory) {
-		require(false, stub_error);
-		dummy = 0;
-		return "";
-	}
-
-	// Changes collection owner to another account
-	//
-	// @dev Owner can be changed only by current owner
-	// @param newOwner new owner account
-	//
-	// Selector: setOwner(address) 13af4035
-	function setOwner(address newOwner) public {
-		require(false, stub_error);
-		newOwner;
-		dummy = 0;
-	}
-
-	// Changes collection owner to another substrate account
-	//
-	// @dev Owner can be changed only by current owner
-	// @param newOwner new owner substrate account
-	//
-	// Selector: setOwnerSubstrate(uint256) b212138f
-	function setOwnerSubstrate(uint256 newOwner) public {
-		require(false, stub_error);
-		newOwner;
-		dummy = 0;
+		return 0x0000000000000000000000000000000000000000;
 	}
 }
 
modifiedpallets/refungible/src/erc.rsdiffbeforeafterboth
--- a/pallets/refungible/src/erc.rs
+++ b/pallets/refungible/src/erc.rs
@@ -53,14 +53,14 @@
 pub const ADDRESS_FOR_PARTIALLY_OWNED_TOKENS: H160 = H160::repeat_byte(0xff);
 
 /// @title A contract that allows to set and delete token properties and change token property permissions.
-#[solidity_interface(name = "TokenProperties")]
+#[solidity_interface(name = TokenProperties)]
 impl<T: Config> RefungibleHandle<T> {
 	/// @notice Set permissions for token property.
 	/// @dev Throws error if `msg.sender` is not admin or owner of the collection.
 	/// @param key Property key.
-	/// @param is_mutable Permission to mutate property.
-	/// @param collection_admin Permission to mutate property by collection admin if property is mutable.
-	/// @param token_owner Permission to mutate property by token owner if property is mutable.
+	/// @param isMutable Permission to mutate property.
+	/// @param collectionAdmin Permission to mutate property by collection admin if property is mutable.
+	/// @param tokenOwner Permission to mutate property by token owner if property is mutable.
 	fn set_token_property_permission(
 		&mut self,
 		caller: caller,
@@ -197,7 +197,7 @@
 	MintingFinished {},
 }
 
-#[solidity_interface(name = "ERC721Metadata")]
+#[solidity_interface(name = ERC721Metadata)]
 impl<T: Config> RefungibleHandle<T> {
 	/// @notice A descriptive name for a collection of RFTs in this contract
 	fn name(&self) -> Result<string> {
@@ -258,7 +258,7 @@
 
 /// @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
 /// @dev See https://eips.ethereum.org/EIPS/eip-721
-#[solidity_interface(name = "ERC721Enumerable")]
+#[solidity_interface(name = ERC721Enumerable)]
 impl<T: Config> RefungibleHandle<T> {
 	/// @notice Enumerate valid RFTs
 	/// @param index A counter less than `totalSupply()`
@@ -285,7 +285,7 @@
 
 /// @title ERC-721 Non-Fungible Token Standard
 /// @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md
-#[solidity_interface(name = "ERC721", events(ERC721Events))]
+#[solidity_interface(name = ERC721, events(ERC721Events))]
 impl<T: Config> RefungibleHandle<T> {
 	/// @notice Count all RFTs assigned to an owner
 	/// @dev RFTs assigned to the zero address are considered invalid, and this
@@ -322,7 +322,6 @@
 		_to: address,
 		_token_id: uint256,
 		_data: bytes,
-		_value: value,
 	) -> Result<void> {
 		// TODO: Not implemetable
 		Err("not implemented".into())
@@ -334,7 +333,6 @@
 		_from: address,
 		_to: address,
 		_token_id: uint256,
-		_value: value,
 	) -> Result<void> {
 		// TODO: Not implemetable
 		Err("not implemented".into())
@@ -350,7 +348,6 @@
 	/// @param from The current owner of the NFT
 	/// @param to The new owner
 	/// @param tokenId The NFT to transfer
-	/// @param _value Not used for an NFT
 	#[weight(<SelfWeightOf<T>>::transfer_from_creating_removing())]
 	fn transfer_from(
 		&mut self,
@@ -358,7 +355,6 @@
 		from: address,
 		to: address,
 		token_id: uint256,
-		_value: value,
 	) -> Result<void> {
 		let caller = T::CrossAccountId::from_eth(caller);
 		let from = T::CrossAccountId::from_eth(from);
@@ -378,13 +374,7 @@
 	}
 
 	/// @dev Not implemented
-	fn approve(
-		&mut self,
-		_caller: caller,
-		_approved: address,
-		_token_id: uint256,
-		_value: value,
-	) -> Result<void> {
+	fn approve(&mut self, _caller: caller, _approved: address, _token_id: uint256) -> Result<void> {
 		Err("not implemented".into())
 	}
 
@@ -438,7 +428,7 @@
 }
 
 /// @title ERC721 Token that can be irreversibly burned (destroyed).
-#[solidity_interface(name = "ERC721Burnable")]
+#[solidity_interface(name = ERC721Burnable)]
 impl<T: Config> RefungibleHandle<T> {
 	/// @notice Burns a specific ERC721 token.
 	/// @dev Throws unless `msg.sender` is the current RFT owner, or an authorized
@@ -458,7 +448,7 @@
 }
 
 /// @title ERC721 minting logic.
-#[solidity_interface(name = "ERC721Mintable", events(ERC721MintableEvents))]
+#[solidity_interface(name = ERC721Mintable, events(ERC721MintableEvents))]
 impl<T: Config> RefungibleHandle<T> {
 	fn minting_finished(&self) -> Result<bool> {
 		Ok(false)
@@ -616,7 +606,7 @@
 }
 
 /// @title Unique extensions for ERC721.
-#[solidity_interface(name = "ERC721UniqueExtensions")]
+#[solidity_interface(name = ERC721UniqueExtensions)]
 impl<T: Config> RefungibleHandle<T> {
 	/// @notice Transfer ownership of an RFT
 	/// @dev Throws unless `msg.sender` is the current owner. Throws if `to`
@@ -624,15 +614,8 @@
 	///  Throws if RFT pieces have multiple owners.
 	/// @param to The new owner
 	/// @param tokenId The RFT to transfer
-	/// @param _value Not used for an RFT
 	#[weight(<SelfWeightOf<T>>::transfer_creating_removing())]
-	fn transfer(
-		&mut self,
-		caller: caller,
-		to: address,
-		token_id: uint256,
-		_value: value,
-	) -> Result<void> {
+	fn transfer(&mut self, caller: caller, to: address, token_id: uint256) -> Result<void> {
 		let caller = T::CrossAccountId::from_eth(caller);
 		let to = T::CrossAccountId::from_eth(to);
 		let token = token_id.try_into()?;
@@ -655,15 +638,8 @@
 	///  Throws if RFT pieces have multiple owners.
 	/// @param from The current owner of the RFT
 	/// @param tokenId The RFT to transfer
-	/// @param _value Not used for an RFT
 	#[weight(<SelfWeightOf<T>>::burn_from())]
-	fn burn_from(
-		&mut self,
-		caller: caller,
-		from: address,
-		token_id: uint256,
-		_value: value,
-	) -> Result<void> {
+	fn burn_from(&mut self, caller: caller, from: address, token_id: uint256) -> Result<void> {
 		let caller = T::CrossAccountId::from_eth(caller);
 		let from = T::CrossAccountId::from_eth(from);
 		let token = token_id.try_into()?;
@@ -801,7 +777,7 @@
 }
 
 #[solidity_interface(
-	name = "UniqueRefungible",
+	name = UniqueRefungible,
 	is(
 		ERC721,
 		ERC721Metadata,
@@ -809,7 +785,7 @@
 		ERC721UniqueExtensions,
 		ERC721Mintable,
 		ERC721Burnable,
-		via("CollectionHandle<T>", common_mut, Collection),
+		Collection(common_mut, CollectionHandle<T>),
 		TokenProperties,
 	)
 )]
modifiedpallets/refungible/src/erc_token.rsdiffbeforeafterboth
--- a/pallets/refungible/src/erc_token.rs
+++ b/pallets/refungible/src/erc_token.rs
@@ -49,7 +49,7 @@
 
 pub struct RefungibleTokenHandle<T: Config>(pub RefungibleHandle<T>, pub TokenId);
 
-#[solidity_interface(name = "ERC1633")]
+#[solidity_interface(name = ERC1633)]
 impl<T: Config> RefungibleTokenHandle<T> {
 	fn parent_token(&self) -> Result<address> {
 		self.consume_store_reads(2)?;
@@ -87,7 +87,7 @@
 	}
 }
 
-#[solidity_interface(name = "ERC1633UniqueExtensions")]
+#[solidity_interface(name = ERC1633UniqueExtensions)]
 impl<T: Config> RefungibleTokenHandle<T> {
 	#[solidity(rename_selector = "setParentNFT")]
 	#[weight(<CommonWeights<T>>::token_owner() + <SelfWeightOf<T>>::set_parent_nft_unchecked())]
@@ -137,7 +137,7 @@
 ///
 /// @dev Implementation of the basic standard token.
 /// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
-#[solidity_interface(name = "ERC20", events(ERC20Events))]
+#[solidity_interface(name = ERC20, events(ERC20Events))]
 impl<T: Config> RefungibleTokenHandle<T> {
 	/// @return the name of the token.
 	fn name(&self) -> Result<string> {
@@ -246,7 +246,7 @@
 	}
 }
 
-#[solidity_interface(name = "ERC20UniqueExtensions")]
+#[solidity_interface(name = ERC20UniqueExtensions)]
 impl<T: Config> RefungibleTokenHandle<T> {
 	/// @dev Function that burns an amount of the token of a given account,
 	/// deducting from the sender's allowance for said account.
@@ -306,7 +306,7 @@
 }
 
 #[solidity_interface(
-	name = "UniqueRefungibleToken",
+	name = UniqueRefungibleToken,
 	is(ERC20, ERC20UniqueExtensions, ERC1633, ERC1633UniqueExtensions)
 )]
 impl<T: Config> RefungibleTokenHandle<T> where T::AccountId: From<[u8; 32]> {}
modifiedpallets/refungible/src/stubs/UniqueRefungible.rawdiffbeforeafterboth

binary blob — no preview

modifiedpallets/refungible/src/stubs/UniqueRefungible.soldiffbeforeafterboth
--- a/pallets/refungible/src/stubs/UniqueRefungible.sol
+++ b/pallets/refungible/src/stubs/UniqueRefungible.sol
@@ -3,13 +3,7 @@
 
 pragma solidity >=0.8.0 <0.9.0;
 
-// Anonymous struct
-struct Tuple0 {
-	uint256 field_0;
-	string field_1;
-}
-
-// Common stubs holder
+/// @dev common stubs holder
 contract Dummy {
 	uint8 dummy;
 	string stub_error = "this contract is implemented in native";
@@ -27,40 +21,17 @@
 	}
 }
 
-// Inline
-contract ERC721Events {
-	event Transfer(
-		address indexed from,
-		address indexed to,
-		uint256 indexed tokenId
-	);
-	event Approval(
-		address indexed owner,
-		address indexed approved,
-		uint256 indexed tokenId
-	);
-	event ApprovalForAll(
-		address indexed owner,
-		address indexed operator,
-		bool approved
-	);
-}
-
-// Inline
-contract ERC721MintableEvents {
-	event MintingFinished();
-}
-
-// Selector: 41369377
+/// @title A contract that allows to set and delete token properties and change token property permissions.
+/// @dev the ERC-165 identifier for this interface is 0x41369377
 contract TokenProperties is Dummy, ERC165 {
-	// @notice Set permissions for token property.
-	// @dev Throws error if `msg.sender` is not admin or owner of the collection.
-	// @param key Property key.
-	// @param is_mutable Permission to mutate property.
-	// @param collection_admin Permission to mutate property by collection admin if property is mutable.
-	// @param token_owner Permission to mutate property by token owner if property is mutable.
-	//
-	// Selector: setTokenPropertyPermission(string,bool,bool,bool) 222d97fa
+	/// @notice Set permissions for token property.
+	/// @dev Throws error if `msg.sender` is not admin or owner of the collection.
+	/// @param key Property key.
+	/// @param isMutable Permission to mutate property.
+	/// @param collectionAdmin Permission to mutate property by collection admin if property is mutable.
+	/// @param tokenOwner Permission to mutate property by token owner if property is mutable.
+	/// @dev EVM selector for this function is: 0x222d97fa,
+	///  or in textual repr: setTokenPropertyPermission(string,bool,bool,bool)
 	function setTokenPropertyPermission(
 		string memory key,
 		bool isMutable,
@@ -75,13 +46,13 @@
 		dummy = 0;
 	}
 
-	// @notice Set token property value.
-	// @dev Throws error if `msg.sender` has no permission to edit the property.
-	// @param tokenId ID of the token.
-	// @param key Property key.
-	// @param value Property value.
-	//
-	// Selector: setProperty(uint256,string,bytes) 1752d67b
+	/// @notice Set token property value.
+	/// @dev Throws error if `msg.sender` has no permission to edit the property.
+	/// @param tokenId ID of the token.
+	/// @param key Property key.
+	/// @param value Property value.
+	/// @dev EVM selector for this function is: 0x1752d67b,
+	///  or in textual repr: setProperty(uint256,string,bytes)
 	function setProperty(
 		uint256 tokenId,
 		string memory key,
@@ -94,12 +65,12 @@
 		dummy = 0;
 	}
 
-	// @notice Delete token property value.
-	// @dev Throws error if `msg.sender` has no permission to edit the property.
-	// @param tokenId ID of the token.
-	// @param key Property key.
-	//
-	// Selector: deleteProperty(uint256,string) 066111d1
+	/// @notice Delete token property value.
+	/// @dev Throws error if `msg.sender` has no permission to edit the property.
+	/// @param tokenId ID of the token.
+	/// @param key Property key.
+	/// @dev EVM selector for this function is: 0x066111d1,
+	///  or in textual repr: deleteProperty(uint256,string)
 	function deleteProperty(uint256 tokenId, string memory key) public {
 		require(false, stub_error);
 		tokenId;
@@ -107,13 +78,13 @@
 		dummy = 0;
 	}
 
-	// @notice Get token property value.
-	// @dev Throws error if key not found
-	// @param tokenId ID of the token.
-	// @param key Property key.
-	// @return Property value bytes
-	//
-	// Selector: property(uint256,string) 7228c327
+	/// @notice Get token property value.
+	/// @dev Throws error if key not found
+	/// @param tokenId ID of the token.
+	/// @param key Property key.
+	/// @return Property value bytes
+	/// @dev EVM selector for this function is: 0x7228c327,
+	///  or in textual repr: property(uint256,string)
 	function property(uint256 tokenId, string memory key)
 		public
 		view
@@ -127,211 +98,334 @@
 	}
 }
 
-// Selector: 42966c68
-contract ERC721Burnable is Dummy, ERC165 {
-	// @notice Burns a specific ERC721 token.
-	// @dev Throws unless `msg.sender` is the current RFT owner, or an authorized
-	//  operator of the current owner.
-	// @param tokenId The RFT to approve
-	//
-	// Selector: burn(uint256) 42966c68
-	function burn(uint256 tokenId) public {
+/// @title A contract that allows you to work with collections.
+/// @dev the ERC-165 identifier for this interface is 0xffe4da23
+contract Collection is Dummy, ERC165 {
+	/// Set collection property.
+	///
+	/// @param key Property key.
+	/// @param value Propery value.
+	/// @dev EVM selector for this function is: 0x2f073f66,
+	///  or in textual repr: setCollectionProperty(string,bytes)
+	function setCollectionProperty(string memory key, bytes memory value)
+		public
+	{
 		require(false, stub_error);
-		tokenId;
+		key;
+		value;
 		dummy = 0;
 	}
-}
 
-// Selector: 58800161
-contract ERC721 is Dummy, ERC165, ERC721Events {
-	// @notice Count all RFTs assigned to an owner
-	// @dev RFTs assigned to the zero address are considered invalid, and this
-	//  function throws for queries about the zero address.
-	// @param owner An address for whom to query the balance
-	// @return The number of RFTs owned by `owner`, possibly zero
-	//
-	// Selector: balanceOf(address) 70a08231
-	function balanceOf(address owner) public view returns (uint256) {
+	/// Delete collection property.
+	///
+	/// @param key Property key.
+	/// @dev EVM selector for this function is: 0x7b7debce,
+	///  or in textual repr: deleteCollectionProperty(string)
+	function deleteCollectionProperty(string memory key) public {
 		require(false, stub_error);
-		owner;
-		dummy;
-		return 0;
+		key;
+		dummy = 0;
 	}
 
-	// @notice Find the owner of an RFT
-	// @dev RFTs assigned to zero address are considered invalid, and queries
-	//  about them do throw.
-	//  Returns special 0xffffffffffffffffffffffffffffffffffffffff address for
-	//  the tokens that are partially owned.
-	// @param tokenId The identifier for an RFT
-	// @return The address of the owner of the RFT
-	//
-	// Selector: ownerOf(uint256) 6352211e
-	function ownerOf(uint256 tokenId) public view returns (address) {
+	/// Get collection property.
+	///
+	/// @dev Throws error if key not found.
+	///
+	/// @param key Property key.
+	/// @return bytes The property corresponding to the key.
+	/// @dev EVM selector for this function is: 0xcf24fd6d,
+	///  or in textual repr: collectionProperty(string)
+	function collectionProperty(string memory key)
+		public
+		view
+		returns (bytes memory)
+	{
 		require(false, stub_error);
-		tokenId;
+		key;
 		dummy;
-		return 0x0000000000000000000000000000000000000000;
+		return hex"";
 	}
 
-	// @dev Not implemented
-	//
-	// Selector: safeTransferFromWithData(address,address,uint256,bytes) 60a11672
-	function safeTransferFromWithData(
-		address from,
-		address to,
-		uint256 tokenId,
-		bytes memory data
-	) public {
+	/// Set the sponsor of the collection.
+	///
+	/// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor.
+	///
+	/// @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract.
+	/// @dev EVM selector for this function is: 0x7623402e,
+	///  or in textual repr: setCollectionSponsor(address)
+	function setCollectionSponsor(address sponsor) public {
 		require(false, stub_error);
-		from;
-		to;
-		tokenId;
-		data;
+		sponsor;
 		dummy = 0;
 	}
 
-	// @dev Not implemented
-	//
-	// Selector: safeTransferFrom(address,address,uint256) 42842e0e
-	function safeTransferFrom(
-		address from,
-		address to,
-		uint256 tokenId
-	) public {
+	/// Collection sponsorship confirmation.
+	///
+	/// @dev After setting the sponsor for the collection, it must be confirmed with this function.
+	/// @dev EVM selector for this function is: 0x3c50e97a,
+	///  or in textual repr: confirmCollectionSponsorship()
+	function confirmCollectionSponsorship() public {
 		require(false, stub_error);
-		from;
-		to;
-		tokenId;
 		dummy = 0;
 	}
 
-	// @notice Transfer ownership of an RFT -- THE CALLER IS RESPONSIBLE
-	//  TO CONFIRM THAT `to` IS CAPABLE OF RECEIVING NFTS OR ELSE
-	//  THEY MAY BE PERMANENTLY LOST
-	// @dev Throws unless `msg.sender` is the current owner or an authorized
-	//  operator for this RFT. Throws if `from` is not the current owner. Throws
-	//  if `to` is the zero address. Throws if `tokenId` is not a valid RFT.
-	//  Throws if RFT pieces have multiple owners.
-	// @param from The current owner of the NFT
-	// @param to The new owner
-	// @param tokenId The NFT to transfer
-	// @param _value Not used for an NFT
-	//
-	// Selector: transferFrom(address,address,uint256) 23b872dd
-	function transferFrom(
-		address from,
-		address to,
-		uint256 tokenId
-	) public {
+	/// Set limits for the collection.
+	/// @dev Throws error if limit not found.
+	/// @param limit Name of the limit. Valid names:
+	/// 	"accountTokenOwnershipLimit",
+	/// 	"sponsoredDataSize",
+	/// 	"sponsoredDataRateLimit",
+	/// 	"tokenLimit",
+	/// 	"sponsorTransferTimeout",
+	/// 	"sponsorApproveTimeout"
+	/// @param value Value of the limit.
+	/// @dev EVM selector for this function is: 0x6a3841db,
+	///  or in textual repr: setCollectionLimit(string,uint32)
+	function setCollectionLimit(string memory limit, uint32 value) public {
 		require(false, stub_error);
-		from;
-		to;
-		tokenId;
+		limit;
+		value;
 		dummy = 0;
 	}
 
-	// @dev Not implemented
-	//
-	// Selector: approve(address,uint256) 095ea7b3
-	function approve(address approved, uint256 tokenId) public {
+	/// Set limits for the collection.
+	/// @dev Throws error if limit not found.
+	/// @param limit Name of the limit. Valid names:
+	/// 	"ownerCanTransfer",
+	/// 	"ownerCanDestroy",
+	/// 	"transfersEnabled"
+	/// @param value Value of the limit.
+	/// @dev EVM selector for this function is: 0x993b7fba,
+	///  or in textual repr: setCollectionLimit(string,bool)
+	function setCollectionLimit(string memory limit, bool value) public {
 		require(false, stub_error);
-		approved;
-		tokenId;
+		limit;
+		value;
 		dummy = 0;
 	}
 
-	// @dev Not implemented
-	//
-	// Selector: setApprovalForAll(address,bool) a22cb465
-	function setApprovalForAll(address operator, bool approved) public {
+	/// Get contract address.
+	/// @dev EVM selector for this function is: 0xf6b4dfb4,
+	///  or in textual repr: contractAddress()
+	function contractAddress() public view returns (address) {
 		require(false, stub_error);
-		operator;
-		approved;
+		dummy;
+		return 0x0000000000000000000000000000000000000000;
+	}
+
+	/// Add collection admin by substrate address.
+	/// @param newAdmin Substrate administrator address.
+	/// @dev EVM selector for this function is: 0x5730062b,
+	///  or in textual repr: addCollectionAdminSubstrate(uint256)
+	function addCollectionAdminSubstrate(uint256 newAdmin) public {
+		require(false, stub_error);
+		newAdmin;
 		dummy = 0;
 	}
 
-	// @dev Not implemented
-	//
-	// Selector: getApproved(uint256) 081812fc
-	function getApproved(uint256 tokenId) public view returns (address) {
+	/// Remove collection admin by substrate address.
+	/// @param admin Substrate administrator address.
+	/// @dev EVM selector for this function is: 0x4048fcf9,
+	///  or in textual repr: removeCollectionAdminSubstrate(uint256)
+	function removeCollectionAdminSubstrate(uint256 admin) public {
 		require(false, stub_error);
-		tokenId;
-		dummy;
-		return 0x0000000000000000000000000000000000000000;
+		admin;
+		dummy = 0;
 	}
 
-	// @dev Not implemented
-	//
-	// Selector: isApprovedForAll(address,address) e985e9c5
-	function isApprovedForAll(address owner, address operator)
+	/// Add collection admin.
+	/// @param newAdmin Address of the added administrator.
+	/// @dev EVM selector for this function is: 0x92e462c7,
+	///  or in textual repr: addCollectionAdmin(address)
+	function addCollectionAdmin(address newAdmin) public {
+		require(false, stub_error);
+		newAdmin;
+		dummy = 0;
+	}
+
+	/// Remove collection admin.
+	///
+	/// @param admin Address of the removed administrator.
+	/// @dev EVM selector for this function is: 0xfafd7b42,
+	///  or in textual repr: removeCollectionAdmin(address)
+	function removeCollectionAdmin(address admin) public {
+		require(false, stub_error);
+		admin;
+		dummy = 0;
+	}
+
+	/// Toggle accessibility of collection nesting.
+	///
+	/// @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'
+	/// @dev EVM selector for this function is: 0x112d4586,
+	///  or in textual repr: setCollectionNesting(bool)
+	function setCollectionNesting(bool enable) public {
+		require(false, stub_error);
+		enable;
+		dummy = 0;
+	}
+
+	/// Toggle accessibility of collection nesting.
+	///
+	/// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'
+	/// @param collections Addresses of collections that will be available for nesting.
+	/// @dev EVM selector for this function is: 0x64872396,
+	///  or in textual repr: setCollectionNesting(bool,address[])
+	function setCollectionNesting(bool enable, address[] memory collections)
 		public
-		view
-		returns (address)
 	{
 		require(false, stub_error);
-		owner;
-		operator;
+		enable;
+		collections;
+		dummy = 0;
+	}
+
+	/// Set the collection access method.
+	/// @param mode Access mode
+	/// 	0 for Normal
+	/// 	1 for AllowList
+	/// @dev EVM selector for this function is: 0x41835d4c,
+	///  or in textual repr: setCollectionAccess(uint8)
+	function setCollectionAccess(uint8 mode) public {
+		require(false, stub_error);
+		mode;
+		dummy = 0;
+	}
+
+	/// Add the user to the allowed list.
+	///
+	/// @param user Address of a trusted user.
+	/// @dev EVM selector for this function is: 0x67844fe6,
+	///  or in textual repr: addToCollectionAllowList(address)
+	function addToCollectionAllowList(address user) public {
+		require(false, stub_error);
+		user;
+		dummy = 0;
+	}
+
+	/// Remove the user from the allowed list.
+	///
+	/// @param user Address of a removed user.
+	/// @dev EVM selector for this function is: 0x85c51acb,
+	///  or in textual repr: removeFromCollectionAllowList(address)
+	function removeFromCollectionAllowList(address user) public {
+		require(false, stub_error);
+		user;
+		dummy = 0;
+	}
+
+	/// Switch permission for minting.
+	///
+	/// @param mode Enable if "true".
+	/// @dev EVM selector for this function is: 0x00018e84,
+	///  or in textual repr: setCollectionMintMode(bool)
+	function setCollectionMintMode(bool mode) public {
+		require(false, stub_error);
+		mode;
+		dummy = 0;
+	}
+
+	/// Check that account is the owner or admin of the collection
+	///
+	/// @param user account to verify
+	/// @return "true" if account is the owner or admin
+	/// @dev EVM selector for this function is: 0x9811b0c7,
+	///  or in textual repr: isOwnerOrAdmin(address)
+	function isOwnerOrAdmin(address user) public view returns (bool) {
+		require(false, stub_error);
+		user;
 		dummy;
-		return 0x0000000000000000000000000000000000000000;
+		return false;
 	}
-}
 
-// Selector: 5b5e139f
-contract ERC721Metadata is Dummy, ERC165 {
-	// @notice A descriptive name for a collection of RFTs in this contract
-	//
-	// Selector: name() 06fdde03
-	function name() public view returns (string memory) {
+	/// Check that substrate account is the owner or admin of the collection
+	///
+	/// @param user account to verify
+	/// @return "true" if account is the owner or admin
+	/// @dev EVM selector for this function is: 0x68910e00,
+	///  or in textual repr: isOwnerOrAdminSubstrate(uint256)
+	function isOwnerOrAdminSubstrate(uint256 user) public view returns (bool) {
 		require(false, stub_error);
+		user;
 		dummy;
-		return "";
+		return false;
 	}
 
-	// @notice An abbreviated name for RFTs in this contract
-	//
-	// Selector: symbol() 95d89b41
-	function symbol() public view returns (string memory) {
+	/// Returns collection type
+	///
+	/// @return `Fungible` or `NFT` or `ReFungible`
+	/// @dev EVM selector for this function is: 0xd34b55b8,
+	///  or in textual repr: uniqueCollectionType()
+	function uniqueCollectionType() public returns (string memory) {
 		require(false, stub_error);
-		dummy;
+		dummy = 0;
 		return "";
 	}
 
-	// @notice A distinct Uniform Resource Identifier (URI) for a given asset.
-	//
-	// @dev If the token has a `url` property and it is not empty, it is returned.
-	//  Else If the collection does not have a property with key `schemaName` or its value is not equal to `ERC721Metadata`, it return an error `tokenURI not set`.
-	//  If the collection property `baseURI` is empty or absent, return "" (empty string)
-	//  otherwise, if token property `suffix` present and is non-empty, return concatenation of baseURI and suffix
-	//  otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings).
-	//
-	// @return token's const_metadata
-	//
-	// Selector: tokenURI(uint256) c87b56dd
-	function tokenURI(uint256 tokenId) public view returns (string memory) {
+	/// Changes collection owner to another account
+	///
+	/// @dev Owner can be changed only by current owner
+	/// @param newOwner new owner account
+	/// @dev EVM selector for this function is: 0x13af4035,
+	///  or in textual repr: setOwner(address)
+	function setOwner(address newOwner) public {
 		require(false, stub_error);
+		newOwner;
+		dummy = 0;
+	}
+
+	/// Changes collection owner to another substrate account
+	///
+	/// @dev Owner can be changed only by current owner
+	/// @param newOwner new owner substrate account
+	/// @dev EVM selector for this function is: 0xb212138f,
+	///  or in textual repr: setOwnerSubstrate(uint256)
+	function setOwnerSubstrate(uint256 newOwner) public {
+		require(false, stub_error);
+		newOwner;
+		dummy = 0;
+	}
+}
+
+/// @title ERC721 Token that can be irreversibly burned (destroyed).
+/// @dev the ERC-165 identifier for this interface is 0x42966c68
+contract ERC721Burnable is Dummy, ERC165 {
+	/// @notice Burns a specific ERC721 token.
+	/// @dev Throws unless `msg.sender` is the current RFT owner, or an authorized
+	///  operator of the current owner.
+	/// @param tokenId The RFT to approve
+	/// @dev EVM selector for this function is: 0x42966c68,
+	///  or in textual repr: burn(uint256)
+	function burn(uint256 tokenId) public {
+		require(false, stub_error);
 		tokenId;
-		dummy;
-		return "";
+		dummy = 0;
 	}
 }
 
-// Selector: 68ccfe89
+/// @dev inlined interface
+contract ERC721MintableEvents {
+	event MintingFinished();
+}
+
+/// @title ERC721 minting logic.
+/// @dev the ERC-165 identifier for this interface is 0x68ccfe89
 contract ERC721Mintable is Dummy, ERC165, ERC721MintableEvents {
-	// Selector: mintingFinished() 05d2035b
+	/// @dev EVM selector for this function is: 0x05d2035b,
+	///  or in textual repr: mintingFinished()
 	function mintingFinished() public view returns (bool) {
 		require(false, stub_error);
 		dummy;
 		return false;
 	}
 
-	// @notice Function to mint token.
-	// @dev `tokenId` should be obtained with `nextTokenId` method,
-	//  unlike standard, you can't specify it manually
-	// @param to The new owner
-	// @param tokenId ID of the minted RFT
-	//
-	// Selector: mint(address,uint256) 40c10f19
+	/// @notice Function to mint token.
+	/// @dev `tokenId` should be obtained with `nextTokenId` method,
+	///  unlike standard, you can't specify it manually
+	/// @param to The new owner
+	/// @param tokenId ID of the minted RFT
+	/// @dev EVM selector for this function is: 0x40c10f19,
+	///  or in textual repr: mint(address,uint256)
 	function mint(address to, uint256 tokenId) public returns (bool) {
 		require(false, stub_error);
 		to;
@@ -340,14 +434,14 @@
 		return false;
 	}
 
-	// @notice Function to mint token with the given tokenUri.
-	// @dev `tokenId` should be obtained with `nextTokenId` method,
-	//  unlike standard, you can't specify it manually
-	// @param to The new owner
-	// @param tokenId ID of the minted RFT
-	// @param tokenUri Token URI that would be stored in the RFT properties
-	//
-	// Selector: mintWithTokenURI(address,uint256,string) 50bb4e7f
+	/// @notice Function to mint token with the given tokenUri.
+	/// @dev `tokenId` should be obtained with `nextTokenId` method,
+	///  unlike standard, you can't specify it manually
+	/// @param to The new owner
+	/// @param tokenId ID of the minted RFT
+	/// @param tokenUri Token URI that would be stored in the RFT properties
+	/// @dev EVM selector for this function is: 0x50bb4e7f,
+	///  or in textual repr: mintWithTokenURI(address,uint256,string)
 	function mintWithTokenURI(
 		address to,
 		uint256 tokenId,
@@ -361,9 +455,9 @@
 		return false;
 	}
 
-	// @dev Not implemented
-	//
-	// Selector: finishMinting() 7d64bcb4
+	/// @dev Not implemented
+	/// @dev EVM selector for this function is: 0x7d64bcb4,
+	///  or in textual repr: finishMinting()
 	function finishMinting() public returns (bool) {
 		require(false, stub_error);
 		dummy = 0;
@@ -371,59 +465,17 @@
 	}
 }
 
-// Selector: 780e9d63
-contract ERC721Enumerable is Dummy, ERC165 {
-	// @notice Enumerate valid RFTs
-	// @param index A counter less than `totalSupply()`
-	// @return The token identifier for the `index`th NFT,
-	//  (sort order not specified)
-	//
-	// Selector: tokenByIndex(uint256) 4f6ccce7
-	function tokenByIndex(uint256 index) public view returns (uint256) {
-		require(false, stub_error);
-		index;
-		dummy;
-		return 0;
-	}
-
-	// Not implemented
-	//
-	// Selector: tokenOfOwnerByIndex(address,uint256) 2f745c59
-	function tokenOfOwnerByIndex(address owner, uint256 index)
-		public
-		view
-		returns (uint256)
-	{
-		require(false, stub_error);
-		owner;
-		index;
-		dummy;
-		return 0;
-	}
-
-	// @notice Count RFTs tracked by this contract
-	// @return A count of valid RFTs tracked by this contract, where each one of
-	//  them has an assigned and queryable owner not equal to the zero address
-	//
-	// Selector: totalSupply() 18160ddd
-	function totalSupply() public view returns (uint256) {
-		require(false, stub_error);
-		dummy;
-		return 0;
-	}
-}
-
-// Selector: 7c3bef89
+/// @title Unique extensions for ERC721.
+/// @dev the ERC-165 identifier for this interface is 0x7c3bef89
 contract ERC721UniqueExtensions is Dummy, ERC165 {
-	// @notice Transfer ownership of an RFT
-	// @dev Throws unless `msg.sender` is the current owner. Throws if `to`
-	//  is the zero address. Throws if `tokenId` is not a valid RFT.
-	//  Throws if RFT pieces have multiple owners.
-	// @param to The new owner
-	// @param tokenId The RFT to transfer
-	// @param _value Not used for an RFT
-	//
-	// Selector: transfer(address,uint256) a9059cbb
+	/// @notice Transfer ownership of an RFT
+	/// @dev Throws unless `msg.sender` is the current owner. Throws if `to`
+	///  is the zero address. Throws if `tokenId` is not a valid RFT.
+	///  Throws if RFT pieces have multiple owners.
+	/// @param to The new owner
+	/// @param tokenId The RFT to transfer
+	/// @dev EVM selector for this function is: 0xa9059cbb,
+	///  or in textual repr: transfer(address,uint256)
 	function transfer(address to, uint256 tokenId) public {
 		require(false, stub_error);
 		to;
@@ -431,16 +483,15 @@
 		dummy = 0;
 	}
 
-	// @notice Burns a specific ERC721 token.
-	// @dev Throws unless `msg.sender` is the current owner or an authorized
-	//  operator for this RFT. Throws if `from` is not the current owner. Throws
-	//  if `to` is the zero address. Throws if `tokenId` is not a valid RFT.
-	//  Throws if RFT pieces have multiple owners.
-	// @param from The current owner of the RFT
-	// @param tokenId The RFT to transfer
-	// @param _value Not used for an RFT
-	//
-	// Selector: burnFrom(address,uint256) 79cc6790
+	/// @notice Burns a specific ERC721 token.
+	/// @dev Throws unless `msg.sender` is the current owner or an authorized
+	///  operator for this RFT. Throws if `from` is not the current owner. Throws
+	///  if `to` is the zero address. Throws if `tokenId` is not a valid RFT.
+	///  Throws if RFT pieces have multiple owners.
+	/// @param from The current owner of the RFT
+	/// @param tokenId The RFT to transfer
+	/// @dev EVM selector for this function is: 0x79cc6790,
+	///  or in textual repr: burnFrom(address,uint256)
 	function burnFrom(address from, uint256 tokenId) public {
 		require(false, stub_error);
 		from;
@@ -448,22 +499,22 @@
 		dummy = 0;
 	}
 
-	// @notice Returns next free RFT ID.
-	//
-	// Selector: nextTokenId() 75794a3c
+	/// @notice Returns next free RFT ID.
+	/// @dev EVM selector for this function is: 0x75794a3c,
+	///  or in textual repr: nextTokenId()
 	function nextTokenId() public view returns (uint256) {
 		require(false, stub_error);
 		dummy;
 		return 0;
 	}
 
-	// @notice Function to mint multiple tokens.
-	// @dev `tokenIds` should be an array of consecutive numbers and first number
-	//  should be obtained with `nextTokenId` method
-	// @param to The new owner
-	// @param tokenIds IDs of the minted RFTs
-	//
-	// Selector: mintBulk(address,uint256[]) 44a9945e
+	/// @notice Function to mint multiple tokens.
+	/// @dev `tokenIds` should be an array of consecutive numbers and first number
+	///  should be obtained with `nextTokenId` method
+	/// @param to The new owner
+	/// @param tokenIds IDs of the minted RFTs
+	/// @dev EVM selector for this function is: 0x44a9945e,
+	///  or in textual repr: mintBulk(address,uint256[])
 	function mintBulk(address to, uint256[] memory tokenIds)
 		public
 		returns (bool)
@@ -475,14 +526,14 @@
 		return false;
 	}
 
-	// @notice Function to mint multiple tokens with the given tokenUris.
-	// @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive
-	//  numbers and first number should be obtained with `nextTokenId` method
-	// @param to The new owner
-	// @param tokens array of pairs of token ID and token URI for minted tokens
-	//
-	// Selector: mintBulkWithTokenURI(address,(uint256,string)[]) 36543006
-	function mintBulkWithTokenURI(address to, Tuple0[] memory tokens)
+	/// @notice Function to mint multiple tokens with the given tokenUris.
+	/// @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive
+	///  numbers and first number should be obtained with `nextTokenId` method
+	/// @param to The new owner
+	/// @param tokens array of pairs of token ID and token URI for minted tokens
+	/// @dev EVM selector for this function is: 0x36543006,
+	///  or in textual repr: mintBulkWithTokenURI(address,(uint256,string)[])
+	function mintBulkWithTokenURI(address to, Tuple8[] memory tokens)
 		public
 		returns (bool)
 	{
@@ -493,11 +544,11 @@
 		return false;
 	}
 
-	// Returns EVM address for refungible token
-	//
-	// @param token ID of the token
-	//
-	// Selector: tokenContractAddress(uint256) ab76fac6
+	/// Returns EVM address for refungible token
+	///
+	/// @param token ID of the token
+	/// @dev EVM selector for this function is: 0xab76fac6,
+	///  or in textual repr: tokenContractAddress(uint256)
 	function tokenContractAddress(uint256 token) public view returns (address) {
 		require(false, stub_error);
 		token;
@@ -506,291 +557,247 @@
 	}
 }
 
-// Selector: ffe4da23
-contract Collection is Dummy, ERC165 {
-	// Set collection property.
-	//
-	// @param key Property key.
-	// @param value Propery value.
-	//
-	// Selector: setCollectionProperty(string,bytes) 2f073f66
-	function setCollectionProperty(string memory key, bytes memory value)
-		public
-	{
-		require(false, stub_error);
-		key;
-		value;
-		dummy = 0;
-	}
+/// @dev anonymous struct
+struct Tuple8 {
+	uint256 field_0;
+	string field_1;
+}
 
-	// Delete collection property.
-	//
-	// @param key Property key.
-	//
-	// Selector: deleteCollectionProperty(string) 7b7debce
-	function deleteCollectionProperty(string memory key) public {
+/// @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
+/// @dev See https://eips.ethereum.org/EIPS/eip-721
+/// @dev the ERC-165 identifier for this interface is 0x780e9d63
+contract ERC721Enumerable is Dummy, ERC165 {
+	/// @notice Enumerate valid RFTs
+	/// @param index A counter less than `totalSupply()`
+	/// @return The token identifier for the `index`th NFT,
+	///  (sort order not specified)
+	/// @dev EVM selector for this function is: 0x4f6ccce7,
+	///  or in textual repr: tokenByIndex(uint256)
+	function tokenByIndex(uint256 index) public view returns (uint256) {
 		require(false, stub_error);
-		key;
-		dummy = 0;
+		index;
+		dummy;
+		return 0;
 	}
 
-	// Get collection property.
-	//
-	// @dev Throws error if key not found.
-	//
-	// @param key Property key.
-	// @return bytes The property corresponding to the key.
-	//
-	// Selector: collectionProperty(string) cf24fd6d
-	function collectionProperty(string memory key)
+	/// Not implemented
+	/// @dev EVM selector for this function is: 0x2f745c59,
+	///  or in textual repr: tokenOfOwnerByIndex(address,uint256)
+	function tokenOfOwnerByIndex(address owner, uint256 index)
 		public
 		view
-		returns (bytes memory)
+		returns (uint256)
 	{
 		require(false, stub_error);
-		key;
+		owner;
+		index;
 		dummy;
-		return hex"";
+		return 0;
 	}
 
-	// Set the sponsor of the collection.
-	//
-	// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor.
-	//
-	// @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract.
-	//
-	// Selector: setCollectionSponsor(address) 7623402e
-	function setCollectionSponsor(address sponsor) public {
+	/// @notice Count RFTs tracked by this contract
+	/// @return A count of valid RFTs tracked by this contract, where each one of
+	///  them has an assigned and queryable owner not equal to the zero address
+	/// @dev EVM selector for this function is: 0x18160ddd,
+	///  or in textual repr: totalSupply()
+	function totalSupply() public view returns (uint256) {
 		require(false, stub_error);
-		sponsor;
-		dummy = 0;
+		dummy;
+		return 0;
 	}
+}
 
-	// Collection sponsorship confirmation.
-	//
-	// @dev After setting the sponsor for the collection, it must be confirmed with this function.
-	//
-	// Selector: confirmCollectionSponsorship() 3c50e97a
-	function confirmCollectionSponsorship() public {
+/// @dev the ERC-165 identifier for this interface is 0x5b5e139f
+contract ERC721Metadata is Dummy, ERC165 {
+	/// @notice A descriptive name for a collection of RFTs in this contract
+	/// @dev EVM selector for this function is: 0x06fdde03,
+	///  or in textual repr: name()
+	function name() public view returns (string memory) {
 		require(false, stub_error);
-		dummy = 0;
+		dummy;
+		return "";
 	}
 
-	// Set limits for the collection.
-	// @dev Throws error if limit not found.
-	// @param limit Name of the limit. Valid names:
-	// 	"accountTokenOwnershipLimit",
-	// 	"sponsoredDataSize",
-	// 	"sponsoredDataRateLimit",
-	// 	"tokenLimit",
-	// 	"sponsorTransferTimeout",
-	// 	"sponsorApproveTimeout"
-	// @param value Value of the limit.
-	//
-	// Selector: setCollectionLimit(string,uint32) 6a3841db
-	function setCollectionLimit(string memory limit, uint32 value) public {
+	/// @notice An abbreviated name for RFTs in this contract
+	/// @dev EVM selector for this function is: 0x95d89b41,
+	///  or in textual repr: symbol()
+	function symbol() public view returns (string memory) {
 		require(false, stub_error);
-		limit;
-		value;
-		dummy = 0;
+		dummy;
+		return "";
 	}
 
-	// Set limits for the collection.
-	// @dev Throws error if limit not found.
-	// @param limit Name of the limit. Valid names:
-	// 	"ownerCanTransfer",
-	// 	"ownerCanDestroy",
-	// 	"transfersEnabled"
-	// @param value Value of the limit.
-	//
-	// Selector: setCollectionLimit(string,bool) 993b7fba
-	function setCollectionLimit(string memory limit, bool value) public {
+	/// @notice A distinct Uniform Resource Identifier (URI) for a given asset.
+	///
+	/// @dev If the token has a `url` property and it is not empty, it is returned.
+	///  Else If the collection does not have a property with key `schemaName` or its value is not equal to `ERC721Metadata`, it return an error `tokenURI not set`.
+	///  If the collection property `baseURI` is empty or absent, return "" (empty string)
+	///  otherwise, if token property `suffix` present and is non-empty, return concatenation of baseURI and suffix
+	///  otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings).
+	///
+	/// @return token's const_metadata
+	/// @dev EVM selector for this function is: 0xc87b56dd,
+	///  or in textual repr: tokenURI(uint256)
+	function tokenURI(uint256 tokenId) public view returns (string memory) {
 		require(false, stub_error);
-		limit;
-		value;
-		dummy = 0;
-	}
-
-	// Get contract address.
-	//
-	// Selector: contractAddress() f6b4dfb4
-	function contractAddress() public view returns (address) {
-		require(false, stub_error);
+		tokenId;
 		dummy;
-		return 0x0000000000000000000000000000000000000000;
+		return "";
 	}
+}
 
-	// Add collection admin by substrate address.
-	// @param new_admin Substrate administrator address.
-	//
-	// Selector: addCollectionAdminSubstrate(uint256) 5730062b
-	function addCollectionAdminSubstrate(uint256 newAdmin) public {
-		require(false, stub_error);
-		newAdmin;
-		dummy = 0;
-	}
+/// @dev inlined interface
+contract ERC721Events {
+	event Transfer(
+		address indexed from,
+		address indexed to,
+		uint256 indexed tokenId
+	);
+	event Approval(
+		address indexed owner,
+		address indexed approved,
+		uint256 indexed tokenId
+	);
+	event ApprovalForAll(
+		address indexed owner,
+		address indexed operator,
+		bool approved
+	);
+}
 
-	// Remove collection admin by substrate address.
-	// @param admin Substrate administrator address.
-	//
-	// Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9
-	function removeCollectionAdminSubstrate(uint256 admin) public {
+/// @title ERC-721 Non-Fungible Token Standard
+/// @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md
+/// @dev the ERC-165 identifier for this interface is 0x58800161
+contract ERC721 is Dummy, ERC165, ERC721Events {
+	/// @notice Count all RFTs assigned to an owner
+	/// @dev RFTs assigned to the zero address are considered invalid, and this
+	///  function throws for queries about the zero address.
+	/// @param owner An address for whom to query the balance
+	/// @return The number of RFTs owned by `owner`, possibly zero
+	/// @dev EVM selector for this function is: 0x70a08231,
+	///  or in textual repr: balanceOf(address)
+	function balanceOf(address owner) public view returns (uint256) {
 		require(false, stub_error);
-		admin;
-		dummy = 0;
+		owner;
+		dummy;
+		return 0;
 	}
 
-	// Add collection admin.
-	// @param new_admin Address of the added administrator.
-	//
-	// Selector: addCollectionAdmin(address) 92e462c7
-	function addCollectionAdmin(address newAdmin) public {
+	/// @notice Find the owner of an RFT
+	/// @dev RFTs assigned to zero address are considered invalid, and queries
+	///  about them do throw.
+	///  Returns special 0xffffffffffffffffffffffffffffffffffffffff address for
+	///  the tokens that are partially owned.
+	/// @param tokenId The identifier for an RFT
+	/// @return The address of the owner of the RFT
+	/// @dev EVM selector for this function is: 0x6352211e,
+	///  or in textual repr: ownerOf(uint256)
+	function ownerOf(uint256 tokenId) public view returns (address) {
 		require(false, stub_error);
-		newAdmin;
-		dummy = 0;
+		tokenId;
+		dummy;
+		return 0x0000000000000000000000000000000000000000;
 	}
 
-	// Remove collection admin.
-	//
-	// @param new_admin Address of the removed administrator.
-	//
-	// Selector: removeCollectionAdmin(address) fafd7b42
-	function removeCollectionAdmin(address admin) public {
+	/// @dev Not implemented
+	/// @dev EVM selector for this function is: 0x60a11672,
+	///  or in textual repr: safeTransferFromWithData(address,address,uint256,bytes)
+	function safeTransferFromWithData(
+		address from,
+		address to,
+		uint256 tokenId,
+		bytes memory data
+	) public {
 		require(false, stub_error);
-		admin;
+		from;
+		to;
+		tokenId;
+		data;
 		dummy = 0;
 	}
 
-	// Toggle accessibility of collection nesting.
-	//
-	// @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'
-	//
-	// Selector: setCollectionNesting(bool) 112d4586
-	function setCollectionNesting(bool enable) public {
+	/// @dev Not implemented
+	/// @dev EVM selector for this function is: 0x42842e0e,
+	///  or in textual repr: safeTransferFrom(address,address,uint256)
+	function safeTransferFrom(
+		address from,
+		address to,
+		uint256 tokenId
+	) public {
 		require(false, stub_error);
-		enable;
+		from;
+		to;
+		tokenId;
 		dummy = 0;
 	}
 
-	// Toggle accessibility of collection nesting.
-	//
-	// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'
-	// @param collections Addresses of collections that will be available for nesting.
-	//
-	// Selector: setCollectionNesting(bool,address[]) 64872396
-	function setCollectionNesting(bool enable, address[] memory collections)
-		public
-	{
-		require(false, stub_error);
-		enable;
-		collections;
-		dummy = 0;
-	}
-
-	// Set the collection access method.
-	// @param mode Access mode
-	// 	0 for Normal
-	// 	1 for AllowList
-	//
-	// Selector: setCollectionAccess(uint8) 41835d4c
-	function setCollectionAccess(uint8 mode) public {
+	/// @notice Transfer ownership of an RFT -- THE CALLER IS RESPONSIBLE
+	///  TO CONFIRM THAT `to` IS CAPABLE OF RECEIVING NFTS OR ELSE
+	///  THEY MAY BE PERMANENTLY LOST
+	/// @dev Throws unless `msg.sender` is the current owner or an authorized
+	///  operator for this RFT. Throws if `from` is not the current owner. Throws
+	///  if `to` is the zero address. Throws if `tokenId` is not a valid RFT.
+	///  Throws if RFT pieces have multiple owners.
+	/// @param from The current owner of the NFT
+	/// @param to The new owner
+	/// @param tokenId The NFT to transfer
+	/// @dev EVM selector for this function is: 0x23b872dd,
+	///  or in textual repr: transferFrom(address,address,uint256)
+	function transferFrom(
+		address from,
+		address to,
+		uint256 tokenId
+	) public {
 		require(false, stub_error);
-		mode;
-		dummy = 0;
-	}
-
-	// Add the user to the allowed list.
-	//
-	// @param user Address of a trusted user.
-	//
-	// Selector: addToCollectionAllowList(address) 67844fe6
-	function addToCollectionAllowList(address user) public {
-		require(false, stub_error);
-		user;
+		from;
+		to;
+		tokenId;
 		dummy = 0;
 	}
 
-	// Remove the user from the allowed list.
-	//
-	// @param user Address of a removed user.
-	//
-	// Selector: removeFromCollectionAllowList(address) 85c51acb
-	function removeFromCollectionAllowList(address user) public {
+	/// @dev Not implemented
+	/// @dev EVM selector for this function is: 0x095ea7b3,
+	///  or in textual repr: approve(address,uint256)
+	function approve(address approved, uint256 tokenId) public {
 		require(false, stub_error);
-		user;
+		approved;
+		tokenId;
 		dummy = 0;
 	}
 
-	// Switch permission for minting.
-	//
-	// @param mode Enable if "true".
-	//
-	// Selector: setCollectionMintMode(bool) 00018e84
-	function setCollectionMintMode(bool mode) public {
+	/// @dev Not implemented
+	/// @dev EVM selector for this function is: 0xa22cb465,
+	///  or in textual repr: setApprovalForAll(address,bool)
+	function setApprovalForAll(address operator, bool approved) public {
 		require(false, stub_error);
-		mode;
+		operator;
+		approved;
 		dummy = 0;
 	}
 
-	// Check that account is the owner or admin of the collection
-	//
-	// @param user account to verify
-	// @return "true" if account is the owner or admin
-	//
-	// Selector: isOwnerOrAdmin(address) 9811b0c7
-	function isOwnerOrAdmin(address user) public view returns (bool) {
+	/// @dev Not implemented
+	/// @dev EVM selector for this function is: 0x081812fc,
+	///  or in textual repr: getApproved(uint256)
+	function getApproved(uint256 tokenId) public view returns (address) {
 		require(false, stub_error);
-		user;
+		tokenId;
 		dummy;
-		return false;
+		return 0x0000000000000000000000000000000000000000;
 	}
 
-	// Check that substrate account is the owner or admin of the collection
-	//
-	// @param user account to verify
-	// @return "true" if account is the owner or admin
-	//
-	// Selector: isOwnerOrAdminSubstrate(uint256) 68910e00
-	function isOwnerOrAdminSubstrate(uint256 user) public view returns (bool) {
+	/// @dev Not implemented
+	/// @dev EVM selector for this function is: 0xe985e9c5,
+	///  or in textual repr: isApprovedForAll(address,address)
+	function isApprovedForAll(address owner, address operator)
+		public
+		view
+		returns (address)
+	{
 		require(false, stub_error);
-		user;
+		owner;
+		operator;
 		dummy;
-		return false;
-	}
-
-	// Returns collection type
-	//
-	// @return `Fungible` or `NFT` or `ReFungible`
-	//
-	// Selector: uniqueCollectionType() d34b55b8
-	function uniqueCollectionType() public returns (string memory) {
-		require(false, stub_error);
-		dummy = 0;
-		return "";
-	}
-
-	// Changes collection owner to another account
-	//
-	// @dev Owner can be changed only by current owner
-	// @param newOwner new owner account
-	//
-	// Selector: setOwner(address) 13af4035
-	function setOwner(address newOwner) public {
-		require(false, stub_error);
-		newOwner;
-		dummy = 0;
-	}
-
-	// Changes collection owner to another substrate account
-	//
-	// @dev Owner can be changed only by current owner
-	// @param newOwner new owner substrate account
-	//
-	// Selector: setOwnerSubstrate(uint256) b212138f
-	function setOwnerSubstrate(uint256 newOwner) public {
-		require(false, stub_error);
-		newOwner;
-		dummy = 0;
+		return 0x0000000000000000000000000000000000000000;
 	}
 }
 
modifiedpallets/refungible/src/stubs/UniqueRefungibleToken.rawdiffbeforeafterboth

binary blob — no preview

modifiedpallets/refungible/src/stubs/UniqueRefungibleToken.soldiffbeforeafterboth
--- a/pallets/refungible/src/stubs/UniqueRefungibleToken.sol
+++ b/pallets/refungible/src/stubs/UniqueRefungibleToken.sol
@@ -3,7 +3,7 @@
 
 pragma solidity >=0.8.0 <0.9.0;
 
-// Common stubs holder
+/// @dev common stubs holder
 contract Dummy {
 	uint8 dummy;
 	string stub_error = "this contract is implemented in native";
@@ -21,19 +21,10 @@
 	}
 }
 
-// Inline
-contract ERC20Events {
-	event Transfer(address indexed from, address indexed to, uint256 value);
-	event Approval(
-		address indexed owner,
-		address indexed spender,
-		uint256 value
-	);
-}
-
-// Selector: 042f1106
+/// @dev the ERC-165 identifier for this interface is 0x042f1106
 contract ERC1633UniqueExtensions is Dummy, ERC165 {
-	// Selector: setParentNFT(address,uint256) 042f1106
+	/// @dev EVM selector for this function is: 0x042f1106,
+	///  or in textual repr: setParentNFT(address,uint256)
 	function setParentNFT(address collection, uint256 nftId)
 		public
 		returns (bool)
@@ -46,16 +37,18 @@
 	}
 }
 
-// Selector: 5755c3f2
+/// @dev the ERC-165 identifier for this interface is 0x5755c3f2
 contract ERC1633 is Dummy, ERC165 {
-	// Selector: parentToken() 80a54001
+	/// @dev EVM selector for this function is: 0x80a54001,
+	///  or in textual repr: parentToken()
 	function parentToken() public view returns (address) {
 		require(false, stub_error);
 		dummy;
 		return 0x0000000000000000000000000000000000000000;
 	}
 
-	// Selector: parentTokenId() d7f083f3
+	/// @dev EVM selector for this function is: 0xd7f083f3,
+	///  or in textual repr: parentTokenId()
 	function parentTokenId() public view returns (uint256) {
 		require(false, stub_error);
 		dummy;
@@ -63,49 +56,92 @@
 	}
 }
 
-// Selector: 942e8b22
+/// @dev the ERC-165 identifier for this interface is 0xab8deb37
+contract ERC20UniqueExtensions is Dummy, ERC165 {
+	/// @dev Function that burns an amount of the token of a given account,
+	/// deducting from the sender's allowance for said account.
+	/// @param from The account whose tokens will be burnt.
+	/// @param amount The amount that will be burnt.
+	/// @dev EVM selector for this function is: 0x79cc6790,
+	///  or in textual repr: burnFrom(address,uint256)
+	function burnFrom(address from, uint256 amount) public returns (bool) {
+		require(false, stub_error);
+		from;
+		amount;
+		dummy = 0;
+		return false;
+	}
+
+	/// @dev Function that changes total amount of the tokens.
+	///  Throws if `msg.sender` doesn't owns all of the tokens.
+	/// @param amount New total amount of the tokens.
+	/// @dev EVM selector for this function is: 0xd2418ca7,
+	///  or in textual repr: repartition(uint256)
+	function repartition(uint256 amount) public returns (bool) {
+		require(false, stub_error);
+		amount;
+		dummy = 0;
+		return false;
+	}
+}
+
+/// @dev inlined interface
+contract ERC20Events {
+	event Transfer(address indexed from, address indexed to, uint256 value);
+	event Approval(
+		address indexed owner,
+		address indexed spender,
+		uint256 value
+	);
+}
+
+/// @title Standard ERC20 token
+///
+/// @dev Implementation of the basic standard token.
+/// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
+/// @dev the ERC-165 identifier for this interface is 0x942e8b22
 contract ERC20 is Dummy, ERC165, ERC20Events {
-	// @return the name of the token.
-	//
-	// Selector: name() 06fdde03
+	/// @return the name of the token.
+	/// @dev EVM selector for this function is: 0x06fdde03,
+	///  or in textual repr: name()
 	function name() public view returns (string memory) {
 		require(false, stub_error);
 		dummy;
 		return "";
 	}
 
-	// @return the symbol of the token.
-	//
-	// Selector: symbol() 95d89b41
+	/// @return the symbol of the token.
+	/// @dev EVM selector for this function is: 0x95d89b41,
+	///  or in textual repr: symbol()
 	function symbol() public view returns (string memory) {
 		require(false, stub_error);
 		dummy;
 		return "";
 	}
 
-	// @dev Total number of tokens in existence
-	//
-	// Selector: totalSupply() 18160ddd
+	/// @dev Total number of tokens in existence
+	/// @dev EVM selector for this function is: 0x18160ddd,
+	///  or in textual repr: totalSupply()
 	function totalSupply() public view returns (uint256) {
 		require(false, stub_error);
 		dummy;
 		return 0;
 	}
 
-	// @dev Not supported
-	//
-	// Selector: decimals() 313ce567
+	/// @dev Not supported
+	/// @dev EVM selector for this function is: 0x313ce567,
+	///  or in textual repr: decimals()
 	function decimals() public view returns (uint8) {
 		require(false, stub_error);
 		dummy;
 		return 0;
 	}
 
-	// @dev Gets the balance of the specified address.
-	// @param owner The address to query the balance of.
-	// @return An uint256 representing the amount owned by the passed address.
-	//
-	// Selector: balanceOf(address) 70a08231
+	/// @dev Gets the balance of the specified address.
+	/// @param owner The address to query the balance of.
+	/// @return An uint256 representing the amount owned by the passed address.
+	/// @dev EVM selector for this function is: 0x70a08231,
+	///  or in textual repr: balanceOf(address)
 	function balanceOf(address owner) public view returns (uint256) {
 		require(false, stub_error);
 		owner;
@@ -113,11 +149,11 @@
 		return 0;
 	}
 
-	// @dev Transfer token for a specified address
-	// @param to The address to transfer to.
-	// @param amount The amount to be transferred.
-	//
-	// Selector: transfer(address,uint256) a9059cbb
+	/// @dev Transfer token for a specified address
+	/// @param to The address to transfer to.
+	/// @param amount The amount to be transferred.
+	/// @dev EVM selector for this function is: 0xa9059cbb,
+	///  or in textual repr: transfer(address,uint256)
 	function transfer(address to, uint256 amount) public returns (bool) {
 		require(false, stub_error);
 		to;
@@ -126,12 +162,12 @@
 		return false;
 	}
 
-	// @dev Transfer tokens from one address to another
-	// @param from address The address which you want to send tokens from
-	// @param to address The address which you want to transfer to
-	// @param amount uint256 the amount of tokens to be transferred
-	//
-	// Selector: transferFrom(address,address,uint256) 23b872dd
+	/// @dev Transfer tokens from one address to another
+	/// @param from address The address which you want to send tokens from
+	/// @param to address The address which you want to transfer to
+	/// @param amount uint256 the amount of tokens to be transferred
+	/// @dev EVM selector for this function is: 0x23b872dd,
+	///  or in textual repr: transferFrom(address,address,uint256)
 	function transferFrom(
 		address from,
 		address to,
@@ -145,15 +181,15 @@
 		return false;
 	}
 
-	// @dev Approve the passed address to spend the specified amount of tokens on behalf of `msg.sender`.
-	// Beware that changing an allowance with this method brings the risk that someone may use both the old
-	// and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
-	// race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
-	// https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
-	// @param spender The address which will spend the funds.
-	// @param amount The amount of tokens to be spent.
-	//
-	// Selector: approve(address,uint256) 095ea7b3
+	/// @dev Approve the passed address to spend the specified amount of tokens on behalf of `msg.sender`.
+	/// Beware that changing an allowance with this method brings the risk that someone may use both the old
+	/// and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
+	/// race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
+	/// https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
+	/// @param spender The address which will spend the funds.
+	/// @param amount The amount of tokens to be spent.
+	/// @dev EVM selector for this function is: 0x095ea7b3,
+	///  or in textual repr: approve(address,uint256)
 	function approve(address spender, uint256 amount) public returns (bool) {
 		require(false, stub_error);
 		spender;
@@ -162,12 +198,12 @@
 		return false;
 	}
 
-	// @dev Function to check the amount of tokens that an owner allowed to a spender.
-	// @param owner address The address which owns the funds.
-	// @param spender address The address which will spend the funds.
-	// @return A uint256 specifying the amount of tokens still available for the spender.
-	//
-	// Selector: allowance(address,address) dd62ed3e
+	/// @dev Function to check the amount of tokens that an owner allowed to a spender.
+	/// @param owner address The address which owns the funds.
+	/// @param spender address The address which will spend the funds.
+	/// @return A uint256 specifying the amount of tokens still available for the spender.
+	/// @dev EVM selector for this function is: 0xdd62ed3e,
+	///  or in textual repr: allowance(address,address)
 	function allowance(address owner, address spender)
 		public
 		view
@@ -178,35 +214,6 @@
 		spender;
 		dummy;
 		return 0;
-	}
-}
-
-// Selector: ab8deb37
-contract ERC20UniqueExtensions is Dummy, ERC165 {
-	// @dev Function that burns an amount of the token of a given account,
-	// deducting from the sender's allowance for said account.
-	// @param from The account whose tokens will be burnt.
-	// @param amount The amount that will be burnt.
-	//
-	// Selector: burnFrom(address,uint256) 79cc6790
-	function burnFrom(address from, uint256 amount) public returns (bool) {
-		require(false, stub_error);
-		from;
-		amount;
-		dummy = 0;
-		return false;
-	}
-
-	// @dev Function that changes total amount of the tokens.
-	//  Throws if `msg.sender` doesn't owns all of the tokens.
-	// @param amount New total amount of the tokens.
-	//
-	// Selector: repartition(uint256) d2418ca7
-	function repartition(uint256 amount) public returns (bool) {
-		require(false, stub_error);
-		amount;
-		dummy = 0;
-		return false;
 	}
 }
 
modifiedpallets/unique/src/eth/mod.rsdiffbeforeafterboth
--- a/pallets/unique/src/eth/mod.rs
+++ b/pallets/unique/src/eth/mod.rs
@@ -203,7 +203,7 @@
 }
 
 /// @title Contract, which allows users to operate with collections
-#[solidity_interface(name = "CollectionHelpers", events(CollectionHelpersEvents))]
+#[solidity_interface(name = CollectionHelpers, events(CollectionHelpersEvents))]
 impl<T> EvmCollectionHelpers<T>
 where
 	T: Config + pallet_nonfungible::Config + pallet_refungible::Config,
@@ -211,7 +211,7 @@
 	/// Create an NFT collection
 	/// @param name Name of the collection
 	/// @param description Informative description of the collection
-	/// @param token_prefix Token prefix to represent the collection tokens in UI and user applications
+	/// @param tokenPrefix Token prefix to represent the collection tokens in UI and user applications
 	/// @return address Address of the newly created collection
 	#[weight(<SelfWeightOf<T>>::create_collection())]
 	fn create_nonfungible_collection(
@@ -304,7 +304,7 @@
 	}
 
 	/// Check if a collection exists
-	/// @param collection_address Address of the collection in question
+	/// @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> {
 		if let Some(id) = pallet_common::eth::map_eth_to_id(&collection_address) {
modifiedpallets/unique/src/eth/stubs/CollectionHelpers.rawdiffbeforeafterboth

binary blob — no preview

modifiedpallets/unique/src/eth/stubs/CollectionHelpers.soldiffbeforeafterboth
--- a/pallets/unique/src/eth/stubs/CollectionHelpers.sol
+++ b/pallets/unique/src/eth/stubs/CollectionHelpers.sol
@@ -3,7 +3,7 @@
 
 pragma solidity >=0.8.0 <0.9.0;
 
-// Common stubs holder
+/// @dev common stubs holder
 contract Dummy {
 	uint8 dummy;
 	string stub_error = "this contract is implemented in native";
@@ -21,7 +21,7 @@
 	}
 }
 
-// Inline
+/// @dev inlined interface
 contract CollectionHelpersEvents {
 	event CollectionCreated(
 		address indexed owner,
@@ -29,15 +29,16 @@
 	);
 }
 
-// Selector: 675f3074
+/// @title Contract, which allows users to operate with collections
+/// @dev the ERC-165 identifier for this interface is 0x675f3074
 contract CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents {
-	// Create an NFT collection
-	// @param name Name of the collection
-	// @param description Informative description of the collection
-	// @param token_prefix Token prefix to represent the collection tokens in UI and user applications
-	// @return address Address of the newly created collection
-	//
-	// Selector: createNonfungibleCollection(string,string,string) e34a6844
+	/// Create an NFT collection
+	/// @param name Name of the collection
+	/// @param description Informative description of the collection
+	/// @param tokenPrefix Token prefix to represent the collection tokens in UI and user applications
+	/// @return address Address of the newly created collection
+	/// @dev EVM selector for this function is: 0xe34a6844,
+	///  or in textual repr: createNonfungibleCollection(string,string,string)
 	function createNonfungibleCollection(
 		string memory name,
 		string memory description,
@@ -51,7 +52,8 @@
 		return 0x0000000000000000000000000000000000000000;
 	}
 
-	// Selector: createERC721MetadataCompatibleCollection(string,string,string,string) a634a5f9
+	/// @dev EVM selector for this function is: 0xa634a5f9,
+	///  or in textual repr: createERC721MetadataCompatibleCollection(string,string,string,string)
 	function createERC721MetadataCompatibleCollection(
 		string memory name,
 		string memory description,
@@ -67,7 +69,8 @@
 		return 0x0000000000000000000000000000000000000000;
 	}
 
-	// Selector: createRefungibleCollection(string,string,string) 44a68ad5
+	/// @dev EVM selector for this function is: 0x44a68ad5,
+	///  or in textual repr: createRefungibleCollection(string,string,string)
 	function createRefungibleCollection(
 		string memory name,
 		string memory description,
@@ -81,7 +84,8 @@
 		return 0x0000000000000000000000000000000000000000;
 	}
 
-	// Selector: createERC721MetadataCompatibleRFTCollection(string,string,string,string) a5596388
+	/// @dev EVM selector for this function is: 0xa5596388,
+	///  or in textual repr: createERC721MetadataCompatibleRFTCollection(string,string,string,string)
 	function createERC721MetadataCompatibleRFTCollection(
 		string memory name,
 		string memory description,
@@ -97,11 +101,11 @@
 		return 0x0000000000000000000000000000000000000000;
 	}
 
-	// Check if a collection exists
-	// @param collection_address Address of the collection in question
-	// @return bool Does the collection exist?
-	//
-	// Selector: isCollectionExist(address) c3de1494
+	/// Check if a collection exists
+	/// @param collectionAddress Address of the collection in question
+	/// @return bool Does the collection exist?
+	/// @dev EVM selector for this function is: 0xc3de1494,
+	///  or in textual repr: isCollectionExist(address)
 	function isCollectionExist(address collectionAddress)
 		public
 		view
modifiedtests/src/eth/api/CollectionHelpers.soldiffbeforeafterboth
--- a/tests/src/eth/api/CollectionHelpers.sol
+++ b/tests/src/eth/api/CollectionHelpers.sol
@@ -3,7 +3,7 @@
 
 pragma solidity >=0.8.0 <0.9.0;
 
-// Common stubs holder
+/// @dev common stubs holder
 interface Dummy {
 
 }
@@ -12,7 +12,7 @@
 	function supportsInterface(bytes4 interfaceID) external view returns (bool);
 }
 
-// Inline
+/// @dev inlined interface
 interface CollectionHelpersEvents {
 	event CollectionCreated(
 		address indexed owner,
@@ -20,22 +20,24 @@
 	);
 }
 
-// Selector: 675f3074
+/// @title Contract, which allows users to operate with collections
+/// @dev the ERC-165 identifier for this interface is 0x675f3074
 interface CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents {
-	// Create an NFT collection
-	// @param name Name of the collection
-	// @param description Informative description of the collection
-	// @param token_prefix Token prefix to represent the collection tokens in UI and user applications
-	// @return address Address of the newly created collection
-	//
-	// Selector: createNonfungibleCollection(string,string,string) e34a6844
+	/// Create an NFT collection
+	/// @param name Name of the collection
+	/// @param description Informative description of the collection
+	/// @param tokenPrefix Token prefix to represent the collection tokens in UI and user applications
+	/// @return address Address of the newly created collection
+	/// @dev EVM selector for this function is: 0xe34a6844,
+	///  or in textual repr: createNonfungibleCollection(string,string,string)
 	function createNonfungibleCollection(
 		string memory name,
 		string memory description,
 		string memory tokenPrefix
 	) external returns (address);
 
-	// Selector: createERC721MetadataCompatibleCollection(string,string,string,string) a634a5f9
+	/// @dev EVM selector for this function is: 0xa634a5f9,
+	///  or in textual repr: createERC721MetadataCompatibleCollection(string,string,string,string)
 	function createERC721MetadataCompatibleCollection(
 		string memory name,
 		string memory description,
@@ -43,14 +45,16 @@
 		string memory baseUri
 	) external returns (address);
 
-	// Selector: createRefungibleCollection(string,string,string) 44a68ad5
+	/// @dev EVM selector for this function is: 0x44a68ad5,
+	///  or in textual repr: createRefungibleCollection(string,string,string)
 	function createRefungibleCollection(
 		string memory name,
 		string memory description,
 		string memory tokenPrefix
 	) external returns (address);
 
-	// Selector: createERC721MetadataCompatibleRFTCollection(string,string,string,string) a5596388
+	/// @dev EVM selector for this function is: 0xa5596388,
+	///  or in textual repr: createERC721MetadataCompatibleRFTCollection(string,string,string,string)
 	function createERC721MetadataCompatibleRFTCollection(
 		string memory name,
 		string memory description,
@@ -58,11 +62,11 @@
 		string memory baseUri
 	) external returns (address);
 
-	// Check if a collection exists
-	// @param collection_address Address of the collection in question
-	// @return bool Does the collection exist?
-	//
-	// Selector: isCollectionExist(address) c3de1494
+	/// Check if a collection exists
+	/// @param collectionAddress Address of the collection in question
+	/// @return bool Does the collection exist?
+	/// @dev EVM selector for this function is: 0xc3de1494,
+	///  or in textual repr: isCollectionExist(address)
 	function isCollectionExist(address collectionAddress)
 		external
 		view
modifiedtests/src/eth/api/ContractHelpers.soldiffbeforeafterboth
--- a/tests/src/eth/api/ContractHelpers.sol
+++ b/tests/src/eth/api/ContractHelpers.sol
@@ -3,13 +3,13 @@
 
 pragma solidity >=0.8.0 <0.9.0;
 
-// Anonymous struct
+/// @dev anonymous struct
 struct Tuple0 {
 	address field_0;
 	uint256 field_1;
 }
 
-// Common stubs holder
+/// @dev common stubs holder
 interface Dummy {
 
 }
@@ -18,124 +18,124 @@
 	function supportsInterface(bytes4 interfaceID) external view returns (bool);
 }
 
-// Selector: 6073d917
+/// @dev the ERC-165 identifier for this interface is 0x6073d917
 interface ContractHelpers is Dummy, ERC165 {
-	// Get contract ovner
-	//
-	// @param Contract_address contract for which the owner is being determined.
-	// @return Contract owner.
-	//
-	// Selector: contractOwner(address) 5152b14c
+	/// Get contract ovner
+	///
+	/// @param contractAddress contract for which the owner is being determined.
+	/// @return Contract owner.
+	///
+	/// Selector: contractOwner(address) 5152b14c
 	function contractOwner(address contractAddress)
 		external
 		view
 		returns (address);
 
-	// Set sponsor.
-	//
-	// @param contract_address Contract for which a sponsor is being established.
-	// @param sponsor User address who set as pending sponsor.
-	//
-	// Selector: setSponsor(address,address) f01fba93
+	/// Set sponsor.
+	///
+	/// @param contractAddress Contract for which a sponsor is being established.
+	/// @param sponsor User address who set as pending sponsor.
+	///
+	/// Selector: setSponsor(address,address) f01fba93
 	function setSponsor(address contractAddress, address sponsor) external;
 
-	// Set contract as self sponsored.
-	//
-	// @param contract_address Contract for which a self sponsoring is being enabled.
-	//
-	// Selector: selfSponsoredEnable(address) 89f7d9ae
+	/// Set contract as self sponsored.
+	///
+	/// @param contractAddress Contract for which a self sponsoring is being enabled.
+	///
+	/// Selector: selfSponsoredEnable(address) 89f7d9ae
 	function selfSponsoredEnable(address contractAddress) external;
 
-	// Remove sponsor.
-	//
-	// @param contract_address Contract for which a sponsorship is being removed.
-	//
-	// Selector: removeSponsor(address) ef784250
+	/// Remove sponsor.
+	///
+	/// @param contractAddress Contract for which a sponsorship is being removed.
+	///
+	/// Selector: removeSponsor(address) ef784250
 	function removeSponsor(address contractAddress) external;
 
-	// Confirm sponsorship.
-	//
-	// @dev Caller must be same that set via [`set_sponsor`].
-	//
-	// @param contract_address Сontract for which need to confirm sponsorship.
-	//
-	// Selector: confirmSponsorship(address) abc00001
+	/// Confirm sponsorship.
+	///
+	/// @dev Caller must be same that set via [`setSponsor`].
+	///
+	/// @param contractAddress Сontract for which need to confirm sponsorship.
+	///
+	/// Selector: confirmSponsorship(address) abc00001
 	function confirmSponsorship(address contractAddress) external;
 
-	// Get current sponsor.
-	//
-	// @param contract_address The contract for which a sponsor is requested.
-	// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.
-	//
-	// Selector: getSponsor(address) 743fc745
+	/// Get current sponsor.
+	///
+	/// @param contractAddress The contract for which a sponsor is requested.
+	/// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.
+	///
+	/// Selector: getSponsor(address) 743fc745
 	function getSponsor(address contractAddress)
 		external
 		view
 		returns (Tuple0 memory);
 
-	// Check tat contract has confirmed sponsor.
-	//
-	// @param contract_address The contract for which the presence of a confirmed sponsor is checked.
-	// @return **true** if contract has confirmed sponsor.
-	//
-	// Selector: hasSponsor(address) 97418603
+	/// Check tat contract has confirmed sponsor.
+	///
+	/// @param contractAddress The contract for which the presence of a confirmed sponsor is checked.
+	/// @return **true** if contract has confirmed sponsor.
+	///
+	/// Selector: hasSponsor(address) 97418603
 	function hasSponsor(address contractAddress) external view returns (bool);
 
-	// Check tat contract has pending sponsor.
-	//
-	// @param contract_address The contract for which the presence of a pending sponsor is checked.
-	// @return **true** if contract has pending sponsor.
-	//
-	// Selector: hasPendingSponsor(address) 39b9b242
+	/// Check tat contract has pending sponsor.
+	///
+	/// @param contractAddress The contract for which the presence of a pending sponsor is checked.
+	/// @return **true** if contract has pending sponsor.
+	///
+	/// Selector: hasPendingSponsor(address) 39b9b242
 	function hasPendingSponsor(address contractAddress)
 		external
 		view
 		returns (bool);
 
-	// Selector: sponsoringEnabled(address) 6027dc61
+	/// Selector: sponsoringEnabled(address) 6027dc61
 	function sponsoringEnabled(address contractAddress)
 		external
 		view
 		returns (bool);
 
-	// Selector: setSponsoringMode(address,uint8) fde8a560
+	/// Selector: setSponsoringMode(address,uint8) fde8a560
 	function setSponsoringMode(address contractAddress, uint8 mode) external;
 
-	// Selector: sponsoringMode(address) b70c7267
+	/// Selector: sponsoringMode(address) b70c7267
 	function sponsoringMode(address contractAddress)
 		external
 		view
 		returns (uint8);
 
-	// Selector: setSponsoringRateLimit(address,uint32) 77b6c908
+	/// Selector: setSponsoringRateLimit(address,uint32) 77b6c908
 	function setSponsoringRateLimit(address contractAddress, uint32 rateLimit)
 		external;
 
-	// Selector: getSponsoringRateLimit(address) 610cfabd
+	/// Selector: getSponsoringRateLimit(address) 610cfabd
 	function getSponsoringRateLimit(address contractAddress)
 		external
 		view
 		returns (uint32);
 
-	// Selector: allowed(address,address) 5c658165
+	/// Selector: allowed(address,address) 5c658165
 	function allowed(address contractAddress, address user)
 		external
 		view
 		returns (bool);
 
-	// Selector: allowlistEnabled(address) c772ef6c
+	/// Selector: allowlistEnabled(address) c772ef6c
 	function allowlistEnabled(address contractAddress)
 		external
 		view
 		returns (bool);
 
-	// Selector: toggleAllowlist(address,bool) 36de20f5
+	/// Selector: toggleAllowlist(address,bool) 36de20f5
 	function toggleAllowlist(address contractAddress, bool enabled) external;
 
-	// Selector: toggleAllowed(address,address,bool) 4706cc1c
+	/// Selector: toggleAllowed(address,address,bool) 4706cc1c
 	function toggleAllowed(
 		address contractAddress,
 		address user,
-		bool allowed
+		bool isAllowed
 	) external;
 }
modifiedtests/src/eth/api/UniqueFungible.soldiffbeforeafterboth
--- a/tests/src/eth/api/UniqueFungible.sol
+++ b/tests/src/eth/api/UniqueFungible.sol
@@ -3,7 +3,7 @@
 
 pragma solidity >=0.8.0 <0.9.0;
 
-// Common stubs holder
+/// @dev common stubs holder
 interface Dummy {
 
 }
@@ -12,246 +12,257 @@
 	function supportsInterface(bytes4 interfaceID) external view returns (bool);
 }
 
-// Inline
-interface ERC20Events {
-	event Transfer(address indexed from, address indexed to, uint256 value);
-	event Approval(
-		address indexed owner,
-		address indexed spender,
-		uint256 value
-	);
-}
-
-// Selector: 79cc6790
-interface ERC20UniqueExtensions is Dummy, ERC165 {
-	// Selector: burnFrom(address,uint256) 79cc6790
-	function burnFrom(address from, uint256 amount) external returns (bool);
-}
-
-// Selector: 942e8b22
-interface ERC20 is Dummy, ERC165, ERC20Events {
-	// Selector: name() 06fdde03
-	function name() external view returns (string memory);
-
-	// Selector: symbol() 95d89b41
-	function symbol() external view returns (string memory);
-
-	// Selector: totalSupply() 18160ddd
-	function totalSupply() external view returns (uint256);
-
-	// Selector: decimals() 313ce567
-	function decimals() external view returns (uint8);
-
-	// Selector: balanceOf(address) 70a08231
-	function balanceOf(address owner) external view returns (uint256);
-
-	// Selector: transfer(address,uint256) a9059cbb
-	function transfer(address to, uint256 amount) external returns (bool);
-
-	// Selector: transferFrom(address,address,uint256) 23b872dd
-	function transferFrom(
-		address from,
-		address to,
-		uint256 amount
-	) external returns (bool);
-
-	// Selector: approve(address,uint256) 095ea7b3
-	function approve(address spender, uint256 amount) external returns (bool);
-
-	// Selector: allowance(address,address) dd62ed3e
-	function allowance(address owner, address spender)
-		external
-		view
-		returns (uint256);
-}
-
-// Selector: ffe4da23
+/// @title A contract that allows you to work with collections.
+/// @dev the ERC-165 identifier for this interface is 0xffe4da23
 interface Collection is Dummy, ERC165 {
-	// Set collection property.
-	//
-	// @param key Property key.
-	// @param value Propery value.
-	//
-	// Selector: setCollectionProperty(string,bytes) 2f073f66
+	/// Set collection property.
+	///
+	/// @param key Property key.
+	/// @param value Propery value.
+	/// @dev EVM selector for this function is: 0x2f073f66,
+	///  or in textual repr: setCollectionProperty(string,bytes)
 	function setCollectionProperty(string memory key, bytes memory value)
 		external;
 
-	// Delete collection property.
-	//
-	// @param key Property key.
-	//
-	// Selector: deleteCollectionProperty(string) 7b7debce
+	/// Delete collection property.
+	///
+	/// @param key Property key.
+	/// @dev EVM selector for this function is: 0x7b7debce,
+	///  or in textual repr: deleteCollectionProperty(string)
 	function deleteCollectionProperty(string memory key) external;
 
-	// Get collection property.
-	//
-	// @dev Throws error if key not found.
-	//
-	// @param key Property key.
-	// @return bytes The property corresponding to the key.
-	//
-	// Selector: collectionProperty(string) cf24fd6d
+	/// Get collection property.
+	///
+	/// @dev Throws error if key not found.
+	///
+	/// @param key Property key.
+	/// @return bytes The property corresponding to the key.
+	/// @dev EVM selector for this function is: 0xcf24fd6d,
+	///  or in textual repr: collectionProperty(string)
 	function collectionProperty(string memory key)
 		external
 		view
 		returns (bytes memory);
 
-	// Set the sponsor of the collection.
-	//
-	// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor.
-	//
-	// @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract.
-	//
-	// Selector: setCollectionSponsor(address) 7623402e
+	/// Set the sponsor of the collection.
+	///
+	/// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor.
+	///
+	/// @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract.
+	/// @dev EVM selector for this function is: 0x7623402e,
+	///  or in textual repr: setCollectionSponsor(address)
 	function setCollectionSponsor(address sponsor) external;
 
-	// Collection sponsorship confirmation.
-	//
-	// @dev After setting the sponsor for the collection, it must be confirmed with this function.
-	//
-	// Selector: confirmCollectionSponsorship() 3c50e97a
+	/// Collection sponsorship confirmation.
+	///
+	/// @dev After setting the sponsor for the collection, it must be confirmed with this function.
+	/// @dev EVM selector for this function is: 0x3c50e97a,
+	///  or in textual repr: confirmCollectionSponsorship()
 	function confirmCollectionSponsorship() external;
 
-	// Set limits for the collection.
-	// @dev Throws error if limit not found.
-	// @param limit Name of the limit. Valid names:
-	// 	"accountTokenOwnershipLimit",
-	// 	"sponsoredDataSize",
-	// 	"sponsoredDataRateLimit",
-	// 	"tokenLimit",
-	// 	"sponsorTransferTimeout",
-	// 	"sponsorApproveTimeout"
-	// @param value Value of the limit.
-	//
-	// Selector: setCollectionLimit(string,uint32) 6a3841db
+	/// Set limits for the collection.
+	/// @dev Throws error if limit not found.
+	/// @param limit Name of the limit. Valid names:
+	/// 	"accountTokenOwnershipLimit",
+	/// 	"sponsoredDataSize",
+	/// 	"sponsoredDataRateLimit",
+	/// 	"tokenLimit",
+	/// 	"sponsorTransferTimeout",
+	/// 	"sponsorApproveTimeout"
+	/// @param value Value of the limit.
+	/// @dev EVM selector for this function is: 0x6a3841db,
+	///  or in textual repr: setCollectionLimit(string,uint32)
 	function setCollectionLimit(string memory limit, uint32 value) external;
 
-	// Set limits for the collection.
-	// @dev Throws error if limit not found.
-	// @param limit Name of the limit. Valid names:
-	// 	"ownerCanTransfer",
-	// 	"ownerCanDestroy",
-	// 	"transfersEnabled"
-	// @param value Value of the limit.
-	//
-	// Selector: setCollectionLimit(string,bool) 993b7fba
+	/// Set limits for the collection.
+	/// @dev Throws error if limit not found.
+	/// @param limit Name of the limit. Valid names:
+	/// 	"ownerCanTransfer",
+	/// 	"ownerCanDestroy",
+	/// 	"transfersEnabled"
+	/// @param value Value of the limit.
+	/// @dev EVM selector for this function is: 0x993b7fba,
+	///  or in textual repr: setCollectionLimit(string,bool)
 	function setCollectionLimit(string memory limit, bool value) external;
 
-	// Get contract address.
-	//
-	// Selector: contractAddress() f6b4dfb4
+	/// Get contract address.
+	/// @dev EVM selector for this function is: 0xf6b4dfb4,
+	///  or in textual repr: contractAddress()
 	function contractAddress() external view returns (address);
 
-	// Add collection admin by substrate address.
-	// @param new_admin Substrate administrator address.
-	//
-	// Selector: addCollectionAdminSubstrate(uint256) 5730062b
+	/// Add collection admin by substrate address.
+	/// @param newAdmin Substrate administrator address.
+	/// @dev EVM selector for this function is: 0x5730062b,
+	///  or in textual repr: addCollectionAdminSubstrate(uint256)
 	function addCollectionAdminSubstrate(uint256 newAdmin) external;
 
-	// Remove collection admin by substrate address.
-	// @param admin Substrate administrator address.
-	//
-	// Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9
+	/// Remove collection admin by substrate address.
+	/// @param admin Substrate administrator address.
+	/// @dev EVM selector for this function is: 0x4048fcf9,
+	///  or in textual repr: removeCollectionAdminSubstrate(uint256)
 	function removeCollectionAdminSubstrate(uint256 admin) external;
 
-	// Add collection admin.
-	// @param new_admin Address of the added administrator.
-	//
-	// Selector: addCollectionAdmin(address) 92e462c7
+	/// Add collection admin.
+	/// @param newAdmin Address of the added administrator.
+	/// @dev EVM selector for this function is: 0x92e462c7,
+	///  or in textual repr: addCollectionAdmin(address)
 	function addCollectionAdmin(address newAdmin) external;
 
-	// Remove collection admin.
-	//
-	// @param new_admin Address of the removed administrator.
-	//
-	// Selector: removeCollectionAdmin(address) fafd7b42
+	/// Remove collection admin.
+	///
+	/// @param admin Address of the removed administrator.
+	/// @dev EVM selector for this function is: 0xfafd7b42,
+	///  or in textual repr: removeCollectionAdmin(address)
 	function removeCollectionAdmin(address admin) external;
 
-	// Toggle accessibility of collection nesting.
-	//
-	// @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'
-	//
-	// Selector: setCollectionNesting(bool) 112d4586
+	/// Toggle accessibility of collection nesting.
+	///
+	/// @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'
+	/// @dev EVM selector for this function is: 0x112d4586,
+	///  or in textual repr: setCollectionNesting(bool)
 	function setCollectionNesting(bool enable) external;
 
-	// Toggle accessibility of collection nesting.
-	//
-	// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'
-	// @param collections Addresses of collections that will be available for nesting.
-	//
-	// Selector: setCollectionNesting(bool,address[]) 64872396
+	/// Toggle accessibility of collection nesting.
+	///
+	/// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'
+	/// @param collections Addresses of collections that will be available for nesting.
+	/// @dev EVM selector for this function is: 0x64872396,
+	///  or in textual repr: setCollectionNesting(bool,address[])
 	function setCollectionNesting(bool enable, address[] memory collections)
 		external;
 
-	// Set the collection access method.
-	// @param mode Access mode
-	// 	0 for Normal
-	// 	1 for AllowList
-	//
-	// Selector: setCollectionAccess(uint8) 41835d4c
+	/// Set the collection access method.
+	/// @param mode Access mode
+	/// 	0 for Normal
+	/// 	1 for AllowList
+	/// @dev EVM selector for this function is: 0x41835d4c,
+	///  or in textual repr: setCollectionAccess(uint8)
 	function setCollectionAccess(uint8 mode) external;
 
-	// Add the user to the allowed list.
-	//
-	// @param user Address of a trusted user.
-	//
-	// Selector: addToCollectionAllowList(address) 67844fe6
+	/// Add the user to the allowed list.
+	///
+	/// @param user Address of a trusted user.
+	/// @dev EVM selector for this function is: 0x67844fe6,
+	///  or in textual repr: addToCollectionAllowList(address)
 	function addToCollectionAllowList(address user) external;
 
-	// Remove the user from the allowed list.
-	//
-	// @param user Address of a removed user.
-	//
-	// Selector: removeFromCollectionAllowList(address) 85c51acb
+	/// Remove the user from the allowed list.
+	///
+	/// @param user Address of a removed user.
+	/// @dev EVM selector for this function is: 0x85c51acb,
+	///  or in textual repr: removeFromCollectionAllowList(address)
 	function removeFromCollectionAllowList(address user) external;
 
-	// Switch permission for minting.
-	//
-	// @param mode Enable if "true".
-	//
-	// Selector: setCollectionMintMode(bool) 00018e84
+	/// Switch permission for minting.
+	///
+	/// @param mode Enable if "true".
+	/// @dev EVM selector for this function is: 0x00018e84,
+	///  or in textual repr: setCollectionMintMode(bool)
 	function setCollectionMintMode(bool mode) external;
 
-	// Check that account is the owner or admin of the collection
-	//
-	// @param user account to verify
-	// @return "true" if account is the owner or admin
-	//
-	// Selector: isOwnerOrAdmin(address) 9811b0c7
+	/// Check that account is the owner or admin of the collection
+	///
+	/// @param user account to verify
+	/// @return "true" if account is the owner or admin
+	/// @dev EVM selector for this function is: 0x9811b0c7,
+	///  or in textual repr: isOwnerOrAdmin(address)
 	function isOwnerOrAdmin(address user) external view returns (bool);
 
-	// Check that substrate account is the owner or admin of the collection
-	//
-	// @param user account to verify
-	// @return "true" if account is the owner or admin
-	//
-	// Selector: isOwnerOrAdminSubstrate(uint256) 68910e00
+	/// Check that substrate account is the owner or admin of the collection
+	///
+	/// @param user account to verify
+	/// @return "true" if account is the owner or admin
+	/// @dev EVM selector for this function is: 0x68910e00,
+	///  or in textual repr: isOwnerOrAdminSubstrate(uint256)
 	function isOwnerOrAdminSubstrate(uint256 user) external view returns (bool);
 
-	// Returns collection type
-	//
-	// @return `Fungible` or `NFT` or `ReFungible`
-	//
-	// Selector: uniqueCollectionType() d34b55b8
+	/// Returns collection type
+	///
+	/// @return `Fungible` or `NFT` or `ReFungible`
+	/// @dev EVM selector for this function is: 0xd34b55b8,
+	///  or in textual repr: uniqueCollectionType()
 	function uniqueCollectionType() external returns (string memory);
 
-	// Changes collection owner to another account
-	//
-	// @dev Owner can be changed only by current owner
-	// @param newOwner new owner account
-	//
-	// Selector: setOwner(address) 13af4035
+	/// Changes collection owner to another account
+	///
+	/// @dev Owner can be changed only by current owner
+	/// @param newOwner new owner account
+	/// @dev EVM selector for this function is: 0x13af4035,
+	///  or in textual repr: setOwner(address)
 	function setOwner(address newOwner) external;
 
-	// Changes collection owner to another substrate account
-	//
-	// @dev Owner can be changed only by current owner
-	// @param newOwner new owner substrate account
-	//
-	// Selector: setOwnerSubstrate(uint256) b212138f
+	/// Changes collection owner to another substrate account
+	///
+	/// @dev Owner can be changed only by current owner
+	/// @param newOwner new owner substrate account
+	/// @dev EVM selector for this function is: 0xb212138f,
+	///  or in textual repr: setOwnerSubstrate(uint256)
 	function setOwnerSubstrate(uint256 newOwner) external;
 }
 
+/// @dev the ERC-165 identifier for this interface is 0x79cc6790
+interface ERC20UniqueExtensions is Dummy, ERC165 {
+	/// @dev EVM selector for this function is: 0x79cc6790,
+	///  or in textual repr: burnFrom(address,uint256)
+	function burnFrom(address from, uint256 amount) external returns (bool);
+}
+
+/// @dev inlined interface
+interface ERC20Events {
+	event Transfer(address indexed from, address indexed to, uint256 value);
+	event Approval(
+		address indexed owner,
+		address indexed spender,
+		uint256 value
+	);
+}
+
+/// @dev the ERC-165 identifier for this interface is 0x942e8b22
+interface ERC20 is Dummy, ERC165, ERC20Events {
+	/// @dev EVM selector for this function is: 0x06fdde03,
+	///  or in textual repr: name()
+	function name() external view returns (string memory);
+
+	/// @dev EVM selector for this function is: 0x95d89b41,
+	///  or in textual repr: symbol()
+	function symbol() external view returns (string memory);
+
+	/// @dev EVM selector for this function is: 0x18160ddd,
+	///  or in textual repr: totalSupply()
+	function totalSupply() external view returns (uint256);
+
+	/// @dev EVM selector for this function is: 0x313ce567,
+	///  or in textual repr: decimals()
+	function decimals() external view returns (uint8);
+
+	/// @dev EVM selector for this function is: 0x70a08231,
+	///  or in textual repr: balanceOf(address)
+	function balanceOf(address owner) external view returns (uint256);
+
+	/// @dev EVM selector for this function is: 0xa9059cbb,
+	///  or in textual repr: transfer(address,uint256)
+	function transfer(address to, uint256 amount) external returns (bool);
+
+	/// @dev EVM selector for this function is: 0x23b872dd,
+	///  or in textual repr: transferFrom(address,address,uint256)
+	function transferFrom(
+		address from,
+		address to,
+		uint256 amount
+	) external returns (bool);
+
+	/// @dev EVM selector for this function is: 0x095ea7b3,
+	///  or in textual repr: approve(address,uint256)
+	function approve(address spender, uint256 amount) external returns (bool);
+
+	/// @dev EVM selector for this function is: 0xdd62ed3e,
+	///  or in textual repr: allowance(address,address)
+	function allowance(address owner, address spender)
+		external
+		view
+		returns (uint256);
+}
+
 interface UniqueFungible is
 	Dummy,
 	ERC165,
modifiedtests/src/eth/api/UniqueNFT.soldiffbeforeafterboth
--- a/tests/src/eth/api/UniqueNFT.sol
+++ b/tests/src/eth/api/UniqueNFT.sol
@@ -3,55 +3,26 @@
 
 pragma solidity >=0.8.0 <0.9.0;
 
-// Anonymous struct
-struct Tuple0 {
-	uint256 field_0;
-	string field_1;
-}
-
-// Common stubs holder
+/// @dev common stubs holder
 interface Dummy {
 
 }
 
 interface ERC165 is Dummy {
 	function supportsInterface(bytes4 interfaceID) external view returns (bool);
-}
-
-// Inline
-interface ERC721Events {
-	event Transfer(
-		address indexed from,
-		address indexed to,
-		uint256 indexed tokenId
-	);
-	event Approval(
-		address indexed owner,
-		address indexed approved,
-		uint256 indexed tokenId
-	);
-	event ApprovalForAll(
-		address indexed owner,
-		address indexed operator,
-		bool approved
-	);
 }
 
-// Inline
-interface ERC721MintableEvents {
-	event MintingFinished();
-}
-
-// Selector: 41369377
+/// @title A contract that allows to set and delete token properties and change token property permissions.
+/// @dev the ERC-165 identifier for this interface is 0x41369377
 interface TokenProperties is Dummy, ERC165 {
-	// @notice Set permissions for token property.
-	// @dev Throws error if `msg.sender` is not admin or owner of the collection.
-	// @param key Property key.
-	// @param is_mutable Permission to mutate property.
-	// @param collection_admin Permission to mutate property by collection admin if property is mutable.
-	// @param token_owner Permission to mutate property by token owner if property is mutable.
-	//
-	// Selector: setTokenPropertyPermission(string,bool,bool,bool) 222d97fa
+	/// @notice Set permissions for token property.
+	/// @dev Throws error if `msg.sender` is not admin or owner of the collection.
+	/// @param key Property key.
+	/// @param isMutable Permission to mutate property.
+	/// @param collectionAdmin Permission to mutate property by collection admin if property is mutable.
+	/// @param tokenOwner Permission to mutate property by token owner if property is mutable.
+	/// @dev EVM selector for this function is: 0x222d97fa,
+	///  or in textual repr: setTokenPropertyPermission(string,bool,bool,bool)
 	function setTokenPropertyPermission(
 		string memory key,
 		bool isMutable,
@@ -59,459 +30,497 @@
 		bool tokenOwner
 	) external;
 
-	// @notice Set token property value.
-	// @dev Throws error if `msg.sender` has no permission to edit the property.
-	// @param tokenId ID of the token.
-	// @param key Property key.
-	// @param value Property value.
-	//
-	// Selector: setProperty(uint256,string,bytes) 1752d67b
+	/// @notice Set token property value.
+	/// @dev Throws error if `msg.sender` has no permission to edit the property.
+	/// @param tokenId ID of the token.
+	/// @param key Property key.
+	/// @param value Property value.
+	/// @dev EVM selector for this function is: 0x1752d67b,
+	///  or in textual repr: setProperty(uint256,string,bytes)
 	function setProperty(
 		uint256 tokenId,
 		string memory key,
 		bytes memory value
 	) external;
 
-	// @notice Delete token property value.
-	// @dev Throws error if `msg.sender` has no permission to edit the property.
-	// @param tokenId ID of the token.
-	// @param key Property key.
-	//
-	// Selector: deleteProperty(uint256,string) 066111d1
+	/// @notice Delete token property value.
+	/// @dev Throws error if `msg.sender` has no permission to edit the property.
+	/// @param tokenId ID of the token.
+	/// @param key Property key.
+	/// @dev EVM selector for this function is: 0x066111d1,
+	///  or in textual repr: deleteProperty(uint256,string)
 	function deleteProperty(uint256 tokenId, string memory key) external;
 
-	// @notice Get token property value.
-	// @dev Throws error if key not found
-	// @param tokenId ID of the token.
-	// @param key Property key.
-	// @return Property value bytes
-	//
-	// Selector: property(uint256,string) 7228c327
+	/// @notice Get token property value.
+	/// @dev Throws error if key not found
+	/// @param tokenId ID of the token.
+	/// @param key Property key.
+	/// @return Property value bytes
+	/// @dev EVM selector for this function is: 0x7228c327,
+	///  or in textual repr: property(uint256,string)
 	function property(uint256 tokenId, string memory key)
 		external
 		view
 		returns (bytes memory);
 }
 
-// Selector: 42966c68
-interface ERC721Burnable is Dummy, ERC165 {
-	// @notice Burns a specific ERC721 token.
-	// @dev Throws unless `msg.sender` is the current NFT owner, or an authorized
-	//  operator of the current owner.
-	// @param tokenId The NFT to approve
-	//
-	// Selector: burn(uint256) 42966c68
-	function burn(uint256 tokenId) external;
-}
+/// @title A contract that allows you to work with collections.
+/// @dev the ERC-165 identifier for this interface is 0xffe4da23
+interface Collection is Dummy, ERC165 {
+	/// Set collection property.
+	///
+	/// @param key Property key.
+	/// @param value Propery value.
+	/// @dev EVM selector for this function is: 0x2f073f66,
+	///  or in textual repr: setCollectionProperty(string,bytes)
+	function setCollectionProperty(string memory key, bytes memory value)
+		external;
 
-// Selector: 58800161
-interface ERC721 is Dummy, ERC165, ERC721Events {
-	// @notice Count all NFTs assigned to an owner
-	// @dev NFTs assigned to the zero address are considered invalid, and this
-	//  function throws for queries about the zero address.
-	// @param owner An address for whom to query the balance
-	// @return The number of NFTs owned by `owner`, possibly zero
-	//
-	// Selector: balanceOf(address) 70a08231
-	function balanceOf(address owner) external view returns (uint256);
+	/// Delete collection property.
+	///
+	/// @param key Property key.
+	/// @dev EVM selector for this function is: 0x7b7debce,
+	///  or in textual repr: deleteCollectionProperty(string)
+	function deleteCollectionProperty(string memory key) external;
 
-	// @notice Find the owner of an NFT
-	// @dev NFTs assigned to zero address are considered invalid, and queries
-	//  about them do throw.
-	// @param tokenId The identifier for an NFT
-	// @return The address of the owner of the NFT
-	//
-	// Selector: ownerOf(uint256) 6352211e
-	function ownerOf(uint256 tokenId) external view returns (address);
+	/// Get collection property.
+	///
+	/// @dev Throws error if key not found.
+	///
+	/// @param key Property key.
+	/// @return bytes The property corresponding to the key.
+	/// @dev EVM selector for this function is: 0xcf24fd6d,
+	///  or in textual repr: collectionProperty(string)
+	function collectionProperty(string memory key)
+		external
+		view
+		returns (bytes memory);
 
-	// @dev Not implemented
-	//
-	// Selector: safeTransferFromWithData(address,address,uint256,bytes) 60a11672
-	function safeTransferFromWithData(
-		address from,
-		address to,
-		uint256 tokenId,
-		bytes memory data
-	) external;
+	/// Set the sponsor of the collection.
+	///
+	/// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor.
+	///
+	/// @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract.
+	/// @dev EVM selector for this function is: 0x7623402e,
+	///  or in textual repr: setCollectionSponsor(address)
+	function setCollectionSponsor(address sponsor) external;
 
-	// @dev Not implemented
-	//
-	// Selector: safeTransferFrom(address,address,uint256) 42842e0e
-	function safeTransferFrom(
-		address from,
-		address to,
-		uint256 tokenId
-	) external;
+	/// Collection sponsorship confirmation.
+	///
+	/// @dev After setting the sponsor for the collection, it must be confirmed with this function.
+	/// @dev EVM selector for this function is: 0x3c50e97a,
+	///  or in textual repr: confirmCollectionSponsorship()
+	function confirmCollectionSponsorship() external;
 
-	// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE
-	//  TO CONFIRM THAT `to` IS CAPABLE OF RECEIVING NFTS OR ELSE
-	//  THEY MAY BE PERMANENTLY LOST
-	// @dev Throws unless `msg.sender` is the current owner or an authorized
-	//  operator for this NFT. Throws if `from` is not the current owner. Throws
-	//  if `to` is the zero address. Throws if `tokenId` is not a valid NFT.
-	// @param from The current owner of the NFT
-	// @param to The new owner
-	// @param tokenId The NFT to transfer
-	// @param _value Not used for an NFT
-	//
-	// Selector: transferFrom(address,address,uint256) 23b872dd
-	function transferFrom(
-		address from,
-		address to,
-		uint256 tokenId
-	) external;
+	/// Set limits for the collection.
+	/// @dev Throws error if limit not found.
+	/// @param limit Name of the limit. Valid names:
+	/// 	"accountTokenOwnershipLimit",
+	/// 	"sponsoredDataSize",
+	/// 	"sponsoredDataRateLimit",
+	/// 	"tokenLimit",
+	/// 	"sponsorTransferTimeout",
+	/// 	"sponsorApproveTimeout"
+	/// @param value Value of the limit.
+	/// @dev EVM selector for this function is: 0x6a3841db,
+	///  or in textual repr: setCollectionLimit(string,uint32)
+	function setCollectionLimit(string memory limit, uint32 value) external;
 
-	// @notice Set or reaffirm the approved address for an NFT
-	// @dev The zero address indicates there is no approved address.
-	// @dev Throws unless `msg.sender` is the current NFT owner, or an authorized
-	//  operator of the current owner.
-	// @param approved The new approved NFT controller
-	// @param tokenId The NFT to approve
-	//
-	// Selector: approve(address,uint256) 095ea7b3
-	function approve(address approved, uint256 tokenId) external;
+	/// Set limits for the collection.
+	/// @dev Throws error if limit not found.
+	/// @param limit Name of the limit. Valid names:
+	/// 	"ownerCanTransfer",
+	/// 	"ownerCanDestroy",
+	/// 	"transfersEnabled"
+	/// @param value Value of the limit.
+	/// @dev EVM selector for this function is: 0x993b7fba,
+	///  or in textual repr: setCollectionLimit(string,bool)
+	function setCollectionLimit(string memory limit, bool value) external;
 
-	// @dev Not implemented
-	//
-	// Selector: setApprovalForAll(address,bool) a22cb465
-	function setApprovalForAll(address operator, bool approved) external;
+	/// Get contract address.
+	/// @dev EVM selector for this function is: 0xf6b4dfb4,
+	///  or in textual repr: contractAddress()
+	function contractAddress() external view returns (address);
 
-	// @dev Not implemented
-	//
-	// Selector: getApproved(uint256) 081812fc
-	function getApproved(uint256 tokenId) external view returns (address);
+	/// Add collection admin by substrate address.
+	/// @param newAdmin Substrate administrator address.
+	/// @dev EVM selector for this function is: 0x5730062b,
+	///  or in textual repr: addCollectionAdminSubstrate(uint256)
+	function addCollectionAdminSubstrate(uint256 newAdmin) external;
+
+	/// Remove collection admin by substrate address.
+	/// @param admin Substrate administrator address.
+	/// @dev EVM selector for this function is: 0x4048fcf9,
+	///  or in textual repr: removeCollectionAdminSubstrate(uint256)
+	function removeCollectionAdminSubstrate(uint256 admin) external;
+
+	/// Add collection admin.
+	/// @param newAdmin Address of the added administrator.
+	/// @dev EVM selector for this function is: 0x92e462c7,
+	///  or in textual repr: addCollectionAdmin(address)
+	function addCollectionAdmin(address newAdmin) external;
 
-	// @dev Not implemented
-	//
-	// Selector: isApprovedForAll(address,address) e985e9c5
-	function isApprovedForAll(address owner, address operator)
-		external
-		view
-		returns (address);
-}
+	/// Remove collection admin.
+	///
+	/// @param admin Address of the removed administrator.
+	/// @dev EVM selector for this function is: 0xfafd7b42,
+	///  or in textual repr: removeCollectionAdmin(address)
+	function removeCollectionAdmin(address admin) external;
+
+	/// Toggle accessibility of collection nesting.
+	///
+	/// @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'
+	/// @dev EVM selector for this function is: 0x112d4586,
+	///  or in textual repr: setCollectionNesting(bool)
+	function setCollectionNesting(bool enable) external;
 
-// Selector: 5b5e139f
-interface ERC721Metadata is Dummy, ERC165 {
-	// @notice A descriptive name for a collection of NFTs in this contract
-	//
-	// Selector: name() 06fdde03
-	function name() external view returns (string memory);
+	/// Toggle accessibility of collection nesting.
+	///
+	/// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'
+	/// @param collections Addresses of collections that will be available for nesting.
+	/// @dev EVM selector for this function is: 0x64872396,
+	///  or in textual repr: setCollectionNesting(bool,address[])
+	function setCollectionNesting(bool enable, address[] memory collections)
+		external;
 
-	// @notice An abbreviated name for NFTs in this contract
-	//
-	// Selector: symbol() 95d89b41
-	function symbol() external view returns (string memory);
+	/// Set the collection access method.
+	/// @param mode Access mode
+	/// 	0 for Normal
+	/// 	1 for AllowList
+	/// @dev EVM selector for this function is: 0x41835d4c,
+	///  or in textual repr: setCollectionAccess(uint8)
+	function setCollectionAccess(uint8 mode) external;
 
-	// @notice A distinct Uniform Resource Identifier (URI) for a given asset.
-	//
-	// @dev If the token has a `url` property and it is not empty, it is returned.
-	//  Else If the collection does not have a property with key `schemaName` or its value is not equal to `ERC721Metadata`, it return an error `tokenURI not set`.
-	//  If the collection property `baseURI` is empty or absent, return "" (empty string)
-	//  otherwise, if token property `suffix` present and is non-empty, return concatenation of baseURI and suffix
-	//  otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings).
-	//
-	// @return token's const_metadata
-	//
-	// Selector: tokenURI(uint256) c87b56dd
-	function tokenURI(uint256 tokenId) external view returns (string memory);
+	/// Add the user to the allowed list.
+	///
+	/// @param user Address of a trusted user.
+	/// @dev EVM selector for this function is: 0x67844fe6,
+	///  or in textual repr: addToCollectionAllowList(address)
+	function addToCollectionAllowList(address user) external;
+
+	/// Remove the user from the allowed list.
+	///
+	/// @param user Address of a removed user.
+	/// @dev EVM selector for this function is: 0x85c51acb,
+	///  or in textual repr: removeFromCollectionAllowList(address)
+	function removeFromCollectionAllowList(address user) external;
+
+	/// Switch permission for minting.
+	///
+	/// @param mode Enable if "true".
+	/// @dev EVM selector for this function is: 0x00018e84,
+	///  or in textual repr: setCollectionMintMode(bool)
+	function setCollectionMintMode(bool mode) external;
+
+	/// Check that account is the owner or admin of the collection
+	///
+	/// @param user account to verify
+	/// @return "true" if account is the owner or admin
+	/// @dev EVM selector for this function is: 0x9811b0c7,
+	///  or in textual repr: isOwnerOrAdmin(address)
+	function isOwnerOrAdmin(address user) external view returns (bool);
+
+	/// Check that substrate account is the owner or admin of the collection
+	///
+	/// @param user account to verify
+	/// @return "true" if account is the owner or admin
+	/// @dev EVM selector for this function is: 0x68910e00,
+	///  or in textual repr: isOwnerOrAdminSubstrate(uint256)
+	function isOwnerOrAdminSubstrate(uint256 user) external view returns (bool);
+
+	/// Returns collection type
+	///
+	/// @return `Fungible` or `NFT` or `ReFungible`
+	/// @dev EVM selector for this function is: 0xd34b55b8,
+	///  or in textual repr: uniqueCollectionType()
+	function uniqueCollectionType() external returns (string memory);
+
+	/// Changes collection owner to another account
+	///
+	/// @dev Owner can be changed only by current owner
+	/// @param newOwner new owner account
+	/// @dev EVM selector for this function is: 0x13af4035,
+	///  or in textual repr: setOwner(address)
+	function setOwner(address newOwner) external;
+
+	/// Changes collection owner to another substrate account
+	///
+	/// @dev Owner can be changed only by current owner
+	/// @param newOwner new owner substrate account
+	/// @dev EVM selector for this function is: 0xb212138f,
+	///  or in textual repr: setOwnerSubstrate(uint256)
+	function setOwnerSubstrate(uint256 newOwner) external;
+}
+
+/// @title ERC721 Token that can be irreversibly burned (destroyed).
+/// @dev the ERC-165 identifier for this interface is 0x42966c68
+interface ERC721Burnable is Dummy, ERC165 {
+	/// @notice Burns a specific ERC721 token.
+	/// @dev Throws unless `msg.sender` is the current NFT owner, or an authorized
+	///  operator of the current owner.
+	/// @param tokenId The NFT to approve
+	/// @dev EVM selector for this function is: 0x42966c68,
+	///  or in textual repr: burn(uint256)
+	function burn(uint256 tokenId) external;
 }
 
-// Selector: 68ccfe89
+/// @dev inlined interface
+interface ERC721MintableEvents {
+	event MintingFinished();
+}
+
+/// @title ERC721 minting logic.
+/// @dev the ERC-165 identifier for this interface is 0x68ccfe89
 interface ERC721Mintable is Dummy, ERC165, ERC721MintableEvents {
-	// Selector: mintingFinished() 05d2035b
+	/// @dev EVM selector for this function is: 0x05d2035b,
+	///  or in textual repr: mintingFinished()
 	function mintingFinished() external view returns (bool);
 
-	// @notice Function to mint token.
-	// @dev `tokenId` should be obtained with `nextTokenId` method,
-	//  unlike standard, you can't specify it manually
-	// @param to The new owner
-	// @param tokenId ID of the minted NFT
-	//
-	// Selector: mint(address,uint256) 40c10f19
+	/// @notice Function to mint token.
+	/// @dev `tokenId` should be obtained with `nextTokenId` method,
+	///  unlike standard, you can't specify it manually
+	/// @param to The new owner
+	/// @param tokenId ID of the minted NFT
+	/// @dev EVM selector for this function is: 0x40c10f19,
+	///  or in textual repr: mint(address,uint256)
 	function mint(address to, uint256 tokenId) external returns (bool);
 
-	// @notice Function to mint token with the given tokenUri.
-	// @dev `tokenId` should be obtained with `nextTokenId` method,
-	//  unlike standard, you can't specify it manually
-	// @param to The new owner
-	// @param tokenId ID of the minted NFT
-	// @param tokenUri Token URI that would be stored in the NFT properties
-	//
-	// Selector: mintWithTokenURI(address,uint256,string) 50bb4e7f
+	/// @notice Function to mint token with the given tokenUri.
+	/// @dev `tokenId` should be obtained with `nextTokenId` method,
+	///  unlike standard, you can't specify it manually
+	/// @param to The new owner
+	/// @param tokenId ID of the minted NFT
+	/// @param tokenUri Token URI that would be stored in the NFT properties
+	/// @dev EVM selector for this function is: 0x50bb4e7f,
+	///  or in textual repr: mintWithTokenURI(address,uint256,string)
 	function mintWithTokenURI(
 		address to,
 		uint256 tokenId,
 		string memory tokenUri
 	) external returns (bool);
 
-	// @dev Not implemented
-	//
-	// Selector: finishMinting() 7d64bcb4
+	/// @dev Not implemented
+	/// @dev EVM selector for this function is: 0x7d64bcb4,
+	///  or in textual repr: finishMinting()
 	function finishMinting() external returns (bool);
 }
 
-// Selector: 780e9d63
-interface ERC721Enumerable is Dummy, ERC165 {
-	// @notice Enumerate valid NFTs
-	// @param index A counter less than `totalSupply()`
-	// @return The token identifier for the `index`th NFT,
-	//  (sort order not specified)
-	//
-	// Selector: tokenByIndex(uint256) 4f6ccce7
-	function tokenByIndex(uint256 index) external view returns (uint256);
-
-	// @dev Not implemented
-	//
-	// Selector: tokenOfOwnerByIndex(address,uint256) 2f745c59
-	function tokenOfOwnerByIndex(address owner, uint256 index)
-		external
-		view
-		returns (uint256);
-
-	// @notice Count NFTs tracked by this contract
-	// @return A count of valid NFTs tracked by this contract, where each one of
-	//  them has an assigned and queryable owner not equal to the zero address
-	//
-	// Selector: totalSupply() 18160ddd
-	function totalSupply() external view returns (uint256);
-}
-
-// Selector: d74d154f
+/// @title Unique extensions for ERC721.
+/// @dev the ERC-165 identifier for this interface is 0xd74d154f
 interface ERC721UniqueExtensions is Dummy, ERC165 {
-	// @notice Transfer ownership of an NFT
-	// @dev Throws unless `msg.sender` is the current owner. Throws if `to`
-	//  is the zero address. Throws if `tokenId` is not a valid NFT.
-	// @param to The new owner
-	// @param tokenId The NFT to transfer
-	// @param _value Not used for an NFT
-	//
-	// Selector: transfer(address,uint256) a9059cbb
+	/// @notice Transfer ownership of an NFT
+	/// @dev Throws unless `msg.sender` is the current owner. Throws if `to`
+	///  is the zero address. Throws if `tokenId` is not a valid NFT.
+	/// @param to The new owner
+	/// @param tokenId The NFT to transfer
+	/// @dev EVM selector for this function is: 0xa9059cbb,
+	///  or in textual repr: transfer(address,uint256)
 	function transfer(address to, uint256 tokenId) external;
 
-	// @notice Burns a specific ERC721 token.
-	// @dev Throws unless `msg.sender` is the current owner or an authorized
-	//  operator for this NFT. Throws if `from` is not the current owner. Throws
-	//  if `to` is the zero address. Throws if `tokenId` is not a valid NFT.
-	// @param from The current owner of the NFT
-	// @param tokenId The NFT to transfer
-	// @param _value Not used for an NFT
-	//
-	// Selector: burnFrom(address,uint256) 79cc6790
+	/// @notice Burns a specific ERC721 token.
+	/// @dev Throws unless `msg.sender` is the current owner or an authorized
+	///  operator for this NFT. Throws if `from` is not the current owner. Throws
+	///  if `to` is the zero address. Throws if `tokenId` is not a valid NFT.
+	/// @param from The current owner of the NFT
+	/// @param tokenId The NFT to transfer
+	/// @dev EVM selector for this function is: 0x79cc6790,
+	///  or in textual repr: burnFrom(address,uint256)
 	function burnFrom(address from, uint256 tokenId) external;
 
-	// @notice Returns next free NFT ID.
-	//
-	// Selector: nextTokenId() 75794a3c
+	/// @notice Returns next free NFT ID.
+	/// @dev EVM selector for this function is: 0x75794a3c,
+	///  or in textual repr: nextTokenId()
 	function nextTokenId() external view returns (uint256);
 
-	// @notice Function to mint multiple tokens.
-	// @dev `tokenIds` should be an array of consecutive numbers and first number
-	//  should be obtained with `nextTokenId` method
-	// @param to The new owner
-	// @param tokenIds IDs of the minted NFTs
-	//
-	// Selector: mintBulk(address,uint256[]) 44a9945e
+	/// @notice Function to mint multiple tokens.
+	/// @dev `tokenIds` should be an array of consecutive numbers and first number
+	///  should be obtained with `nextTokenId` method
+	/// @param to The new owner
+	/// @param tokenIds IDs of the minted NFTs
+	/// @dev EVM selector for this function is: 0x44a9945e,
+	///  or in textual repr: mintBulk(address,uint256[])
 	function mintBulk(address to, uint256[] memory tokenIds)
 		external
 		returns (bool);
 
-	// @notice Function to mint multiple tokens with the given tokenUris.
-	// @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive
-	//  numbers and first number should be obtained with `nextTokenId` method
-	// @param to The new owner
-	// @param tokens array of pairs of token ID and token URI for minted tokens
-	//
-	// Selector: mintBulkWithTokenURI(address,(uint256,string)[]) 36543006
-	function mintBulkWithTokenURI(address to, Tuple0[] memory tokens)
+	/// @notice Function to mint multiple tokens with the given tokenUris.
+	/// @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive
+	///  numbers and first number should be obtained with `nextTokenId` method
+	/// @param to The new owner
+	/// @param tokens array of pairs of token ID and token URI for minted tokens
+	/// @dev EVM selector for this function is: 0x36543006,
+	///  or in textual repr: mintBulkWithTokenURI(address,(uint256,string)[])
+	function mintBulkWithTokenURI(address to, Tuple8[] memory tokens)
 		external
 		returns (bool);
 }
 
-// Selector: ffe4da23
-interface Collection is Dummy, ERC165 {
-	// Set collection property.
-	//
-	// @param key Property key.
-	// @param value Propery value.
-	//
-	// Selector: setCollectionProperty(string,bytes) 2f073f66
-	function setCollectionProperty(string memory key, bytes memory value)
-		external;
+/// @dev anonymous struct
+struct Tuple8 {
+	uint256 field_0;
+	string field_1;
+}
 
-	// Delete collection property.
-	//
-	// @param key Property key.
-	//
-	// Selector: deleteCollectionProperty(string) 7b7debce
-	function deleteCollectionProperty(string memory key) external;
+/// @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
+/// @dev See https://eips.ethereum.org/EIPS/eip-721
+/// @dev the ERC-165 identifier for this interface is 0x780e9d63
+interface ERC721Enumerable is Dummy, ERC165 {
+	/// @notice Enumerate valid NFTs
+	/// @param index A counter less than `totalSupply()`
+	/// @return The token identifier for the `index`th NFT,
+	///  (sort order not specified)
+	/// @dev EVM selector for this function is: 0x4f6ccce7,
+	///  or in textual repr: tokenByIndex(uint256)
+	function tokenByIndex(uint256 index) external view returns (uint256);
 
-	// Get collection property.
-	//
-	// @dev Throws error if key not found.
-	//
-	// @param key Property key.
-	// @return bytes The property corresponding to the key.
-	//
-	// Selector: collectionProperty(string) cf24fd6d
-	function collectionProperty(string memory key)
+	/// @dev Not implemented
+	/// @dev EVM selector for this function is: 0x2f745c59,
+	///  or in textual repr: tokenOfOwnerByIndex(address,uint256)
+	function tokenOfOwnerByIndex(address owner, uint256 index)
 		external
 		view
-		returns (bytes memory);
+		returns (uint256);
 
-	// Set the sponsor of the collection.
-	//
-	// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor.
-	//
-	// @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract.
-	//
-	// Selector: setCollectionSponsor(address) 7623402e
-	function setCollectionSponsor(address sponsor) external;
+	/// @notice Count NFTs tracked by this contract
+	/// @return A count of valid NFTs tracked by this contract, where each one of
+	///  them has an assigned and queryable owner not equal to the zero address
+	/// @dev EVM selector for this function is: 0x18160ddd,
+	///  or in textual repr: totalSupply()
+	function totalSupply() external view returns (uint256);
+}
 
-	// Collection sponsorship confirmation.
-	//
-	// @dev After setting the sponsor for the collection, it must be confirmed with this function.
-	//
-	// Selector: confirmCollectionSponsorship() 3c50e97a
-	function confirmCollectionSponsorship() external;
+/// @title ERC-721 Non-Fungible Token Standard, optional metadata extension
+/// @dev See https://eips.ethereum.org/EIPS/eip-721
+/// @dev the ERC-165 identifier for this interface is 0x5b5e139f
+interface ERC721Metadata is Dummy, ERC165 {
+	/// @notice A descriptive name for a collection of NFTs in this contract
+	/// @dev EVM selector for this function is: 0x06fdde03,
+	///  or in textual repr: name()
+	function name() external view returns (string memory);
 
-	// Set limits for the collection.
-	// @dev Throws error if limit not found.
-	// @param limit Name of the limit. Valid names:
-	// 	"accountTokenOwnershipLimit",
-	// 	"sponsoredDataSize",
-	// 	"sponsoredDataRateLimit",
-	// 	"tokenLimit",
-	// 	"sponsorTransferTimeout",
-	// 	"sponsorApproveTimeout"
-	// @param value Value of the limit.
-	//
-	// Selector: setCollectionLimit(string,uint32) 6a3841db
-	function setCollectionLimit(string memory limit, uint32 value) external;
+	/// @notice An abbreviated name for NFTs in this contract
+	/// @dev EVM selector for this function is: 0x95d89b41,
+	///  or in textual repr: symbol()
+	function symbol() external view returns (string memory);
 
-	// Set limits for the collection.
-	// @dev Throws error if limit not found.
-	// @param limit Name of the limit. Valid names:
-	// 	"ownerCanTransfer",
-	// 	"ownerCanDestroy",
-	// 	"transfersEnabled"
-	// @param value Value of the limit.
-	//
-	// Selector: setCollectionLimit(string,bool) 993b7fba
-	function setCollectionLimit(string memory limit, bool value) external;
+	/// @notice A distinct Uniform Resource Identifier (URI) for a given asset.
+	///
+	/// @dev If the token has a `url` property and it is not empty, it is returned.
+	///  Else If the collection does not have a property with key `schemaName` or its value is not equal to `ERC721Metadata`, it return an error `tokenURI not set`.
+	///  If the collection property `baseURI` is empty or absent, return "" (empty string)
+	///  otherwise, if token property `suffix` present and is non-empty, return concatenation of baseURI and suffix
+	///  otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings).
+	///
+	/// @return token's const_metadata
+	/// @dev EVM selector for this function is: 0xc87b56dd,
+	///  or in textual repr: tokenURI(uint256)
+	function tokenURI(uint256 tokenId) external view returns (string memory);
+}
 
-	// Get contract address.
-	//
-	// Selector: contractAddress() f6b4dfb4
-	function contractAddress() external view returns (address);
+/// @dev inlined interface
+interface ERC721Events {
+	event Transfer(
+		address indexed from,
+		address indexed to,
+		uint256 indexed tokenId
+	);
+	event Approval(
+		address indexed owner,
+		address indexed approved,
+		uint256 indexed tokenId
+	);
+	event ApprovalForAll(
+		address indexed owner,
+		address indexed operator,
+		bool approved
+	);
+}
 
-	// Add collection admin by substrate address.
-	// @param new_admin Substrate administrator address.
-	//
-	// Selector: addCollectionAdminSubstrate(uint256) 5730062b
-	function addCollectionAdminSubstrate(uint256 newAdmin) external;
+/// @title ERC-721 Non-Fungible Token Standard
+/// @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md
+/// @dev the ERC-165 identifier for this interface is 0x80ac58cd
+interface ERC721 is Dummy, ERC165, ERC721Events {
+	/// @notice Count all NFTs assigned to an owner
+	/// @dev NFTs assigned to the zero address are considered invalid, and this
+	///  function throws for queries about the zero address.
+	/// @param owner An address for whom to query the balance
+	/// @return The number of NFTs owned by `owner`, possibly zero
+	/// @dev EVM selector for this function is: 0x70a08231,
+	///  or in textual repr: balanceOf(address)
+	function balanceOf(address owner) external view returns (uint256);
 
-	// Remove collection admin by substrate address.
-	// @param admin Substrate administrator address.
-	//
-	// Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9
-	function removeCollectionAdminSubstrate(uint256 admin) external;
-
-	// Add collection admin.
-	// @param new_admin Address of the added administrator.
-	//
-	// Selector: addCollectionAdmin(address) 92e462c7
-	function addCollectionAdmin(address newAdmin) external;
-
-	// Remove collection admin.
-	//
-	// @param new_admin Address of the removed administrator.
-	//
-	// Selector: removeCollectionAdmin(address) fafd7b42
-	function removeCollectionAdmin(address admin) external;
-
-	// Toggle accessibility of collection nesting.
-	//
-	// @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'
-	//
-	// Selector: setCollectionNesting(bool) 112d4586
-	function setCollectionNesting(bool enable) external;
-
-	// Toggle accessibility of collection nesting.
-	//
-	// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'
-	// @param collections Addresses of collections that will be available for nesting.
-	//
-	// Selector: setCollectionNesting(bool,address[]) 64872396
-	function setCollectionNesting(bool enable, address[] memory collections)
-		external;
-
-	// Set the collection access method.
-	// @param mode Access mode
-	// 	0 for Normal
-	// 	1 for AllowList
-	//
-	// Selector: setCollectionAccess(uint8) 41835d4c
-	function setCollectionAccess(uint8 mode) external;
-
-	// Add the user to the allowed list.
-	//
-	// @param user Address of a trusted user.
-	//
-	// Selector: addToCollectionAllowList(address) 67844fe6
-	function addToCollectionAllowList(address user) external;
+	/// @notice Find the owner of an NFT
+	/// @dev NFTs assigned to zero address are considered invalid, and queries
+	///  about them do throw.
+	/// @param tokenId The identifier for an NFT
+	/// @return The address of the owner of the NFT
+	/// @dev EVM selector for this function is: 0x6352211e,
+	///  or in textual repr: ownerOf(uint256)
+	function ownerOf(uint256 tokenId) external view returns (address);
 
-	// Remove the user from the allowed list.
-	//
-	// @param user Address of a removed user.
-	//
-	// Selector: removeFromCollectionAllowList(address) 85c51acb
-	function removeFromCollectionAllowList(address user) external;
+	/// @dev Not implemented
+	/// @dev EVM selector for this function is: 0xb88d4fde,
+	///  or in textual repr: safeTransferFrom(address,address,uint256,bytes)
+	function safeTransferFrom(
+		address from,
+		address to,
+		uint256 tokenId,
+		bytes memory data
+	) external;
 
-	// Switch permission for minting.
-	//
-	// @param mode Enable if "true".
-	//
-	// Selector: setCollectionMintMode(bool) 00018e84
-	function setCollectionMintMode(bool mode) external;
+	/// @dev Not implemented
+	/// @dev EVM selector for this function is: 0x42842e0e,
+	///  or in textual repr: safeTransferFrom(address,address,uint256)
+	function safeTransferFrom(
+		address from,
+		address to,
+		uint256 tokenId
+	) external;
 
-	// Check that account is the owner or admin of the collection
-	//
-	// @param user account to verify
-	// @return "true" if account is the owner or admin
-	//
-	// Selector: isOwnerOrAdmin(address) 9811b0c7
-	function isOwnerOrAdmin(address user) external view returns (bool);
+	/// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE
+	///  TO CONFIRM THAT `to` IS CAPABLE OF RECEIVING NFTS OR ELSE
+	///  THEY MAY BE PERMANENTLY LOST
+	/// @dev Throws unless `msg.sender` is the current owner or an authorized
+	///  operator for this NFT. Throws if `from` is not the current owner. Throws
+	///  if `to` is the zero address. Throws if `tokenId` is not a valid NFT.
+	/// @param from The current owner of the NFT
+	/// @param to The new owner
+	/// @param tokenId The NFT to transfer
+	/// @dev EVM selector for this function is: 0x23b872dd,
+	///  or in textual repr: transferFrom(address,address,uint256)
+	function transferFrom(
+		address from,
+		address to,
+		uint256 tokenId
+	) external;
 
-	// Check that substrate account is the owner or admin of the collection
-	//
-	// @param user account to verify
-	// @return "true" if account is the owner or admin
-	//
-	// Selector: isOwnerOrAdminSubstrate(uint256) 68910e00
-	function isOwnerOrAdminSubstrate(uint256 user) external view returns (bool);
+	/// @notice Set or reaffirm the approved address for an NFT
+	/// @dev The zero address indicates there is no approved address.
+	/// @dev Throws unless `msg.sender` is the current NFT owner, or an authorized
+	///  operator of the current owner.
+	/// @param approved The new approved NFT controller
+	/// @param tokenId The NFT to approve
+	/// @dev EVM selector for this function is: 0x095ea7b3,
+	///  or in textual repr: approve(address,uint256)
+	function approve(address approved, uint256 tokenId) external;
 
-	// Returns collection type
-	//
-	// @return `Fungible` or `NFT` or `ReFungible`
-	//
-	// Selector: uniqueCollectionType() d34b55b8
-	function uniqueCollectionType() external returns (string memory);
+	/// @dev Not implemented
+	/// @dev EVM selector for this function is: 0xa22cb465,
+	///  or in textual repr: setApprovalForAll(address,bool)
+	function setApprovalForAll(address operator, bool approved) external;
 
-	// Changes collection owner to another account
-	//
-	// @dev Owner can be changed only by current owner
-	// @param newOwner new owner account
-	//
-	// Selector: setOwner(address) 13af4035
-	function setOwner(address newOwner) external;
+	/// @dev Not implemented
+	/// @dev EVM selector for this function is: 0x081812fc,
+	///  or in textual repr: getApproved(uint256)
+	function getApproved(uint256 tokenId) external view returns (address);
 
-	// Changes collection owner to another substrate account
-	//
-	// @dev Owner can be changed only by current owner
-	// @param newOwner new owner substrate account
-	//
-	// Selector: setOwnerSubstrate(uint256) b212138f
-	function setOwnerSubstrate(uint256 newOwner) external;
+	/// @dev Not implemented
+	/// @dev EVM selector for this function is: 0xe985e9c5,
+	///  or in textual repr: isApprovedForAll(address,address)
+	function isApprovedForAll(address owner, address operator)
+		external
+		view
+		returns (address);
 }
 
 interface UniqueNFT is
modifiedtests/src/eth/api/UniqueRefungible.soldiffbeforeafterboth
--- a/tests/src/eth/api/UniqueRefungible.sol
+++ b/tests/src/eth/api/UniqueRefungible.sol
@@ -3,13 +3,7 @@
 
 pragma solidity >=0.8.0 <0.9.0;
 
-// Anonymous struct
-struct Tuple0 {
-	uint256 field_0;
-	string field_1;
-}
-
-// Common stubs holder
+/// @dev common stubs holder
 interface Dummy {
 
 }
@@ -18,40 +12,17 @@
 	function supportsInterface(bytes4 interfaceID) external view returns (bool);
 }
 
-// Inline
-interface ERC721Events {
-	event Transfer(
-		address indexed from,
-		address indexed to,
-		uint256 indexed tokenId
-	);
-	event Approval(
-		address indexed owner,
-		address indexed approved,
-		uint256 indexed tokenId
-	);
-	event ApprovalForAll(
-		address indexed owner,
-		address indexed operator,
-		bool approved
-	);
-}
-
-// Inline
-interface ERC721MintableEvents {
-	event MintingFinished();
-}
-
-// Selector: 41369377
+/// @title A contract that allows to set and delete token properties and change token property permissions.
+/// @dev the ERC-165 identifier for this interface is 0x41369377
 interface TokenProperties is Dummy, ERC165 {
-	// @notice Set permissions for token property.
-	// @dev Throws error if `msg.sender` is not admin or owner of the collection.
-	// @param key Property key.
-	// @param is_mutable Permission to mutate property.
-	// @param collection_admin Permission to mutate property by collection admin if property is mutable.
-	// @param token_owner Permission to mutate property by token owner if property is mutable.
-	//
-	// Selector: setTokenPropertyPermission(string,bool,bool,bool) 222d97fa
+	/// @notice Set permissions for token property.
+	/// @dev Throws error if `msg.sender` is not admin or owner of the collection.
+	/// @param key Property key.
+	/// @param isMutable Permission to mutate property.
+	/// @param collectionAdmin Permission to mutate property by collection admin if property is mutable.
+	/// @param tokenOwner Permission to mutate property by token owner if property is mutable.
+	/// @dev EVM selector for this function is: 0x222d97fa,
+	///  or in textual repr: setTokenPropertyPermission(string,bool,bool,bool)
 	function setTokenPropertyPermission(
 		string memory key,
 		bool isMutable,
@@ -59,469 +30,505 @@
 		bool tokenOwner
 	) external;
 
-	// @notice Set token property value.
-	// @dev Throws error if `msg.sender` has no permission to edit the property.
-	// @param tokenId ID of the token.
-	// @param key Property key.
-	// @param value Property value.
-	//
-	// Selector: setProperty(uint256,string,bytes) 1752d67b
+	/// @notice Set token property value.
+	/// @dev Throws error if `msg.sender` has no permission to edit the property.
+	/// @param tokenId ID of the token.
+	/// @param key Property key.
+	/// @param value Property value.
+	/// @dev EVM selector for this function is: 0x1752d67b,
+	///  or in textual repr: setProperty(uint256,string,bytes)
 	function setProperty(
 		uint256 tokenId,
 		string memory key,
 		bytes memory value
 	) external;
 
-	// @notice Delete token property value.
-	// @dev Throws error if `msg.sender` has no permission to edit the property.
-	// @param tokenId ID of the token.
-	// @param key Property key.
-	//
-	// Selector: deleteProperty(uint256,string) 066111d1
+	/// @notice Delete token property value.
+	/// @dev Throws error if `msg.sender` has no permission to edit the property.
+	/// @param tokenId ID of the token.
+	/// @param key Property key.
+	/// @dev EVM selector for this function is: 0x066111d1,
+	///  or in textual repr: deleteProperty(uint256,string)
 	function deleteProperty(uint256 tokenId, string memory key) external;
 
-	// @notice Get token property value.
-	// @dev Throws error if key not found
-	// @param tokenId ID of the token.
-	// @param key Property key.
-	// @return Property value bytes
-	//
-	// Selector: property(uint256,string) 7228c327
+	/// @notice Get token property value.
+	/// @dev Throws error if key not found
+	/// @param tokenId ID of the token.
+	/// @param key Property key.
+	/// @return Property value bytes
+	/// @dev EVM selector for this function is: 0x7228c327,
+	///  or in textual repr: property(uint256,string)
 	function property(uint256 tokenId, string memory key)
 		external
 		view
 		returns (bytes memory);
 }
 
-// Selector: 42966c68
-interface ERC721Burnable is Dummy, ERC165 {
-	// @notice Burns a specific ERC721 token.
-	// @dev Throws unless `msg.sender` is the current RFT owner, or an authorized
-	//  operator of the current owner.
-	// @param tokenId The RFT to approve
-	//
-	// Selector: burn(uint256) 42966c68
-	function burn(uint256 tokenId) external;
-}
+/// @title A contract that allows you to work with collections.
+/// @dev the ERC-165 identifier for this interface is 0xffe4da23
+interface Collection is Dummy, ERC165 {
+	/// Set collection property.
+	///
+	/// @param key Property key.
+	/// @param value Propery value.
+	/// @dev EVM selector for this function is: 0x2f073f66,
+	///  or in textual repr: setCollectionProperty(string,bytes)
+	function setCollectionProperty(string memory key, bytes memory value)
+		external;
 
-// Selector: 58800161
-interface ERC721 is Dummy, ERC165, ERC721Events {
-	// @notice Count all RFTs assigned to an owner
-	// @dev RFTs assigned to the zero address are considered invalid, and this
-	//  function throws for queries about the zero address.
-	// @param owner An address for whom to query the balance
-	// @return The number of RFTs owned by `owner`, possibly zero
-	//
-	// Selector: balanceOf(address) 70a08231
-	function balanceOf(address owner) external view returns (uint256);
+	/// Delete collection property.
+	///
+	/// @param key Property key.
+	/// @dev EVM selector for this function is: 0x7b7debce,
+	///  or in textual repr: deleteCollectionProperty(string)
+	function deleteCollectionProperty(string memory key) external;
 
-	// @notice Find the owner of an RFT
-	// @dev RFTs assigned to zero address are considered invalid, and queries
-	//  about them do throw.
-	//  Returns special 0xffffffffffffffffffffffffffffffffffffffff address for
-	//  the tokens that are partially owned.
-	// @param tokenId The identifier for an RFT
-	// @return The address of the owner of the RFT
-	//
-	// Selector: ownerOf(uint256) 6352211e
-	function ownerOf(uint256 tokenId) external view returns (address);
+	/// Get collection property.
+	///
+	/// @dev Throws error if key not found.
+	///
+	/// @param key Property key.
+	/// @return bytes The property corresponding to the key.
+	/// @dev EVM selector for this function is: 0xcf24fd6d,
+	///  or in textual repr: collectionProperty(string)
+	function collectionProperty(string memory key)
+		external
+		view
+		returns (bytes memory);
 
-	// @dev Not implemented
-	//
-	// Selector: safeTransferFromWithData(address,address,uint256,bytes) 60a11672
-	function safeTransferFromWithData(
-		address from,
-		address to,
-		uint256 tokenId,
-		bytes memory data
-	) external;
+	/// Set the sponsor of the collection.
+	///
+	/// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor.
+	///
+	/// @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract.
+	/// @dev EVM selector for this function is: 0x7623402e,
+	///  or in textual repr: setCollectionSponsor(address)
+	function setCollectionSponsor(address sponsor) external;
 
-	// @dev Not implemented
-	//
-	// Selector: safeTransferFrom(address,address,uint256) 42842e0e
-	function safeTransferFrom(
-		address from,
-		address to,
-		uint256 tokenId
-	) external;
+	/// Collection sponsorship confirmation.
+	///
+	/// @dev After setting the sponsor for the collection, it must be confirmed with this function.
+	/// @dev EVM selector for this function is: 0x3c50e97a,
+	///  or in textual repr: confirmCollectionSponsorship()
+	function confirmCollectionSponsorship() external;
 
-	// @notice Transfer ownership of an RFT -- THE CALLER IS RESPONSIBLE
-	//  TO CONFIRM THAT `to` IS CAPABLE OF RECEIVING NFTS OR ELSE
-	//  THEY MAY BE PERMANENTLY LOST
-	// @dev Throws unless `msg.sender` is the current owner or an authorized
-	//  operator for this RFT. Throws if `from` is not the current owner. Throws
-	//  if `to` is the zero address. Throws if `tokenId` is not a valid RFT.
-	//  Throws if RFT pieces have multiple owners.
-	// @param from The current owner of the NFT
-	// @param to The new owner
-	// @param tokenId The NFT to transfer
-	// @param _value Not used for an NFT
-	//
-	// Selector: transferFrom(address,address,uint256) 23b872dd
-	function transferFrom(
-		address from,
-		address to,
-		uint256 tokenId
-	) external;
+	/// Set limits for the collection.
+	/// @dev Throws error if limit not found.
+	/// @param limit Name of the limit. Valid names:
+	/// 	"accountTokenOwnershipLimit",
+	/// 	"sponsoredDataSize",
+	/// 	"sponsoredDataRateLimit",
+	/// 	"tokenLimit",
+	/// 	"sponsorTransferTimeout",
+	/// 	"sponsorApproveTimeout"
+	/// @param value Value of the limit.
+	/// @dev EVM selector for this function is: 0x6a3841db,
+	///  or in textual repr: setCollectionLimit(string,uint32)
+	function setCollectionLimit(string memory limit, uint32 value) external;
 
-	// @dev Not implemented
-	//
-	// Selector: approve(address,uint256) 095ea7b3
-	function approve(address approved, uint256 tokenId) external;
+	/// Set limits for the collection.
+	/// @dev Throws error if limit not found.
+	/// @param limit Name of the limit. Valid names:
+	/// 	"ownerCanTransfer",
+	/// 	"ownerCanDestroy",
+	/// 	"transfersEnabled"
+	/// @param value Value of the limit.
+	/// @dev EVM selector for this function is: 0x993b7fba,
+	///  or in textual repr: setCollectionLimit(string,bool)
+	function setCollectionLimit(string memory limit, bool value) external;
 
-	// @dev Not implemented
-	//
-	// Selector: setApprovalForAll(address,bool) a22cb465
-	function setApprovalForAll(address operator, bool approved) external;
+	/// Get contract address.
+	/// @dev EVM selector for this function is: 0xf6b4dfb4,
+	///  or in textual repr: contractAddress()
+	function contractAddress() external view returns (address);
 
-	// @dev Not implemented
-	//
-	// Selector: getApproved(uint256) 081812fc
-	function getApproved(uint256 tokenId) external view returns (address);
+	/// Add collection admin by substrate address.
+	/// @param newAdmin Substrate administrator address.
+	/// @dev EVM selector for this function is: 0x5730062b,
+	///  or in textual repr: addCollectionAdminSubstrate(uint256)
+	function addCollectionAdminSubstrate(uint256 newAdmin) external;
 
-	// @dev Not implemented
-	//
-	// Selector: isApprovedForAll(address,address) e985e9c5
-	function isApprovedForAll(address owner, address operator)
-		external
-		view
-		returns (address);
-}
+	/// Remove collection admin by substrate address.
+	/// @param admin Substrate administrator address.
+	/// @dev EVM selector for this function is: 0x4048fcf9,
+	///  or in textual repr: removeCollectionAdminSubstrate(uint256)
+	function removeCollectionAdminSubstrate(uint256 admin) external;
 
-// Selector: 5b5e139f
-interface ERC721Metadata is Dummy, ERC165 {
-	// @notice A descriptive name for a collection of RFTs in this contract
-	//
-	// Selector: name() 06fdde03
-	function name() external view returns (string memory);
+	/// Add collection admin.
+	/// @param newAdmin Address of the added administrator.
+	/// @dev EVM selector for this function is: 0x92e462c7,
+	///  or in textual repr: addCollectionAdmin(address)
+	function addCollectionAdmin(address newAdmin) external;
 
-	// @notice An abbreviated name for RFTs in this contract
-	//
-	// Selector: symbol() 95d89b41
-	function symbol() external view returns (string memory);
+	/// Remove collection admin.
+	///
+	/// @param admin Address of the removed administrator.
+	/// @dev EVM selector for this function is: 0xfafd7b42,
+	///  or in textual repr: removeCollectionAdmin(address)
+	function removeCollectionAdmin(address admin) external;
 
-	// @notice A distinct Uniform Resource Identifier (URI) for a given asset.
-	//
-	// @dev If the token has a `url` property and it is not empty, it is returned.
-	//  Else If the collection does not have a property with key `schemaName` or its value is not equal to `ERC721Metadata`, it return an error `tokenURI not set`.
-	//  If the collection property `baseURI` is empty or absent, return "" (empty string)
-	//  otherwise, if token property `suffix` present and is non-empty, return concatenation of baseURI and suffix
-	//  otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings).
-	//
-	// @return token's const_metadata
-	//
-	// Selector: tokenURI(uint256) c87b56dd
-	function tokenURI(uint256 tokenId) external view returns (string memory);
+	/// Toggle accessibility of collection nesting.
+	///
+	/// @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'
+	/// @dev EVM selector for this function is: 0x112d4586,
+	///  or in textual repr: setCollectionNesting(bool)
+	function setCollectionNesting(bool enable) external;
+
+	/// Toggle accessibility of collection nesting.
+	///
+	/// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'
+	/// @param collections Addresses of collections that will be available for nesting.
+	/// @dev EVM selector for this function is: 0x64872396,
+	///  or in textual repr: setCollectionNesting(bool,address[])
+	function setCollectionNesting(bool enable, address[] memory collections)
+		external;
+
+	/// Set the collection access method.
+	/// @param mode Access mode
+	/// 	0 for Normal
+	/// 	1 for AllowList
+	/// @dev EVM selector for this function is: 0x41835d4c,
+	///  or in textual repr: setCollectionAccess(uint8)
+	function setCollectionAccess(uint8 mode) external;
+
+	/// Add the user to the allowed list.
+	///
+	/// @param user Address of a trusted user.
+	/// @dev EVM selector for this function is: 0x67844fe6,
+	///  or in textual repr: addToCollectionAllowList(address)
+	function addToCollectionAllowList(address user) external;
+
+	/// Remove the user from the allowed list.
+	///
+	/// @param user Address of a removed user.
+	/// @dev EVM selector for this function is: 0x85c51acb,
+	///  or in textual repr: removeFromCollectionAllowList(address)
+	function removeFromCollectionAllowList(address user) external;
+
+	/// Switch permission for minting.
+	///
+	/// @param mode Enable if "true".
+	/// @dev EVM selector for this function is: 0x00018e84,
+	///  or in textual repr: setCollectionMintMode(bool)
+	function setCollectionMintMode(bool mode) external;
+
+	/// Check that account is the owner or admin of the collection
+	///
+	/// @param user account to verify
+	/// @return "true" if account is the owner or admin
+	/// @dev EVM selector for this function is: 0x9811b0c7,
+	///  or in textual repr: isOwnerOrAdmin(address)
+	function isOwnerOrAdmin(address user) external view returns (bool);
+
+	/// Check that substrate account is the owner or admin of the collection
+	///
+	/// @param user account to verify
+	/// @return "true" if account is the owner or admin
+	/// @dev EVM selector for this function is: 0x68910e00,
+	///  or in textual repr: isOwnerOrAdminSubstrate(uint256)
+	function isOwnerOrAdminSubstrate(uint256 user) external view returns (bool);
+
+	/// Returns collection type
+	///
+	/// @return `Fungible` or `NFT` or `ReFungible`
+	/// @dev EVM selector for this function is: 0xd34b55b8,
+	///  or in textual repr: uniqueCollectionType()
+	function uniqueCollectionType() external returns (string memory);
+
+	/// Changes collection owner to another account
+	///
+	/// @dev Owner can be changed only by current owner
+	/// @param newOwner new owner account
+	/// @dev EVM selector for this function is: 0x13af4035,
+	///  or in textual repr: setOwner(address)
+	function setOwner(address newOwner) external;
+
+	/// Changes collection owner to another substrate account
+	///
+	/// @dev Owner can be changed only by current owner
+	/// @param newOwner new owner substrate account
+	/// @dev EVM selector for this function is: 0xb212138f,
+	///  or in textual repr: setOwnerSubstrate(uint256)
+	function setOwnerSubstrate(uint256 newOwner) external;
+}
+
+/// @title ERC721 Token that can be irreversibly burned (destroyed).
+/// @dev the ERC-165 identifier for this interface is 0x42966c68
+interface ERC721Burnable is Dummy, ERC165 {
+	/// @notice Burns a specific ERC721 token.
+	/// @dev Throws unless `msg.sender` is the current RFT owner, or an authorized
+	///  operator of the current owner.
+	/// @param tokenId The RFT to approve
+	/// @dev EVM selector for this function is: 0x42966c68,
+	///  or in textual repr: burn(uint256)
+	function burn(uint256 tokenId) external;
 }
 
-// Selector: 68ccfe89
+/// @dev inlined interface
+interface ERC721MintableEvents {
+	event MintingFinished();
+}
+
+/// @title ERC721 minting logic.
+/// @dev the ERC-165 identifier for this interface is 0x68ccfe89
 interface ERC721Mintable is Dummy, ERC165, ERC721MintableEvents {
-	// Selector: mintingFinished() 05d2035b
+	/// @dev EVM selector for this function is: 0x05d2035b,
+	///  or in textual repr: mintingFinished()
 	function mintingFinished() external view returns (bool);
 
-	// @notice Function to mint token.
-	// @dev `tokenId` should be obtained with `nextTokenId` method,
-	//  unlike standard, you can't specify it manually
-	// @param to The new owner
-	// @param tokenId ID of the minted RFT
-	//
-	// Selector: mint(address,uint256) 40c10f19
+	/// @notice Function to mint token.
+	/// @dev `tokenId` should be obtained with `nextTokenId` method,
+	///  unlike standard, you can't specify it manually
+	/// @param to The new owner
+	/// @param tokenId ID of the minted RFT
+	/// @dev EVM selector for this function is: 0x40c10f19,
+	///  or in textual repr: mint(address,uint256)
 	function mint(address to, uint256 tokenId) external returns (bool);
 
-	// @notice Function to mint token with the given tokenUri.
-	// @dev `tokenId` should be obtained with `nextTokenId` method,
-	//  unlike standard, you can't specify it manually
-	// @param to The new owner
-	// @param tokenId ID of the minted RFT
-	// @param tokenUri Token URI that would be stored in the RFT properties
-	//
-	// Selector: mintWithTokenURI(address,uint256,string) 50bb4e7f
+	/// @notice Function to mint token with the given tokenUri.
+	/// @dev `tokenId` should be obtained with `nextTokenId` method,
+	///  unlike standard, you can't specify it manually
+	/// @param to The new owner
+	/// @param tokenId ID of the minted RFT
+	/// @param tokenUri Token URI that would be stored in the RFT properties
+	/// @dev EVM selector for this function is: 0x50bb4e7f,
+	///  or in textual repr: mintWithTokenURI(address,uint256,string)
 	function mintWithTokenURI(
 		address to,
 		uint256 tokenId,
 		string memory tokenUri
 	) external returns (bool);
 
-	// @dev Not implemented
-	//
-	// Selector: finishMinting() 7d64bcb4
+	/// @dev Not implemented
+	/// @dev EVM selector for this function is: 0x7d64bcb4,
+	///  or in textual repr: finishMinting()
 	function finishMinting() external returns (bool);
 }
-
-// Selector: 780e9d63
-interface ERC721Enumerable is Dummy, ERC165 {
-	// @notice Enumerate valid RFTs
-	// @param index A counter less than `totalSupply()`
-	// @return The token identifier for the `index`th NFT,
-	//  (sort order not specified)
-	//
-	// Selector: tokenByIndex(uint256) 4f6ccce7
-	function tokenByIndex(uint256 index) external view returns (uint256);
 
-	// Not implemented
-	//
-	// Selector: tokenOfOwnerByIndex(address,uint256) 2f745c59
-	function tokenOfOwnerByIndex(address owner, uint256 index)
-		external
-		view
-		returns (uint256);
-
-	// @notice Count RFTs tracked by this contract
-	// @return A count of valid RFTs tracked by this contract, where each one of
-	//  them has an assigned and queryable owner not equal to the zero address
-	//
-	// Selector: totalSupply() 18160ddd
-	function totalSupply() external view returns (uint256);
-}
-
-// Selector: 7c3bef89
+/// @title Unique extensions for ERC721.
+/// @dev the ERC-165 identifier for this interface is 0x7c3bef89
 interface ERC721UniqueExtensions is Dummy, ERC165 {
-	// @notice Transfer ownership of an RFT
-	// @dev Throws unless `msg.sender` is the current owner. Throws if `to`
-	//  is the zero address. Throws if `tokenId` is not a valid RFT.
-	//  Throws if RFT pieces have multiple owners.
-	// @param to The new owner
-	// @param tokenId The RFT to transfer
-	// @param _value Not used for an RFT
-	//
-	// Selector: transfer(address,uint256) a9059cbb
+	/// @notice Transfer ownership of an RFT
+	/// @dev Throws unless `msg.sender` is the current owner. Throws if `to`
+	///  is the zero address. Throws if `tokenId` is not a valid RFT.
+	///  Throws if RFT pieces have multiple owners.
+	/// @param to The new owner
+	/// @param tokenId The RFT to transfer
+	/// @dev EVM selector for this function is: 0xa9059cbb,
+	///  or in textual repr: transfer(address,uint256)
 	function transfer(address to, uint256 tokenId) external;
 
-	// @notice Burns a specific ERC721 token.
-	// @dev Throws unless `msg.sender` is the current owner or an authorized
-	//  operator for this RFT. Throws if `from` is not the current owner. Throws
-	//  if `to` is the zero address. Throws if `tokenId` is not a valid RFT.
-	//  Throws if RFT pieces have multiple owners.
-	// @param from The current owner of the RFT
-	// @param tokenId The RFT to transfer
-	// @param _value Not used for an RFT
-	//
-	// Selector: burnFrom(address,uint256) 79cc6790
+	/// @notice Burns a specific ERC721 token.
+	/// @dev Throws unless `msg.sender` is the current owner or an authorized
+	///  operator for this RFT. Throws if `from` is not the current owner. Throws
+	///  if `to` is the zero address. Throws if `tokenId` is not a valid RFT.
+	///  Throws if RFT pieces have multiple owners.
+	/// @param from The current owner of the RFT
+	/// @param tokenId The RFT to transfer
+	/// @dev EVM selector for this function is: 0x79cc6790,
+	///  or in textual repr: burnFrom(address,uint256)
 	function burnFrom(address from, uint256 tokenId) external;
 
-	// @notice Returns next free RFT ID.
-	//
-	// Selector: nextTokenId() 75794a3c
+	/// @notice Returns next free RFT ID.
+	/// @dev EVM selector for this function is: 0x75794a3c,
+	///  or in textual repr: nextTokenId()
 	function nextTokenId() external view returns (uint256);
 
-	// @notice Function to mint multiple tokens.
-	// @dev `tokenIds` should be an array of consecutive numbers and first number
-	//  should be obtained with `nextTokenId` method
-	// @param to The new owner
-	// @param tokenIds IDs of the minted RFTs
-	//
-	// Selector: mintBulk(address,uint256[]) 44a9945e
+	/// @notice Function to mint multiple tokens.
+	/// @dev `tokenIds` should be an array of consecutive numbers and first number
+	///  should be obtained with `nextTokenId` method
+	/// @param to The new owner
+	/// @param tokenIds IDs of the minted RFTs
+	/// @dev EVM selector for this function is: 0x44a9945e,
+	///  or in textual repr: mintBulk(address,uint256[])
 	function mintBulk(address to, uint256[] memory tokenIds)
 		external
 		returns (bool);
 
-	// @notice Function to mint multiple tokens with the given tokenUris.
-	// @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive
-	//  numbers and first number should be obtained with `nextTokenId` method
-	// @param to The new owner
-	// @param tokens array of pairs of token ID and token URI for minted tokens
-	//
-	// Selector: mintBulkWithTokenURI(address,(uint256,string)[]) 36543006
-	function mintBulkWithTokenURI(address to, Tuple0[] memory tokens)
+	/// @notice Function to mint multiple tokens with the given tokenUris.
+	/// @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive
+	///  numbers and first number should be obtained with `nextTokenId` method
+	/// @param to The new owner
+	/// @param tokens array of pairs of token ID and token URI for minted tokens
+	/// @dev EVM selector for this function is: 0x36543006,
+	///  or in textual repr: mintBulkWithTokenURI(address,(uint256,string)[])
+	function mintBulkWithTokenURI(address to, Tuple8[] memory tokens)
 		external
 		returns (bool);
 
-	// Returns EVM address for refungible token
-	//
-	// @param token ID of the token
-	//
-	// Selector: tokenContractAddress(uint256) ab76fac6
+	/// Returns EVM address for refungible token
+	///
+	/// @param token ID of the token
+	/// @dev EVM selector for this function is: 0xab76fac6,
+	///  or in textual repr: tokenContractAddress(uint256)
 	function tokenContractAddress(uint256 token)
 		external
 		view
 		returns (address);
 }
 
-// Selector: ffe4da23
-interface Collection is Dummy, ERC165 {
-	// Set collection property.
-	//
-	// @param key Property key.
-	// @param value Propery value.
-	//
-	// Selector: setCollectionProperty(string,bytes) 2f073f66
-	function setCollectionProperty(string memory key, bytes memory value)
-		external;
+/// @dev anonymous struct
+struct Tuple8 {
+	uint256 field_0;
+	string field_1;
+}
 
-	// Delete collection property.
-	//
-	// @param key Property key.
-	//
-	// Selector: deleteCollectionProperty(string) 7b7debce
-	function deleteCollectionProperty(string memory key) external;
+/// @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
+/// @dev See https://eips.ethereum.org/EIPS/eip-721
+/// @dev the ERC-165 identifier for this interface is 0x780e9d63
+interface ERC721Enumerable is Dummy, ERC165 {
+	/// @notice Enumerate valid RFTs
+	/// @param index A counter less than `totalSupply()`
+	/// @return The token identifier for the `index`th NFT,
+	///  (sort order not specified)
+	/// @dev EVM selector for this function is: 0x4f6ccce7,
+	///  or in textual repr: tokenByIndex(uint256)
+	function tokenByIndex(uint256 index) external view returns (uint256);
 
-	// Get collection property.
-	//
-	// @dev Throws error if key not found.
-	//
-	// @param key Property key.
-	// @return bytes The property corresponding to the key.
-	//
-	// Selector: collectionProperty(string) cf24fd6d
-	function collectionProperty(string memory key)
+	/// Not implemented
+	/// @dev EVM selector for this function is: 0x2f745c59,
+	///  or in textual repr: tokenOfOwnerByIndex(address,uint256)
+	function tokenOfOwnerByIndex(address owner, uint256 index)
 		external
 		view
-		returns (bytes memory);
+		returns (uint256);
 
-	// Set the sponsor of the collection.
-	//
-	// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor.
-	//
-	// @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract.
-	//
-	// Selector: setCollectionSponsor(address) 7623402e
-	function setCollectionSponsor(address sponsor) external;
+	/// @notice Count RFTs tracked by this contract
+	/// @return A count of valid RFTs tracked by this contract, where each one of
+	///  them has an assigned and queryable owner not equal to the zero address
+	/// @dev EVM selector for this function is: 0x18160ddd,
+	///  or in textual repr: totalSupply()
+	function totalSupply() external view returns (uint256);
+}
 
-	// Collection sponsorship confirmation.
-	//
-	// @dev After setting the sponsor for the collection, it must be confirmed with this function.
-	//
-	// Selector: confirmCollectionSponsorship() 3c50e97a
-	function confirmCollectionSponsorship() external;
+/// @dev the ERC-165 identifier for this interface is 0x5b5e139f
+interface ERC721Metadata is Dummy, ERC165 {
+	/// @notice A descriptive name for a collection of RFTs in this contract
+	/// @dev EVM selector for this function is: 0x06fdde03,
+	///  or in textual repr: name()
+	function name() external view returns (string memory);
 
-	// Set limits for the collection.
-	// @dev Throws error if limit not found.
-	// @param limit Name of the limit. Valid names:
-	// 	"accountTokenOwnershipLimit",
-	// 	"sponsoredDataSize",
-	// 	"sponsoredDataRateLimit",
-	// 	"tokenLimit",
-	// 	"sponsorTransferTimeout",
-	// 	"sponsorApproveTimeout"
-	// @param value Value of the limit.
-	//
-	// Selector: setCollectionLimit(string,uint32) 6a3841db
-	function setCollectionLimit(string memory limit, uint32 value) external;
+	/// @notice An abbreviated name for RFTs in this contract
+	/// @dev EVM selector for this function is: 0x95d89b41,
+	///  or in textual repr: symbol()
+	function symbol() external view returns (string memory);
 
-	// Set limits for the collection.
-	// @dev Throws error if limit not found.
-	// @param limit Name of the limit. Valid names:
-	// 	"ownerCanTransfer",
-	// 	"ownerCanDestroy",
-	// 	"transfersEnabled"
-	// @param value Value of the limit.
-	//
-	// Selector: setCollectionLimit(string,bool) 993b7fba
-	function setCollectionLimit(string memory limit, bool value) external;
-
-	// Get contract address.
-	//
-	// Selector: contractAddress() f6b4dfb4
-	function contractAddress() external view returns (address);
-
-	// Add collection admin by substrate address.
-	// @param new_admin Substrate administrator address.
-	//
-	// Selector: addCollectionAdminSubstrate(uint256) 5730062b
-	function addCollectionAdminSubstrate(uint256 newAdmin) external;
+	/// @notice A distinct Uniform Resource Identifier (URI) for a given asset.
+	///
+	/// @dev If the token has a `url` property and it is not empty, it is returned.
+	///  Else If the collection does not have a property with key `schemaName` or its value is not equal to `ERC721Metadata`, it return an error `tokenURI not set`.
+	///  If the collection property `baseURI` is empty or absent, return "" (empty string)
+	///  otherwise, if token property `suffix` present and is non-empty, return concatenation of baseURI and suffix
+	///  otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings).
+	///
+	/// @return token's const_metadata
+	/// @dev EVM selector for this function is: 0xc87b56dd,
+	///  or in textual repr: tokenURI(uint256)
+	function tokenURI(uint256 tokenId) external view returns (string memory);
+}
 
-	// Remove collection admin by substrate address.
-	// @param admin Substrate administrator address.
-	//
-	// Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9
-	function removeCollectionAdminSubstrate(uint256 admin) external;
-
-	// Add collection admin.
-	// @param new_admin Address of the added administrator.
-	//
-	// Selector: addCollectionAdmin(address) 92e462c7
-	function addCollectionAdmin(address newAdmin) external;
-
-	// Remove collection admin.
-	//
-	// @param new_admin Address of the removed administrator.
-	//
-	// Selector: removeCollectionAdmin(address) fafd7b42
-	function removeCollectionAdmin(address admin) external;
-
-	// Toggle accessibility of collection nesting.
-	//
-	// @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'
-	//
-	// Selector: setCollectionNesting(bool) 112d4586
-	function setCollectionNesting(bool enable) external;
-
-	// Toggle accessibility of collection nesting.
-	//
-	// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'
-	// @param collections Addresses of collections that will be available for nesting.
-	//
-	// Selector: setCollectionNesting(bool,address[]) 64872396
-	function setCollectionNesting(bool enable, address[] memory collections)
-		external;
+/// @dev inlined interface
+interface ERC721Events {
+	event Transfer(
+		address indexed from,
+		address indexed to,
+		uint256 indexed tokenId
+	);
+	event Approval(
+		address indexed owner,
+		address indexed approved,
+		uint256 indexed tokenId
+	);
+	event ApprovalForAll(
+		address indexed owner,
+		address indexed operator,
+		bool approved
+	);
+}
 
-	// Set the collection access method.
-	// @param mode Access mode
-	// 	0 for Normal
-	// 	1 for AllowList
-	//
-	// Selector: setCollectionAccess(uint8) 41835d4c
-	function setCollectionAccess(uint8 mode) external;
+/// @title ERC-721 Non-Fungible Token Standard
+/// @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md
+/// @dev the ERC-165 identifier for this interface is 0x58800161
+interface ERC721 is Dummy, ERC165, ERC721Events {
+	/// @notice Count all RFTs assigned to an owner
+	/// @dev RFTs assigned to the zero address are considered invalid, and this
+	///  function throws for queries about the zero address.
+	/// @param owner An address for whom to query the balance
+	/// @return The number of RFTs owned by `owner`, possibly zero
+	/// @dev EVM selector for this function is: 0x70a08231,
+	///  or in textual repr: balanceOf(address)
+	function balanceOf(address owner) external view returns (uint256);
 
-	// Add the user to the allowed list.
-	//
-	// @param user Address of a trusted user.
-	//
-	// Selector: addToCollectionAllowList(address) 67844fe6
-	function addToCollectionAllowList(address user) external;
+	/// @notice Find the owner of an RFT
+	/// @dev RFTs assigned to zero address are considered invalid, and queries
+	///  about them do throw.
+	///  Returns special 0xffffffffffffffffffffffffffffffffffffffff address for
+	///  the tokens that are partially owned.
+	/// @param tokenId The identifier for an RFT
+	/// @return The address of the owner of the RFT
+	/// @dev EVM selector for this function is: 0x6352211e,
+	///  or in textual repr: ownerOf(uint256)
+	function ownerOf(uint256 tokenId) external view returns (address);
 
-	// Remove the user from the allowed list.
-	//
-	// @param user Address of a removed user.
-	//
-	// Selector: removeFromCollectionAllowList(address) 85c51acb
-	function removeFromCollectionAllowList(address user) external;
+	/// @dev Not implemented
+	/// @dev EVM selector for this function is: 0x60a11672,
+	///  or in textual repr: safeTransferFromWithData(address,address,uint256,bytes)
+	function safeTransferFromWithData(
+		address from,
+		address to,
+		uint256 tokenId,
+		bytes memory data
+	) external;
 
-	// Switch permission for minting.
-	//
-	// @param mode Enable if "true".
-	//
-	// Selector: setCollectionMintMode(bool) 00018e84
-	function setCollectionMintMode(bool mode) external;
+	/// @dev Not implemented
+	/// @dev EVM selector for this function is: 0x42842e0e,
+	///  or in textual repr: safeTransferFrom(address,address,uint256)
+	function safeTransferFrom(
+		address from,
+		address to,
+		uint256 tokenId
+	) external;
 
-	// Check that account is the owner or admin of the collection
-	//
-	// @param user account to verify
-	// @return "true" if account is the owner or admin
-	//
-	// Selector: isOwnerOrAdmin(address) 9811b0c7
-	function isOwnerOrAdmin(address user) external view returns (bool);
+	/// @notice Transfer ownership of an RFT -- THE CALLER IS RESPONSIBLE
+	///  TO CONFIRM THAT `to` IS CAPABLE OF RECEIVING NFTS OR ELSE
+	///  THEY MAY BE PERMANENTLY LOST
+	/// @dev Throws unless `msg.sender` is the current owner or an authorized
+	///  operator for this RFT. Throws if `from` is not the current owner. Throws
+	///  if `to` is the zero address. Throws if `tokenId` is not a valid RFT.
+	///  Throws if RFT pieces have multiple owners.
+	/// @param from The current owner of the NFT
+	/// @param to The new owner
+	/// @param tokenId The NFT to transfer
+	/// @dev EVM selector for this function is: 0x23b872dd,
+	///  or in textual repr: transferFrom(address,address,uint256)
+	function transferFrom(
+		address from,
+		address to,
+		uint256 tokenId
+	) external;
 
-	// Check that substrate account is the owner or admin of the collection
-	//
-	// @param user account to verify
-	// @return "true" if account is the owner or admin
-	//
-	// Selector: isOwnerOrAdminSubstrate(uint256) 68910e00
-	function isOwnerOrAdminSubstrate(uint256 user) external view returns (bool);
+	/// @dev Not implemented
+	/// @dev EVM selector for this function is: 0x095ea7b3,
+	///  or in textual repr: approve(address,uint256)
+	function approve(address approved, uint256 tokenId) external;
 
-	// Returns collection type
-	//
-	// @return `Fungible` or `NFT` or `ReFungible`
-	//
-	// Selector: uniqueCollectionType() d34b55b8
-	function uniqueCollectionType() external returns (string memory);
+	/// @dev Not implemented
+	/// @dev EVM selector for this function is: 0xa22cb465,
+	///  or in textual repr: setApprovalForAll(address,bool)
+	function setApprovalForAll(address operator, bool approved) external;
 
-	// Changes collection owner to another account
-	//
-	// @dev Owner can be changed only by current owner
-	// @param newOwner new owner account
-	//
-	// Selector: setOwner(address) 13af4035
-	function setOwner(address newOwner) external;
+	/// @dev Not implemented
+	/// @dev EVM selector for this function is: 0x081812fc,
+	///  or in textual repr: getApproved(uint256)
+	function getApproved(uint256 tokenId) external view returns (address);
 
-	// Changes collection owner to another substrate account
-	//
-	// @dev Owner can be changed only by current owner
-	// @param newOwner new owner substrate account
-	//
-	// Selector: setOwnerSubstrate(uint256) b212138f
-	function setOwnerSubstrate(uint256 newOwner) external;
+	/// @dev Not implemented
+	/// @dev EVM selector for this function is: 0xe985e9c5,
+	///  or in textual repr: isApprovedForAll(address,address)
+	function isApprovedForAll(address owner, address operator)
+		external
+		view
+		returns (address);
 }
 
 interface UniqueRefungible is
modifiedtests/src/eth/api/UniqueRefungibleToken.soldiffbeforeafterboth
--- a/tests/src/eth/api/UniqueRefungibleToken.sol
+++ b/tests/src/eth/api/UniqueRefungibleToken.sol
@@ -3,7 +3,7 @@
 
 pragma solidity >=0.8.0 <0.9.0;
 
-// Common stubs holder
+/// @dev common stubs holder
 interface Dummy {
 
 }
@@ -12,120 +12,127 @@
 	function supportsInterface(bytes4 interfaceID) external view returns (bool);
 }
 
-// Inline
-interface ERC20Events {
-	event Transfer(address indexed from, address indexed to, uint256 value);
-	event Approval(
-		address indexed owner,
-		address indexed spender,
-		uint256 value
-	);
-}
-
-// Selector: 042f1106
+/// @dev the ERC-165 identifier for this interface is 0x042f1106
 interface ERC1633UniqueExtensions is Dummy, ERC165 {
-	// Selector: setParentNFT(address,uint256) 042f1106
+	/// @dev EVM selector for this function is: 0x042f1106,
+	///  or in textual repr: setParentNFT(address,uint256)
 	function setParentNFT(address collection, uint256 nftId)
 		external
 		returns (bool);
 }
 
-// Selector: 5755c3f2
+/// @dev the ERC-165 identifier for this interface is 0x5755c3f2
 interface ERC1633 is Dummy, ERC165 {
-	// Selector: parentToken() 80a54001
+	/// @dev EVM selector for this function is: 0x80a54001,
+	///  or in textual repr: parentToken()
 	function parentToken() external view returns (address);
 
-	// Selector: parentTokenId() d7f083f3
+	/// @dev EVM selector for this function is: 0xd7f083f3,
+	///  or in textual repr: parentTokenId()
 	function parentTokenId() external view returns (uint256);
 }
 
-// Selector: 942e8b22
+/// @dev the ERC-165 identifier for this interface is 0xab8deb37
+interface ERC20UniqueExtensions is Dummy, ERC165 {
+	/// @dev Function that burns an amount of the token of a given account,
+	/// deducting from the sender's allowance for said account.
+	/// @param from The account whose tokens will be burnt.
+	/// @param amount The amount that will be burnt.
+	/// @dev EVM selector for this function is: 0x79cc6790,
+	///  or in textual repr: burnFrom(address,uint256)
+	function burnFrom(address from, uint256 amount) external returns (bool);
+
+	/// @dev Function that changes total amount of the tokens.
+	///  Throws if `msg.sender` doesn't owns all of the tokens.
+	/// @param amount New total amount of the tokens.
+	/// @dev EVM selector for this function is: 0xd2418ca7,
+	///  or in textual repr: repartition(uint256)
+	function repartition(uint256 amount) external returns (bool);
+}
+
+/// @dev inlined interface
+interface ERC20Events {
+	event Transfer(address indexed from, address indexed to, uint256 value);
+	event Approval(
+		address indexed owner,
+		address indexed spender,
+		uint256 value
+	);
+}
+
+/// @title Standard ERC20 token
+///
+/// @dev Implementation of the basic standard token.
+/// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
+/// @dev the ERC-165 identifier for this interface is 0x942e8b22
 interface ERC20 is Dummy, ERC165, ERC20Events {
-	// @return the name of the token.
-	//
-	// Selector: name() 06fdde03
+	/// @return the name of the token.
+	/// @dev EVM selector for this function is: 0x06fdde03,
+	///  or in textual repr: name()
 	function name() external view returns (string memory);
 
-	// @return the symbol of the token.
-	//
-	// Selector: symbol() 95d89b41
+	/// @return the symbol of the token.
+	/// @dev EVM selector for this function is: 0x95d89b41,
+	///  or in textual repr: symbol()
 	function symbol() external view returns (string memory);
 
-	// @dev Total number of tokens in existence
-	//
-	// Selector: totalSupply() 18160ddd
+	/// @dev Total number of tokens in existence
+	/// @dev EVM selector for this function is: 0x18160ddd,
+	///  or in textual repr: totalSupply()
 	function totalSupply() external view returns (uint256);
 
-	// @dev Not supported
-	//
-	// Selector: decimals() 313ce567
+	/// @dev Not supported
+	/// @dev EVM selector for this function is: 0x313ce567,
+	///  or in textual repr: decimals()
 	function decimals() external view returns (uint8);
 
-	// @dev Gets the balance of the specified address.
-	// @param owner The address to query the balance of.
-	// @return An uint256 representing the amount owned by the passed address.
-	//
-	// Selector: balanceOf(address) 70a08231
+	/// @dev Gets the balance of the specified address.
+	/// @param owner The address to query the balance of.
+	/// @return An uint256 representing the amount owned by the passed address.
+	/// @dev EVM selector for this function is: 0x70a08231,
+	///  or in textual repr: balanceOf(address)
 	function balanceOf(address owner) external view returns (uint256);
 
-	// @dev Transfer token for a specified address
-	// @param to The address to transfer to.
-	// @param amount The amount to be transferred.
-	//
-	// Selector: transfer(address,uint256) a9059cbb
+	/// @dev Transfer token for a specified address
+	/// @param to The address to transfer to.
+	/// @param amount The amount to be transferred.
+	/// @dev EVM selector for this function is: 0xa9059cbb,
+	///  or in textual repr: transfer(address,uint256)
 	function transfer(address to, uint256 amount) external returns (bool);
 
-	// @dev Transfer tokens from one address to another
-	// @param from address The address which you want to send tokens from
-	// @param to address The address which you want to transfer to
-	// @param amount uint256 the amount of tokens to be transferred
-	//
-	// Selector: transferFrom(address,address,uint256) 23b872dd
+	/// @dev Transfer tokens from one address to another
+	/// @param from address The address which you want to send tokens from
+	/// @param to address The address which you want to transfer to
+	/// @param amount uint256 the amount of tokens to be transferred
+	/// @dev EVM selector for this function is: 0x23b872dd,
+	///  or in textual repr: transferFrom(address,address,uint256)
 	function transferFrom(
 		address from,
 		address to,
 		uint256 amount
 	) external returns (bool);
 
-	// @dev Approve the passed address to spend the specified amount of tokens on behalf of `msg.sender`.
-	// Beware that changing an allowance with this method brings the risk that someone may use both the old
-	// and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
-	// race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
-	// https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
-	// @param spender The address which will spend the funds.
-	// @param amount The amount of tokens to be spent.
-	//
-	// Selector: approve(address,uint256) 095ea7b3
+	/// @dev Approve the passed address to spend the specified amount of tokens on behalf of `msg.sender`.
+	/// Beware that changing an allowance with this method brings the risk that someone may use both the old
+	/// and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
+	/// race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
+	/// https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
+	/// @param spender The address which will spend the funds.
+	/// @param amount The amount of tokens to be spent.
+	/// @dev EVM selector for this function is: 0x095ea7b3,
+	///  or in textual repr: approve(address,uint256)
 	function approve(address spender, uint256 amount) external returns (bool);
 
-	// @dev Function to check the amount of tokens that an owner allowed to a spender.
-	// @param owner address The address which owns the funds.
-	// @param spender address The address which will spend the funds.
-	// @return A uint256 specifying the amount of tokens still available for the spender.
-	//
-	// Selector: allowance(address,address) dd62ed3e
+	/// @dev Function to check the amount of tokens that an owner allowed to a spender.
+	/// @param owner address The address which owns the funds.
+	/// @param spender address The address which will spend the funds.
+	/// @return A uint256 specifying the amount of tokens still available for the spender.
+	/// @dev EVM selector for this function is: 0xdd62ed3e,
+	///  or in textual repr: allowance(address,address)
 	function allowance(address owner, address spender)
 		external
 		view
 		returns (uint256);
-}
-
-// Selector: ab8deb37
-interface ERC20UniqueExtensions is Dummy, ERC165 {
-	// @dev Function that burns an amount of the token of a given account,
-	// deducting from the sender's allowance for said account.
-	// @param from The account whose tokens will be burnt.
-	// @param amount The amount that will be burnt.
-	//
-	// Selector: burnFrom(address,uint256) 79cc6790
-	function burnFrom(address from, uint256 amount) external returns (bool);
-
-	// @dev Function that changes total amount of the tokens.
-	//  Throws if `msg.sender` doesn't owns all of the tokens.
-	// @param amount New total amount of the tokens.
-	//
-	// Selector: repartition(uint256) d2418ca7
-	function repartition(uint256 amount) external returns (bool);
 }
 
 interface UniqueRefungibleToken is
modifiedtests/src/eth/nonFungibleAbi.jsondiffbeforeafterboth
--- a/tests/src/eth/nonFungibleAbi.json
+++ b/tests/src/eth/nonFungibleAbi.json
@@ -255,7 +255,7 @@
           { "internalType": "uint256", "name": "field_0", "type": "uint256" },
           { "internalType": "string", "name": "field_1", "type": "string" }
         ],
-        "internalType": "struct Tuple0[]",
+        "internalType": "struct Tuple8[]",
         "name": "tokens",
         "type": "tuple[]"
       }
@@ -361,7 +361,7 @@
       { "internalType": "uint256", "name": "tokenId", "type": "uint256" },
       { "internalType": "bytes", "name": "data", "type": "bytes" }
     ],
-    "name": "safeTransferFromWithData",
+    "name": "safeTransferFrom",
     "outputs": [],
     "stateMutability": "nonpayable",
     "type": "function"
modifiedtests/src/eth/reFungibleAbi.jsondiffbeforeafterboth
--- a/tests/src/eth/reFungibleAbi.json
+++ b/tests/src/eth/reFungibleAbi.json
@@ -255,7 +255,7 @@
           { "internalType": "uint256", "name": "field_0", "type": "uint256" },
           { "internalType": "string", "name": "field_1", "type": "string" }
         ],
-        "internalType": "struct Tuple0[]",
+        "internalType": "struct Tuple8[]",
         "name": "tokens",
         "type": "tuple[]"
       }
modifiedtests/src/eth/util/contractHelpersAbi.jsondiffbeforeafterboth
--- a/tests/src/eth/util/contractHelpersAbi.json
+++ b/tests/src/eth/util/contractHelpersAbi.json
@@ -225,7 +225,7 @@
         "type": "address"
       },
       { "internalType": "address", "name": "user", "type": "address" },
-      { "internalType": "bool", "name": "allowed", "type": "bool" }
+      { "internalType": "bool", "name": "isAllowed", "type": "bool" }
     ],
     "name": "toggleAllowed",
     "outputs": [],