difftreelog
CORE-386 Add methodt to evm
in: master
8 files changed
pallets/common/src/erc.rsdiffbeforeafterboth--- a/pallets/common/src/erc.rs
+++ b/pallets/common/src/erc.rs
@@ -47,8 +47,9 @@
}
#[solidity_interface(name = "Collection")]
-impl<T: Config> CollectionHandle<T>
-// where
+
+impl<T: Config> CollectionHandle<T>
+// where
// T::AccountId: From<H256>
{
fn set_collection_property(&mut self, caller: caller, key: string, value: bytes) -> Result<()> {
@@ -192,7 +193,7 @@
// Ok(())
// }
- fn add_collection_admin(&self, caller: caller, new_admin: address) -> Result<void> {
+ fn add_admin(&self, caller: caller, new_admin: address) -> Result<void> {
let caller = T::CrossAccountId::from_eth(caller);
self.check_is_owner_or_admin(&caller)
.map_err(dispatch_to_evm::<T>)?;
@@ -202,16 +203,17 @@
Ok(())
}
- fn remove_collection_admin(&self, caller: caller, admin: address) -> Result<void> {
+ fn remove_admin(&self, caller: caller, admin: address) -> Result<void> {
let caller = T::CrossAccountId::from_eth(caller);
self.check_is_owner_or_admin(&caller)
.map_err(dispatch_to_evm::<T>)?;
let admin = T::CrossAccountId::from_eth(admin);
- <Pallet<T>>::toggle_admin(&self, &caller, &admin, false).map_err(dispatch_to_evm::<T>)?;
+ <Pallet<T>>::toggle_admin(&self, &caller, &admin, false)
+ .map_err(dispatch_to_evm::<T>)?;
Ok(())
}
- #[solidity(rename_selector = "setCollectionNesting")]
+ #[solidity(rename_selector = "setNesting")]
fn set_nesting_bool(&mut self, caller: caller, enable: bool) -> Result<void> {
let caller = T::CrossAccountId::from_eth(caller);
self.check_is_owner_or_admin(&caller)
@@ -224,22 +226,13 @@
Ok(())
}
- #[solidity(rename_selector = "setCollectionNesting")]
- fn set_nesting(
- &mut self,
- caller: caller,
- enable: bool,
- collections: Vec<address>,
- ) -> Result<void> {
+ #[solidity(rename_selector = "setNesting")]
+ fn set_nesting(&mut self, caller: caller, enable: bool, collections: Vec<address>) -> Result<void> {
if collections.is_empty() {
return Err("No addresses provided".into());
}
if collections.len() >= OwnerRestrictedSet::bound() {
- return Err(Error::Revert(format!(
- "Out of bound: {} >= {}",
- collections.len(),
- OwnerRestrictedSet::bound()
- )));
+ return Err(Error::Revert(format!("Out of bound: {} >= {}", collections.len(), OwnerRestrictedSet::bound())));
}
let caller = T::CrossAccountId::from_eth(caller);
self.check_is_owner_or_admin(&caller)
@@ -249,48 +242,14 @@
true => {
let mut bv = OwnerRestrictedSet::new();
for i in collections {
- bv.try_insert(crate::eth::map_eth_to_id(&i).ok_or(Error::Revert(
- "Can't convert address into collection id".into(),
- ))?)
- .map_err(|e| Error::Revert(format!("{:?}", e)))?;
+ bv.try_insert(
+ crate::eth::map_eth_to_id(&i)
+ .ok_or(Error::Revert("Can't convert address into collection id".into()))?
+ ).map_err(|e| Error::Revert(format!("{:?}", e)))?;
}
- NestingRule::OwnerRestricted(bv)
+ NestingRule::OwnerRestricted (bv)
}
- });
- save(self);
- Ok(())
- }
-
- fn set_collection_access(&mut self, caller: caller, mode: uint8) -> Result<void> {
- let caller = T::CrossAccountId::from_eth(caller);
- self.check_is_owner_or_admin(&caller)
- .map_err(dispatch_to_evm::<T>)?;
- self.collection.permissions.access = Some(match mode {
- 0 => AccessMode::Normal,
- 1 => AccessMode::AllowList,
- _ => return Err("Not supported access mode".into()),
});
- save(self);
- Ok(())
- }
-
- fn add_to_collection_allow_list(&self, caller: caller, user: address) -> Result<void> {
- let caller = check_is_owner_or_admin(caller, self)?;
- let user = T::CrossAccountId::from_eth(user);
- <Pallet<T>>::toggle_allowlist(self, &caller, &user, true).map_err(dispatch_to_evm::<T>)?;
- Ok(())
- }
-
- fn remove_from_collection_allow_list(&self, caller: caller, user: address) -> Result<void> {
- let caller = check_is_owner_or_admin(caller, self)?;
- let user = T::CrossAccountId::from_eth(user);
- <Pallet<T>>::toggle_allowlist(self, &caller, &user, false).map_err(dispatch_to_evm::<T>)?;
- Ok(())
- }
-
- fn set_collection_mint_mode(&mut self, caller: caller, mode: bool) -> Result<void> {
- check_is_owner_or_admin(caller, self)?;
- self.collection.permissions.mint_mode = Some(mode);
save(self);
Ok(())
}
pallets/common/src/lib.rsdiffbeforeafterboth--- a/pallets/common/src/lib.rs
+++ b/pallets/common/src/lib.rs
@@ -148,7 +148,8 @@
.saturating_mul(writes),
))
}
- pub fn save(self) -> Result<(), DispatchError> {
+
+ pub fn save(self) -> DispatchResult {
<CollectionById<T>>::insert(self.id, self.collection);
Ok(())
}
pallets/nonfungible/src/stubs/UniqueNFT.soldiffbeforeafterboth--- a/pallets/nonfungible/src/stubs/UniqueNFT.sol
+++ b/pallets/nonfungible/src/stubs/UniqueNFT.sol
@@ -51,6 +51,105 @@
event MintingFinished();
}
+// Selector: 3a54513b
+contract Collection is Dummy, ERC165 {
+ // Selector: setCollectionProperty(string,bytes) 2f073f66
+ function setCollectionProperty(string memory key, bytes memory value)
+ public
+ {
+ require(false, stub_error);
+ key;
+ value;
+ dummy = 0;
+ }
+
+ // Selector: deleteCollectionProperty(string) 7b7debce
+ function deleteCollectionProperty(string memory key) public {
+ require(false, stub_error);
+ key;
+ dummy = 0;
+ }
+
+ // Throws error if key not found
+ //
+ // Selector: collectionProperty(string) cf24fd6d
+ function collectionProperty(string memory key)
+ public
+ view
+ returns (bytes memory)
+ {
+ require(false, stub_error);
+ key;
+ dummy;
+ return hex"";
+ }
+
+ // Selector: ethSetSponsor(address) 8f9af356
+ function ethSetSponsor(address sponsor) public {
+ require(false, stub_error);
+ sponsor;
+ dummy = 0;
+ }
+
+ // Selector: ethConfirmSponsorship() a8580d1a
+ function ethConfirmSponsorship() public {
+ require(false, stub_error);
+ dummy = 0;
+ }
+
+ // Selector: setLimit(string,uint32) 68db30ca
+ function setLimit(string memory limit, uint32 value) public {
+ require(false, stub_error);
+ limit;
+ value;
+ dummy = 0;
+ }
+
+ // Selector: setLimit(string,bool) ea67e4c2
+ function setLimit(string memory limit, bool value) public {
+ require(false, stub_error);
+ limit;
+ value;
+ dummy = 0;
+ }
+
+ // Selector: contractAddress() f6b4dfb4
+ function contractAddress() public view returns (address) {
+ require(false, stub_error);
+ dummy;
+ return 0x0000000000000000000000000000000000000000;
+ }
+
+ // Selector: addAdmin(address) 70480275
+ function addAdmin(address newAdmin) public view {
+ require(false, stub_error);
+ newAdmin;
+ dummy;
+ }
+
+ // Selector: removeAdmin(address) 1785f53c
+ function removeAdmin(address admin) public view {
+ require(false, stub_error);
+ admin;
+ dummy;
+ }
+
+ // Selector: setNesting(bool) e8fc50dd
+ function setNesting(bool enable) public {
+ require(false, stub_error);
+ enable;
+ dummy = 0;
+ }
+
+ // Selector: setNesting(bool,address[]) 7df12a9a
+ function setNesting(bool enable, address[] memory collections) public {
+ require(false, stub_error);
+ enable;
+ collections;
+ dummy = 0;
+ }
+}
+
// Selector: 41369377
contract TokenProperties is Dummy, ERC165 {
// Selector: setTokenPropertyPermission(string,bool,bool,bool) 222d97fa
@@ -294,135 +393,6 @@
require(false, stub_error);
dummy = 0;
return false;
- }
-}
-
-// Selector: 6aea9834
-contract Collection is Dummy, ERC165 {
- // Selector: setCollectionProperty(string,bytes) 2f073f66
- function setCollectionProperty(string memory key, bytes memory value)
- public
- {
- require(false, stub_error);
- key;
- value;
- dummy = 0;
- }
-
- // Selector: deleteCollectionProperty(string) 7b7debce
- function deleteCollectionProperty(string memory key) public {
- require(false, stub_error);
- key;
- dummy = 0;
- }
-
- // Throws error if key not found
- //
- // Selector: collectionProperty(string) cf24fd6d
- function collectionProperty(string memory key)
- public
- view
- returns (bytes memory)
- {
- require(false, stub_error);
- key;
- dummy;
- return hex"";
- }
-
- // Selector: setCollectionSponsor(address) 7623402e
- function setCollectionSponsor(address sponsor) public {
- require(false, stub_error);
- sponsor;
- dummy = 0;
- }
-
- // Selector: confirmCollectionSponsorship() 3c50e97a
- function confirmCollectionSponsorship() public {
- require(false, stub_error);
- dummy = 0;
- }
-
- // Selector: setCollectionLimit(string,uint32) 6a3841db
- function setCollectionLimit(string memory limit, uint32 value) public {
- require(false, stub_error);
- limit;
- value;
- dummy = 0;
- }
-
- // Selector: setCollectionLimit(string,bool) 993b7fba
- function setCollectionLimit(string memory limit, bool value) public {
- require(false, stub_error);
- limit;
- value;
- dummy = 0;
- }
-
- // Selector: contractAddress() f6b4dfb4
- function contractAddress() public view returns (address) {
- require(false, stub_error);
- dummy;
- return 0x0000000000000000000000000000000000000000;
- }
-
- // Selector: addCollectionAdmin(address) 92e462c7
- function addCollectionAdmin(address newAdmin) public view {
- require(false, stub_error);
- newAdmin;
- dummy;
- }
-
- // Selector: removeCollectionAdmin(address) fafd7b42
- function removeCollectionAdmin(address admin) public view {
- require(false, stub_error);
- admin;
- dummy;
- }
-
- // Selector: setCollectionNesting(bool) 112d4586
- function setCollectionNesting(bool enable) public {
- require(false, stub_error);
- enable;
- dummy = 0;
- }
-
- // Selector: setCollectionNesting(bool,address[]) 64872396
- function setCollectionNesting(bool enable, address[] memory collections)
- public
- {
- require(false, stub_error);
- enable;
- collections;
- dummy = 0;
- }
-
- // Selector: setCollectionAccess(uint8) 41835d4c
- function setCollectionAccess(uint8 mode) public {
- require(false, stub_error);
- mode;
- dummy = 0;
- }
-
- // Selector: addToCollectionAllowList(address) 67844fe6
- function addToCollectionAllowList(address user) public view {
- require(false, stub_error);
- user;
- dummy;
- }
-
- // Selector: removeFromCollectionAllowList(address) 85c51acb
- function removeFromCollectionAllowList(address user) public view {
- require(false, stub_error);
- user;
- dummy;
- }
-
- // Selector: setCollectionMintMode(bool) 00018e84
- function setCollectionMintMode(bool mode) public {
- require(false, stub_error);
- mode;
- dummy = 0;
}
}
tests/src/eth/api/UniqueNFT.soldiffbeforeafterboth1// SPDX-License-Identifier: OTHER2// This code is automatically generated34pragma solidity >=0.8.0 <0.9.0;56// Anonymous struct7struct Tuple0 {8 uint256 field_0;9 string field_1;10}1112// Common stubs holder13interface Dummy {1415}1617interface ERC165 is Dummy {18 function supportsInterface(bytes4 interfaceID) external view returns (bool);19}2021// Inline22interface ERC721Events {23 event Transfer(24 address indexed from,25 address indexed to,26 uint256 indexed tokenId27 );28 event Approval(29 address indexed owner,30 address indexed approved,31 uint256 indexed tokenId32 );33 event ApprovalForAll(34 address indexed owner,35 address indexed operator,36 bool approved37 );38}3940// Inline41interface ERC721MintableEvents {42 event MintingFinished();43}4445// Selector: 4136937746interface TokenProperties is Dummy, ERC165 {47 // Selector: setTokenPropertyPermission(string,bool,bool,bool) 222d97fa48 function setTokenPropertyPermission(49 string memory key,50 bool isMutable,51 bool collectionAdmin,52 bool tokenOwner53 ) external;5455 // Selector: setProperty(uint256,string,bytes) 1752d67b56 function setProperty(57 uint256 tokenId,58 string memory key,59 bytes memory value60 ) external;6162 // Selector: deleteProperty(uint256,string) 066111d163 function deleteProperty(uint256 tokenId, string memory key) external;6465 // Throws error if key not found66 //67 // Selector: property(uint256,string) 7228c32768 function property(uint256 tokenId, string memory key)69 external70 view71 returns (bytes memory);72}7374// Selector: 42966c6875interface ERC721Burnable is Dummy, ERC165 {76 // Selector: burn(uint256) 42966c6877 function burn(uint256 tokenId) external;78}7980// Selector: 5880016181interface ERC721 is Dummy, ERC165, ERC721Events {82 // Selector: balanceOf(address) 70a0823183 function balanceOf(address owner) external view returns (uint256);8485 // Selector: ownerOf(uint256) 6352211e86 function ownerOf(uint256 tokenId) external view returns (address);8788 // Not implemented89 //90 // Selector: safeTransferFromWithData(address,address,uint256,bytes) 60a1167291 function safeTransferFromWithData(92 address from,93 address to,94 uint256 tokenId,95 bytes memory data96 ) external;9798 // Not implemented99 //100 // Selector: safeTransferFrom(address,address,uint256) 42842e0e101 function safeTransferFrom(102 address from,103 address to,104 uint256 tokenId105 ) external;106107 // Selector: transferFrom(address,address,uint256) 23b872dd108 function transferFrom(109 address from,110 address to,111 uint256 tokenId112 ) external;113114 // Selector: approve(address,uint256) 095ea7b3115 function approve(address approved, uint256 tokenId) external;116117 // Not implemented118 //119 // Selector: setApprovalForAll(address,bool) a22cb465120 function setApprovalForAll(address operator, bool approved) external;121122 // Not implemented123 //124 // Selector: getApproved(uint256) 081812fc125 function getApproved(uint256 tokenId) external view returns (address);126127 // Not implemented128 //129 // Selector: isApprovedForAll(address,address) e985e9c5130 function isApprovedForAll(address owner, address operator)131 external132 view133 returns (address);134}135136// Selector: 5b5e139f137interface ERC721Metadata is Dummy, ERC165 {138 // Selector: name() 06fdde03139 function name() external view returns (string memory);140141 // Selector: symbol() 95d89b41142 function symbol() external view returns (string memory);143144 // Returns token's const_metadata145 //146 // Selector: tokenURI(uint256) c87b56dd147 function tokenURI(uint256 tokenId) external view returns (string memory);148}149150// Selector: 68ccfe89151interface ERC721Mintable is Dummy, ERC165, ERC721MintableEvents {152 // Selector: mintingFinished() 05d2035b153 function mintingFinished() external view returns (bool);154155 // `token_id` should be obtained with `next_token_id` method,156 // unlike standard, you can't specify it manually157 //158 // Selector: mint(address,uint256) 40c10f19159 function mint(address to, uint256 tokenId) external returns (bool);160161 // `token_id` should be obtained with `next_token_id` method,162 // unlike standard, you can't specify it manually163 //164 // Selector: mintWithTokenURI(address,uint256,string) 50bb4e7f165 function mintWithTokenURI(166 address to,167 uint256 tokenId,168 string memory tokenUri169 ) external returns (bool);170171 // Not implemented172 //173 // Selector: finishMinting() 7d64bcb4174 function finishMinting() external returns (bool);175}176177// Selector: 6aea9834178interface Collection is Dummy, ERC165 {179 // Selector: setCollectionProperty(string,bytes) 2f073f66180 function setCollectionProperty(string memory key, bytes memory value)181 external;182183 // Selector: deleteCollectionProperty(string) 7b7debce184 function deleteCollectionProperty(string memory key) external;185186 // Throws error if key not found187 //188 // Selector: collectionProperty(string) cf24fd6d189 function collectionProperty(string memory key)190 external191 view192 returns (bytes memory);193194 // Selector: setCollectionSponsor(address) 7623402e195 function setCollectionSponsor(address sponsor) external;196197 // Selector: confirmCollectionSponsorship() 3c50e97a198 function confirmCollectionSponsorship() external;199200 // Selector: setCollectionLimit(string,uint32) 6a3841db201 function setCollectionLimit(string memory limit, uint32 value) external;202203 // Selector: setCollectionLimit(string,bool) 993b7fba204 function setCollectionLimit(string memory limit, bool value) external;205206 // Selector: contractAddress() f6b4dfb4207 function contractAddress() external view returns (address);208209 // Selector: addCollectionAdmin(address) 92e462c7210 function addCollectionAdmin(address newAdmin) external view;211212 // Selector: removeCollectionAdmin(address) fafd7b42213 function removeCollectionAdmin(address admin) external view;214215 // Selector: setCollectionNesting(bool) 112d4586216 function setCollectionNesting(bool enable) external;217218 // Selector: setCollectionNesting(bool,address[]) 64872396219 function setCollectionNesting(bool enable, address[] memory collections)220 external;221222 // Selector: setCollectionAccess(uint8) 41835d4c223 function setCollectionAccess(uint8 mode) external;224225 // Selector: addToCollectionAllowList(address) 67844fe6226 function addToCollectionAllowList(address user) external view;227228 // Selector: removeFromCollectionAllowList(address) 85c51acb229 function removeFromCollectionAllowList(address user) external view;230231 // Selector: setCollectionMintMode(bool) 00018e84232 function setCollectionMintMode(bool mode) external;233}234235// Selector: 780e9d63236interface ERC721Enumerable is Dummy, ERC165 {237 // Selector: tokenByIndex(uint256) 4f6ccce7238 function tokenByIndex(uint256 index) external view returns (uint256);239240 // Not implemented241 //242 // Selector: tokenOfOwnerByIndex(address,uint256) 2f745c59243 function tokenOfOwnerByIndex(address owner, uint256 index)244 external245 view246 returns (uint256);247248 // Selector: totalSupply() 18160ddd249 function totalSupply() external view returns (uint256);250}251252// Selector: d74d154f253interface ERC721UniqueExtensions is Dummy, ERC165 {254 // Selector: transfer(address,uint256) a9059cbb255 function transfer(address to, uint256 tokenId) external;256257 // Selector: burnFrom(address,uint256) 79cc6790258 function burnFrom(address from, uint256 tokenId) external;259260 // Selector: nextTokenId() 75794a3c261 function nextTokenId() external view returns (uint256);262263 // Selector: mintBulk(address,uint256[]) 44a9945e264 function mintBulk(address to, uint256[] memory tokenIds)265 external266 returns (bool);267268 // Selector: mintBulkWithTokenURI(address,(uint256,string)[]) 36543006269 function mintBulkWithTokenURI(address to, Tuple0[] memory tokens)270 external271 returns (bool);272}273274interface UniqueNFT is275 Dummy,276 ERC165,277 ERC721,278 ERC721Metadata,279 ERC721Enumerable,280 ERC721UniqueExtensions,281 ERC721Mintable,282 ERC721Burnable,283 Collection,284 TokenProperties285{}1// SPDX-License-Identifier: OTHER2// This code is automatically generated34pragma solidity >=0.8.0 <0.9.0;56// Anonymous struct7struct Tuple0 {8 uint256 field_0;9 string field_1;10}1112// Common stubs holder13interface Dummy {1415}1617interface ERC165 is Dummy {18 function supportsInterface(bytes4 interfaceID) external view returns (bool);19}2021// Inline22interface ERC721Events {23 event Transfer(24 address indexed from,25 address indexed to,26 uint256 indexed tokenId27 );28 event Approval(29 address indexed owner,30 address indexed approved,31 uint256 indexed tokenId32 );33 event ApprovalForAll(34 address indexed owner,35 address indexed operator,36 bool approved37 );38}3940// Inline41interface ERC721MintableEvents {42 event MintingFinished();43}4445// Selector: 3a54513b46interface Collection is Dummy, ERC165 {47 // Selector: setCollectionProperty(string,bytes) 2f073f6648 function setCollectionProperty(string memory key, bytes memory value)49 external;5051 // Selector: deleteCollectionProperty(string) 7b7debce52 function deleteCollectionProperty(string memory key) external;5354 // Throws error if key not found55 //56 // Selector: collectionProperty(string) cf24fd6d57 function collectionProperty(string memory key)58 external59 view60 returns (bytes memory);6162 // Selector: ethSetSponsor(address) 8f9af35663 function ethSetSponsor(address sponsor) external;6465 // Selector: ethConfirmSponsorship() a8580d1a66 function ethConfirmSponsorship() external;6768 // Selector: setLimit(string,uint32) 68db30ca69 function setLimit(string memory limit, uint32 value) external;7071 // Selector: setLimit(string,bool) ea67e4c272 function setLimit(string memory limit, bool value) external;7374 // Selector: contractAddress() f6b4dfb475 function contractAddress() external view returns (address);7677 // Selector: addAdmin(address) 7048027578 function addAdmin(address newAdmin) external view;7980 // Selector: removeAdmin(address) 1785f53c81 function removeAdmin(address admin) external view;8283 // Selector: setNesting(bool) e8fc50dd84 function setNesting(bool enable) external;8586 // Selector: setNesting(bool,address[]) 7df12a9a87 function setNesting(bool enable, address[] memory collections) external;88}8990// Selector: 4136937791interface TokenProperties is Dummy, ERC165 {92 // Selector: setTokenPropertyPermission(string,bool,bool,bool) 222d97fa93 function setTokenPropertyPermission(94 string memory key,95 bool isMutable,96 bool collectionAdmin,97 bool tokenOwner98 ) external;99100 // Selector: setProperty(uint256,string,bytes) 1752d67b101 function setProperty(102 uint256 tokenId,103 string memory key,104 bytes memory value105 ) external;106107 // Selector: deleteProperty(uint256,string) 066111d1108 function deleteProperty(uint256 tokenId, string memory key) external;109110 // Throws error if key not found111 //112 // Selector: property(uint256,string) 7228c327113 function property(uint256 tokenId, string memory key)114 external115 view116 returns (bytes memory);117}118119// Selector: 42966c68120interface ERC721Burnable is Dummy, ERC165 {121 // Selector: burn(uint256) 42966c68122 function burn(uint256 tokenId) external;123}124125// Selector: 58800161126interface ERC721 is Dummy, ERC165, ERC721Events {127 // Selector: balanceOf(address) 70a08231128 function balanceOf(address owner) external view returns (uint256);129130 // Selector: ownerOf(uint256) 6352211e131 function ownerOf(uint256 tokenId) external view returns (address);132133 // Not implemented134 //135 // Selector: safeTransferFromWithData(address,address,uint256,bytes) 60a11672136 function safeTransferFromWithData(137 address from,138 address to,139 uint256 tokenId,140 bytes memory data141 ) external;142143 // Not implemented144 //145 // Selector: safeTransferFrom(address,address,uint256) 42842e0e146 function safeTransferFrom(147 address from,148 address to,149 uint256 tokenId150 ) external;151152 // Selector: transferFrom(address,address,uint256) 23b872dd153 function transferFrom(154 address from,155 address to,156 uint256 tokenId157 ) external;158159 // Selector: approve(address,uint256) 095ea7b3160 function approve(address approved, uint256 tokenId) external;161162 // Not implemented163 //164 // Selector: setApprovalForAll(address,bool) a22cb465165 function setApprovalForAll(address operator, bool approved) external;166167 // Not implemented168 //169 // Selector: getApproved(uint256) 081812fc170 function getApproved(uint256 tokenId) external view returns (address);171172 // Not implemented173 //174 // Selector: isApprovedForAll(address,address) e985e9c5175 function isApprovedForAll(address owner, address operator)176 external177 view178 returns (address);179}180181// Selector: 5b5e139f182interface ERC721Metadata is Dummy, ERC165 {183 // Selector: name() 06fdde03184 function name() external view returns (string memory);185186 // Selector: symbol() 95d89b41187 function symbol() external view returns (string memory);188189 // Returns token's const_metadata190 //191 // Selector: tokenURI(uint256) c87b56dd192 function tokenURI(uint256 tokenId) external view returns (string memory);193}194195// Selector: 68ccfe89196interface ERC721Mintable is Dummy, ERC165, ERC721MintableEvents {197 // Selector: mintingFinished() 05d2035b198 function mintingFinished() external view returns (bool);199200 // `token_id` should be obtained with `next_token_id` method,201 // unlike standard, you can't specify it manually202 //203 // Selector: mint(address,uint256) 40c10f19204 function mint(address to, uint256 tokenId) external returns (bool);205206 // `token_id` should be obtained with `next_token_id` method,207 // unlike standard, you can't specify it manually208 //209 // Selector: mintWithTokenURI(address,uint256,string) 50bb4e7f210 function mintWithTokenURI(211 address to,212 uint256 tokenId,213 string memory tokenUri214 ) external returns (bool);215216 // Not implemented217 //218 // Selector: finishMinting() 7d64bcb4219 function finishMinting() external returns (bool);220}221222// Selector: 780e9d63223interface ERC721Enumerable is Dummy, ERC165 {224 // Selector: tokenByIndex(uint256) 4f6ccce7225 function tokenByIndex(uint256 index) external view returns (uint256);226227 // Not implemented228 //229 // Selector: tokenOfOwnerByIndex(address,uint256) 2f745c59230 function tokenOfOwnerByIndex(address owner, uint256 index)231 external232 view233 returns (uint256);234235 // Selector: totalSupply() 18160ddd236 function totalSupply() external view returns (uint256);237}238239// Selector: d74d154f240interface ERC721UniqueExtensions is Dummy, ERC165 {241 // Selector: transfer(address,uint256) a9059cbb242 function transfer(address to, uint256 tokenId) external;243244 // Selector: burnFrom(address,uint256) 79cc6790245 function burnFrom(address from, uint256 tokenId) external;246247 // Selector: nextTokenId() 75794a3c248 function nextTokenId() external view returns (uint256);249250 // Selector: mintBulk(address,uint256[]) 44a9945e251 function mintBulk(address to, uint256[] memory tokenIds)252 external253 returns (bool);254255 // Selector: mintBulkWithTokenURI(address,(uint256,string)[]) 36543006256 function mintBulkWithTokenURI(address to, Tuple0[] memory tokens)257 external258 returns (bool);259}260261interface UniqueNFT is262 Dummy,263 ERC165,264 ERC721,265 ERC721Metadata,266 ERC721Enumerable,267 ERC721UniqueExtensions,268 ERC721Mintable,269 ERC721Burnable,270 Collection,271 TokenProperties272{}tests/src/eth/nonFungibleAbi.jsondiffbeforeafterboth--- a/tests/src/eth/nonFungibleAbi.json
+++ b/tests/src/eth/nonFungibleAbi.json
@@ -84,16 +84,7 @@
"inputs": [
{ "internalType": "address", "name": "newAdmin", "type": "address" }
],
- "name": "addCollectionAdmin",
- "outputs": [],
- "stateMutability": "view",
- "type": "function"
- },
- {
- "inputs": [
- { "internalType": "address", "name": "user", "type": "address" }
- ],
- "name": "addToCollectionAllowList",
+ "name": "addAdmin",
"outputs": [],
"stateMutability": "view",
"type": "function"
@@ -293,16 +284,7 @@
"inputs": [
{ "internalType": "address", "name": "admin", "type": "address" }
],
- "name": "removeCollectionAdmin",
- "outputs": [],
- "stateMutability": "view",
- "type": "function"
- },
- {
- "inputs": [
- { "internalType": "address", "name": "user", "type": "address" }
- ],
- "name": "removeFromCollectionAllowList",
+ "name": "removeAdmin",
"outputs": [],
"stateMutability": "view",
"type": "function"
@@ -416,6 +398,27 @@
},
{
"inputs": [
+ { "internalType": "bool", "name": "enable", "type": "bool" },
+ {
+ "internalType": "address[]",
+ "name": "collections",
+ "type": "address[]"
+ }
+ ],
+ "name": "setNesting",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [{ "internalType": "bool", "name": "enable", "type": "bool" }],
+ "name": "setNesting",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [
{ "internalType": "uint256", "name": "tokenId", "type": "uint256" },
{ "internalType": "string", "name": "key", "type": "string" },
{ "internalType": "bytes", "name": "value", "type": "bytes" }
tests/src/eth/proxy/nonFungibleProxy.test.tsdiffbeforeafterboth--- a/tests/src/eth/proxy/nonFungibleProxy.test.ts
+++ b/tests/src/eth/proxy/nonFungibleProxy.test.ts
@@ -99,7 +99,7 @@
const collectionEvmOwned = evmCollection(web3, owner, collectionIdAddress);
const collectionEvm = evmCollection(web3, caller, collectionIdAddress);
const contract = await proxyWrap(api, web3, collectionEvm);
- await collectionEvmOwned.methods.addCollectionAdmin(contract.options.address).send();
+ await collectionEvmOwned.methods.addAdmin(contract.options.address).send();
{
const nextTokenId = await contract.methods.nextTokenId().call();
tests/src/interfaces/augment-api-rpc.tsdiffbeforeafterboth--- a/tests/src/interfaces/augment-api-rpc.ts
+++ b/tests/src/interfaces/augment-api-rpc.ts
@@ -18,7 +18,7 @@
import type { EthAccount, EthCallRequest, EthFilter, EthFilterChanges, EthLog, EthReceipt, EthRichBlock, EthSubKind, EthSubParams, EthSyncStatus, EthTransaction, EthTransactionRequest, EthWork } from '@polkadot/types/interfaces/eth';
import type { Extrinsic } from '@polkadot/types/interfaces/extrinsics';
import type { EncodedFinalityProofs, JustificationNotification, ReportedRoundStates } from '@polkadot/types/interfaces/grandpa';
-import type { MmrLeafBatchProof, MmrLeafProof } from '@polkadot/types/interfaces/mmr';
+import type { MmrLeafProof } from '@polkadot/types/interfaces/mmr';
import type { StorageKind } from '@polkadot/types/interfaces/offchain';
import type { FeeDetails, RuntimeDispatchInfo } from '@polkadot/types/interfaces/payment';
import type { RpcMethods } from '@polkadot/types/interfaces/rpc';
@@ -354,14 +354,10 @@
subscribeJustifications: AugmentedRpc<() => Observable<JustificationNotification>>;
};
mmr: {
- /**
- * Generate MMR proof for the given leaf indices.
- **/
- generateBatchProof: AugmentedRpc<(leafIndices: Vec<u64> | (u64 | AnyNumber | Uint8Array)[], at?: BlockHash | string | Uint8Array) => Observable<MmrLeafProof>>;
/**
* Generate MMR proof for given leaf index.
**/
- generateProof: AugmentedRpc<(leafIndex: u64 | AnyNumber | Uint8Array, at?: BlockHash | string | Uint8Array) => Observable<MmrLeafBatchProof>>;
+ generateProof: AugmentedRpc<(leafIndex: u64 | AnyNumber | Uint8Array, at?: BlockHash | string | Uint8Array) => Observable<MmrLeafProof>>;
};
net: {
/**
tests/src/interfaces/augment-types.tsdiffbeforeafterboth--- a/tests/src/interfaces/augment-types.ts
+++ b/tests/src/interfaces/augment-types.ts
@@ -3,7 +3,7 @@
import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSupportWeightsWeightToFeeCoefficient, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUnqSchedulerCall, PalletUnqSchedulerError, PalletUnqSchedulerEvent, PalletUnqSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExData, UpDataStructsNestingRule, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipState, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from './default';
import type { Data, StorageKey } from '@polkadot/types';
-import type { BitVec, Bool, Bytes, I128, I16, I256, I32, I64, I8, Json, Null, OptionBool, Raw, Text, Type, U128, U16, U256, U32, U64, U8, USize, bool, i128, i16, i256, i32, i64, i8, u128, u16, u256, u32, u64, u8, usize } from '@polkadot/types-codec';
+import type { BitVec, Bool, Bytes, I128, I16, I256, I32, I64, I8, Json, Null, Raw, Text, Type, U128, U16, U256, U32, U64, U8, USize, bool, i128, i16, i256, i32, i64, i8, u128, u16, u256, u32, u64, u8, usize } from '@polkadot/types-codec';
import type { AssetApproval, AssetApprovalKey, AssetBalance, AssetDestroyWitness, AssetDetails, AssetMetadata, TAssetBalance, TAssetDepositBalance } from '@polkadot/types/interfaces/assets';
import type { BlockAttestations, IncludedBlocks, MoreAttestations } from '@polkadot/types/interfaces/attestations';
import type { RawAuraPreDigest } from '@polkadot/types/interfaces/aura';
@@ -36,7 +36,7 @@
import type { AuthIndex, AuthoritySignature, Heartbeat, HeartbeatTo244, OpaqueMultiaddr, OpaqueNetworkState, OpaquePeerId } from '@polkadot/types/interfaces/imOnline';
import type { CallIndex, LotteryConfig } from '@polkadot/types/interfaces/lottery';
import type { ErrorMetadataLatest, ErrorMetadataV10, ErrorMetadataV11, ErrorMetadataV12, ErrorMetadataV13, ErrorMetadataV14, ErrorMetadataV9, EventMetadataLatest, EventMetadataV10, EventMetadataV11, EventMetadataV12, EventMetadataV13, EventMetadataV14, EventMetadataV9, ExtrinsicMetadataLatest, ExtrinsicMetadataV11, ExtrinsicMetadataV12, ExtrinsicMetadataV13, ExtrinsicMetadataV14, FunctionArgumentMetadataLatest, FunctionArgumentMetadataV10, FunctionArgumentMetadataV11, FunctionArgumentMetadataV12, FunctionArgumentMetadataV13, FunctionArgumentMetadataV14, FunctionArgumentMetadataV9, FunctionMetadataLatest, FunctionMetadataV10, FunctionMetadataV11, FunctionMetadataV12, FunctionMetadataV13, FunctionMetadataV14, FunctionMetadataV9, MetadataAll, MetadataLatest, MetadataV10, MetadataV11, MetadataV12, MetadataV13, MetadataV14, MetadataV9, ModuleConstantMetadataV10, ModuleConstantMetadataV11, ModuleConstantMetadataV12, ModuleConstantMetadataV13, ModuleConstantMetadataV9, ModuleMetadataV10, ModuleMetadataV11, ModuleMetadataV12, ModuleMetadataV13, ModuleMetadataV9, PalletCallMetadataLatest, PalletCallMetadataV14, PalletConstantMetadataLatest, PalletConstantMetadataV14, PalletErrorMetadataLatest, PalletErrorMetadataV14, PalletEventMetadataLatest, PalletEventMetadataV14, PalletMetadataLatest, PalletMetadataV14, PalletStorageMetadataLatest, PalletStorageMetadataV14, PortableType, PortableTypeV14, SignedExtensionMetadataLatest, SignedExtensionMetadataV14, StorageEntryMetadataLatest, StorageEntryMetadataV10, StorageEntryMetadataV11, StorageEntryMetadataV12, StorageEntryMetadataV13, StorageEntryMetadataV14, StorageEntryMetadataV9, StorageEntryModifierLatest, StorageEntryModifierV10, StorageEntryModifierV11, StorageEntryModifierV12, StorageEntryModifierV13, StorageEntryModifierV14, StorageEntryModifierV9, StorageEntryTypeLatest, StorageEntryTypeV10, StorageEntryTypeV11, StorageEntryTypeV12, StorageEntryTypeV13, StorageEntryTypeV14, StorageEntryTypeV9, StorageHasher, StorageHasherV10, StorageHasherV11, StorageHasherV12, StorageHasherV13, StorageHasherV14, StorageHasherV9, StorageMetadataV10, StorageMetadataV11, StorageMetadataV12, StorageMetadataV13, StorageMetadataV9 } from '@polkadot/types/interfaces/metadata';
-import type { MmrLeafBatchProof, MmrLeafProof } from '@polkadot/types/interfaces/mmr';
+import type { MmrLeafProof } from '@polkadot/types/interfaces/mmr';
import type { StorageKind } from '@polkadot/types/interfaces/offchain';
import type { DeferredOffenceOf, Kind, OffenceDetails, Offender, OpaqueTimeSlot, ReportIdOf, Reporter } from '@polkadot/types/interfaces/offences';
import type { AbridgedCandidateReceipt, AbridgedHostConfiguration, AbridgedHrmpChannel, AssignmentId, AssignmentKind, AttestedCandidate, AuctionIndex, AuthorityDiscoveryId, AvailabilityBitfield, AvailabilityBitfieldRecord, BackedCandidate, Bidder, BufferedSessionChange, CandidateCommitments, CandidateDescriptor, CandidateHash, CandidateInfo, CandidatePendingAvailability, CandidateReceipt, CollatorId, CollatorSignature, CommittedCandidateReceipt, CoreAssignment, CoreIndex, CoreOccupied, DisputeLocation, DisputeResult, DisputeState, DisputeStatement, DisputeStatementSet, DoubleVoteReport, DownwardMessage, ExplicitDisputeStatement, GlobalValidationData, GlobalValidationSchedule, GroupIndex, HeadData, HostConfiguration, HrmpChannel, HrmpChannelId, HrmpOpenChannelRequest, InboundDownwardMessage, InboundHrmpMessage, InboundHrmpMessages, IncomingParachain, IncomingParachainDeploy, IncomingParachainFixed, InvalidDisputeStatementKind, LeasePeriod, LeasePeriodOf, LocalValidationData, MessageIngestionType, MessageQueueChain, MessagingStateSnapshot, MessagingStateSnapshotEgressEntry, MultiDisputeStatementSet, NewBidder, OutboundHrmpMessage, ParaGenesisArgs, ParaId, ParaInfo, ParaLifecycle, ParaPastCodeMeta, ParaScheduling, ParaValidatorIndex, ParachainDispatchOrigin, ParachainInherentData, ParachainProposal, ParachainsInherentData, ParathreadClaim, ParathreadClaimQueue, ParathreadEntry, PersistedValidationData, QueuedParathread, RegisteredParachainInfo, RelayBlockNumber, RelayChainBlockNumber, RelayChainHash, RelayHash, Remark, ReplacementTimes, Retriable, Scheduling, ServiceQuality, SessionInfo, SessionInfoValidatorGroup, SignedAvailabilityBitfield, SignedAvailabilityBitfields, SigningContext, SlotRange, SlotRange10, Statement, SubId, SystemInherentData, TransientValidationData, UpgradeGoAhead, UpgradeRestriction, UpwardMessage, ValidDisputeStatementKind, ValidationCode, ValidationCodeHash, ValidationData, ValidationDataType, ValidationFunctionParams, ValidatorSignature, ValidityAttestation, VecInboundHrmpMessage, WinnersData, WinnersData10, WinnersDataTuple, WinnersDataTuple10, WinningData, WinningData10, WinningDataEntry } from '@polkadot/types/interfaces/parachains';
@@ -664,7 +664,6 @@
MetadataV14: MetadataV14;
MetadataV9: MetadataV9;
MigrationStatusResult: MigrationStatusResult;
- MmrLeafBatchProof: MmrLeafBatchProof;
MmrLeafProof: MmrLeafProof;
MmrRootHash: MmrRootHash;
ModuleConstantMetadataV10: ModuleConstantMetadataV10;
@@ -732,7 +731,6 @@
OpenTipTip: OpenTipTip;
OpenTipTo225: OpenTipTo225;
OperatingMode: OperatingMode;
- OptionBool: OptionBool;
Origin: Origin;
OriginCaller: OriginCaller;
OriginKindV0: OriginKindV0;