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

difftreelog

fix rft test

Trubnikov Sergey2022-12-15parent: #a37fff1.patch.diff
in: master

6 files changed

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
@@ -18,30 +18,45 @@
 }
 
 /// @title A contract that allows to set and delete token properties and change token property permissions.
-/// @dev the ERC-165 identifier for this interface is 0x91a97a68
+/// @dev the ERC-165 identifier for this interface is 0xde0695c2
 contract TokenProperties is Dummy, ERC165 {
+	// /// @notice Set permissions for token property.
+	// /// @dev Throws error if `msg.sender` is not admin or owner of the collection.
+	// /// @param key Property key.
+	// /// @param isMutable Permission to mutate property.
+	// /// @param collectionAdmin Permission to mutate property by collection admin if property is mutable.
+	// /// @param tokenOwner Permission to mutate property by token owner if property is mutable.
+	// /// @dev EVM selector for this function is: 0x222d97fa,
+	// ///  or in textual repr: setTokenPropertyPermission(string,bool,bool,bool)
+	// function setTokenPropertyPermission(string memory key, bool isMutable, bool collectionAdmin, bool tokenOwner) public {
+	// 	require(false, stub_error);
+	// 	key;
+	// 	isMutable;
+	// 	collectionAdmin;
+	// 	tokenOwner;
+	// 	dummy = 0;
+	// }
+
 	/// @notice Set permissions for token property.
 	/// @dev Throws error if `msg.sender` is not admin or owner of the collection.
-	/// @param key Property key.
-	/// @param isMutable Permission to mutate property.
-	/// @param collectionAdmin Permission to mutate property by collection admin if property is mutable.
-	/// @param tokenOwner Permission to mutate property by token owner if property is mutable.
-	/// @dev EVM selector for this function is: 0x222d97fa,
-	///  or in textual repr: setTokenPropertyPermission(string,bool,bool,bool)
-	function setTokenPropertyPermission(
-		string memory key,
-		bool isMutable,
-		bool collectionAdmin,
-		bool tokenOwner
-	) public {
+	/// @param permissions Permissions for keys.
+	/// @dev EVM selector for this function is: 0xbd92983a,
+	///  or in textual repr: setTokenPropertyPermissions((string,(uint8,bool)[])[])
+	function setTokenPropertyPermissions(Tuple53[] memory permissions) public {
 		require(false, stub_error);
-		key;
-		isMutable;
-		collectionAdmin;
-		tokenOwner;
+		permissions;
 		dummy = 0;
 	}
 
+	/// @notice Get permissions for token properties.
+	/// @dev EVM selector for this function is: 0xf23d7790,
+	///  or in textual repr: tokenPropertyPermissions()
+	function tokenPropertyPermissions() public view returns (Tuple53[] memory) {
+		require(false, stub_error);
+		dummy;
+		return new Tuple53[](0);
+	}
+
 	// /// @notice Set token property value.
 	// /// @dev Throws error if `msg.sender` has no permission to edit the property.
 	// /// @param tokenId ID of the token.
@@ -118,6 +133,24 @@
 	bytes value;
 }
 
+enum EthTokenPermissions {
+	Mutable,
+	TokenOwner,
+	CollectionAdmin
+}
+
+/// @dev anonymous struct
+struct Tuple53 {
+	string field_0;
+	Tuple51[] field_1;
+}
+
+/// @dev anonymous struct
+struct Tuple51 {
+	EthTokenPermissions field_0;
+	bool field_1;
+}
+
 /// @title A contract that allows you to work with collections.
 /// @dev the ERC-165 identifier for this interface is 0xb5e1747f
 contract Collection is Dummy, ERC165 {
modifiedtests/src/eth/abi/reFungible.jsondiffbeforeafterboth
--- a/tests/src/eth/abi/reFungible.json
+++ b/tests/src/eth/abi/reFungible.json
@@ -679,12 +679,29 @@
   },
   {
     "inputs": [
-      { "internalType": "string", "name": "key", "type": "string" },
-      { "internalType": "bool", "name": "isMutable", "type": "bool" },
-      { "internalType": "bool", "name": "collectionAdmin", "type": "bool" },
-      { "internalType": "bool", "name": "tokenOwner", "type": "bool" }
+      {
+        "components": [
+          { "internalType": "string", "name": "field_0", "type": "string" },
+          {
+            "components": [
+              {
+                "internalType": "enum EthTokenPermissions",
+                "name": "field_0",
+                "type": "uint8"
+              },
+              { "internalType": "bool", "name": "field_1", "type": "bool" }
+            ],
+            "internalType": "struct Tuple51[]",
+            "name": "field_1",
+            "type": "tuple[]"
+          }
+        ],
+        "internalType": "struct Tuple53[]",
+        "name": "permissions",
+        "type": "tuple[]"
+      }
     ],
-    "name": "setTokenPropertyPermission",
+    "name": "setTokenPropertyPermissions",
     "outputs": [],
     "stateMutability": "nonpayable",
     "type": "function"
@@ -734,6 +751,35 @@
     "type": "function"
   },
   {
+    "inputs": [],
+    "name": "tokenPropertyPermissions",
+    "outputs": [
+      {
+        "components": [
+          { "internalType": "string", "name": "field_0", "type": "string" },
+          {
+            "components": [
+              {
+                "internalType": "enum EthTokenPermissions",
+                "name": "field_0",
+                "type": "uint8"
+              },
+              { "internalType": "bool", "name": "field_1", "type": "bool" }
+            ],
+            "internalType": "struct Tuple51[]",
+            "name": "field_1",
+            "type": "tuple[]"
+          }
+        ],
+        "internalType": "struct Tuple53[]",
+        "name": "",
+        "type": "tuple[]"
+      }
+    ],
+    "stateMutability": "view",
+    "type": "function"
+  },
+  {
     "inputs": [
       { "internalType": "uint256", "name": "tokenId", "type": "uint256" }
     ],
modifiedtests/src/eth/api/UniqueRefungible.soldiffbeforeafterboth
before · tests/src/eth/api/UniqueRefungible.sol
1// SPDX-License-Identifier: OTHER2// This code is automatically generated34pragma solidity >=0.8.0 <0.9.0;56/// @dev common stubs holder7interface Dummy {89}1011interface ERC165 is Dummy {12	function supportsInterface(bytes4 interfaceID) external view returns (bool);13}1415/// @title A contract that allows to set and delete token properties and change token property permissions.16/// @dev the ERC-165 identifier for this interface is 0x91a97a6817interface TokenProperties is Dummy, ERC165 {18	/// @notice Set permissions for token property.19	/// @dev Throws error if `msg.sender` is not admin or owner of the collection.20	/// @param key Property key.21	/// @param isMutable Permission to mutate property.22	/// @param collectionAdmin Permission to mutate property by collection admin if property is mutable.23	/// @param tokenOwner Permission to mutate property by token owner if property is mutable.24	/// @dev EVM selector for this function is: 0x222d97fa,25	///  or in textual repr: setTokenPropertyPermission(string,bool,bool,bool)26	function setTokenPropertyPermission(27		string memory key,28		bool isMutable,29		bool collectionAdmin,30		bool tokenOwner31	) external;3233	// /// @notice Set token property value.34	// /// @dev Throws error if `msg.sender` has no permission to edit the property.35	// /// @param tokenId ID of the token.36	// /// @param key Property key.37	// /// @param value Property value.38	// /// @dev EVM selector for this function is: 0x1752d67b,39	// ///  or in textual repr: setProperty(uint256,string,bytes)40	// function setProperty(uint256 tokenId, string memory key, bytes memory value) external;4142	/// @notice Set token properties value.43	/// @dev Throws error if `msg.sender` has no permission to edit the property.44	/// @param tokenId ID of the token.45	/// @param properties settable properties46	/// @dev EVM selector for this function is: 0x14ed3a6e,47	///  or in textual repr: setProperties(uint256,(string,bytes)[])48	function setProperties(uint256 tokenId, Property[] memory properties) external;4950	// /// @notice Delete token property value.51	// /// @dev Throws error if `msg.sender` has no permission to edit the property.52	// /// @param tokenId ID of the token.53	// /// @param key Property key.54	// /// @dev EVM selector for this function is: 0x066111d1,55	// ///  or in textual repr: deleteProperty(uint256,string)56	// function deleteProperty(uint256 tokenId, string memory key) external;5758	/// @notice Delete token properties value.59	/// @dev Throws error if `msg.sender` has no permission to edit the property.60	/// @param tokenId ID of the token.61	/// @param keys Properties key.62	/// @dev EVM selector for this function is: 0xc472d371,63	///  or in textual repr: deleteProperties(uint256,string[])64	function deleteProperties(uint256 tokenId, string[] memory keys) external;6566	/// @notice Get token property value.67	/// @dev Throws error if key not found68	/// @param tokenId ID of the token.69	/// @param key Property key.70	/// @return Property value bytes71	/// @dev EVM selector for this function is: 0x7228c327,72	///  or in textual repr: property(uint256,string)73	function property(uint256 tokenId, string memory key) external view returns (bytes memory);74}7576/// @dev Property struct77struct Property {78	string key;79	bytes value;80}8182/// @title A contract that allows you to work with collections.83/// @dev the ERC-165 identifier for this interface is 0xb5e1747f84interface Collection is Dummy, ERC165 {85	// /// Set collection property.86	// ///87	// /// @param key Property key.88	// /// @param value Propery value.89	// /// @dev EVM selector for this function is: 0x2f073f66,90	// ///  or in textual repr: setCollectionProperty(string,bytes)91	// function setCollectionProperty(string memory key, bytes memory value) external;9293	/// Set collection properties.94	///95	/// @param properties Vector of properties key/value pair.96	/// @dev EVM selector for this function is: 0x50b26b2a,97	///  or in textual repr: setCollectionProperties((string,bytes)[])98	function setCollectionProperties(Property[] memory properties) external;99100	// /// Delete collection property.101	// ///102	// /// @param key Property key.103	// /// @dev EVM selector for this function is: 0x7b7debce,104	// ///  or in textual repr: deleteCollectionProperty(string)105	// function deleteCollectionProperty(string memory key) external;106107	/// Delete collection properties.108	///109	/// @param keys Properties keys.110	/// @dev EVM selector for this function is: 0xee206ee3,111	///  or in textual repr: deleteCollectionProperties(string[])112	function deleteCollectionProperties(string[] memory keys) external;113114	/// Get collection property.115	///116	/// @dev Throws error if key not found.117	///118	/// @param key Property key.119	/// @return bytes The property corresponding to the key.120	/// @dev EVM selector for this function is: 0xcf24fd6d,121	///  or in textual repr: collectionProperty(string)122	function collectionProperty(string memory key) external view returns (bytes memory);123124	/// Get collection properties.125	///126	/// @param keys Properties keys. Empty keys for all propertyes.127	/// @return Vector of properties key/value pairs.128	/// @dev EVM selector for this function is: 0x285fb8e6,129	///  or in textual repr: collectionProperties(string[])130	function collectionProperties(string[] memory keys) external view returns (Property[] memory);131132	// /// Set the sponsor of the collection.133	// ///134	// /// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor.135	// ///136	// /// @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract.137	// /// @dev EVM selector for this function is: 0x7623402e,138	// ///  or in textual repr: setCollectionSponsor(address)139	// function setCollectionSponsor(address sponsor) external;140141	/// Set the sponsor of the collection.142	///143	/// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor.144	///145	/// @param sponsor Cross account address of the sponsor from whose account funds will be debited for operations with the contract.146	/// @dev EVM selector for this function is: 0x84a1d5a8,147	///  or in textual repr: setCollectionSponsorCross((address,uint256))148	function setCollectionSponsorCross(EthCrossAccount memory sponsor) external;149150	/// Whether there is a pending sponsor.151	/// @dev EVM selector for this function is: 0x058ac185,152	///  or in textual repr: hasCollectionPendingSponsor()153	function hasCollectionPendingSponsor() external view returns (bool);154155	/// Collection sponsorship confirmation.156	///157	/// @dev After setting the sponsor for the collection, it must be confirmed with this function.158	/// @dev EVM selector for this function is: 0x3c50e97a,159	///  or in textual repr: confirmCollectionSponsorship()160	function confirmCollectionSponsorship() external;161162	/// Remove collection sponsor.163	/// @dev EVM selector for this function is: 0x6e0326a3,164	///  or in textual repr: removeCollectionSponsor()165	function removeCollectionSponsor() external;166167	/// Get current sponsor.168	///169	/// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.170	/// @dev EVM selector for this function is: 0x6ec0a9f1,171	///  or in textual repr: collectionSponsor()172	function collectionSponsor() external view returns (Tuple26 memory);173174	/// Set limits for the collection.175	/// @dev Throws error if limit not found.176	/// @param limit Name of the limit. Valid names:177	/// 	"accountTokenOwnershipLimit",178	/// 	"sponsoredDataSize",179	/// 	"sponsoredDataRateLimit",180	/// 	"tokenLimit",181	/// 	"sponsorTransferTimeout",182	/// 	"sponsorApproveTimeout"183	///  	"ownerCanTransfer",184	/// 	"ownerCanDestroy",185	/// 	"transfersEnabled"186	/// @param value Value of the limit.187	/// @dev EVM selector for this function is: 0x4ad890a8,188	///  or in textual repr: setCollectionLimit(string,uint256)189	function setCollectionLimit(string memory limit, uint256 value) external;190191	/// Get contract address.192	/// @dev EVM selector for this function is: 0xf6b4dfb4,193	///  or in textual repr: contractAddress()194	function contractAddress() external view returns (address);195196	/// Add collection admin.197	/// @param newAdmin Cross account administrator address.198	/// @dev EVM selector for this function is: 0x859aa7d6,199	///  or in textual repr: addCollectionAdminCross((address,uint256))200	function addCollectionAdminCross(EthCrossAccount memory newAdmin) external;201202	/// Remove collection admin.203	/// @param admin Cross account administrator address.204	/// @dev EVM selector for this function is: 0x6c0cd173,205	///  or in textual repr: removeCollectionAdminCross((address,uint256))206	function removeCollectionAdminCross(EthCrossAccount memory admin) external;207208	// /// Add collection admin.209	// /// @param newAdmin Address of the added administrator.210	// /// @dev EVM selector for this function is: 0x92e462c7,211	// ///  or in textual repr: addCollectionAdmin(address)212	// function addCollectionAdmin(address newAdmin) external;213214	// /// Remove collection admin.215	// ///216	// /// @param admin Address of the removed administrator.217	// /// @dev EVM selector for this function is: 0xfafd7b42,218	// ///  or in textual repr: removeCollectionAdmin(address)219	// function removeCollectionAdmin(address admin) external;220221	/// Toggle accessibility of collection nesting.222	///223	/// @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'224	/// @dev EVM selector for this function is: 0x112d4586,225	///  or in textual repr: setCollectionNesting(bool)226	function setCollectionNesting(bool enable) external;227228	/// Toggle accessibility of collection nesting.229	///230	/// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'231	/// @param collections Addresses of collections that will be available for nesting.232	/// @dev EVM selector for this function is: 0x64872396,233	///  or in textual repr: setCollectionNesting(bool,address[])234	function setCollectionNesting(bool enable, address[] memory collections) external;235236	/// Returns nesting for a collection237	/// @dev EVM selector for this function is: 0x22d25bfe,238	///  or in textual repr: collectionNestingRestrictedCollectionIds()239	function collectionNestingRestrictedCollectionIds() external view returns (Tuple30 memory);240241	/// Returns permissions for a collection242	/// @dev EVM selector for this function is: 0x5b2eaf4b,243	///  or in textual repr: collectionNestingPermissions()244	function collectionNestingPermissions() external view returns (Tuple33[] memory);245246	/// Set the collection access method.247	/// @param mode Access mode248	/// 	0 for Normal249	/// 	1 for AllowList250	/// @dev EVM selector for this function is: 0x41835d4c,251	///  or in textual repr: setCollectionAccess(uint8)252	function setCollectionAccess(uint8 mode) external;253254	/// Checks that user allowed to operate with collection.255	///256	/// @param user User address to check.257	/// @dev EVM selector for this function is: 0x91b6df49,258	///  or in textual repr: allowlistedCross((address,uint256))259	function allowlistedCross(EthCrossAccount memory user) external view returns (bool);260261	// /// Add the user to the allowed list.262	// ///263	// /// @param user Address of a trusted user.264	// /// @dev EVM selector for this function is: 0x67844fe6,265	// ///  or in textual repr: addToCollectionAllowList(address)266	// function addToCollectionAllowList(address user) external;267268	/// Add user to allowed list.269	///270	/// @param user User cross account address.271	/// @dev EVM selector for this function is: 0xa0184a3a,272	///  or in textual repr: addToCollectionAllowListCross((address,uint256))273	function addToCollectionAllowListCross(EthCrossAccount memory user) external;274275	// /// Remove the user from the allowed list.276	// ///277	// /// @param user Address of a removed user.278	// /// @dev EVM selector for this function is: 0x85c51acb,279	// ///  or in textual repr: removeFromCollectionAllowList(address)280	// function removeFromCollectionAllowList(address user) external;281282	/// Remove user from allowed list.283	///284	/// @param user User cross account address.285	/// @dev EVM selector for this function is: 0x09ba452a,286	///  or in textual repr: removeFromCollectionAllowListCross((address,uint256))287	function removeFromCollectionAllowListCross(EthCrossAccount memory user) external;288289	/// Switch permission for minting.290	///291	/// @param mode Enable if "true".292	/// @dev EVM selector for this function is: 0x00018e84,293	///  or in textual repr: setCollectionMintMode(bool)294	function setCollectionMintMode(bool mode) external;295296	// /// Check that account is the owner or admin of the collection297	// ///298	// /// @param user account to verify299	// /// @return "true" if account is the owner or admin300	// /// @dev EVM selector for this function is: 0x9811b0c7,301	// ///  or in textual repr: isOwnerOrAdmin(address)302	// function isOwnerOrAdmin(address user) external view returns (bool);303304	/// Check that account is the owner or admin of the collection305	///306	/// @param user User cross account to verify307	/// @return "true" if account is the owner or admin308	/// @dev EVM selector for this function is: 0x3e75a905,309	///  or in textual repr: isOwnerOrAdminCross((address,uint256))310	function isOwnerOrAdminCross(EthCrossAccount memory user) external view returns (bool);311312	/// Returns collection type313	///314	/// @return `Fungible` or `NFT` or `ReFungible`315	/// @dev EVM selector for this function is: 0xd34b55b8,316	///  or in textual repr: uniqueCollectionType()317	function uniqueCollectionType() external view returns (string memory);318319	/// Get collection owner.320	///321	/// @return Tuble with sponsor address and his substrate mirror.322	/// If address is canonical then substrate mirror is zero and vice versa.323	/// @dev EVM selector for this function is: 0xdf727d3b,324	///  or in textual repr: collectionOwner()325	function collectionOwner() external view returns (EthCrossAccount memory);326327	// /// Changes collection owner to another account328	// ///329	// /// @dev Owner can be changed only by current owner330	// /// @param newOwner new owner account331	// /// @dev EVM selector for this function is: 0x4f53e226,332	// ///  or in textual repr: changeCollectionOwner(address)333	// function changeCollectionOwner(address newOwner) external;334335	/// Get collection administrators336	///337	/// @return Vector of tuples with admins address and his substrate mirror.338	/// If address is canonical then substrate mirror is zero and vice versa.339	/// @dev EVM selector for this function is: 0x5813216b,340	///  or in textual repr: collectionAdmins()341	function collectionAdmins() external view returns (EthCrossAccount[] memory);342343	/// Changes collection owner to another account344	///345	/// @dev Owner can be changed only by current owner346	/// @param newOwner new owner cross account347	/// @dev EVM selector for this function is: 0x6496c497,348	///  or in textual repr: changeCollectionOwnerCross((address,uint256))349	function changeCollectionOwnerCross(EthCrossAccount memory newOwner) external;350}351352/// @dev Cross account struct353struct EthCrossAccount {354	address eth;355	uint256 sub;356}357358/// @dev anonymous struct359struct Tuple33 {360	CollectionPermissions field_0;361	bool field_1;362}363364enum CollectionPermissions {365	CollectionAdmin,366	TokenOwner367}368369/// @dev anonymous struct370struct Tuple30 {371	bool field_0;372	uint256[] field_1;373}374375/// @dev anonymous struct376struct Tuple26 {377	address field_0;378	uint256 field_1;379}380381/// @dev the ERC-165 identifier for this interface is 0x5b5e139f382interface ERC721Metadata is Dummy, ERC165 {383	// /// @notice A descriptive name for a collection of NFTs in this contract384	// /// @dev real implementation of this function lies in `ERC721UniqueExtensions`385	// /// @dev EVM selector for this function is: 0x06fdde03,386	// ///  or in textual repr: name()387	// function name() external view returns (string memory);388389	// /// @notice An abbreviated name for NFTs in this contract390	// /// @dev real implementation of this function lies in `ERC721UniqueExtensions`391	// /// @dev EVM selector for this function is: 0x95d89b41,392	// ///  or in textual repr: symbol()393	// function symbol() external view returns (string memory);394395	/// @notice A distinct Uniform Resource Identifier (URI) for a given asset.396	///397	/// @dev If the token has a `url` property and it is not empty, it is returned.398	///  Else If the collection does not have a property with key `schemaName` or its value is not equal to `ERC721Metadata`, it return an error `tokenURI not set`.399	///  If the collection property `baseURI` is empty or absent, return "" (empty string)400	///  otherwise, if token property `suffix` present and is non-empty, return concatenation of baseURI and suffix401	///  otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings).402	///403	/// @return token's const_metadata404	/// @dev EVM selector for this function is: 0xc87b56dd,405	///  or in textual repr: tokenURI(uint256)406	function tokenURI(uint256 tokenId) external view returns (string memory);407}408409/// @title ERC721 Token that can be irreversibly burned (destroyed).410/// @dev the ERC-165 identifier for this interface is 0x42966c68411interface ERC721Burnable is Dummy, ERC165 {412	/// @notice Burns a specific ERC721 token.413	/// @dev Throws unless `msg.sender` is the current RFT owner, or an authorized414	///  operator of the current owner.415	/// @param tokenId The RFT to approve416	/// @dev EVM selector for this function is: 0x42966c68,417	///  or in textual repr: burn(uint256)418	function burn(uint256 tokenId) external;419}420421/// @dev inlined interface422interface ERC721UniqueMintableEvents {423	event MintingFinished();424}425426/// @title ERC721 minting logic.427/// @dev the ERC-165 identifier for this interface is 0x476ff149428interface ERC721UniqueMintable is Dummy, ERC165, ERC721UniqueMintableEvents {429	/// @dev EVM selector for this function is: 0x05d2035b,430	///  or in textual repr: mintingFinished()431	function mintingFinished() external view returns (bool);432433	/// @notice Function to mint token.434	/// @param to The new owner435	/// @return uint256 The id of the newly minted token436	/// @dev EVM selector for this function is: 0x6a627842,437	///  or in textual repr: mint(address)438	function mint(address to) external returns (uint256);439440	// /// @notice Function to mint token.441	// /// @dev `tokenId` should be obtained with `nextTokenId` method,442	// ///  unlike standard, you can't specify it manually443	// /// @param to The new owner444	// /// @param tokenId ID of the minted RFT445	// /// @dev EVM selector for this function is: 0x40c10f19,446	// ///  or in textual repr: mint(address,uint256)447	// function mint(address to, uint256 tokenId) external returns (bool);448449	/// @notice Function to mint token with the given tokenUri.450	/// @param to The new owner451	/// @param tokenUri Token URI that would be stored in the NFT properties452	/// @return uint256 The id of the newly minted token453	/// @dev EVM selector for this function is: 0x45c17782,454	///  or in textual repr: mintWithTokenURI(address,string)455	function mintWithTokenURI(address to, string memory tokenUri) external returns (uint256);456457	// /// @notice Function to mint token with the given tokenUri.458	// /// @dev `tokenId` should be obtained with `nextTokenId` method,459	// ///  unlike standard, you can't specify it manually460	// /// @param to The new owner461	// /// @param tokenId ID of the minted RFT462	// /// @param tokenUri Token URI that would be stored in the RFT properties463	// /// @dev EVM selector for this function is: 0x50bb4e7f,464	// ///  or in textual repr: mintWithTokenURI(address,uint256,string)465	// function mintWithTokenURI(address to, uint256 tokenId, string memory tokenUri) external returns (bool);466467	/// @dev Not implemented468	/// @dev EVM selector for this function is: 0x7d64bcb4,469	///  or in textual repr: finishMinting()470	function finishMinting() external returns (bool);471}472473/// @title Unique extensions for ERC721.474/// @dev the ERC-165 identifier for this interface is 0x12f7d6c1475interface ERC721UniqueExtensions is Dummy, ERC165 {476	/// @notice A descriptive name for a collection of NFTs in this contract477	/// @dev EVM selector for this function is: 0x06fdde03,478	///  or in textual repr: name()479	function name() external view returns (string memory);480481	/// @notice An abbreviated name for NFTs in this contract482	/// @dev EVM selector for this function is: 0x95d89b41,483	///  or in textual repr: symbol()484	function symbol() external view returns (string memory);485486	/// @notice A description for the collection.487	/// @dev EVM selector for this function is: 0x7284e416,488	///  or in textual repr: description()489	function description() external view returns (string memory);490491	/// Returns the owner (in cross format) of the token.492	///493	/// @param tokenId Id for the token.494	/// @dev EVM selector for this function is: 0x2b29dace,495	///  or in textual repr: crossOwnerOf(uint256)496	function crossOwnerOf(uint256 tokenId) external view returns (EthCrossAccount memory);497498	/// Returns the token properties.499	///500	/// @param tokenId Id for the token.501	/// @param keys Properties keys. Empty keys for all propertyes.502	/// @return Vector of properties key/value pairs.503	/// @dev EVM selector for this function is: 0xe07ede7e,504	///  or in textual repr: properties(uint256,string[])505	function properties(uint256 tokenId, string[] memory keys) external view returns (Property[] memory);506507	/// @notice Transfer ownership of an RFT508	/// @dev Throws unless `msg.sender` is the current owner. Throws if `to`509	///  is the zero address. Throws if `tokenId` is not a valid RFT.510	///  Throws if RFT pieces have multiple owners.511	/// @param to The new owner512	/// @param tokenId The RFT to transfer513	/// @dev EVM selector for this function is: 0xa9059cbb,514	///  or in textual repr: transfer(address,uint256)515	function transfer(address to, uint256 tokenId) external;516517	/// @notice Transfer ownership of an RFT518	/// @dev Throws unless `msg.sender` is the current owner. Throws if `to`519	///  is the zero address. Throws if `tokenId` is not a valid RFT.520	///  Throws if RFT pieces have multiple owners.521	/// @param to The new owner522	/// @param tokenId The RFT to transfer523	/// @dev EVM selector for this function is: 0x2ada85ff,524	///  or in textual repr: transferCross((address,uint256),uint256)525	function transferCross(EthCrossAccount memory to, uint256 tokenId) external;526527	/// @notice Transfer ownership of an RFT528	/// @dev Throws unless `msg.sender` is the current owner. Throws if `to`529	///  is the zero address. Throws if `tokenId` is not a valid RFT.530	///  Throws if RFT pieces have multiple owners.531	/// @param to The new owner532	/// @param tokenId The RFT to transfer533	/// @dev EVM selector for this function is: 0xd5cf430b,534	///  or in textual repr: transferFromCross((address,uint256),(address,uint256),uint256)535	function transferFromCross(536		EthCrossAccount memory from,537		EthCrossAccount memory to,538		uint256 tokenId539	) external;540541	// /// @notice Burns a specific ERC721 token.542	// /// @dev Throws unless `msg.sender` is the current owner or an authorized543	// ///  operator for this RFT. Throws if `from` is not the current owner. Throws544	// ///  if `to` is the zero address. Throws if `tokenId` is not a valid RFT.545	// ///  Throws if RFT pieces have multiple owners.546	// /// @param from The current owner of the RFT547	// /// @param tokenId The RFT to transfer548	// /// @dev EVM selector for this function is: 0x79cc6790,549	// ///  or in textual repr: burnFrom(address,uint256)550	// function burnFrom(address from, uint256 tokenId) external;551552	/// @notice Burns a specific ERC721 token.553	/// @dev Throws unless `msg.sender` is the current owner or an authorized554	///  operator for this RFT. Throws if `from` is not the current owner. Throws555	///  if `to` is the zero address. Throws if `tokenId` is not a valid RFT.556	///  Throws if RFT pieces have multiple owners.557	/// @param from The current owner of the RFT558	/// @param tokenId The RFT to transfer559	/// @dev EVM selector for this function is: 0xbb2f5a58,560	///  or in textual repr: burnFromCross((address,uint256),uint256)561	function burnFromCross(EthCrossAccount memory from, uint256 tokenId) external;562563	/// @notice Returns next free RFT ID.564	/// @dev EVM selector for this function is: 0x75794a3c,565	///  or in textual repr: nextTokenId()566	function nextTokenId() external view returns (uint256);567568	// /// @notice Function to mint multiple tokens.569	// /// @dev `tokenIds` should be an array of consecutive numbers and first number570	// ///  should be obtained with `nextTokenId` method571	// /// @param to The new owner572	// /// @param tokenIds IDs of the minted RFTs573	// /// @dev EVM selector for this function is: 0x44a9945e,574	// ///  or in textual repr: mintBulk(address,uint256[])575	// function mintBulk(address to, uint256[] memory tokenIds) external returns (bool);576577	// /// @notice Function to mint multiple tokens with the given tokenUris.578	// /// @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive579	// ///  numbers and first number should be obtained with `nextTokenId` method580	// /// @param to The new owner581	// /// @param tokens array of pairs of token ID and token URI for minted tokens582	// /// @dev EVM selector for this function is: 0x36543006,583	// ///  or in textual repr: mintBulkWithTokenURI(address,(uint256,string)[])584	// function mintBulkWithTokenURI(address to, Tuple12[] memory tokens) external returns (bool);585586	/// Returns EVM address for refungible token587	///588	/// @param token ID of the token589	/// @dev EVM selector for this function is: 0xab76fac6,590	///  or in textual repr: tokenContractAddress(uint256)591	function tokenContractAddress(uint256 token) external view returns (address);592}593594/// @dev anonymous struct595struct Tuple12 {596	uint256 field_0;597	string field_1;598}599600/// @title ERC-721 Non-Fungible Token Standard, optional enumeration extension601/// @dev See https://eips.ethereum.org/EIPS/eip-721602/// @dev the ERC-165 identifier for this interface is 0x780e9d63603interface ERC721Enumerable is Dummy, ERC165 {604	/// @notice Enumerate valid RFTs605	/// @param index A counter less than `totalSupply()`606	/// @return The token identifier for the `index`th NFT,607	///  (sort order not specified)608	/// @dev EVM selector for this function is: 0x4f6ccce7,609	///  or in textual repr: tokenByIndex(uint256)610	function tokenByIndex(uint256 index) external view returns (uint256);611612	/// Not implemented613	/// @dev EVM selector for this function is: 0x2f745c59,614	///  or in textual repr: tokenOfOwnerByIndex(address,uint256)615	function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);616617	/// @notice Count RFTs tracked by this contract618	/// @return A count of valid RFTs tracked by this contract, where each one of619	///  them has an assigned and queryable owner not equal to the zero address620	/// @dev EVM selector for this function is: 0x18160ddd,621	///  or in textual repr: totalSupply()622	function totalSupply() external view returns (uint256);623}624625/// @dev inlined interface626interface ERC721Events {627	event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);628	event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);629	event ApprovalForAll(address indexed owner, address indexed operator, bool approved);630}631632/// @title ERC-721 Non-Fungible Token Standard633/// @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md634/// @dev the ERC-165 identifier for this interface is 0x4016cd87635interface ERC721 is Dummy, ERC165, ERC721Events {636	/// @notice Count all RFTs assigned to an owner637	/// @dev RFTs assigned to the zero address are considered invalid, and this638	///  function throws for queries about the zero address.639	/// @param owner An address for whom to query the balance640	/// @return The number of RFTs owned by `owner`, possibly zero641	/// @dev EVM selector for this function is: 0x70a08231,642	///  or in textual repr: balanceOf(address)643	function balanceOf(address owner) external view returns (uint256);644645	/// @notice Find the owner of an RFT646	/// @dev RFTs assigned to zero address are considered invalid, and queries647	///  about them do throw.648	///  Returns special 0xffffffffffffffffffffffffffffffffffffffff address for649	///  the tokens that are partially owned.650	/// @param tokenId The identifier for an RFT651	/// @return The address of the owner of the RFT652	/// @dev EVM selector for this function is: 0x6352211e,653	///  or in textual repr: ownerOf(uint256)654	function ownerOf(uint256 tokenId) external view returns (address);655656	/// @dev Not implemented657	/// @dev EVM selector for this function is: 0x60a11672,658	///  or in textual repr: safeTransferFromWithData(address,address,uint256,bytes)659	function safeTransferFromWithData(660		address from,661		address to,662		uint256 tokenId,663		bytes memory data664	) external;665666	/// @dev Not implemented667	/// @dev EVM selector for this function is: 0x42842e0e,668	///  or in textual repr: safeTransferFrom(address,address,uint256)669	function safeTransferFrom(670		address from,671		address to,672		uint256 tokenId673	) external;674675	/// @notice Transfer ownership of an RFT -- THE CALLER IS RESPONSIBLE676	///  TO CONFIRM THAT `to` IS CAPABLE OF RECEIVING NFTS OR ELSE677	///  THEY MAY BE PERMANENTLY LOST678	/// @dev Throws unless `msg.sender` is the current owner or an authorized679	///  operator for this RFT. Throws if `from` is not the current owner. Throws680	///  if `to` is the zero address. Throws if `tokenId` is not a valid RFT.681	///  Throws if RFT pieces have multiple owners.682	/// @param from The current owner of the NFT683	/// @param to The new owner684	/// @param tokenId The NFT to transfer685	/// @dev EVM selector for this function is: 0x23b872dd,686	///  or in textual repr: transferFrom(address,address,uint256)687	function transferFrom(688		address from,689		address to,690		uint256 tokenId691	) external;692693	/// @dev Not implemented694	/// @dev EVM selector for this function is: 0x095ea7b3,695	///  or in textual repr: approve(address,uint256)696	function approve(address approved, uint256 tokenId) external;697698	/// @notice Sets or unsets the approval of a given operator.699	///  The `operator` is allowed to transfer all token pieces of the `caller` on their behalf.700	/// @param operator Operator701	/// @param approved Should operator status be granted or revoked?702	/// @dev EVM selector for this function is: 0xa22cb465,703	///  or in textual repr: setApprovalForAll(address,bool)704	function setApprovalForAll(address operator, bool approved) external;705706	/// @dev Not implemented707	/// @dev EVM selector for this function is: 0x081812fc,708	///  or in textual repr: getApproved(uint256)709	function getApproved(uint256 tokenId) external view returns (address);710711	/// @notice Tells whether the given `owner` approves the `operator`.712	/// @dev EVM selector for this function is: 0xe985e9c5,713	///  or in textual repr: isApprovedForAll(address,address)714	function isApprovedForAll(address owner, address operator) external view returns (bool);715716	/// @notice Returns collection helper contract address717	/// @dev EVM selector for this function is: 0x1896cce6,718	///  or in textual repr: collectionHelperAddress()719	function collectionHelperAddress() external view returns (address);720}721722interface UniqueRefungible is723	Dummy,724	ERC165,725	ERC721,726	ERC721Enumerable,727	ERC721UniqueExtensions,728	ERC721UniqueMintable,729	ERC721Burnable,730	ERC721Metadata,731	Collection,732	TokenProperties733{}
after · tests/src/eth/api/UniqueRefungible.sol
1// SPDX-License-Identifier: OTHER2// This code is automatically generated34pragma solidity >=0.8.0 <0.9.0;56/// @dev common stubs holder7interface Dummy {89}1011interface ERC165 is Dummy {12	function supportsInterface(bytes4 interfaceID) external view returns (bool);13}1415/// @title A contract that allows to set and delete token properties and change token property permissions.16/// @dev the ERC-165 identifier for this interface is 0xde0695c217interface TokenProperties is Dummy, ERC165 {18	// /// @notice Set permissions for token property.19	// /// @dev Throws error if `msg.sender` is not admin or owner of the collection.20	// /// @param key Property key.21	// /// @param isMutable Permission to mutate property.22	// /// @param collectionAdmin Permission to mutate property by collection admin if property is mutable.23	// /// @param tokenOwner Permission to mutate property by token owner if property is mutable.24	// /// @dev EVM selector for this function is: 0x222d97fa,25	// ///  or in textual repr: setTokenPropertyPermission(string,bool,bool,bool)26	// function setTokenPropertyPermission(string memory key, bool isMutable, bool collectionAdmin, bool tokenOwner) external;2728	/// @notice Set permissions for token property.29	/// @dev Throws error if `msg.sender` is not admin or owner of the collection.30	/// @param permissions Permissions for keys.31	/// @dev EVM selector for this function is: 0xbd92983a,32	///  or in textual repr: setTokenPropertyPermissions((string,(uint8,bool)[])[])33	function setTokenPropertyPermissions(Tuple47[] memory permissions) external;3435	/// @notice Get permissions for token properties.36	/// @dev EVM selector for this function is: 0xf23d7790,37	///  or in textual repr: tokenPropertyPermissions()38	function tokenPropertyPermissions() external view returns (Tuple47[] memory);3940	// /// @notice Set token property value.41	// /// @dev Throws error if `msg.sender` has no permission to edit the property.42	// /// @param tokenId ID of the token.43	// /// @param key Property key.44	// /// @param value Property value.45	// /// @dev EVM selector for this function is: 0x1752d67b,46	// ///  or in textual repr: setProperty(uint256,string,bytes)47	// function setProperty(uint256 tokenId, string memory key, bytes memory value) external;4849	/// @notice Set token properties value.50	/// @dev Throws error if `msg.sender` has no permission to edit the property.51	/// @param tokenId ID of the token.52	/// @param properties settable properties53	/// @dev EVM selector for this function is: 0x14ed3a6e,54	///  or in textual repr: setProperties(uint256,(string,bytes)[])55	function setProperties(uint256 tokenId, Property[] memory properties) external;5657	// /// @notice Delete token property value.58	// /// @dev Throws error if `msg.sender` has no permission to edit the property.59	// /// @param tokenId ID of the token.60	// /// @param key Property key.61	// /// @dev EVM selector for this function is: 0x066111d1,62	// ///  or in textual repr: deleteProperty(uint256,string)63	// function deleteProperty(uint256 tokenId, string memory key) external;6465	/// @notice Delete token properties value.66	/// @dev Throws error if `msg.sender` has no permission to edit the property.67	/// @param tokenId ID of the token.68	/// @param keys Properties key.69	/// @dev EVM selector for this function is: 0xc472d371,70	///  or in textual repr: deleteProperties(uint256,string[])71	function deleteProperties(uint256 tokenId, string[] memory keys) external;7273	/// @notice Get token property value.74	/// @dev Throws error if key not found75	/// @param tokenId ID of the token.76	/// @param key Property key.77	/// @return Property value bytes78	/// @dev EVM selector for this function is: 0x7228c327,79	///  or in textual repr: property(uint256,string)80	function property(uint256 tokenId, string memory key) external view returns (bytes memory);81}8283/// @dev Property struct84struct Property {85	string key;86	bytes value;87}8889enum EthTokenPermissions {90	Mutable,91	TokenOwner,92	CollectionAdmin93}9495/// @dev anonymous struct96struct Tuple47 {97	string field_0;98	Tuple45[] field_1;99}100101/// @dev anonymous struct102struct Tuple45 {103	EthTokenPermissions field_0;104	bool field_1;105}106107/// @title A contract that allows you to work with collections.108/// @dev the ERC-165 identifier for this interface is 0xb5e1747f109interface Collection is Dummy, ERC165 {110	// /// Set collection property.111	// ///112	// /// @param key Property key.113	// /// @param value Propery value.114	// /// @dev EVM selector for this function is: 0x2f073f66,115	// ///  or in textual repr: setCollectionProperty(string,bytes)116	// function setCollectionProperty(string memory key, bytes memory value) external;117118	/// Set collection properties.119	///120	/// @param properties Vector of properties key/value pair.121	/// @dev EVM selector for this function is: 0x50b26b2a,122	///  or in textual repr: setCollectionProperties((string,bytes)[])123	function setCollectionProperties(Property[] memory properties) external;124125	// /// Delete collection property.126	// ///127	// /// @param key Property key.128	// /// @dev EVM selector for this function is: 0x7b7debce,129	// ///  or in textual repr: deleteCollectionProperty(string)130	// function deleteCollectionProperty(string memory key) external;131132	/// Delete collection properties.133	///134	/// @param keys Properties keys.135	/// @dev EVM selector for this function is: 0xee206ee3,136	///  or in textual repr: deleteCollectionProperties(string[])137	function deleteCollectionProperties(string[] memory keys) external;138139	/// Get collection property.140	///141	/// @dev Throws error if key not found.142	///143	/// @param key Property key.144	/// @return bytes The property corresponding to the key.145	/// @dev EVM selector for this function is: 0xcf24fd6d,146	///  or in textual repr: collectionProperty(string)147	function collectionProperty(string memory key) external view returns (bytes memory);148149	/// Get collection properties.150	///151	/// @param keys Properties keys. Empty keys for all propertyes.152	/// @return Vector of properties key/value pairs.153	/// @dev EVM selector for this function is: 0x285fb8e6,154	///  or in textual repr: collectionProperties(string[])155	function collectionProperties(string[] memory keys) external view returns (Property[] memory);156157	// /// Set the sponsor of the collection.158	// ///159	// /// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor.160	// ///161	// /// @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract.162	// /// @dev EVM selector for this function is: 0x7623402e,163	// ///  or in textual repr: setCollectionSponsor(address)164	// function setCollectionSponsor(address sponsor) external;165166	/// Set the sponsor of the collection.167	///168	/// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor.169	///170	/// @param sponsor Cross account address of the sponsor from whose account funds will be debited for operations with the contract.171	/// @dev EVM selector for this function is: 0x84a1d5a8,172	///  or in textual repr: setCollectionSponsorCross((address,uint256))173	function setCollectionSponsorCross(EthCrossAccount memory sponsor) external;174175	/// Whether there is a pending sponsor.176	/// @dev EVM selector for this function is: 0x058ac185,177	///  or in textual repr: hasCollectionPendingSponsor()178	function hasCollectionPendingSponsor() external view returns (bool);179180	/// Collection sponsorship confirmation.181	///182	/// @dev After setting the sponsor for the collection, it must be confirmed with this function.183	/// @dev EVM selector for this function is: 0x3c50e97a,184	///  or in textual repr: confirmCollectionSponsorship()185	function confirmCollectionSponsorship() external;186187	/// Remove collection sponsor.188	/// @dev EVM selector for this function is: 0x6e0326a3,189	///  or in textual repr: removeCollectionSponsor()190	function removeCollectionSponsor() external;191192	/// Get current sponsor.193	///194	/// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.195	/// @dev EVM selector for this function is: 0x6ec0a9f1,196	///  or in textual repr: collectionSponsor()197	function collectionSponsor() external view returns (Tuple26 memory);198199	/// Set limits for the collection.200	/// @dev Throws error if limit not found.201	/// @param limit Name of the limit. Valid names:202	/// 	"accountTokenOwnershipLimit",203	/// 	"sponsoredDataSize",204	/// 	"sponsoredDataRateLimit",205	/// 	"tokenLimit",206	/// 	"sponsorTransferTimeout",207	/// 	"sponsorApproveTimeout"208	///  	"ownerCanTransfer",209	/// 	"ownerCanDestroy",210	/// 	"transfersEnabled"211	/// @param value Value of the limit.212	/// @dev EVM selector for this function is: 0x4ad890a8,213	///  or in textual repr: setCollectionLimit(string,uint256)214	function setCollectionLimit(string memory limit, uint256 value) external;215216	/// Get contract address.217	/// @dev EVM selector for this function is: 0xf6b4dfb4,218	///  or in textual repr: contractAddress()219	function contractAddress() external view returns (address);220221	/// Add collection admin.222	/// @param newAdmin Cross account administrator address.223	/// @dev EVM selector for this function is: 0x859aa7d6,224	///  or in textual repr: addCollectionAdminCross((address,uint256))225	function addCollectionAdminCross(EthCrossAccount memory newAdmin) external;226227	/// Remove collection admin.228	/// @param admin Cross account administrator address.229	/// @dev EVM selector for this function is: 0x6c0cd173,230	///  or in textual repr: removeCollectionAdminCross((address,uint256))231	function removeCollectionAdminCross(EthCrossAccount memory admin) external;232233	// /// Add collection admin.234	// /// @param newAdmin Address of the added administrator.235	// /// @dev EVM selector for this function is: 0x92e462c7,236	// ///  or in textual repr: addCollectionAdmin(address)237	// function addCollectionAdmin(address newAdmin) external;238239	// /// Remove collection admin.240	// ///241	// /// @param admin Address of the removed administrator.242	// /// @dev EVM selector for this function is: 0xfafd7b42,243	// ///  or in textual repr: removeCollectionAdmin(address)244	// function removeCollectionAdmin(address admin) external;245246	/// Toggle accessibility of collection nesting.247	///248	/// @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'249	/// @dev EVM selector for this function is: 0x112d4586,250	///  or in textual repr: setCollectionNesting(bool)251	function setCollectionNesting(bool enable) external;252253	/// Toggle accessibility of collection nesting.254	///255	/// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'256	/// @param collections Addresses of collections that will be available for nesting.257	/// @dev EVM selector for this function is: 0x64872396,258	///  or in textual repr: setCollectionNesting(bool,address[])259	function setCollectionNesting(bool enable, address[] memory collections) external;260261	/// Returns nesting for a collection262	/// @dev EVM selector for this function is: 0x22d25bfe,263	///  or in textual repr: collectionNestingRestrictedCollectionIds()264	function collectionNestingRestrictedCollectionIds() external view returns (Tuple30 memory);265266	/// Returns permissions for a collection267	/// @dev EVM selector for this function is: 0x5b2eaf4b,268	///  or in textual repr: collectionNestingPermissions()269	function collectionNestingPermissions() external view returns (Tuple33[] memory);270271	/// Set the collection access method.272	/// @param mode Access mode273	/// 	0 for Normal274	/// 	1 for AllowList275	/// @dev EVM selector for this function is: 0x41835d4c,276	///  or in textual repr: setCollectionAccess(uint8)277	function setCollectionAccess(uint8 mode) external;278279	/// Checks that user allowed to operate with collection.280	///281	/// @param user User address to check.282	/// @dev EVM selector for this function is: 0x91b6df49,283	///  or in textual repr: allowlistedCross((address,uint256))284	function allowlistedCross(EthCrossAccount memory user) external view returns (bool);285286	// /// Add the user to the allowed list.287	// ///288	// /// @param user Address of a trusted user.289	// /// @dev EVM selector for this function is: 0x67844fe6,290	// ///  or in textual repr: addToCollectionAllowList(address)291	// function addToCollectionAllowList(address user) external;292293	/// Add user to allowed list.294	///295	/// @param user User cross account address.296	/// @dev EVM selector for this function is: 0xa0184a3a,297	///  or in textual repr: addToCollectionAllowListCross((address,uint256))298	function addToCollectionAllowListCross(EthCrossAccount memory user) external;299300	// /// Remove the user from the allowed list.301	// ///302	// /// @param user Address of a removed user.303	// /// @dev EVM selector for this function is: 0x85c51acb,304	// ///  or in textual repr: removeFromCollectionAllowList(address)305	// function removeFromCollectionAllowList(address user) external;306307	/// Remove user from allowed list.308	///309	/// @param user User cross account address.310	/// @dev EVM selector for this function is: 0x09ba452a,311	///  or in textual repr: removeFromCollectionAllowListCross((address,uint256))312	function removeFromCollectionAllowListCross(EthCrossAccount memory user) external;313314	/// Switch permission for minting.315	///316	/// @param mode Enable if "true".317	/// @dev EVM selector for this function is: 0x00018e84,318	///  or in textual repr: setCollectionMintMode(bool)319	function setCollectionMintMode(bool mode) external;320321	// /// Check that account is the owner or admin of the collection322	// ///323	// /// @param user account to verify324	// /// @return "true" if account is the owner or admin325	// /// @dev EVM selector for this function is: 0x9811b0c7,326	// ///  or in textual repr: isOwnerOrAdmin(address)327	// function isOwnerOrAdmin(address user) external view returns (bool);328329	/// Check that account is the owner or admin of the collection330	///331	/// @param user User cross account to verify332	/// @return "true" if account is the owner or admin333	/// @dev EVM selector for this function is: 0x3e75a905,334	///  or in textual repr: isOwnerOrAdminCross((address,uint256))335	function isOwnerOrAdminCross(EthCrossAccount memory user) external view returns (bool);336337	/// Returns collection type338	///339	/// @return `Fungible` or `NFT` or `ReFungible`340	/// @dev EVM selector for this function is: 0xd34b55b8,341	///  or in textual repr: uniqueCollectionType()342	function uniqueCollectionType() external view returns (string memory);343344	/// Get collection owner.345	///346	/// @return Tuble with sponsor address and his substrate mirror.347	/// If address is canonical then substrate mirror is zero and vice versa.348	/// @dev EVM selector for this function is: 0xdf727d3b,349	///  or in textual repr: collectionOwner()350	function collectionOwner() external view returns (EthCrossAccount memory);351352	// /// Changes collection owner to another account353	// ///354	// /// @dev Owner can be changed only by current owner355	// /// @param newOwner new owner account356	// /// @dev EVM selector for this function is: 0x4f53e226,357	// ///  or in textual repr: changeCollectionOwner(address)358	// function changeCollectionOwner(address newOwner) external;359360	/// Get collection administrators361	///362	/// @return Vector of tuples with admins address and his substrate mirror.363	/// If address is canonical then substrate mirror is zero and vice versa.364	/// @dev EVM selector for this function is: 0x5813216b,365	///  or in textual repr: collectionAdmins()366	function collectionAdmins() external view returns (EthCrossAccount[] memory);367368	/// Changes collection owner to another account369	///370	/// @dev Owner can be changed only by current owner371	/// @param newOwner new owner cross account372	/// @dev EVM selector for this function is: 0x6496c497,373	///  or in textual repr: changeCollectionOwnerCross((address,uint256))374	function changeCollectionOwnerCross(EthCrossAccount memory newOwner) external;375}376377/// @dev Cross account struct378struct EthCrossAccount {379	address eth;380	uint256 sub;381}382383/// @dev anonymous struct384struct Tuple33 {385	CollectionPermissions field_0;386	bool field_1;387}388389enum CollectionPermissions {390	CollectionAdmin,391	TokenOwner392}393394/// @dev anonymous struct395struct Tuple30 {396	bool field_0;397	uint256[] field_1;398}399400/// @dev anonymous struct401struct Tuple26 {402	address field_0;403	uint256 field_1;404}405406/// @dev the ERC-165 identifier for this interface is 0x5b5e139f407interface ERC721Metadata is Dummy, ERC165 {408	// /// @notice A descriptive name for a collection of NFTs in this contract409	// /// @dev real implementation of this function lies in `ERC721UniqueExtensions`410	// /// @dev EVM selector for this function is: 0x06fdde03,411	// ///  or in textual repr: name()412	// function name() external view returns (string memory);413414	// /// @notice An abbreviated name for NFTs in this contract415	// /// @dev real implementation of this function lies in `ERC721UniqueExtensions`416	// /// @dev EVM selector for this function is: 0x95d89b41,417	// ///  or in textual repr: symbol()418	// function symbol() external view returns (string memory);419420	/// @notice A distinct Uniform Resource Identifier (URI) for a given asset.421	///422	/// @dev If the token has a `url` property and it is not empty, it is returned.423	///  Else If the collection does not have a property with key `schemaName` or its value is not equal to `ERC721Metadata`, it return an error `tokenURI not set`.424	///  If the collection property `baseURI` is empty or absent, return "" (empty string)425	///  otherwise, if token property `suffix` present and is non-empty, return concatenation of baseURI and suffix426	///  otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings).427	///428	/// @return token's const_metadata429	/// @dev EVM selector for this function is: 0xc87b56dd,430	///  or in textual repr: tokenURI(uint256)431	function tokenURI(uint256 tokenId) external view returns (string memory);432}433434/// @title ERC721 Token that can be irreversibly burned (destroyed).435/// @dev the ERC-165 identifier for this interface is 0x42966c68436interface ERC721Burnable is Dummy, ERC165 {437	/// @notice Burns a specific ERC721 token.438	/// @dev Throws unless `msg.sender` is the current RFT owner, or an authorized439	///  operator of the current owner.440	/// @param tokenId The RFT to approve441	/// @dev EVM selector for this function is: 0x42966c68,442	///  or in textual repr: burn(uint256)443	function burn(uint256 tokenId) external;444}445446/// @dev inlined interface447interface ERC721UniqueMintableEvents {448	event MintingFinished();449}450451/// @title ERC721 minting logic.452/// @dev the ERC-165 identifier for this interface is 0x476ff149453interface ERC721UniqueMintable is Dummy, ERC165, ERC721UniqueMintableEvents {454	/// @dev EVM selector for this function is: 0x05d2035b,455	///  or in textual repr: mintingFinished()456	function mintingFinished() external view returns (bool);457458	/// @notice Function to mint token.459	/// @param to The new owner460	/// @return uint256 The id of the newly minted token461	/// @dev EVM selector for this function is: 0x6a627842,462	///  or in textual repr: mint(address)463	function mint(address to) external returns (uint256);464465	// /// @notice Function to mint token.466	// /// @dev `tokenId` should be obtained with `nextTokenId` method,467	// ///  unlike standard, you can't specify it manually468	// /// @param to The new owner469	// /// @param tokenId ID of the minted RFT470	// /// @dev EVM selector for this function is: 0x40c10f19,471	// ///  or in textual repr: mint(address,uint256)472	// function mint(address to, uint256 tokenId) external returns (bool);473474	/// @notice Function to mint token with the given tokenUri.475	/// @param to The new owner476	/// @param tokenUri Token URI that would be stored in the NFT properties477	/// @return uint256 The id of the newly minted token478	/// @dev EVM selector for this function is: 0x45c17782,479	///  or in textual repr: mintWithTokenURI(address,string)480	function mintWithTokenURI(address to, string memory tokenUri) external returns (uint256);481482	// /// @notice Function to mint token with the given tokenUri.483	// /// @dev `tokenId` should be obtained with `nextTokenId` method,484	// ///  unlike standard, you can't specify it manually485	// /// @param to The new owner486	// /// @param tokenId ID of the minted RFT487	// /// @param tokenUri Token URI that would be stored in the RFT properties488	// /// @dev EVM selector for this function is: 0x50bb4e7f,489	// ///  or in textual repr: mintWithTokenURI(address,uint256,string)490	// function mintWithTokenURI(address to, uint256 tokenId, string memory tokenUri) external returns (bool);491492	/// @dev Not implemented493	/// @dev EVM selector for this function is: 0x7d64bcb4,494	///  or in textual repr: finishMinting()495	function finishMinting() external returns (bool);496}497498/// @title Unique extensions for ERC721.499/// @dev the ERC-165 identifier for this interface is 0x12f7d6c1500interface ERC721UniqueExtensions is Dummy, ERC165 {501	/// @notice A descriptive name for a collection of NFTs in this contract502	/// @dev EVM selector for this function is: 0x06fdde03,503	///  or in textual repr: name()504	function name() external view returns (string memory);505506	/// @notice An abbreviated name for NFTs in this contract507	/// @dev EVM selector for this function is: 0x95d89b41,508	///  or in textual repr: symbol()509	function symbol() external view returns (string memory);510511	/// @notice A description for the collection.512	/// @dev EVM selector for this function is: 0x7284e416,513	///  or in textual repr: description()514	function description() external view returns (string memory);515516	/// Returns the owner (in cross format) of the token.517	///518	/// @param tokenId Id for the token.519	/// @dev EVM selector for this function is: 0x2b29dace,520	///  or in textual repr: crossOwnerOf(uint256)521	function crossOwnerOf(uint256 tokenId) external view returns (EthCrossAccount memory);522523	/// Returns the token properties.524	///525	/// @param tokenId Id for the token.526	/// @param keys Properties keys. Empty keys for all propertyes.527	/// @return Vector of properties key/value pairs.528	/// @dev EVM selector for this function is: 0xe07ede7e,529	///  or in textual repr: properties(uint256,string[])530	function properties(uint256 tokenId, string[] memory keys) external view returns (Property[] memory);531532	/// @notice Transfer ownership of an RFT533	/// @dev Throws unless `msg.sender` is the current owner. Throws if `to`534	///  is the zero address. Throws if `tokenId` is not a valid RFT.535	///  Throws if RFT pieces have multiple owners.536	/// @param to The new owner537	/// @param tokenId The RFT to transfer538	/// @dev EVM selector for this function is: 0xa9059cbb,539	///  or in textual repr: transfer(address,uint256)540	function transfer(address to, uint256 tokenId) external;541542	/// @notice Transfer ownership of an RFT543	/// @dev Throws unless `msg.sender` is the current owner. Throws if `to`544	///  is the zero address. Throws if `tokenId` is not a valid RFT.545	///  Throws if RFT pieces have multiple owners.546	/// @param to The new owner547	/// @param tokenId The RFT to transfer548	/// @dev EVM selector for this function is: 0x2ada85ff,549	///  or in textual repr: transferCross((address,uint256),uint256)550	function transferCross(EthCrossAccount memory to, uint256 tokenId) external;551552	/// @notice Transfer ownership of an RFT553	/// @dev Throws unless `msg.sender` is the current owner. Throws if `to`554	///  is the zero address. Throws if `tokenId` is not a valid RFT.555	///  Throws if RFT pieces have multiple owners.556	/// @param to The new owner557	/// @param tokenId The RFT to transfer558	/// @dev EVM selector for this function is: 0xd5cf430b,559	///  or in textual repr: transferFromCross((address,uint256),(address,uint256),uint256)560	function transferFromCross(561		EthCrossAccount memory from,562		EthCrossAccount memory to,563		uint256 tokenId564	) external;565566	// /// @notice Burns a specific ERC721 token.567	// /// @dev Throws unless `msg.sender` is the current owner or an authorized568	// ///  operator for this RFT. Throws if `from` is not the current owner. Throws569	// ///  if `to` is the zero address. Throws if `tokenId` is not a valid RFT.570	// ///  Throws if RFT pieces have multiple owners.571	// /// @param from The current owner of the RFT572	// /// @param tokenId The RFT to transfer573	// /// @dev EVM selector for this function is: 0x79cc6790,574	// ///  or in textual repr: burnFrom(address,uint256)575	// function burnFrom(address from, uint256 tokenId) external;576577	/// @notice Burns a specific ERC721 token.578	/// @dev Throws unless `msg.sender` is the current owner or an authorized579	///  operator for this RFT. Throws if `from` is not the current owner. Throws580	///  if `to` is the zero address. Throws if `tokenId` is not a valid RFT.581	///  Throws if RFT pieces have multiple owners.582	/// @param from The current owner of the RFT583	/// @param tokenId The RFT to transfer584	/// @dev EVM selector for this function is: 0xbb2f5a58,585	///  or in textual repr: burnFromCross((address,uint256),uint256)586	function burnFromCross(EthCrossAccount memory from, uint256 tokenId) external;587588	/// @notice Returns next free RFT ID.589	/// @dev EVM selector for this function is: 0x75794a3c,590	///  or in textual repr: nextTokenId()591	function nextTokenId() external view returns (uint256);592593	// /// @notice Function to mint multiple tokens.594	// /// @dev `tokenIds` should be an array of consecutive numbers and first number595	// ///  should be obtained with `nextTokenId` method596	// /// @param to The new owner597	// /// @param tokenIds IDs of the minted RFTs598	// /// @dev EVM selector for this function is: 0x44a9945e,599	// ///  or in textual repr: mintBulk(address,uint256[])600	// function mintBulk(address to, uint256[] memory tokenIds) external returns (bool);601602	// /// @notice Function to mint multiple tokens with the given tokenUris.603	// /// @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive604	// ///  numbers and first number should be obtained with `nextTokenId` method605	// /// @param to The new owner606	// /// @param tokens array of pairs of token ID and token URI for minted tokens607	// /// @dev EVM selector for this function is: 0x36543006,608	// ///  or in textual repr: mintBulkWithTokenURI(address,(uint256,string)[])609	// function mintBulkWithTokenURI(address to, Tuple12[] memory tokens) external returns (bool);610611	/// Returns EVM address for refungible token612	///613	/// @param token ID of the token614	/// @dev EVM selector for this function is: 0xab76fac6,615	///  or in textual repr: tokenContractAddress(uint256)616	function tokenContractAddress(uint256 token) external view returns (address);617}618619/// @dev anonymous struct620struct Tuple12 {621	uint256 field_0;622	string field_1;623}624625/// @title ERC-721 Non-Fungible Token Standard, optional enumeration extension626/// @dev See https://eips.ethereum.org/EIPS/eip-721627/// @dev the ERC-165 identifier for this interface is 0x780e9d63628interface ERC721Enumerable is Dummy, ERC165 {629	/// @notice Enumerate valid RFTs630	/// @param index A counter less than `totalSupply()`631	/// @return The token identifier for the `index`th NFT,632	///  (sort order not specified)633	/// @dev EVM selector for this function is: 0x4f6ccce7,634	///  or in textual repr: tokenByIndex(uint256)635	function tokenByIndex(uint256 index) external view returns (uint256);636637	/// Not implemented638	/// @dev EVM selector for this function is: 0x2f745c59,639	///  or in textual repr: tokenOfOwnerByIndex(address,uint256)640	function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);641642	/// @notice Count RFTs tracked by this contract643	/// @return A count of valid RFTs tracked by this contract, where each one of644	///  them has an assigned and queryable owner not equal to the zero address645	/// @dev EVM selector for this function is: 0x18160ddd,646	///  or in textual repr: totalSupply()647	function totalSupply() external view returns (uint256);648}649650/// @dev inlined interface651interface ERC721Events {652	event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);653	event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);654	event ApprovalForAll(address indexed owner, address indexed operator, bool approved);655}656657/// @title ERC-721 Non-Fungible Token Standard658/// @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md659/// @dev the ERC-165 identifier for this interface is 0x4016cd87660interface ERC721 is Dummy, ERC165, ERC721Events {661	/// @notice Count all RFTs assigned to an owner662	/// @dev RFTs assigned to the zero address are considered invalid, and this663	///  function throws for queries about the zero address.664	/// @param owner An address for whom to query the balance665	/// @return The number of RFTs owned by `owner`, possibly zero666	/// @dev EVM selector for this function is: 0x70a08231,667	///  or in textual repr: balanceOf(address)668	function balanceOf(address owner) external view returns (uint256);669670	/// @notice Find the owner of an RFT671	/// @dev RFTs assigned to zero address are considered invalid, and queries672	///  about them do throw.673	///  Returns special 0xffffffffffffffffffffffffffffffffffffffff address for674	///  the tokens that are partially owned.675	/// @param tokenId The identifier for an RFT676	/// @return The address of the owner of the RFT677	/// @dev EVM selector for this function is: 0x6352211e,678	///  or in textual repr: ownerOf(uint256)679	function ownerOf(uint256 tokenId) external view returns (address);680681	/// @dev Not implemented682	/// @dev EVM selector for this function is: 0x60a11672,683	///  or in textual repr: safeTransferFromWithData(address,address,uint256,bytes)684	function safeTransferFromWithData(685		address from,686		address to,687		uint256 tokenId,688		bytes memory data689	) external;690691	/// @dev Not implemented692	/// @dev EVM selector for this function is: 0x42842e0e,693	///  or in textual repr: safeTransferFrom(address,address,uint256)694	function safeTransferFrom(695		address from,696		address to,697		uint256 tokenId698	) external;699700	/// @notice Transfer ownership of an RFT -- THE CALLER IS RESPONSIBLE701	///  TO CONFIRM THAT `to` IS CAPABLE OF RECEIVING NFTS OR ELSE702	///  THEY MAY BE PERMANENTLY LOST703	/// @dev Throws unless `msg.sender` is the current owner or an authorized704	///  operator for this RFT. Throws if `from` is not the current owner. Throws705	///  if `to` is the zero address. Throws if `tokenId` is not a valid RFT.706	///  Throws if RFT pieces have multiple owners.707	/// @param from The current owner of the NFT708	/// @param to The new owner709	/// @param tokenId The NFT to transfer710	/// @dev EVM selector for this function is: 0x23b872dd,711	///  or in textual repr: transferFrom(address,address,uint256)712	function transferFrom(713		address from,714		address to,715		uint256 tokenId716	) external;717718	/// @dev Not implemented719	/// @dev EVM selector for this function is: 0x095ea7b3,720	///  or in textual repr: approve(address,uint256)721	function approve(address approved, uint256 tokenId) external;722723	/// @notice Sets or unsets the approval of a given operator.724	///  The `operator` is allowed to transfer all token pieces of the `caller` on their behalf.725	/// @param operator Operator726	/// @param approved Should operator status be granted or revoked?727	/// @dev EVM selector for this function is: 0xa22cb465,728	///  or in textual repr: setApprovalForAll(address,bool)729	function setApprovalForAll(address operator, bool approved) external;730731	/// @dev Not implemented732	/// @dev EVM selector for this function is: 0x081812fc,733	///  or in textual repr: getApproved(uint256)734	function getApproved(uint256 tokenId) external view returns (address);735736	/// @notice Tells whether the given `owner` approves the `operator`.737	/// @dev EVM selector for this function is: 0xe985e9c5,738	///  or in textual repr: isApprovedForAll(address,address)739	function isApprovedForAll(address owner, address operator) external view returns (bool);740741	/// @notice Returns collection helper contract address742	/// @dev EVM selector for this function is: 0x1896cce6,743	///  or in textual repr: collectionHelperAddress()744	function collectionHelperAddress() external view returns (address);745}746747interface UniqueRefungible is748	Dummy,749	ERC165,750	ERC721,751	ERC721Enumerable,752	ERC721UniqueExtensions,753	ERC721UniqueMintable,754	ERC721Burnable,755	ERC721Metadata,756	Collection,757	TokenProperties758{}
modifiedtests/src/eth/events.test.tsdiffbeforeafterboth
--- a/tests/src/eth/events.test.ts
+++ b/tests/src/eth/events.test.ts
@@ -119,7 +119,7 @@
     ethEvents.push(event);
   });
   const {unsubscribe, collectedEvents: subEvents} = await helper.subscribeEvents([{section: 'common', names: ['PropertyPermissionSet']}]);
