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

difftreelog

feat add eth methots for bulk properties

Trubnikov Sergey2022-10-24parent: #0321433.patch.diff
in: master

14 files changed

modifiedpallets/common/src/erc.rsdiffbeforeafterboth
--- a/pallets/common/src/erc.rs
+++ b/pallets/common/src/erc.rs
@@ -27,7 +27,7 @@
 use sp_std::vec::Vec;
 use up_data_structs::{
 	AccessMode, CollectionMode, CollectionPermissions, OwnerRestrictedSet, Property,
-	SponsoringRateLimit, SponsorshipState,
+	SponsoringRateLimit, SponsorshipState, PropertyKey,
 };
 use alloc::format;
 
@@ -97,6 +97,21 @@
 			.map_err(dispatch_to_evm::<T>)
 	}
 
+	/// Set collection properties.
+	///
+	/// @param properties Vector of properties key/value pair.
+	#[weight(<SelfWeightOf<T>>::set_collection_properties(properties.len() as u32))]
+	fn set_collection_properties(
+		&mut self,
+		caller: caller,
+		properties: Vec<(string, bytes)>,
+	) -> Result<void> {
+		for (key, value) in properties.into_iter() {
+			self.set_collection_property(caller, key, value)?;
+		}
+		Ok(())
+	}
+
 	/// Delete collection property.
 	///
 	/// @param key Property key.
@@ -123,12 +138,38 @@
 			.try_into()
 			.map_err(|_| "key too large")?;
 
-		let props = <CollectionProperties<T>>::get(self.id);
+		let props = CollectionProperties::<T>::get(self.id);
 		let prop = props.get(&key).ok_or("key not found")?;
 
 		Ok(bytes(prop.to_vec()))
 	}
 
+	/// Get collection properties.
+	///
+	/// @param keys Properties keys.
+	/// @return Vector of properties key/value pairs.
+	fn collection_properties(&self, keys: Vec<string>) -> Result<Vec<(string, bytes)>> {
+		let mut keys_ = Vec::<PropertyKey>::with_capacity(keys.len());
+		for key in keys {
+			keys_.push(
+				<Vec<u8>>::from(key)
+					.try_into()
+					.map_err(|_| Error::Revert("key too large".into()))?,
+			)
+		}
+		let properties = Pallet::<T>::filter_collection_properties(self.id, Some(keys_))
+			.map_err(dispatch_to_evm::<T>)?;
+
+		let mut properties_ = Vec::<(string, bytes)>::with_capacity(properties.len());
+		for p in properties {
+			let key =
+				string::from_utf8(p.key.into()).map_err(|e| Error::Revert(format!("{}", e)))?;
+			let value = bytes(p.value.to_vec());
+			properties_.push((key, value));
+		}
+		Ok(properties_)
+	}
+
 	/// Set the sponsor of the collection.
 	///
 	/// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor.
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
@@ -18,7 +18,7 @@
 }
 
 /// @title A contract that allows you to work with collections.
-/// @dev the ERC-165 identifier for this interface is 0x25d897dc
+/// @dev the ERC-165 identifier for this interface is 0x5d354410
 contract Collection is Dummy, ERC165 {
 	/// Set collection property.
 	///
@@ -33,6 +33,17 @@
 		dummy = 0;
 	}
 
+	/// Set collection properties.
+	///
+	/// @param properties Vector of properties key/value pair.
+	/// @dev EVM selector for this function is: 0x50b26b2a,
+	///  or in textual repr: setCollectionProperties((string,bytes)[])
+	function setCollectionProperties(Tuple10[] memory properties) public {
+		require(false, stub_error);
+		properties;
+		dummy = 0;
+	}
+
 	/// Delete collection property.
 	///
 	/// @param key Property key.
@@ -59,6 +70,19 @@
 		return hex"";
 	}
 
+	/// Get collection properties.
+	///
+	/// @param keys Properties keys.
+	/// @return Vector of properties key/value pairs.
+	/// @dev EVM selector for this function is: 0x285fb8e6,
+	///  or in textual repr: collectionProperties(string[])
+	function collectionProperties(string[] memory keys) public view returns (Tuple10[] memory) {
+		require(false, stub_error);
+		keys;
+		dummy;
+		return new Tuple10[](0);
+	}
+
 	/// Set the sponsor of the collection.
 	///
 	/// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor.
@@ -397,6 +421,12 @@
 	}
 }
 
+/// @dev anonymous struct
+struct Tuple10 {
+	string field_0;
+	bytes field_1;
+}
+
 /// @dev the ERC-165 identifier for this interface is 0x032e5926
 contract ERC20UniqueExtensions is Dummy, ERC165 {
 	/// @dev EVM selector for this function is: 0x0ecd0ab0,
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
@@ -91,7 +91,7 @@
 }
 
 /// @title A contract that allows you to work with collections.
-/// @dev the ERC-165 identifier for this interface is 0x25d897dc
+/// @dev the ERC-165 identifier for this interface is 0x5d354410
 contract Collection is Dummy, ERC165 {
 	/// Set collection property.
 	///
@@ -106,6 +106,17 @@
 		dummy = 0;
 	}
 
