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
--- a/tests/src/eth/nonFungibleAbi.json
+++ b/tests/src/eth/nonFungibleAbi.json
@@ -259,6 +259,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" }],
@@ -578,6 +597,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" }
     ],
modifiedtests/src/eth/reFungibleAbi.jsondiffbeforeafterboth
after · tests/src/eth/reFungibleAbi.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      { "internalType": "address", "name": "owner", "type": "address" }157    ],158    "name": "balanceOf",159    "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],160    "stateMutability": "view",161    "type": "function"162  },163  {164    "inputs": [165      { "internalType": "uint256", "name": "tokenId", "type": "uint256" }166    ],167    "name": "burn",168    "outputs": [],169    "stateMutability": "nonpayable",170    "type": "function"171  },172  {173    "inputs": [174      { "internalType": "address", "name": "from", "type": "address" },175      { "internalType": "uint256", "name": "tokenId", "type": "uint256" }176    ],177    "name": "burnFrom",178    "outputs": [],179    "stateMutability": "nonpayable",180    "type": "function"181  },182  {183    "inputs": [184      {185        "components": [186          { "internalType": "address", "name": "field_0", "type": "address" },187          { "internalType": "uint256", "name": "field_1", "type": "uint256" }188        ],189        "internalType": "struct Tuple6",190        "name": "from",191        "type": "tuple"192      },193      { "internalType": "uint256", "name": "tokenId", "type": "uint256" }194    ],195    "name": "burnFromCross",196    "outputs": [],197    "stateMutability": "nonpayable",198    "type": "function"199  },200  {201    "inputs": [202      { "internalType": "address", "name": "newOwner", "type": "address" }203    ],204    "name": "changeCollectionOwner",205    "outputs": [],206    "stateMutability": "nonpayable",207    "type": "function"208  },209  {210    "inputs": [],211    "name": "collectionAdmins",212    "outputs": [213      {214        "components": [215          { "internalType": "address", "name": "field_0", "type": "address" },216          { "internalType": "uint256", "name": "field_1", "type": "uint256" }217        ],218        "internalType": "struct Tuple6[]",219        "name": "",220        "type": "tuple[]"221      }222    ],223    "stateMutability": "view",224    "type": "function"225  },226  {227    "inputs": [],228    "name": "collectionOwner",229    "outputs": [230      {231        "components": [232          { "internalType": "address", "name": "field_0", "type": "address" },233          { "internalType": "uint256", "name": "field_1", "type": "uint256" }234        ],235        "internalType": "struct Tuple6",236        "name": "",237        "type": "tuple"238      }239    ],240    "stateMutability": "view",241    "type": "function"242  },243  {244    "inputs": [245      { "internalType": "string[]", "name": "keys", "type": "string[]" }246    ],247    "name": "collectionProperties",248    "outputs": [249      {250        "components": [251          { "internalType": "string", "name": "field_0", "type": "string" },252          { "internalType": "bytes", "name": "field_1", "type": "bytes" }253        ],254        "internalType": "struct Tuple19[]",255        "name": "",256        "type": "tuple[]"257      }258    ],259    "stateMutability": "view",260    "type": "function"261  },262  {263    "inputs": [{ "internalType": "string", "name": "key", "type": "string" }],264    "name": "collectionProperty",265    "outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }],266    "stateMutability": "view",267    "type": "function"268  },269  {270    "inputs": [],271    "name": "collectionSponsor",272    "outputs": [273      {274        "components": [275          { "internalType": "address", "name": "field_0", "type": "address" },276          { "internalType": "uint256", "name": "field_1", "type": "uint256" }277        ],278        "internalType": "struct Tuple6",279        "name": "",280        "type": "tuple"281      }282    ],283    "stateMutability": "view",284    "type": "function"285  },286  {287    "inputs": [],288    "name": "confirmCollectionSponsorship",289    "outputs": [],290    "stateMutability": "nonpayable",291    "type": "function"292  },293  {294    "inputs": [],295    "name": "contractAddress",296    "outputs": [{ "internalType": "address", "name": "", "type": "address" }],297    "stateMutability": "view",298    "type": "function"299  },300  {301    "inputs": [{ "internalType": "string", "name": "key", "type": "string" }],302    "name": "deleteCollectionProperty",303    "outputs": [],304    "stateMutability": "nonpayable",305    "type": "function"306  },307  {308    "inputs": [309      { "internalType": "uint256", "name": "tokenId", "type": "uint256" },310      { "internalType": "string", "name": "key", "type": "string" }311    ],312    "name": "deleteProperty",313    "outputs": [],314    "stateMutability": "nonpayable",315    "type": "function"316  },317  {318    "inputs": [],319    "name": "finishMinting",320    "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],321    "stateMutability": "nonpayable",322    "type": "function"323  },324  {325    "inputs": [326      { "internalType": "uint256", "name": "tokenId", "type": "uint256" }327    ],328    "name": "getApproved",329    "outputs": [{ "internalType": "address", "name": "", "type": "address" }],330    "stateMutability": "view",331    "type": "function"332  },333  {334    "inputs": [],335    "name": "hasCollectionPendingSponsor",336    "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],337    "stateMutability": "view",338    "type": "function"339  },340  {341    "inputs": [342      { "internalType": "address", "name": "owner", "type": "address" },343      { "internalType": "address", "name": "operator", "type": "address" }344    ],345    "name": "isApprovedForAll",346    "outputs": [{ "internalType": "address", "name": "", "type": "address" }],347    "stateMutability": "view",348    "type": "function"349  },350  {351    "inputs": [352      { "internalType": "address", "name": "user", "type": "address" }353    ],354    "name": "isOwnerOrAdmin",355    "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],356    "stateMutability": "view",357    "type": "function"358  },359  {360    "inputs": [361      {362        "components": [363          { "internalType": "address", "name": "field_0", "type": "address" },364          { "internalType": "uint256", "name": "field_1", "type": "uint256" }365        ],366        "internalType": "struct Tuple6",367        "name": "user",368        "type": "tuple"369      }370    ],371    "name": "isOwnerOrAdminCross",372    "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],373    "stateMutability": "view",374    "type": "function"375  },376  {377    "inputs": [{ "internalType": "address", "name": "to", "type": "address" }],378    "name": "mint",379    "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],380    "stateMutability": "nonpayable",381    "type": "function"382  },383  {384    "inputs": [385      { "internalType": "address", "name": "to", "type": "address" },386      { "internalType": "string", "name": "tokenUri", "type": "string" }387    ],388    "name": "mintWithTokenURI",389    "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],390    "stateMutability": "nonpayable",391    "type": "function"392  },393  {394    "inputs": [],395    "name": "mintingFinished",396    "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],397    "stateMutability": "view",398    "type": "function"399  },400  {401    "inputs": [],402    "name": "name",403    "outputs": [{ "internalType": "string", "name": "", "type": "string" }],404    "stateMutability": "view",405    "type": "function"406  },407  {408    "inputs": [],409    "name": "nextTokenId",410    "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],411    "stateMutability": "view",412    "type": "function"413  },414  {415    "inputs": [416      { "internalType": "uint256", "name": "tokenId", "type": "uint256" }417    ],418    "name": "ownerOf",419    "outputs": [{ "internalType": "address", "name": "", "type": "address" }],420    "stateMutability": "view",421    "type": "function"422  },423  {424    "inputs": [425      { "internalType": "uint256", "name": "tokenId", "type": "uint256" },426      { "internalType": "string", "name": "key", "type": "string" }427    ],428    "name": "property",429    "outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }],430    "stateMutability": "view",431    "type": "function"432  },433  {434    "inputs": [435      { "internalType": "address", "name": "admin", "type": "address" }436    ],437    "name": "removeCollectionAdmin",438    "outputs": [],439    "stateMutability": "nonpayable",440    "type": "function"441  },442  {443    "inputs": [444      {445        "components": [446          { "internalType": "address", "name": "field_0", "type": "address" },447          { "internalType": "uint256", "name": "field_1", "type": "uint256" }448        ],449        "internalType": "struct Tuple6",450        "name": "admin",451        "type": "tuple"452      }453    ],454    "name": "removeCollectionAdminCross",455    "outputs": [],456    "stateMutability": "nonpayable",457    "type": "function"458  },459  {460    "inputs": [],461    "name": "removeCollectionSponsor",462    "outputs": [],463    "stateMutability": "nonpayable",464    "type": "function"465  },466  {467    "inputs": [468      { "internalType": "address", "name": "user", "type": "address" }469    ],470    "name": "removeFromCollectionAllowList",471    "outputs": [],472    "stateMutability": "nonpayable",473    "type": "function"474  },475  {476    "inputs": [477      {478        "components": [479          { "internalType": "address", "name": "field_0", "type": "address" },480          { "internalType": "uint256", "name": "field_1", "type": "uint256" }481        ],482        "internalType": "struct Tuple6",483        "name": "user",484        "type": "tuple"485      }486    ],487    "name": "removeFromCollectionAllowListCross",488    "outputs": [],489    "stateMutability": "nonpayable",490    "type": "function"491  },492  {493    "inputs": [494      { "internalType": "address", "name": "from", "type": "address" },495      { "internalType": "address", "name": "to", "type": "address" },496      { "internalType": "uint256", "name": "tokenId", "type": "uint256" }497    ],498    "name": "safeTransferFrom",499    "outputs": [],500    "stateMutability": "nonpayable",501    "type": "function"502  },503  {504    "inputs": [505      { "internalType": "address", "name": "from", "type": "address" },506      { "internalType": "address", "name": "to", "type": "address" },507      { "internalType": "uint256", "name": "tokenId", "type": "uint256" },508      { "internalType": "bytes", "name": "data", "type": "bytes" }509    ],510    "name": "safeTransferFromWithData",511    "outputs": [],512    "stateMutability": "nonpayable",513    "type": "function"514  },515  {516    "inputs": [517      { "internalType": "address", "name": "operator", "type": "address" },518      { "internalType": "bool", "name": "approved", "type": "bool" }519    ],520    "name": "setApprovalForAll",521    "outputs": [],522    "stateMutability": "nonpayable",523    "type": "function"524  },525  {526    "inputs": [{ "internalType": "uint8", "name": "mode", "type": "uint8" }],527    "name": "setCollectionAccess",528    "outputs": [],529    "stateMutability": "nonpayable",530    "type": "function"531  },532  {533    "inputs": [534      { "internalType": "string", "name": "limit", "type": "string" },535      { "internalType": "uint32", "name": "value", "type": "uint32" }536    ],537    "name": "setCollectionLimit",538    "outputs": [],539    "stateMutability": "nonpayable",540    "type": "function"541  },542  {543    "inputs": [544      { "internalType": "string", "name": "limit", "type": "string" },545      { "internalType": "bool", "name": "value", "type": "bool" }546    ],547    "name": "setCollectionLimit",548    "outputs": [],549    "stateMutability": "nonpayable",550    "type": "function"551  },552  {553    "inputs": [{ "internalType": "bool", "name": "mode", "type": "bool" }],554    "name": "setCollectionMintMode",555    "outputs": [],556    "stateMutability": "nonpayable",557    "type": "function"558  },559  {560    "inputs": [{ "internalType": "bool", "name": "enable", "type": "bool" }],561    "name": "setCollectionNesting",562    "outputs": [],563    "stateMutability": "nonpayable",564    "type": "function"565  },566  {567    "inputs": [568      { "internalType": "bool", "name": "enable", "type": "bool" },569      {570        "internalType": "address[]",571        "name": "collections",572        "type": "address[]"573      }574    ],575    "name": "setCollectionNesting",576    "outputs": [],577    "stateMutability": "nonpayable",578    "type": "function"579  },580  {581    "inputs": [582      {583        "components": [584          { "internalType": "string", "name": "field_0", "type": "string" },585          { "internalType": "bytes", "name": "field_1", "type": "bytes" }586        ],587        "internalType": "struct Tuple19[]",588        "name": "properties",589        "type": "tuple[]"590      }591    ],592    "name": "setCollectionProperties",593    "outputs": [],594    "stateMutability": "nonpayable",595    "type": "function"596  },597  {598    "inputs": [599      { "internalType": "string", "name": "key", "type": "string" },600      { "internalType": "bytes", "name": "value", "type": "bytes" }601    ],602    "name": "setCollectionProperty",603    "outputs": [],604    "stateMutability": "nonpayable",605    "type": "function"606  },607  {608    "inputs": [609      { "internalType": "address", "name": "sponsor", "type": "address" }610    ],611    "name": "setCollectionSponsor",612    "outputs": [],613    "stateMutability": "nonpayable",614    "type": "function"615  },616  {617    "inputs": [618      {619        "components": [620          { "internalType": "address", "name": "field_0", "type": "address" },621          { "internalType": "uint256", "name": "field_1", "type": "uint256" }622        ],623        "internalType": "struct Tuple6",624        "name": "sponsor",625        "type": "tuple"626      }627    ],628    "name": "setCollectionSponsorCross",629    "outputs": [],630    "stateMutability": "nonpayable",631    "type": "function"632  },633  {634    "inputs": [635      {636        "components": [637          { "internalType": "address", "name": "field_0", "type": "address" },638          { "internalType": "uint256", "name": "field_1", "type": "uint256" }639        ],640        "internalType": "struct Tuple6",641        "name": "newOwner",642        "type": "tuple"643      }644    ],645    "name": "setOwnerCross",646    "outputs": [],647    "stateMutability": "nonpayable",648    "type": "function"649  },650  {651    "inputs": [652      { "internalType": "uint256", "name": "tokenId", "type": "uint256" },653      { "internalType": "string", "name": "key", "type": "string" },654      { "internalType": "bytes", "name": "value", "type": "bytes" }655    ],656    "name": "setProperty",657    "outputs": [],658    "stateMutability": "nonpayable",659    "type": "function"660  },661  {662    "inputs": [663      { "internalType": "string", "name": "key", "type": "string" },664      { "internalType": "bool", "name": "isMutable", "type": "bool" },665      { "internalType": "bool", "name": "collectionAdmin", "type": "bool" },666      { "internalType": "bool", "name": "tokenOwner", "type": "bool" }667    ],668    "name": "setTokenPropertyPermission",669    "outputs": [],670    "stateMutability": "nonpayable",671    "type": "function"672  },673  {674    "inputs": [675      { "internalType": "bytes4", "name": "interfaceID", "type": "bytes4" }676    ],677    "name": "supportsInterface",678    "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],679    "stateMutability": "view",680    "type": "function"681  },682  {683    "inputs": [],684    "name": "symbol",685    "outputs": [{ "internalType": "string", "name": "", "type": "string" }],686    "stateMutability": "view",687    "type": "function"688  },689  {690    "inputs": [691      { "internalType": "uint256", "name": "index", "type": "uint256" }692    ],693    "name": "tokenByIndex",694    "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],695    "stateMutability": "view",696    "type": "function"697  },698  {699    "inputs": [700      { "internalType": "uint256", "name": "token", "type": "uint256" }701    ],702    "name": "tokenContractAddress",703    "outputs": [{ "internalType": "address", "name": "", "type": "address" }],704    "stateMutability": "view",705    "type": "function"706  },707  {708    "inputs": [709      { "internalType": "address", "name": "owner", "type": "address" },710      { "internalType": "uint256", "name": "index", "type": "uint256" }711    ],712    "name": "tokenOfOwnerByIndex",713    "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],714    "stateMutability": "view",715    "type": "function"716  },717  {718    "inputs": [719      { "internalType": "uint256", "name": "tokenId", "type": "uint256" }720    ],721    "name": "tokenURI",722    "outputs": [{ "internalType": "string", "name": "", "type": "string" }],723    "stateMutability": "view",724    "type": "function"725  },726  {727    "inputs": [],728    "name": "totalSupply",729    "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],730    "stateMutability": "view",731    "type": "function"732  },733  {734    "inputs": [735      { "internalType": "address", "name": "to", "type": "address" },736      { "internalType": "uint256", "name": "tokenId", "type": "uint256" }737    ],738    "name": "transfer",739    "outputs": [],740    "stateMutability": "nonpayable",741    "type": "function"742  },743  {744    "inputs": [745      { "internalType": "address", "name": "from", "type": "address" },746      { "internalType": "address", "name": "to", "type": "address" },747      { "internalType": "uint256", "name": "tokenId", "type": "uint256" }748    ],749    "name": "transferFrom",750    "outputs": [],751    "stateMutability": "nonpayable",752    "type": "function"753  },754  {755    "inputs": [756      {757        "components": [758          { "internalType": "address", "name": "field_0", "type": "address" },759          { "internalType": "uint256", "name": "field_1", "type": "uint256" }760        ],761        "internalType": "struct Tuple6",762        "name": "from",763        "type": "tuple"764      },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": "to",772        "type": "tuple"773      },774      { "internalType": "uint256", "name": "tokenId", "type": "uint256" }775    ],776    "name": "transferFromCross",777    "outputs": [],778    "stateMutability": "nonpayable",779    "type": "function"780  },781  {782    "inputs": [],783    "name": "uniqueCollectionType",784    "outputs": [{ "internalType": "string", "name": "", "type": "string" }],785    "stateMutability": "view",786    "type": "function"787  }788]