git.delta.rocks / unique-network / refs/commits / 5223dbed88c4

difftreelog

added `collectionNestingRestrictedCollectionIds()` function in `Collection` interface.

PraetorP2022-12-02parent: #46e50c0.patch.diff
in: master

14 files changed

modifiedpallets/common/src/erc.rsdiffbeforeafterboth
--- a/pallets/common/src/erc.rs
+++ b/pallets/common/src/erc.rs
@@ -493,6 +493,21 @@
 		<Pallet<T>>::update_permissions(&caller, self, permissions).map_err(dispatch_to_evm::<T>)
 	}
 
+	/// Returns nesting for a collection
+	#[solidity(rename_selector = "collectionNestingRestrictedCollectionIds")]
+	fn collection_nesting_restricted_ids(&self) -> Result<(bool, Vec<uint256>)> {
+		let nesting = self.collection.permissions.nesting();
+
+		Ok((
+			nesting.token_owner,
+			nesting
+				.restricted
+				.clone()
+				.map(|b| b.0.into_inner().iter().map(|id| id.0.into()).collect())
+				.unwrap_or_default(),
+		))
+	}
+
 	/// Set the collection access method.
 	/// @param mode Access mode
 	/// 	0 for Normal
modifiedpallets/evm-contract-helpers/src/stubs/ContractHelpers.rawdiffbeforeafterboth

binary blob — no preview

modifiedpallets/fungible/src/stubs/UniqueFungible.rawdiffbeforeafterboth

binary blob — no preview