+	/// Set collection properties.
+	///
+	/// @param properties Vector of properties key/value pair.
+	/// @dev EVM selector for this function is: 0x50b26b2a,
+	///  or in textual repr: setCollectionProperties((string,bytes)[])
+	function setCollectionProperties(Tuple19[] memory properties) public {
+		require(false, stub_error);
+		properties;
+		dummy = 0;
+	}
+
 	/// Delete collection property.
 	///
 	/// @param key Property key.
@@ -132,6 +143,19 @@
 		return hex"";
 	}
 
+	/// Get collection properties.
+	///
+	/// @param keys Properties keys.
+	/// @return Vector of properties key/value pairs.
+	/// @dev EVM selector for this function is: 0x285fb8e6,
+	///  or in textual repr: collectionProperties(string[])
+	function collectionProperties(string[] memory keys) public view returns (Tuple19[] memory) {
+		require(false, stub_error);
+		keys;
+		dummy;
+		return new Tuple19[](0);
+	}
+
 	/// Set the sponsor of the collection.
 	///
 	/// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor.
@@ -470,6 +494,12 @@
 	}
 }
 
+/// @dev anonymous struct
+struct Tuple19 {
+	string field_0;
+	bytes field_1;
+}
+
 /// @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
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
@@ -91,7 +91,7 @@
 }
 
 /// @title A contract that allows you to work with collections.
-/// @dev the ERC-165 identifier for this interface is 0x25d897dc
+/// @dev the ERC-165 identifier for this interface is 0x5d354410
 contract Collection is Dummy, ERC165 {
 	/// Set collection property.
 	///
@@ -106,6 +106,17 @@
 		dummy = 0;
 	}
 
+	/// Set collection properties.
+	///
+	/// @param properties Vector of properties key/value pair.
+	/// @dev EVM selector for this function is: 0x50b26b2a,
+	///  or in textual repr: setCollectionProperties((string,bytes)[])
+	function setCollectionProperties(Tuple19[] memory properties) public {
+		require(false, stub_error);
+		properties;
+		dummy = 0;
+	}
+
 	/// Delete collection property.
 	///
 	/// @param key Property key.
@@ -132,6 +143,19 @@
 		return hex"";
 	}
 
+	/// Get collection properties.
+	///
+	/// @param keys Properties keys.
+	/// @return Vector of properties key/value pairs.
+	/// @dev EVM selector for this function is: 0x285fb8e6,
+	///  or in textual repr: collectionProperties(string[])
+	function collectionProperties(string[] memory keys) public view returns (Tuple19[] memory) {
+		require(false, stub_error);
+		keys;
+		dummy;
+		return new Tuple19[](0);
+	}
+
 	/// Set the sponsor of the collection.
 	///
 	/// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor.
@@ -470,6 +494,12 @@
 	}
 }
 
+/// @dev anonymous struct
+struct Tuple19 {
+	string field_0;
+	bytes field_1;
+}
+
 /// @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
modifiedtests/src/eth/api/UniqueFungible.soldiffbeforeafterboth
--- a/tests/src/eth/api/UniqueFungible.sol
+++ b/tests/src/eth/api/UniqueFungible.sol
@@ -13,7 +13,7 @@
 }
 
 /// @title A contract that allows you to work with collections.
-/// @dev the ERC-165 identifier for this interface is 0x25d897dc
+/// @dev the ERC-165 identifier for this interface is 0x5d354410
 interface Collection is Dummy, ERC165 {
 	/// Set collection property.
 	///
@@ -23,6 +23,13 @@
 	///  or in textual repr: setCollectionProperty(string,bytes)
 	function setCollectionProperty(string memory key, bytes memory value) external;
 
+	/// Set collection properties.
+	///
+	/// @param properties Vector of properties key/value pair.
+	/// @dev EVM selector for this function is: 0x50b26b2a,
+	///  or in textual repr: setCollectionProperties((string,bytes)[])
+	function setCollectionProperties(Tuple10[] memory properties) external;
+
 	/// Delete collection property.
 	///
 	/// @param key Property key.
@@ -40,6 +47,14 @@
 	///  or in textual repr: collectionProperty(string)
 	function collectionProperty(string memory key) external view returns (bytes memory);
 
+	/// Get collection properties.
+	///
+	/// @param keys Properties keys.
+	/// @return Vector of properties key/value pairs.
+	/// @dev EVM selector for this function is: 0x285fb8e6,
+	///  or in textual repr: collectionProperties(string[])
+	function collectionProperties(string[] memory keys) external view returns (Tuple10[] memory);
+
 	/// Set the sponsor of the collection.
 	///
 	/// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor.
@@ -258,6 +273,12 @@
 	function setOwnerCross(Tuple6 memory newOwner) external;
 }
 