-  await collection.methods.setTokenPropertyPermission('testKey', true, true, true).send({from: owner});
+  await collection.methods.setTokenPropertyPermissions([['testKey', [[0, true], [1, true], [2, true]]]]).send({from: owner});
   await helper.wait.newBlocks(1);
   expect(ethEvents).to.be.like([
     {
@@ -374,7 +374,7 @@
   const collectionHelper = helper.ethNativeContract.collectionHelpers(owner);
   const result = await collection.methods.mint(owner).send({from: owner});
   const tokenId = result.events.Transfer.returnValues.tokenId;
-  await collection.methods.setTokenPropertyPermission('A', true, true, true).send({from: owner});
+  await collection.methods.setTokenPropertyPermissions([['A', [[0, true], [1, true], [2, true]]]]).send({from: owner});
 
 
   const ethEvents: any = [];
modifiedtests/src/eth/tokenProperties.test.tsdiffbeforeafterboth
--- a/tests/src/eth/tokenProperties.test.ts
+++ b/tests/src/eth/tokenProperties.test.ts
@@ -17,7 +17,7 @@
 import {IKeyringPair} from '@polkadot/types/types';
 import {Contract} from 'web3-eth-contract';
 import {itEth, usingEthPlaygrounds, expect} from './util';
-import {ITokenPropertyPermission} from '../util/playgrounds/types';
+import {ITokenPropertyPermission, TCollectionMode} from '../util/playgrounds/types';
 import {Pallets} from '../util';
 import {UniqueNFTCollection, UniqueNFToken, UniqueRFTCollection} from '../util/playgrounds/unique';
 
@@ -32,28 +32,32 @@
     });
   });
 