modifiedpallets/fungible/src/stubs/UniqueFungible.soldiffbeforeafterboth
after · pallets/fungible/src/stubs/UniqueFungible.sol
1// SPDX-License-Identifier: OTHER2// This code is automatically generated34pragma solidity >=0.8.0 <0.9.0;56/// @dev common stubs holder7contract Dummy {8	uint8 dummy;9	string stub_error = "this contract is implemented in native";10}1112contract ERC165 is Dummy {13	function supportsInterface(bytes4 interfaceID) external view returns (bool) {14		require(false, stub_error);15		interfaceID;16		return true;17	}18}1920/// @title A contract that allows you to work with collections.21/// @dev the ERC-165 identifier for this interface is 0xeecfdb3422contract Collection is Dummy, ERC165 {23	// /// Set collection property.24	// ///25	// /// @param key Property key.26	// /// @param value Propery value.27	// /// @dev EVM selector for this function is: 0x2f073f66,28	// ///  or in textual repr: setCollectionProperty(string,bytes)29	// function setCollectionProperty(string memory key, bytes memory value) public {30	// 	require(false, stub_error);31	// 	key;32	// 	value;33	// 	dummy = 0;34	// }3536	/// Set collection properties.37	///38	/// @param properties Vector of properties key/value pair.39	/// @dev EVM selector for this function is: 0x50b26b2a,40	///  or in textual repr: setCollectionProperties((string,bytes)[])41	function setCollectionProperties(Property[] memory properties) public {42		require(false, stub_error);43		properties;44		dummy = 0;45	}4647	// /// Delete collection property.48	// ///49	// /// @param key Property key.50	// /// @dev EVM selector for this function is: 0x7b7debce,51	// ///  or in textual repr: deleteCollectionProperty(string)52	// function deleteCollectionProperty(string memory key) public {53	// 	require(false, stub_error);54	// 	key;55	// 	dummy = 0;56	// }5758	/// Delete collection properties.59	///60	/// @param keys Properties keys.61	/// @dev EVM selector for this function is: 0xee206ee3,62	///  or in textual repr: deleteCollectionProperties(string[])63	function deleteCollectionProperties(string[] memory keys) public {64		require(false, stub_error);65		keys;66		dummy = 0;67	}6869	/// Get collection property.70	///71	/// @dev Throws error if key not found.72	///73	/// @param key Property key.74	/// @return bytes The property corresponding to the key.75	/// @dev EVM selector for this function is: 0xcf24fd6d,76	///  or in textual repr: collectionProperty(string)77	function collectionProperty(string memory key) public view returns (bytes memory) {78		require(false, stub_error);79		key;80		dummy;81		return hex"";82	}8384	/// Get collection properties.85	///86	/// @param keys Properties keys. Empty keys for all propertyes.87	/// @return Vector of properties key/value pairs.88	/// @dev EVM selector for this function is: 0x285fb8e6,89	///  or in textual repr: collectionProperties(string[])90	function collectionProperties(string[] memory keys) public view returns (Property[] memory) {91		require(false, stub_error);92		keys;93		dummy;94		return new Property[](0);95	}9697	// /// Set the sponsor of the collection.98	// ///99	// /// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor.100	// ///101	// /// @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract.102	// /// @dev EVM selector for this function is: 0x7623402e,103	// ///  or in textual repr: setCollectionSponsor(address)104	// function setCollectionSponsor(address sponsor) public {105	// 	require(false, stub_error);106	// 	sponsor;107	// 	dummy = 0;108	// }109110	/// Set the sponsor of the collection.111	///112	/// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor.113	///114	/// @param sponsor Cross account address of the sponsor from whose account funds will be debited for operations with the contract.115	/// @dev EVM selector for this function is: 0x84a1d5a8,116	///  or in textual repr: setCollectionSponsorCross((address,uint256))117	function setCollectionSponsorCross(EthCrossAccount memory sponsor) public {118		require(false, stub_error);119		sponsor;120		dummy = 0;121	}122123	/// Whether there is a pending sponsor.124	/// @dev EVM selector for this function is: 0x058ac185,125	///  or in textual repr: hasCollectionPendingSponsor()126	function hasCollectionPendingSponsor() public view returns (bool) {127		require(false, stub_error);128		dummy;129		return false;130	}131132	/// Collection sponsorship confirmation.133	///134	/// @dev After setting the sponsor for the collection, it must be confirmed with this function.135	/// @dev EVM selector for this function is: 0x3c50e97a,136	///  or in textual repr: confirmCollectionSponsorship()137	function confirmCollectionSponsorship() public {138		require(false, stub_error);139		dummy = 0;140	}141142	/// Remove collection sponsor.143	/// @dev EVM selector for this function is: 0x6e0326a3,144	///  or in textual repr: removeCollectionSponsor()145	function removeCollectionSponsor() public {146		require(false, stub_error);147		dummy = 0;148	}149150	/// Get current sponsor.151	///152	/// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.153	/// @dev EVM selector for this function is: 0x6ec0a9f1,154	///  or in textual repr: collectionSponsor()155	function collectionSponsor() public view returns (Tuple8 memory) {156		require(false, stub_error);157		dummy;158		return Tuple8(0x0000000000000000000000000000000000000000, 0);159	}160161	/// Set limits for the collection.162	/// @dev Throws error if limit not found.163	/// @param limit Name of the limit. Valid names:164	/// 	"accountTokenOwnershipLimit",165	/// 	"sponsoredDataSize",166	/// 	"sponsoredDataRateLimit",167	/// 	"tokenLimit",168	/// 	"sponsorTransferTimeout",169	/// 	"sponsorApproveTimeout"170	///  	"ownerCanTransfer",171	/// 	"ownerCanDestroy",172	/// 	"transfersEnabled"173	/// @param value Value of the limit.174	/// @dev EVM selector for this function is: 0x4ad890a8,175	///  or in textual repr: setCollectionLimit(string,uint256)176	function setCollectionLimit(string memory limit, uint256 value) public {177		require(false, stub_error);178		limit;179		value;180		dummy = 0;181	}182183	/// Get contract address.184	/// @dev EVM selector for this function is: 0xf6b4dfb4,185	///  or in textual repr: contractAddress()186	function contractAddress() public view returns (address) {187		require(false, stub_error);188		dummy;189		return 0x0000000000000000000000000000000000000000;190	}191192	/// Add collection admin.193	/// @param newAdmin Cross account administrator address.194	/// @dev EVM selector for this function is: 0x859aa7d6,195	///  or in textual repr: addCollectionAdminCross((address,uint256))196	function addCollectionAdminCross(EthCrossAccount memory newAdmin) public {197		require(false, stub_error);198		newAdmin;199		dummy = 0;200	}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) public {207		require(false, stub_error);208		admin;209		dummy = 0;210	}211212	// /// Add collection admin.213	// /// @param newAdmin Address of the added administrator.214	// /// @dev EVM selector for this function is: 0x92e462c7,215	// ///  or in textual repr: addCollectionAdmin(address)216	// function addCollectionAdmin(address newAdmin) public {217	// 	require(false, stub_error);218	// 	newAdmin;219	// 	dummy = 0;220	// }221222	// /// Remove collection admin.223	// ///224	// /// @param admin Address of the removed administrator.225	// /// @dev EVM selector for this function is: 0xfafd7b42,226	// ///  or in textual repr: removeCollectionAdmin(address)227	// function removeCollectionAdmin(address admin) public {228	// 	require(false, stub_error);229	// 	admin;230	// 	dummy = 0;231	// }232233	/// Toggle accessibility of collection nesting.234	///235	/// @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'236	/// @dev EVM selector for this function is: 0x112d4586,237	///  or in textual repr: setCollectionNesting(bool)238	function setCollectionNesting(bool enable) public {239		require(false, stub_error);240		enable;241		dummy = 0;242	}243244	/// Toggle accessibility of collection nesting.245	///246	/// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'247	/// @param collections Addresses of collections that will be available for nesting.248	/// @dev EVM selector for this function is: 0x64872396,249	///  or in textual repr: setCollectionNesting(bool,address[])250	function setCollectionNesting(bool enable, address[] memory collections) public {251		require(false, stub_error);252		enable;253		collections;254		dummy = 0;255	}256257	/// Returns nesting for a collection258	/// @dev EVM selector for this function is: 0x22d25bfe,259	///  or in textual repr: collectionNestingRestrictedCollectionIds()260	function collectionNestingRestrictedCollectionIds() public view returns (Tuple21 memory) {261		require(false, stub_error);262		dummy;263		return Tuple21(false, new uint256[](0));264	}265266	/// Set the collection access method.267	/// @param mode Access mode268	/// 	0 for Normal269	/// 	1 for AllowList270	/// @dev EVM selector for this function is: 0x41835d4c,271	///  or in textual repr: setCollectionAccess(uint8)272	function setCollectionAccess(uint8 mode) public {273		require(false, stub_error);274		mode;275		dummy = 0;276	}277278	/// Checks that user allowed to operate with collection.279	///280	/// @param user User address to check.281	/// @dev EVM selector for this function is: 0x91b6df49,282	///  or in textual repr: allowlistedCross((address,uint256))283	function allowlistedCross(EthCrossAccount memory user) public view returns (bool) {284		require(false, stub_error);285		user;286		dummy;287		return false;288	}289290	// /// Add the user to the allowed list.291	// ///292	// /// @param user Address of a trusted user.293	// /// @dev EVM selector for this function is: 0x67844fe6,294	// ///  or in textual repr: addToCollectionAllowList(address)295	// function addToCollectionAllowList(address user) public {296	// 	require(false, stub_error);297	// 	user;298	// 	dummy = 0;299	// }300301	/// Add user to allowed list.302	///303	/// @param user User cross account address.304	/// @dev EVM selector for this function is: 0xa0184a3a,305	///  or in textual repr: addToCollectionAllowListCross((address,uint256))306	function addToCollectionAllowListCross(EthCrossAccount memory user) public {307		require(false, stub_error);308		user;309		dummy = 0;310	}311312	// /// Remove the user from the allowed list.313	// ///314	// /// @param user Address of a removed user.315	// /// @dev EVM selector for this function is: 0x85c51acb,316	// ///  or in textual repr: removeFromCollectionAllowList(address)317	// function removeFromCollectionAllowList(address user) public {318	// 	require(false, stub_error);319	// 	user;320	// 	dummy = 0;321	// }322323	/// Remove user from allowed list.324	///325	/// @param user User cross account address.326	/// @dev EVM selector for this function is: 0x09ba452a,327	///  or in textual repr: removeFromCollectionAllowListCross((address,uint256))328	function removeFromCollectionAllowListCross(EthCrossAccount memory user) public {329		require(false, stub_error);330		user;331		dummy = 0;332	}333334	/// Switch permission for minting.335	///336	/// @param mode Enable if "true".337	/// @dev EVM selector for this function is: 0x00018e84,338	///  or in textual repr: setCollectionMintMode(bool)339	function setCollectionMintMode(bool mode) public {340		require(false, stub_error);341		mode;342		dummy = 0;343	}344345	// /// Check that account is the owner or admin of the collection346	// ///347	// /// @param user account to verify348	// /// @return "true" if account is the owner or admin349	// /// @dev EVM selector for this function is: 0x9811b0c7,350	// ///  or in textual repr: isOwnerOrAdmin(address)351	// function isOwnerOrAdmin(address user) public view returns (bool) {352	// 	require(false, stub_error);353	// 	user;354	// 	dummy;355	// 	return false;356	// }357358	/// Check that account is the owner or admin of the collection359	///360	/// @param user User cross account to verify361	/// @return "true" if account is the owner or admin362	/// @dev EVM selector for this function is: 0x3e75a905,363	///  or in textual repr: isOwnerOrAdminCross((address,uint256))364	function isOwnerOrAdminCross(EthCrossAccount memory user) public view returns (bool) {365		require(false, stub_error);366		user;367		dummy;368		return false;369	}370371	/// Returns collection type372	///373	/// @return `Fungible` or `NFT` or `ReFungible`374	/// @dev EVM selector for this function is: 0xd34b55b8,375	///  or in textual repr: uniqueCollectionType()376	function uniqueCollectionType() public view returns (string memory) {377		require(false, stub_error);378		dummy;379		return "";380	}381382	/// Get collection owner.383	///384	/// @return Tuble with sponsor address and his substrate mirror.385	/// If address is canonical then substrate mirror is zero and vice versa.386	/// @dev EVM selector for this function is: 0xdf727d3b,387	///  or in textual repr: collectionOwner()388	function collectionOwner() public view returns (EthCrossAccount memory) {389		require(false, stub_error);390		dummy;391		return EthCrossAccount(0x0000000000000000000000000000000000000000, 0);392	}393394	// /// Changes collection owner to another account395	// ///396	// /// @dev Owner can be changed only by current owner397	// /// @param newOwner new owner account398	// /// @dev EVM selector for this function is: 0x4f53e226,399	// ///  or in textual repr: changeCollectionOwner(address)400	// function changeCollectionOwner(address newOwner) public {401	// 	require(false, stub_error);402	// 	newOwner;403	// 	dummy = 0;404	// }405406	/// Get collection administrators407	///408	/// @return Vector of tuples with admins address and his substrate mirror.409	/// If address is canonical then substrate mirror is zero and vice versa.410	/// @dev EVM selector for this function is: 0x5813216b,411	///  or in textual repr: collectionAdmins()412	function collectionAdmins() public view returns (EthCrossAccount[] memory) {413		require(false, stub_error);414		dummy;415		return new EthCrossAccount[](0);416	}417418	/// Changes collection owner to another account419	///420	/// @dev Owner can be changed only by current owner421	/// @param newOwner new owner cross account422	/// @dev EVM selector for this function is: 0x6496c497,423	///  or in textual repr: changeCollectionOwnerCross((address,uint256))424	function changeCollectionOwnerCross(EthCrossAccount memory newOwner) public {425		require(false, stub_error);426		newOwner;427		dummy = 0;428	}429}430431/// @dev Cross account struct432struct EthCrossAccount {433	address eth;434	uint256 sub;435}436437/// @dev anonymous struct438struct Tuple21 {439	bool field_0;440	uint256[] field_1;441}442443/// @dev Property struct444struct Property {445	string key;446	bytes value;447}448449/// @dev the ERC-165 identifier for this interface is 0x5b7038cf450contract ERC20UniqueExtensions is Dummy, ERC165 {451	/// @notice A description for the collection.452	/// @dev EVM selector for this function is: 0x7284e416,453	///  or in textual repr: description()454	function description() public view returns (string memory) {455		require(false, stub_error);456		dummy;457		return "";458	}459460	/// @dev EVM selector for this function is: 0x0ecd0ab0,461	///  or in textual repr: approveCross((address,uint256),uint256)462	function approveCross(EthCrossAccount memory spender, uint256 amount) public returns (bool) {463		require(false, stub_error);464		spender;465		amount;466		dummy = 0;467		return false;468	}469470	// /// Burn tokens from account471	// /// @dev Function that burns an `amount` of the tokens of a given account,472	// /// deducting from the sender's allowance for said account.473	// /// @param from The account whose tokens will be burnt.474	// /// @param amount The amount that will be burnt.475	// /// @dev EVM selector for this function is: 0x79cc6790,476	// ///  or in textual repr: burnFrom(address,uint256)477	// function burnFrom(address from, uint256 amount) public returns (bool) {478	// 	require(false, stub_error);479	// 	from;480	// 	amount;481	// 	dummy = 0;482	// 	return false;483	// }484485	/// Burn tokens from account486	/// @dev Function that burns an `amount` of the tokens of a given account,487	/// deducting from the sender's allowance for said account.488	/// @param from The account whose tokens will be burnt.489	/// @param amount The amount that will be burnt.490	/// @dev EVM selector for this function is: 0xbb2f5a58,491	///  or in textual repr: burnFromCross((address,uint256),uint256)492	function burnFromCross(EthCrossAccount memory from, uint256 amount) public returns (bool) {493		require(false, stub_error);494		from;495		amount;496		dummy = 0;497		return false;498	}499500	/// Mint tokens for multiple accounts.501	/// @param amounts array of pairs of account address and amount502	/// @dev EVM selector for this function is: 0x1acf2d55,503	///  or in textual repr: mintBulk((address,uint256)[])504	function mintBulk(Tuple8[] memory amounts) public returns (bool) {505		require(false, stub_error);506		amounts;507		dummy = 0;508		return false;509	}510511	/// @dev EVM selector for this function is: 0x2ada85ff,512	///  or in textual repr: transferCross((address,uint256),uint256)513	function transferCross(EthCrossAccount memory to, uint256 amount) public returns (bool) {514		require(false, stub_error);515		to;516		amount;517		dummy = 0;518		return false;519	}520521	/// @dev EVM selector for this function is: 0xd5cf430b,522	///  or in textual repr: transferFromCross((address,uint256),(address,uint256),uint256)523	function transferFromCross(524		EthCrossAccount memory from,525		EthCrossAccount memory to,526		uint256 amount527	) public returns (bool) {528		require(false, stub_error);529		from;530		to;531		amount;532		dummy = 0;533		return false;534	}535}536537/// @dev anonymous struct538struct Tuple8 {539	address field_0;540	uint256 field_1;541}542543/// @dev the ERC-165 identifier for this interface is 0x40c10f19544contract ERC20Mintable is Dummy, ERC165 {545	/// Mint tokens for `to` account.546	/// @param to account that will receive minted tokens547	/// @param amount amount of tokens to mint548	/// @dev EVM selector for this function is: 0x40c10f19,549	///  or in textual repr: mint(address,uint256)550	function mint(address to, uint256 amount) public returns (bool) {551		require(false, stub_error);552		to;553		amount;554		dummy = 0;555		return false;556	}557}558559/// @dev inlined interface560contract ERC20Events {561	event Transfer(address indexed from, address indexed to, uint256 value);562	event Approval(address indexed owner, address indexed spender, uint256 value);563}564565/// @dev the ERC-165 identifier for this interface is 0x8cb847c4566contract ERC20 is Dummy, ERC165, ERC20Events {567	/// @dev EVM selector for this function is: 0x06fdde03,568	///  or in textual repr: name()569	function name() public view returns (string memory) {570		require(false, stub_error);571		dummy;572		return "";573	}574575	/// @dev EVM selector for this function is: 0x95d89b41,576	///  or in textual repr: symbol()577	function symbol() public view returns (string memory) {578		require(false, stub_error);579		dummy;580		return "";581	}582583	/// @dev EVM selector for this function is: 0x18160ddd,584	///  or in textual repr: totalSupply()585	function totalSupply() public view returns (uint256) {586		require(false, stub_error);587		dummy;588		return 0;589	}590591	/// @dev EVM selector for this function is: 0x313ce567,592	///  or in textual repr: decimals()593	function decimals() public view returns (uint8) {594		require(false, stub_error);595		dummy;596		return 0;597	}598599	/// @dev EVM selector for this function is: 0x70a08231,600	///  or in textual repr: balanceOf(address)601	function balanceOf(address owner) public view returns (uint256) {602		require(false, stub_error);603		owner;604		dummy;605		return 0;606	}607608	/// @dev EVM selector for this function is: 0xa9059cbb,609	///  or in textual repr: transfer(address,uint256)610	function transfer(address to, uint256 amount) public returns (bool) {611		require(false, stub_error);612		to;613		amount;614		dummy = 0;615		return false;616	}617618	/// @dev EVM selector for this function is: 0x23b872dd,619	///  or in textual repr: transferFrom(address,address,uint256)620	function transferFrom(621		address from,622		address to,623		uint256 amount624	) public returns (bool) {625		require(false, stub_error);626		from;627		to;628		amount;629		dummy = 0;630		return false;631	}632633	/// @dev EVM selector for this function is: 0x095ea7b3,634	///  or in textual repr: approve(address,uint256)635	function approve(address spender, uint256 amount) public returns (bool) {636		require(false, stub_error);637		spender;638		amount;639		dummy = 0;640		return false;641	}642643	/// @dev EVM selector for this function is: 0xdd62ed3e,644	///  or in textual repr: allowance(address,address)645	function allowance(address owner, address spender) public view returns (uint256) {646		require(false, stub_error);647		owner;648		spender;649		dummy;650		return 0;651	}652653	/// @notice Returns collection helper contract address654	/// @dev EVM selector for this function is: 0x1896cce6,655	///  or in textual repr: collectionHelperAddress()656	function collectionHelperAddress() public view returns (address) {657		require(false, stub_error);658		dummy;659		return 0x0000000000000000000000000000000000000000;660	}661}662663contract UniqueFungible is Dummy, ERC165, ERC20, ERC20Mintable, ERC20UniqueExtensions, Collection {}
modifiedpallets/nonfungible/src/stubs/UniqueNFT.soldiffbeforeafterboth
--- a/pallets/nonfungible/src/stubs/UniqueNFT.sol
+++ b/pallets/nonfungible/src/stubs/UniqueNFT.sol
@@ -119,7 +119,7 @@
 }
 
 /// @title A contract that allows you to work with collections.