+/// @dev anonymous struct
+struct Tuple10 {
+	string field_0;
+	bytes field_1;
+}
+
 /// @dev the ERC-165 identifier for this interface is 0x032e5926
 interface ERC20UniqueExtensions is Dummy, ERC165 {
 	/// @dev EVM selector for this function is: 0x0ecd0ab0,
modifiedtests/src/eth/api/UniqueNFT.soldiffbeforeafterboth
--- a/tests/src/eth/api/UniqueNFT.sol
+++ b/tests/src/eth/api/UniqueNFT.sol
@@ -62,7 +62,7 @@
 }
 
 /// @title A contract that allows you to work with collections.
-/// @dev the ERC-165 identifier for this interface is 0x25d897dc
+/// @dev the ERC-165 identifier for this interface is 0x5d354410
 interface Collection is Dummy, ERC165 {
 	/// Set collection property.
 	///
@@ -72,6 +72,13 @@
 	///  or in textual repr: setCollectionProperty(string,bytes)
 	function setCollectionProperty(string memory key, bytes memory value) external;
 
+	/// Set collection properties.
+	///
+	/// @param properties Vector of properties key/value pair.
+	/// @dev EVM selector for this function is: 0x50b26b2a,
+	///  or in textual repr: setCollectionProperties((string,bytes)[])
+	function setCollectionProperties(Tuple19[] memory properties) external;
+
 	/// Delete collection property.
 	///
 	/// @param key Property key.
@@ -89,6 +96,14 @@
 	///  or in textual repr: collectionProperty(string)
 	function collectionProperty(string memory key) external view returns (bytes memory);
 
+	/// Get collection properties.
+	///
+	/// @param keys Properties keys.
+	/// @return Vector of properties key/value pairs.
+	/// @dev EVM selector for this function is: 0x285fb8e6,
+	///  or in textual repr: collectionProperties(string[])
+	function collectionProperties(string[] memory keys) external view returns (Tuple19[] memory);
+
 	/// Set the sponsor of the collection.
 	///
 	/// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor.
@@ -307,6 +322,12 @@
 	function setOwnerCross(Tuple6 memory newOwner) external;
 }
 
+/// @dev anonymous struct
+struct Tuple19 {
+	string field_0;
+	bytes field_1;
+}
+
 /// @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
modifiedtests/src/eth/api/UniqueRefungible.soldiffbeforeafterboth
--- a/tests/src/eth/api/UniqueRefungible.sol
+++ b/tests/src/eth/api/UniqueRefungible.sol
@@ -62,7 +62,7 @@
 }
 
 /// @title A contract that allows you to work with collections.
-/// @dev the ERC-165 identifier for this interface is 0x25d897dc
+/// @dev the ERC-165 identifier for this interface is 0x5d354410
 interface Collection is Dummy, ERC165 {
 	/// Set collection property.
 	///
@@ -72,6 +72,13 @@
 	///  or in textual repr: setCollectionProperty(string,bytes)
 	function setCollectionProperty(string memory key, bytes memory value) external;
 
+	/// Set collection properties.
+	///
+	/// @param properties Vector of properties key/value pair.
+	/// @dev EVM selector for this function is: 0x50b26b2a,
+	///  or in textual repr: setCollectionProperties((string,bytes)[])
+	function setCollectionProperties(Tuple19[] memory properties) external;
+
 	/// Delete collection property.
 	///
 	/// @param key Property key.
@@ -89,6 +96,14 @@
 	///  or in textual repr: collectionProperty(string)
 	function collectionProperty(string memory key) external view returns (bytes memory);
 
+	/// Get collection properties.
+	///
+	/// @param keys Properties keys.
+	/// @return Vector of properties key/value pairs.
+	/// @dev EVM selector for this function is: 0x285fb8e6,
+	///  or in textual repr: collectionProperties(string[])
+	function collectionProperties(string[] memory keys) external view returns (Tuple19[] memory);
+
 	/// Set the sponsor of the collection.
 	///
 	/// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor.
@@ -307,6 +322,12 @@
 	function setOwnerCross(Tuple6 memory newOwner) external;
 }
 
+/// @dev anonymous struct
+struct Tuple19 {
+	string field_0;
+	bytes field_1;
+}
+
 /// @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
modifiedtests/src/eth/collectionProperties.test.tsdiffbeforeafterboth
--- a/tests/src/eth/collectionProperties.test.ts
+++ b/tests/src/eth/collectionProperties.test.ts
@@ -161,3 +161,31 @@
     await checkERC721Metadata(helper, 'rft');
   });
 });