-  itEth('Can be reconfigured', async({helper}) => {
+  [
+    {mode: 'nft'},
+    {mode: 'rft'}
+  ].map(testCase =>
+  itEth(`[${testCase.mode}] Set and get token property permissions`, async({helper}) => {
     const owner = await helper.eth.createAccountWithBalance(donor);
-    const caller = await helper.eth.createAccountWithBalance(donor);
+    const caller = await helper.ethCrossAccount.createAccountWithBalance(donor);
+    const mode: any = testCase.mode;
     for(const [mutable,collectionAdmin, tokenOwner] of cartesian([], [false, true], [false, true], [false, true])) {
-      const collection = await helper.nft.mintCollection(alice);
-      await collection.addAdmin(alice, {Ethereum: caller});
+      const {collectionId, collectionAddress} = await helper.eth.createCollection(mode, owner, 'A', 'B', 'C');
+      const collection = await helper.ethNativeContract.collection(collectionAddress, mode, owner);
+      await collection.methods.addCollectionAdminCross(caller).send({from: owner});
+
+      await collection.methods.setTokenPropertyPermissions([['testKey', [[0, mutable], [1, tokenOwner], [2, collectionAdmin]]]]).send({from: caller.eth});
       
-      const address = helper.ethAddress.fromCollectionId(collection.collectionId);
-      const contract = helper.ethNativeContract.collection(address, 'nft', caller);
-  
-      await contract.methods.setTokenPropertyPermissions([['testKey', [[0, mutable], [1, tokenOwner], [2, collectionAdmin]]]]).send({from: caller});
-  
-      expect(await collection.getPropertyPermissions()).to.be.deep.equal([{
+      expect(await helper.nft.getPropertyPermissions(collectionId)).to.be.deep.equal([{
         key: 'testKey',
         permission: {mutable, collectionAdmin, tokenOwner},
       }]);
 
-      expect(await contract.methods.tokenPropertyPermissions().call({from: caller})).to.be.like([
+      expect(await collection.methods.tokenPropertyPermissions().call({from: caller.eth})).to.be.like([
         ['testKey', [['0', mutable], ['1', tokenOwner], ['2', collectionAdmin]]]
       ]);
     }
-  });
+  })
+  );
 
   [
     {