-/// @dev the ERC-165 identifier for this interface is 0xcc1d80ca
+/// @dev the ERC-165 identifier for this interface is 0xeecfdb34
 contract Collection is Dummy, ERC165 {
 	// /// Set collection property.
 	// ///
@@ -355,6 +355,15 @@
 		dummy = 0;
 	}
 
+	/// Returns nesting for a collection
+	/// @dev EVM selector for this function is: 0x22d25bfe,
+	///  or in textual repr: collectionNestingRestrictedCollectionIds()
+	function collectionNestingRestrictedCollectionIds() public view returns (Tuple34 memory) {
+		require(false, stub_error);
+		dummy;
+		return Tuple34(false, new uint256[](0));
+	}
+
 	/// Set the collection access method.
 	/// @param mode Access mode
 	/// 	0 for Normal
@@ -527,6 +536,12 @@
 }
 
 /// @dev anonymous struct
+struct Tuple34 {
+	bool field_0;
+	uint256[] field_1;
+}
+
+/// @dev anonymous struct
 struct Tuple30 {
 	address field_0;
 	uint256 field_1;
modifiedpallets/refungible/src/stubs/UniqueRefungible.soldiffbeforeafterboth
--- a/pallets/refungible/src/stubs/UniqueRefungible.sol
+++ b/pallets/refungible/src/stubs/UniqueRefungible.sol
@@ -119,7 +119,7 @@
 }
 
 /// @title A contract that allows you to work with collections.
