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