+
+describe('EVM collection property', () => {
+  itEth('Set/read properties', async ({helper, privateKey}) => {
+    const alice = await privateKey('//Alice');
+    const collection = await helper.nft.mintCollection(alice, {name: 'A', description: 'B', tokenPrefix: 'C'});
+
+    const sender = await helper.eth.createAccountWithBalance(alice, 100n);
+    await collection.addAdmin(alice, {Ethereum: sender});
+
+    const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId);
+    const contract = helper.ethNativeContract.collection(collectionAddress, 'nft', sender);
+
+    const key1 = 'key1';
+    const value1 = Buffer.from('value1');
+    
+    const key2 = 'key2';
+    const value2 = Buffer.from('value2');
+
+    const writeProperties = [
+      [key1, '0x'+value1.toString('hex')],
+      [key2, '0x'+value2.toString('hex')],
+    ];
+
+    await contract.methods.setCollectionProperties(writeProperties).send();
+    const readProperties = await contract.methods.collectionProperties([key1, key2]).call();
+    expect(readProperties).to.be.like(writeProperties);
+  });
+});
modifiedtests/src/eth/fungibleAbi.jsondiffbeforeafterboth
--- a/tests/src/eth/fungibleAbi.json
+++ b/tests/src/eth/fungibleAbi.json
@@ -229,6 +229,25 @@
     "type": "function"
   },
   {
+    "inputs": [
+      { "internalType": "string[]", "name": "keys", "type": "string[]" }
+    ],
+    "name": "collectionProperties",
+    "outputs": [
+      {
+        "components": [
+          { "internalType": "string", "name": "field_0", "type": "string" },
+          { "internalType": "bytes", "name": "field_1", "type": "bytes" }
+        ],
+        "internalType": "struct Tuple10[]",
+        "name": "",
+        "type": "tuple[]"
+      }
+    ],
+    "stateMutability": "view",
+    "type": "function"
+  },
+  {
     "inputs": [{ "internalType": "string", "name": "key", "type": "string" }],
     "name": "collectionProperty",
     "outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }],
@@ -463,6 +482,23 @@
   },
   {
     "inputs": [
+      {
+        "components": [
+          { "internalType": "string", "name": "field_0", "type": "string" },
+          { "internalType": "bytes", "name": "field_1", "type": "bytes" }
+        ],
+        "internalType": "struct Tuple10[]",
+        "name": "properties",
+        "type": "tuple[]"
+      }
+    ],
+    "name": "setCollectionProperties",
+    "outputs": [],
+    "stateMutability": "nonpayable",
+    "type": "function"
+  },
+  {
+    "inputs": [
       { "internalType": "string", "name": "key", "type": "string" },
       { "internalType": "bytes", "name": "value", "type": "bytes" }
     ],
modifiedtests/src/eth/nonFungibleAbi.jsondiffbeforeafterboth
after · tests/src/eth/nonFungibleAbi.json
1[2  {3    "anonymous": false,4    "inputs": [5      {6        "indexed": true,7        "internalType": "address",8        "name": "owner",9        "type": "address"10      },11      {12        "indexed": true,13        "internalType": "address",14        "name": "approved",15        "type": "address"16      },17      {18        "indexed": true,19        "internalType": "uint256",20        "name": "tokenId",21        "type": "uint256"22      }23    ],24    "name": "Approval",25    "type": "event"26  },27  {28    "anonymous": false,29    "inputs": [30      {31        "indexed": true,32        "internalType": "address",33        "name": "owner",34        "type": "address"35      },36      {37        "indexed": true,38        "internalType": "address",39        "name": "operator",40        "type": "address"41      },42      {43        "indexed": false,44        "internalType": "bool",45        "name": "approved",46        "type": "bool"47      }48    ],49    "name": "ApprovalForAll",50    "type": "event"51  },52  {53    "anonymous": false,54    "inputs": [],55    "name": "MintingFinished",56    "type": "event"57  },58  {59    "anonymous": false,60    "inputs": [61      {62        "indexed": true,63        "internalType": "address",64        "name": "from",65        "type": "address"66      },67      {68        "indexed": true,69        "internalType": "address",70        "name": "to",71        "type": "address"72      },73      {74        "indexed": true,75        "internalType": "uint256",76        "name": "tokenId",77        "type": "uint256"78      }79    ],80    "name": "Transfer",81    "type": "event"82  },83  {84    "inputs": [85      { "internalType": "address", "name": "newAdmin", "type": "address" }86    ],87    "name": "addCollectionAdmin",88    "outputs": [],89    "stateMutability": "nonpayable",90    "type": "function"91  },92  {93    "inputs": [94      {95        "components": [96          { "internalType": "address", "name": "field_0", "type": "address" },97          { "internalType": "uint256", "name": "field_1", "type": "uint256" }98        ],99        "internalType": "struct Tuple6",100        "name": "newAdmin",101        "type": "tuple"102      }103    ],104    "name": "addCollectionAdminCross",105    "outputs": [],106    "stateMutability": "nonpayable",107    "type": "function"108  },109  {110    "inputs": [111      { "internalType": "address", "name": "user", "type": "address" }112    ],113    "name": "addToCollectionAllowList",114    "outputs": [],115    "stateMutability": "nonpayable",116    "type": "function"117  },118  {119    "inputs": [120      {121        "components": [122          { "internalType": "address", "name": "field_0", "type": "address" },123          { "internalType": "uint256", "name": "field_1", "type": "uint256" }124        ],125        "internalType": "struct Tuple6",126        "name": "user",127        "type": "tuple"128      }129    ],130    "name": "addToCollectionAllowListCross",131    "outputs": [],132    "stateMutability": "nonpayable",133    "type": "function"134  },135  {136    "inputs": [137      { "internalType": "address", "name": "user", "type": "address" }138    ],139    "name": "allowed",140    "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],141    "stateMutability": "view",142    "type": "function"143  },144  {145    "inputs": [146      { "internalType": "address", "name": "approved", "type": "address" },147      { "internalType": "uint256", "name": "tokenId", "type": "uint256" }148    ],149    "name": "approve",150    "outputs": [],151    "stateMutability": "nonpayable",152    "type": "function"153  },154  {155    "inputs": [156      {157        "components": [158          { "internalType": "address", "name": "field_0", "type": "address" },159          { "internalType": "uint256", "name": "field_1", "type": "uint256" }160        ],161        "internalType": "struct Tuple6",162        "name": "approved",163        "type": "tuple"164      },165      { "internalType": "uint256", "name": "tokenId", "type": "uint256" }166    ],167    "name": "approveCross",168    "outputs": [],169    "stateMutability": "nonpayable",170    "type": "function"171  },172  {173    "inputs": [174      { "internalType": "address", "name": "owner", "type": "address" }175    ],176    "name": "balanceOf",177    "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],178    "stateMutability": "view",179    "type": "function"180  },181  {182    "inputs": [183      { "internalType": "uint256", "name": "tokenId", "type": "uint256" }184    ],185    "name": "burn",186    "outputs": [],187    "stateMutability": "nonpayable",188    "type": "function"189  },190  {191    "inputs": [192      { "internalType": "address", "name": "from", "type": "address" },193      { "internalType": "uint256", "name": "tokenId", "type": "uint256" }194    ],195    "name": "burnFrom",196    "outputs": [],197    "stateMutability": "nonpayable",198    "type": "function"199  },200  {201    "inputs": [202      {203        "components": [204          { "internalType": "address", "name": "field_0", "type": "address" },205          { "internalType": "uint256", "name": "field_1", "type": "uint256" }206        ],207        "internalType": "struct Tuple6",208        "name": "from",209        "type": "tuple"210      },211      { "internalType": "uint256", "name": "tokenId", "type": "uint256" }212    ],213    "name": "burnFromCross",214    "outputs": [],215    "stateMutability": "nonpayable",216    "type": "function"217  },218  {219    "inputs": [220      { "internalType": "address", "name": "newOwner", "type": "address" }221    ],222    "name": "changeCollectionOwner",223    "outputs": [],224    "stateMutability": "nonpayable",225    "type": "function"226  },227  {228    "inputs": [],229    "name": "collectionAdmins",230    "outputs": [231      {232        "components": [233          { "internalType": "address", "name": "field_0", "type": "address" },234          { "internalType": "uint256", "name": "field_1", "type": "uint256" }235        ],236        "internalType": "struct Tuple6[]",237        "name": "",238        "type": "tuple[]"239      }240    ],241    "stateMutability": "view",242    "type": "function"243  },244  {245    "inputs": [],246    "name": "collectionOwner",247    "outputs": [248      {249        "components": [250          { "internalType": "address", "name": "field_0", "type": "address" },251          { "internalType": "uint256", "name": "field_1", "type": "uint256" }252        ],253        "internalType": "struct Tuple6",254        "name": "",255        "type": "tuple"256      }257    ],258    "stateMutability": "view",259    "type": "function"260  },261  {262    "inputs": [263      { "internalType": "string[]", "name": "keys", "type": "string[]" }264    ],265    "name": "collectionProperties",266    "outputs": [267      {268        "components": [269          { "internalType": "string", "name": "field_0", "type": "string" },270          { "internalType": "bytes", "name": "field_1", "type": "bytes" }271        ],272        "internalType": "struct Tuple19[]",273        "name": "",274        "type": "tuple[]"275      }276    ],277    "stateMutability": "view",278    "type": "function"279  },280  {281    "inputs": [{ "internalType": "string", "name": "key", "type": "string" }],282    "name": "collectionProperty",283    "outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }],284    "stateMutability": "view",285    "type": "function"286  },287  {288    "inputs": [],289    "name": "collectionSponsor",290    "outputs": [291      {292        "components": [293          { "internalType": "address", "name": "field_0", "type": "address" },294          { "internalType": "uint256", "name": "field_1", "type": "uint256" }295        ],296        "internalType": "struct Tuple6",297        "name": "",298        "type": "tuple"299      }300    ],301    "stateMutability": "view",302    "type": "function"303  },304  {305    "inputs": [],306    "name": "confirmCollectionSponsorship",307    "outputs": [],308    "stateMutability": "nonpayable",309    "type": "function"310  },311  {312    "inputs": [],313    "name": "contractAddress",314    "outputs": [{ "internalType": "address", "name": "", "type": "address" }],315    "stateMutability": "view",316    "type": "function"317  },318  {319    "inputs": [{ "internalType": "string", "name": "key", "type": "string" }],320    "name": "deleteCollectionProperty",321    "outputs": [],322    "stateMutability": "nonpayable",323    "type": "function"324  },325  {326    "inputs": [327      { "internalType": "uint256", "name": "tokenId", "type": "uint256" },328      { "internalType": "string", "name": "key", "type": "string" }329    ],330    "name": "deleteProperty",331    "outputs": [],332    "stateMutability": "nonpayable",333    "type": "function"334  },335  {336    "inputs": [],337    "name": "finishMinting",338    "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],339    "stateMutability": "nonpayable",340    "type": "function"341  },342  {343    "inputs": [344      { "internalType": "uint256", "name": "tokenId", "type": "uint256" }345    ],346    "name": "getApproved",347    "outputs": [{ "internalType": "address", "name": "", "type": "address" }],348    "stateMutability": "view",349    "type": "function"350  },351  {352    "inputs": [],353    "name": "hasCollectionPendingSponsor",354    "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],355    "stateMutability": "view",356    "type": "function"357  },358  {359    "inputs": [360      { "internalType": "address", "name": "owner", "type": "address" },361      { "internalType": "address", "name": "operator", "type": "address" }362    ],363    "name": "isApprovedForAll",364    "outputs": [{ "internalType": "address", "name": "", "type": "address" }],365    "stateMutability": "view",366    "type": "function"367  },368  {369    "inputs": [370      { "internalType": "address", "name": "user", "type": "address" }371    ],372    "name": "isOwnerOrAdmin",373    "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],374    "stateMutability": "view",375    "type": "function"376  },377  {378    "inputs": [379      {380        "components": [381          { "internalType": "address", "name": "field_0", "type": "address" },382          { "internalType": "uint256", "name": "field_1", "type": "uint256" }383        ],384        "internalType": "struct Tuple6",385        "name": "user",386        "type": "tuple"387      }388    ],389    "name": "isOwnerOrAdminCross",390    "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],391    "stateMutability": "view",392    "type": "function"393  },394  {395    "inputs": [{ "internalType": "address", "name": "to", "type": "address" }],396    "name": "mint",397    "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],398    "stateMutability": "nonpayable",399    "type": "function"400  },401  {402    "inputs": [403      { "internalType": "address", "name": "to", "type": "address" },404      { "internalType": "string", "name": "tokenUri", "type": "string" }405    ],406    "name": "mintWithTokenURI",407    "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],408    "stateMutability": "nonpayable",409    "type": "function"410  },411  {412    "inputs": [],413    "name": "mintingFinished",414    "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],415    "stateMutability": "view",416    "type": "function"417  },418  {419    "inputs": [],420    "name": "name",421    "outputs": [{ "internalType": "string", "name": "", "type": "string" }],422    "stateMutability": "view",423    "type": "function"424  },425  {426    "inputs": [],427    "name": "nextTokenId",428    "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],429    "stateMutability": "view",430    "type": "function"431  },432  {433    "inputs": [434      { "internalType": "uint256", "name": "tokenId", "type": "uint256" }435    ],436    "name": "ownerOf",437    "outputs": [{ "internalType": "address", "name": "", "type": "address" }],438    "stateMutability": "view",439    "type": "function"440  },441  {442    "inputs": [443      { "internalType": "uint256", "name": "tokenId", "type": "uint256" },444      { "internalType": "string", "name": "key", "type": "string" }445    ],446    "name": "property",447    "outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }],448    "stateMutability": "view",449    "type": "function"450  },451  {452    "inputs": [453      { "internalType": "address", "name": "admin", "type": "address" }454    ],455    "name": "removeCollectionAdmin",456    "outputs": [],457    "stateMutability": "nonpayable",458    "type": "function"459  },460  {461    "inputs": [462      {463        "components": [464          { "internalType": "address", "name": "field_0", "type": "address" },465          { "internalType": "uint256", "name": "field_1", "type": "uint256" }466        ],467        "internalType": "struct Tuple6",468        "name": "admin",469        "type": "tuple"470      }471    ],472    "name": "removeCollectionAdminCross",473    "outputs": [],474    "stateMutability": "nonpayable",475    "type": "function"476  },477  {478    "inputs": [],479    "name": "removeCollectionSponsor",480    "outputs": [],481    "stateMutability": "nonpayable",482    "type": "function"483  },484  {485    "inputs": [486      { "internalType": "address", "name": "user", "type": "address" }487    ],488    "name": "removeFromCollectionAllowList",489    "outputs": [],490    "stateMutability": "nonpayable",491    "type": "function"492  },493  {494    "inputs": [495      {496        "components": [497          { "internalType": "address", "name": "field_0", "type": "address" },498          { "internalType": "uint256", "name": "field_1", "type": "uint256" }499        ],500        "internalType": "struct Tuple6",501        "name": "user",502        "type": "tuple"503      }504    ],505    "name": "removeFromCollectionAllowListCross",506    "outputs": [],507    "stateMutability": "nonpayable",508    "type": "function"509  },510  {511    "inputs": [512      { "internalType": "address", "name": "from", "type": "address" },513      { "internalType": "address", "name": "to", "type": "address" },514      { "internalType": "uint256", "name": "tokenId", "type": "uint256" }515    ],516    "name": "safeTransferFrom",517    "outputs": [],518    "stateMutability": "nonpayable",519    "type": "function"520  },521  {522    "inputs": [523      { "internalType": "address", "name": "from", "type": "address" },524      { "internalType": "address", "name": "to", "type": "address" },525      { "internalType": "uint256", "name": "tokenId", "type": "uint256" },526      { "internalType": "bytes", "name": "data", "type": "bytes" }527    ],528    "name": "safeTransferFrom",529    "outputs": [],530    "stateMutability": "nonpayable",531    "type": "function"532  },533  {534    "inputs": [535      { "internalType": "address", "name": "operator", "type": "address" },536      { "internalType": "bool", "name": "approved", "type": "bool" }537    ],538    "name": "setApprovalForAll",539    "outputs": [],540    "stateMutability": "nonpayable",541    "type": "function"542  },543  {544    "inputs": [{ "internalType": "uint8", "name": "mode", "type": "uint8" }],545    "name": "setCollectionAccess",546    "outputs": [],547    "stateMutability": "nonpayable",548    "type": "function"549  },550  {551    "inputs": [552      { "internalType": "string", "name": "limit", "type": "string" },553      { "internalType": "uint32", "name": "value", "type": "uint32" }554    ],555    "name": "setCollectionLimit",556    "outputs": [],557    "stateMutability": "nonpayable",558    "type": "function"559  },560  {561    "inputs": [562      { "internalType": "string", "name": "limit", "type": "string" },563      { "internalType": "bool", "name": "value", "type": "bool" }564    ],565    "name": "setCollectionLimit",566    "outputs": [],567    "stateMutability": "nonpayable",568    "type": "function"569  },570  {571    "inputs": [{ "internalType": "bool", "name": "mode", "type": "bool" }],572    "name": "setCollectionMintMode",573    "outputs": [],574    "stateMutability": "nonpayable",575    "type": "function"576  },577  {578    "inputs": [{ "internalType": "bool", "name": "enable", "type": "bool" }],579    "name": "setCollectionNesting",580    "outputs": [],581    "stateMutability": "nonpayable",582    "type": "function"583  },584  {585    "inputs": [586      { "internalType": "bool", "name": "enable", "type": "bool" },587      {588        "internalType": "address[]",589        "name": "collections",590        "type": "address[]"591      }592    ],593    "name": "setCollectionNesting",594    "outputs": [],595    "stateMutability": "nonpayable",596    "type": "function"597  },598  {599    "inputs": [600      {601        "components": [602          { "internalType": "string", "name": "field_0", "type": "string" },603          { "internalType": "bytes", "name": "field_1", "type": "bytes" }604        ],605        "internalType": "struct Tuple19[]",606        "name": "properties",607        "type": "tuple[]"608      }609    ],610    "name": "setCollectionProperties",611    "outputs": [],612    "stateMutability": "nonpayable",613    "type": "function"614  },615  {616    "inputs": [617      { "internalType": "string", "name": "key", "type": "string" },618      { "internalType": "bytes", "name": "value", "type": "bytes" }619    ],620    "name": "setCollectionProperty",621    "outputs": [],622    "stateMutability": "nonpayable",623    "type": "function"624  },625  {626    "inputs": [627      { "internalType": "address", "name": "sponsor", "type": "address" }628    ],629    "name": "setCollectionSponsor",630    "outputs": [],631    "stateMutability": "nonpayable",632    "type": "function"633  },634  {635    "inputs": [636      {637        "components": [638          { "internalType": "address", "name": "field_0", "type": "address" },639          { "internalType": "uint256", "name": "field_1", "type": "uint256" }640        ],641        "internalType": "struct Tuple6",642        "name": "sponsor",643        "type": "tuple"644      }645    ],646    "name": "setCollectionSponsorCross",647    "outputs": [],648    "stateMutability": "nonpayable",649    "type": "function"650  },651  {652    "inputs": [653      {654        "components": [655          { "internalType": "address", "name": "field_0", "type": "address" },656          { "internalType": "uint256", "name": "field_1", "type": "uint256" }657        ],658        "internalType": "struct Tuple6",659        "name": "newOwner",660        "type": "tuple"661      }662    ],663    "name": "setOwnerCross",664    "outputs": [],665    "stateMutability": "nonpayable",666    "type": "function"667  },668  {669    "inputs": [670      { "internalType": "uint256", "name": "tokenId", "type": "uint256" },671      { "internalType": "string", "name": "key", "type": "string" },672      { "internalType": "bytes", "name": "value", "type": "bytes" }673    ],674    "name": "setProperty",675    "outputs": [],676    "stateMutability": "nonpayable",677    "type": "function"678  },679  {680    "inputs": [681      { "internalType": "string", "name": "key", "type": "string" },682      { "internalType": "bool", "name": "isMutable", "type": "bool" },683      { "internalType": "bool", "name": "collectionAdmin", "type": "bool" },684      { "internalType": "bool", "name": "tokenOwner", "type": "bool" }685    ],686    "name": "setTokenPropertyPermission",687    "outputs": [],688    "stateMutability": "nonpayable",689    "type": "function"690  },691  {692    "inputs": [693      { "internalType": "bytes4", "name": "interfaceID", "type": "bytes4" }694    ],695    "name": "supportsInterface",696    "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],697    "stateMutability": "view",698    "type": "function"699  },700  {701    "inputs": [],702    "name": "symbol",703    "outputs": [{ "internalType": "string", "name": "", "type": "string" }],704    "stateMutability": "view",705    "type": "function"706  },707  {708    "inputs": [709      { "internalType": "uint256", "name": "index", "type": "uint256" }710    ],711    "name": "tokenByIndex",712    "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],713    "stateMutability": "view",714    "type": "function"715  },716  {717    "inputs": [718      { "internalType": "address", "name": "owner", "type": "address" },719      { "internalType": "uint256", "name": "index", "type": "uint256" }720    ],721    "name": "tokenOfOwnerByIndex",722    "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],723    "stateMutability": "view",724    "type": "function"725  },726  {727    "inputs": [728      { "internalType": "uint256", "name": "tokenId", "type": "uint256" }729    ],730    "name": "tokenURI",731    "outputs": [{ "internalType": "string", "name": "", "type": "string" }],732    "stateMutability": "view",733    "type": "function"734  },735  {736    "inputs": [],737    "name": "totalSupply",738    "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],739    "stateMutability": "view",740    "type": "function"741  },742  {743    "inputs": [744      { "internalType": "address", "name": "to", "type": "address" },745      { "internalType": "uint256", "name": "tokenId", "type": "uint256" }746    ],747    "name": "transfer",748    "outputs": [],749    "stateMutability": "nonpayable",750    "type": "function"751  },752  {753    "inputs": [754      { "internalType": "address", "name": "from", "type": "address" },755      { "internalType": "address", "name": "to", "type": "address" },756      { "internalType": "uint256", "name": "tokenId", "type": "uint256" }757    ],758    "name": "transferFrom",759    "outputs": [],760    "stateMutability": "nonpayable",761    "type": "function"762  },763  {764    "inputs": [765      {766        "components": [767          { "internalType": "address", "name": "field_0", "type": "address" },768          { "internalType": "uint256", "name": "field_1", "type": "uint256" }769        ],770        "internalType": "struct Tuple6",771        "name": "from",772        "type": "tuple"773      },774      {775        "components": [776          { "internalType": "address", "name": "field_0", "type": "address" },777          { "internalType": "uint256", "name": "field_1", "type": "uint256" }778        ],779        "internalType": "struct Tuple6",780        "name": "to",781        "type": "tuple"782      },783      { "internalType": "uint256", "name": "tokenId", "type": "uint256" }784    ],785    "name": "transferFromCross",786    "outputs": [],787    "stateMutability": "nonpayable",788    "type": "function"789  },790  {791    "inputs": [],792    "name": "uniqueCollectionType",793    "outputs": [{ "internalType": "string", "name": "", "type": "string" }],794    "stateMutability": "view",795    "type": "function"796  }797]
modifiedtests/src/eth/reFungibleAbi.jsondiffbeforeafterboth
--- a/tests/src/eth/reFungibleAbi.json
+++ b/tests/src/eth/reFungibleAbi.json
@@ -241,6 +241,25 @@
     "type": "function"
   },
   {
+    "inputs": [
+      { "internalType": "string[]", "name": "keys", "type": "string[]" }
+    ],
+    "name": "collectionProperties",
+    "outputs": [
+      {
+        "components": [
+          { "internalType": "string", "name": "field_0", "type": "string" },
+          { "internalType": "bytes", "name": "field_1", "type": "bytes" }
+        ],
+        "internalType": "struct Tuple19[]",
+        "name": "",
+        "type": "tuple[]"
+      }
+    ],
+    "stateMutability": "view",
+    "type": "function"
+  },
+  {
     "inputs": [{ "internalType": "string", "name": "key", "type": "string" }],
     "name": "collectionProperty",
     "outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }],
@@ -560,6 +579,23 @@
   },
   {
     "inputs": [
+      {
+        "components": [
+          { "internalType": "string", "name": "field_0", "type": "string" },
+          { "internalType": "bytes", "name": "field_1", "type": "bytes" }
+        ],
+        "internalType": "struct Tuple19[]",
+        "name": "properties",
+        "type": "tuple[]"
+      }
+    ],
+    "name": "setCollectionProperties",
+    "outputs": [],
+    "stateMutability": "nonpayable",
+    "type": "function"
+  },
+  {
+    "inputs": [
       { "internalType": "string", "name": "key", "type": "string" },
       { "internalType": "bytes", "name": "value", "type": "bytes" }
     ],