-/// @dev the ERC-165 identifier for this interface is 0xcc1d80ca
+/// @dev the ERC-165 identifier for this interface is 0xeecfdb34
 contract Collection is Dummy, ERC165 {
 	// /// Set collection property.
 	// ///
@@ -355,6 +355,15 @@
 		dummy = 0;
 	}
 
+	/// Returns nesting for a collection
+	/// @dev EVM selector for this function is: 0x22d25bfe,
+	///  or in textual repr: collectionNestingRestrictedCollectionIds()
+	function collectionNestingRestrictedCollectionIds() public view returns (Tuple33 memory) {
+		require(false, stub_error);
+		dummy;
+		return Tuple33(false, new uint256[](0));
+	}
+
 	/// Set the collection access method.
 	/// @param mode Access mode
 	/// 	0 for Normal
@@ -527,6 +536,12 @@
 }
 
 /// @dev anonymous struct
+struct Tuple33 {
+	bool field_0;
+	uint256[] field_1;
+}
+
+/// @dev anonymous struct
 struct Tuple29 {
 	address field_0;
 	uint256 field_1;
modifiedpallets/refungible/src/stubs/UniqueRefungibleToken.rawdiffbeforeafterboth

binary blob — no preview

modifiedtests/src/eth/abi/fungible.jsondiffbeforeafterboth
--- a/tests/src/eth/abi/fungible.json
+++ b/tests/src/eth/abi/fungible.json
@@ -208,6 +208,27 @@
   },
   {
     "inputs": [],
+    "name": "collectionNestingRestrictedCollectionIds",
+    "outputs": [
+      {
+        "components": [
+          { "internalType": "bool", "name": "field_0", "type": "bool" },
+          {
+            "internalType": "uint256[]",
+            "name": "field_1",
+            "type": "uint256[]"
+          }
+        ],
+        "internalType": "struct Tuple21",
+        "name": "",
+        "type": "tuple"
+      }
+    ],
+    "stateMutability": "view",
+    "type": "function"
+  },
+  {
+    "inputs": [],
     "name": "collectionOwner",
     "outputs": [
       {
modifiedtests/src/eth/abi/nonFungible.jsondiffbeforeafterboth
--- a/tests/src/eth/abi/nonFungible.json
+++ b/tests/src/eth/abi/nonFungible.json
@@ -238,6 +238,27 @@
   },
   {
     "inputs": [],
+    "name": "collectionNestingRestrictedCollectionIds",
+    "outputs": [
+      {
+        "components": [
+          { "internalType": "bool", "name": "field_0", "type": "bool" },
+          {
+            "internalType": "uint256[]",
+            "name": "field_1",
+            "type": "uint256[]"
+          }
+        ],
+        "internalType": "struct Tuple34",
+        "name": "",
+        "type": "tuple"
+      }
+    ],
+    "stateMutability": "view",
+    "type": "function"
+  },
+  {
+    "inputs": [],
     "name": "collectionOwner",
     "outputs": [
       {
modifiedtests/src/eth/abi/reFungible.jsondiffbeforeafterboth
--- a/tests/src/eth/abi/reFungible.json
+++ b/tests/src/eth/abi/reFungible.json
@@ -220,6 +220,27 @@
   },
   {
     "inputs": [],
+    "name": "collectionNestingRestrictedCollectionIds",
+    "outputs": [
+      {
+        "components": [
+          { "internalType": "bool", "name": "field_0", "type": "bool" },
+          {
+            "internalType": "uint256[]",
+            "name": "field_1",
+            "type": "uint256[]"
+          }
+        ],
+        "internalType": "struct Tuple33",
+        "name": "",
+        "type": "tuple"
+      }
+    ],
+    "stateMutability": "view",
+    "type": "function"
+  },
+  {
+    "inputs": [],
     "name": "collectionOwner",
     "outputs": [
       {
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 0xcc1d80ca
+/// @dev the ERC-165 identifier for this interface is 0xeecfdb34
 interface Collection is Dummy, ERC165 {
 	// /// Set collection property.
 	// ///
@@ -166,6 +166,11 @@
 	///  or in textual repr: setCollectionNesting(bool,address[])
 	function setCollectionNesting(bool enable, address[] memory collections) external;
 
+	/// Returns nesting for a collection
+	/// @dev EVM selector for this function is: 0x22d25bfe,
+	///  or in textual repr: collectionNestingRestrictedCollectionIds()
+	function collectionNestingRestrictedCollectionIds() external view returns (Tuple20 memory);
+
 	/// Set the collection access method.
 	/// @param mode Access mode
 	/// 	0 for Normal
@@ -278,6 +283,12 @@
 	uint256 sub;
 }
 
+/// @dev anonymous struct
+struct Tuple20 {
+	bool field_0;
+	uint256[] field_1;
+}
+
 /// @dev Property struct
 struct Property {
 	string key;
modifiedtests/src/eth/api/UniqueNFT.soldiffbeforeafterboth
--- a/tests/src/eth/api/UniqueNFT.sol
+++ b/tests/src/eth/api/UniqueNFT.sol
@@ -80,7 +80,7 @@
 }
 
 /// @title A contract that allows you to work with collections.
-/// @dev the ERC-165 identifier for this interface is 0xcc1d80ca
+/// @dev the ERC-165 identifier for this interface is 0xeecfdb34
 interface Collection is Dummy, ERC165 {
 	// /// Set collection property.
 	// ///
@@ -233,6 +233,11 @@
 	///  or in textual repr: setCollectionNesting(bool,address[])
 	function setCollectionNesting(bool enable, address[] memory collections) external;
 
+	/// Returns nesting for a collection
+	/// @dev EVM selector for this function is: 0x22d25bfe,
+	///  or in textual repr: collectionNestingRestrictedCollectionIds()
+	function collectionNestingRestrictedCollectionIds() external view returns (Tuple31 memory);
+
 	/// Set the collection access method.
 	/// @param mode Access mode
 	/// 	0 for Normal
@@ -346,6 +351,12 @@
 }
 
 /// @dev anonymous struct
+struct Tuple31 {
+	bool field_0;
+	uint256[] field_1;
+}
+
+/// @dev anonymous struct
 struct Tuple27 {
 	address field_0;
 	uint256 field_1;
modifiedtests/src/eth/api/UniqueRefungible.soldiffbeforeafterboth
--- a/tests/src/eth/api/UniqueRefungible.sol
+++ b/tests/src/eth/api/UniqueRefungible.sol
@@ -80,7 +80,7 @@
 }
 
 /// @title A contract that allows you to work with collections.
-/// @dev the ERC-165 identifier for this interface is 0xcc1d80ca
+/// @dev the ERC-165 identifier for this interface is 0xeecfdb34
 interface Collection is Dummy, ERC165 {
 	// /// Set collection property.
 	// ///
@@ -233,6 +233,11 @@
 	///  or in textual repr: setCollectionNesting(bool,address[])
 	function setCollectionNesting(bool enable, address[] memory collections) external;
 
+	/// Returns nesting for a collection
+	/// @dev EVM selector for this function is: 0x22d25bfe,
+	///  or in textual repr: collectionNestingRestrictedCollectionIds()
+	function collectionNestingRestrictedCollectionIds() external view returns (Tuple30 memory);
+
 	/// Set the collection access method.
 	/// @param mode Access mode
 	/// 	0 for Normal
@@ -346,6 +351,12 @@
 }
 
 /// @dev anonymous struct
+struct Tuple30 {
+	bool field_0;
+	uint256[] field_1;
+}
+
+/// @dev anonymous struct
 struct Tuple26 {
 	address field_0;
 	uint256 field_1;
modifiedtests/src/eth/nesting/nest.test.tsdiffbeforeafterboth
--- a/tests/src/eth/nesting/nest.test.ts
+++ b/tests/src/eth/nesting/nest.test.ts
@@ -51,7 +51,20 @@
       await contract.methods.transferFrom(targetNftTokenAddress, owner, secondTokenId).send({from: owner});
       expect(await contract.methods.ownerOf(secondTokenId).call()).to.be.equal(owner);
     });
-
+    
+    itEth('NFT: collectionNestingRestrictedCollectionIds()', async ({helper}) => {
+      const owner = await helper.eth.createAccountWithBalance(donor);
+      const {collectionId: unnestedCollsectionId, collectionAddress: unnsetedCollectionAddress} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C');
+      const unnestedContract = helper.ethNativeContract.collection(unnsetedCollectionAddress, 'nft', owner);
+      expect(await unnestedContract.methods.collectionNestingRestrictedCollectionIds().call({from: owner})).to.be.like([false, []]);
+      
+      const {contract} = await createNestingCollection(helper, owner);
+      expect(await contract.methods.collectionNestingRestrictedCollectionIds().call({from: owner})).to.be.like([true, []]);
+      await contract.methods.setCollectionNesting(true, [unnsetedCollectionAddress]).send({from: owner});
+      expect(await contract.methods.collectionNestingRestrictedCollectionIds().call({from: owner})).to.be.like([true, [unnestedCollsectionId.toString()]]);
+      
+    });
+    
     itEth('NFT: allows an Owner to nest/unnest their token (Restricted nesting)', async ({helper}) => {
       const owner = await helper.eth.createAccountWithBalance(donor);