From a9c26037395e319c6ac261658b7e126c39d78aa9 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Mon, 26 Sep 2022 12:25:28 +0000 Subject: [PATCH] misk: Turn off eth metods for substrate addresses. --- --- a/pallets/common/src/erc.rs +++ b/pallets/common/src/erc.rs @@ -139,25 +139,26 @@ save(self) } - /// Set the substrate sponsor of the collection. - /// - /// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. - /// - /// @param sponsor Substrate address of the sponsor from whose account funds will be debited for operations with the contract. - fn set_collection_sponsor_substrate( - &mut self, - caller: caller, - sponsor: uint256, - ) -> Result { - self.consume_store_reads_and_writes(1, 1)?; + // TODO: Temprorary off. Need refactor + // /// Set the substrate sponsor of the collection. + // /// + // /// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. + // /// + // /// @param sponsor Substrate address of the sponsor from whose account funds will be debited for operations with the contract. + // fn set_collection_sponsor_substrate( + // &mut self, + // caller: caller, + // sponsor: uint256, + // ) -> Result { + // self.consume_store_reads_and_writes(1, 1)?; - check_is_owner_or_admin(caller, self)?; + // check_is_owner_or_admin(caller, self)?; - let sponsor = convert_uint256_to_cross_account::(sponsor); - self.set_sponsor(sponsor.as_sub().clone()) - .map_err(dispatch_to_evm::)?; - save(self) - } + // let sponsor = convert_uint256_to_cross_account::(sponsor); + // self.set_sponsor(sponsor.as_sub().clone()) + // .map_err(dispatch_to_evm::)?; + // save(self) + // } /// Whether there is a pending sponsor. fn has_collection_pending_sponsor(&self) -> Result { @@ -299,35 +300,37 @@ Ok(crate::eth::collection_id_to_address(self.id)) } - /// Add collection admin by substrate address. - /// @param newAdmin Substrate administrator address. - fn add_collection_admin_substrate( - &mut self, - caller: caller, - new_admin: uint256, - ) -> Result { - self.consume_store_writes(2)?; + // TODO: Temprorary off. Need refactor + // /// Add collection admin by substrate address. + // /// @param newAdmin Substrate administrator address. + // fn add_collection_admin_substrate( + // &mut self, + // caller: caller, + // new_admin: uint256, + // ) -> Result { + // self.consume_store_writes(2)?; - let caller = T::CrossAccountId::from_eth(caller); - let new_admin = convert_uint256_to_cross_account::(new_admin); - >::toggle_admin(self, &caller, &new_admin, true).map_err(dispatch_to_evm::)?; - Ok(()) - } + // let caller = T::CrossAccountId::from_eth(caller); + // let new_admin = convert_uint256_to_cross_account::(new_admin); + // >::toggle_admin(self, &caller, &new_admin, true).map_err(dispatch_to_evm::)?; + // Ok(()) + // } - /// Remove collection admin by substrate address. - /// @param admin Substrate administrator address. - fn remove_collection_admin_substrate( - &mut self, - caller: caller, - admin: uint256, - ) -> Result { - self.consume_store_writes(2)?; + // TODO: Temprorary off. Need refactor + // /// Remove collection admin by substrate address. + // /// @param admin Substrate administrator address. + // fn remove_collection_admin_substrate( + // &mut self, + // caller: caller, + // admin: uint256, + // ) -> Result { + // self.consume_store_writes(2)?; - let caller = T::CrossAccountId::from_eth(caller); - let admin = convert_uint256_to_cross_account::(admin); - >::toggle_admin(self, &caller, &admin, false).map_err(dispatch_to_evm::)?; - Ok(()) - } + // let caller = T::CrossAccountId::from_eth(caller); + // let admin = convert_uint256_to_cross_account::(admin); + // >::toggle_admin(self, &caller, &admin, false).map_err(dispatch_to_evm::)?; + // Ok(()) + // } /// Add collection admin. /// @param newAdmin Address of the added administrator. @@ -476,21 +479,22 @@ Ok(()) } - /// Add substrate user to allowed list. - /// - /// @param user User substrate address. - fn add_to_collection_allow_list_substrate( - &mut self, - caller: caller, - user: uint256, - ) -> Result { - self.consume_store_writes(1)?; + // TODO: Temprorary off. Need refactor + // /// Add substrate user to allowed list. + // /// + // /// @param user User substrate address. + // fn add_to_collection_allow_list_substrate( + // &mut self, + // caller: caller, + // user: uint256, + // ) -> Result { + // self.consume_store_writes(1)?; - let caller = T::CrossAccountId::from_eth(caller); - let user = convert_uint256_to_cross_account::(user); - Pallet::::toggle_allowlist(self, &caller, &user, true).map_err(dispatch_to_evm::)?; - Ok(()) - } + // let caller = T::CrossAccountId::from_eth(caller); + // let user = convert_uint256_to_cross_account::(user); + // Pallet::::toggle_allowlist(self, &caller, &user, true).map_err(dispatch_to_evm::)?; + // Ok(()) + // } /// Remove the user from the allowed list. /// @@ -504,21 +508,22 @@ Ok(()) } - /// Remove substrate user from allowed list. - /// - /// @param user User substrate address. - fn remove_from_collection_allow_list_substrate( - &mut self, - caller: caller, - user: uint256, - ) -> Result { - self.consume_store_writes(1)?; + // TODO: Temprorary off. Need refactor + // /// Remove substrate user from allowed list. + // /// + // /// @param user User substrate address. + // fn remove_from_collection_allow_list_substrate( + // &mut self, + // caller: caller, + // user: uint256, + // ) -> Result { + // self.consume_store_writes(1)?; - let caller = T::CrossAccountId::from_eth(caller); - let user = convert_uint256_to_cross_account::(user); - Pallet::::toggle_allowlist(self, &caller, &user, false).map_err(dispatch_to_evm::)?; - Ok(()) - } + // let caller = T::CrossAccountId::from_eth(caller); + // let user = convert_uint256_to_cross_account::(user); + // Pallet::::toggle_allowlist(self, &caller, &user, false).map_err(dispatch_to_evm::)?; + // Ok(()) + // } /// Switch permission for minting. /// @@ -551,14 +556,15 @@ Ok(self.is_owner_or_admin(&user)) } - /// Check that substrate account is the owner or admin of the collection - /// - /// @param user account to verify - /// @return "true" if account is the owner or admin - fn is_owner_or_admin_substrate(&self, user: uint256) -> Result { - let user = convert_uint256_to_cross_account::(user); - Ok(self.is_owner_or_admin(&user)) - } + // TODO: Temprorary off. Need refactor + // /// Check that substrate account is the owner or admin of the collection + // /// + // /// @param user account to verify + // /// @return "true" if account is the owner or admin + // fn is_owner_or_admin_substrate(&self, user: uint256) -> Result { + // let user = convert_uint256_to_cross_account::(user); + // Ok(self.is_owner_or_admin(&user)) + // } /// Returns collection type /// @@ -595,18 +601,19 @@ .map_err(dispatch_to_evm::) } - /// Changes collection owner to another substrate account - /// - /// @dev Owner can be changed only by current owner - /// @param newOwner new owner substrate account - fn set_owner_substrate(&mut self, caller: caller, new_owner: uint256) -> Result { - self.consume_store_writes(1)?; + // TODO: Temprorary off. Need refactor + // /// Changes collection owner to another substrate account + // /// + // /// @dev Owner can be changed only by current owner + // /// @param newOwner new owner substrate account + // fn set_owner_substrate(&mut self, caller: caller, new_owner: uint256) -> Result { + // self.consume_store_writes(1)?; - let caller = T::CrossAccountId::from_eth(caller); - let new_owner = convert_uint256_to_cross_account::(new_owner); - self.set_owner_internal(caller, new_owner) - .map_err(dispatch_to_evm::) - } + // let caller = T::CrossAccountId::from_eth(caller); + // let new_owner = convert_uint256_to_cross_account::(new_owner); + // self.set_owner_internal(caller, new_owner) + // .map_err(dispatch_to_evm::) + // } // TODO: need implement AbiWriter for &Vec // fn collection_admins(&self) -> Result> { --- a/pallets/fungible/src/stubs/UniqueFungible.sol +++ b/pallets/fungible/src/stubs/UniqueFungible.sol @@ -18,7 +18,7 @@ } /// @title A contract that allows you to work with collections. -/// @dev the ERC-165 identifier for this interface is 0x47dbc105 +/// @dev the ERC-165 identifier for this interface is 0x3e1e8083 contract Collection is Dummy, ERC165 { /// Set collection property. /// @@ -72,19 +72,6 @@ dummy = 0; } - /// Set the substrate sponsor of the collection. - /// - /// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. - /// - /// @param sponsor Substrate address of the sponsor from whose account funds will be debited for operations with the contract. - /// @dev EVM selector for this function is: 0xc74d6751, - /// or in textual repr: setCollectionSponsorSubstrate(uint256) - function setCollectionSponsorSubstrate(uint256 sponsor) public { - require(false, stub_error); - sponsor; - dummy = 0; - } - /// Whether there is a pending sponsor. /// @dev EVM selector for this function is: 0x058ac185, /// or in textual repr: hasCollectionPendingSponsor() @@ -167,26 +154,6 @@ return 0x0000000000000000000000000000000000000000; } - /// Add collection admin by substrate address. - /// @param newAdmin Substrate administrator address. - /// @dev EVM selector for this function is: 0x5730062b, - /// or in textual repr: addCollectionAdminSubstrate(uint256) - function addCollectionAdminSubstrate(uint256 newAdmin) public { - require(false, stub_error); - newAdmin; - dummy = 0; - } - - /// Remove collection admin by substrate address. - /// @param admin Substrate administrator address. - /// @dev EVM selector for this function is: 0x4048fcf9, - /// or in textual repr: removeCollectionAdminSubstrate(uint256) - function removeCollectionAdminSubstrate(uint256 admin) public { - require(false, stub_error); - admin; - dummy = 0; - } - /// Add collection admin. /// @param newAdmin Address of the added administrator. /// @dev EVM selector for this function is: 0x92e462c7, @@ -262,17 +229,6 @@ /// @dev EVM selector for this function is: 0x67844fe6, /// or in textual repr: addToCollectionAllowList(address) function addToCollectionAllowList(address user) public { - require(false, stub_error); - user; - dummy = 0; - } - - /// Add substrate user to allowed list. - /// - /// @param user User substrate address. - /// @dev EVM selector for this function is: 0xd06ad267, - /// or in textual repr: addToCollectionAllowListSubstrate(uint256) - function addToCollectionAllowListSubstrate(uint256 user) public { require(false, stub_error); user; dummy = 0; @@ -289,17 +245,6 @@ dummy = 0; } - /// Remove substrate user from allowed list. - /// - /// @param user User substrate address. - /// @dev EVM selector for this function is: 0xa31913ed, - /// or in textual repr: removeFromCollectionAllowListSubstrate(uint256) - function removeFromCollectionAllowListSubstrate(uint256 user) public { - require(false, stub_error); - user; - dummy = 0; - } - /// Switch permission for minting. /// /// @param mode Enable if "true". @@ -324,19 +269,6 @@ return false; } - /// Check that substrate account is the owner or admin of the collection - /// - /// @param user account to verify - /// @return "true" if account is the owner or admin - /// @dev EVM selector for this function is: 0x68910e00, - /// or in textual repr: isOwnerOrAdminSubstrate(uint256) - function isOwnerOrAdminSubstrate(uint256 user) public view returns (bool) { - require(false, stub_error); - user; - dummy; - return false; - } - /// Returns collection type /// /// @return `Fungible` or `NFT` or `ReFungible` @@ -367,18 +299,6 @@ /// @dev EVM selector for this function is: 0x13af4035, /// or in textual repr: setOwner(address) function setOwner(address newOwner) public { - require(false, stub_error); - newOwner; - dummy = 0; - } - - /// Changes collection owner to another substrate account - /// - /// @dev Owner can be changed only by current owner - /// @param newOwner new owner substrate account - /// @dev EVM selector for this function is: 0xb212138f, - /// or in textual repr: setOwnerSubstrate(uint256) - function setOwnerSubstrate(uint256 newOwner) public { require(false, stub_error); newOwner; dummy = 0; --- a/pallets/nonfungible/src/stubs/UniqueNFT.sol +++ b/pallets/nonfungible/src/stubs/UniqueNFT.sol @@ -91,7 +91,7 @@ } /// @title A contract that allows you to work with collections. -/// @dev the ERC-165 identifier for this interface is 0x47dbc105 +/// @dev the ERC-165 identifier for this interface is 0x3e1e8083 contract Collection is Dummy, ERC165 { /// Set collection property. /// @@ -145,19 +145,6 @@ dummy = 0; } - /// Set the substrate sponsor of the collection. - /// - /// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. - /// - /// @param sponsor Substrate address of the sponsor from whose account funds will be debited for operations with the contract. - /// @dev EVM selector for this function is: 0xc74d6751, - /// or in textual repr: setCollectionSponsorSubstrate(uint256) - function setCollectionSponsorSubstrate(uint256 sponsor) public { - require(false, stub_error); - sponsor; - dummy = 0; - } - /// Whether there is a pending sponsor. /// @dev EVM selector for this function is: 0x058ac185, /// or in textual repr: hasCollectionPendingSponsor() @@ -240,26 +227,6 @@ return 0x0000000000000000000000000000000000000000; } - /// Add collection admin by substrate address. - /// @param newAdmin Substrate administrator address. - /// @dev EVM selector for this function is: 0x5730062b, - /// or in textual repr: addCollectionAdminSubstrate(uint256) - function addCollectionAdminSubstrate(uint256 newAdmin) public { - require(false, stub_error); - newAdmin; - dummy = 0; - } - - /// Remove collection admin by substrate address. - /// @param admin Substrate administrator address. - /// @dev EVM selector for this function is: 0x4048fcf9, - /// or in textual repr: removeCollectionAdminSubstrate(uint256) - function removeCollectionAdminSubstrate(uint256 admin) public { - require(false, stub_error); - admin; - dummy = 0; - } - /// Add collection admin. /// @param newAdmin Address of the added administrator. /// @dev EVM selector for this function is: 0x92e462c7, @@ -335,17 +302,6 @@ /// @dev EVM selector for this function is: 0x67844fe6, /// or in textual repr: addToCollectionAllowList(address) function addToCollectionAllowList(address user) public { - require(false, stub_error); - user; - dummy = 0; - } - - /// Add substrate user to allowed list. - /// - /// @param user User substrate address. - /// @dev EVM selector for this function is: 0xd06ad267, - /// or in textual repr: addToCollectionAllowListSubstrate(uint256) - function addToCollectionAllowListSubstrate(uint256 user) public { require(false, stub_error); user; dummy = 0; @@ -362,17 +318,6 @@ dummy = 0; } - /// Remove substrate user from allowed list. - /// - /// @param user User substrate address. - /// @dev EVM selector for this function is: 0xa31913ed, - /// or in textual repr: removeFromCollectionAllowListSubstrate(uint256) - function removeFromCollectionAllowListSubstrate(uint256 user) public { - require(false, stub_error); - user; - dummy = 0; - } - /// Switch permission for minting. /// /// @param mode Enable if "true". @@ -397,19 +342,6 @@ return false; } - /// Check that substrate account is the owner or admin of the collection - /// - /// @param user account to verify - /// @return "true" if account is the owner or admin - /// @dev EVM selector for this function is: 0x68910e00, - /// or in textual repr: isOwnerOrAdminSubstrate(uint256) - function isOwnerOrAdminSubstrate(uint256 user) public view returns (bool) { - require(false, stub_error); - user; - dummy; - return false; - } - /// Returns collection type /// /// @return `Fungible` or `NFT` or `ReFungible` @@ -440,18 +372,6 @@ /// @dev EVM selector for this function is: 0x13af4035, /// or in textual repr: setOwner(address) function setOwner(address newOwner) public { - require(false, stub_error); - newOwner; - dummy = 0; - } - - /// Changes collection owner to another substrate account - /// - /// @dev Owner can be changed only by current owner - /// @param newOwner new owner substrate account - /// @dev EVM selector for this function is: 0xb212138f, - /// or in textual repr: setOwnerSubstrate(uint256) - function setOwnerSubstrate(uint256 newOwner) public { require(false, stub_error); newOwner; dummy = 0; --- a/pallets/refungible/src/stubs/UniqueRefungible.sol +++ b/pallets/refungible/src/stubs/UniqueRefungible.sol @@ -91,7 +91,7 @@ } /// @title A contract that allows you to work with collections. -/// @dev the ERC-165 identifier for this interface is 0x47dbc105 +/// @dev the ERC-165 identifier for this interface is 0x3e1e8083 contract Collection is Dummy, ERC165 { /// Set collection property. /// @@ -145,19 +145,6 @@ dummy = 0; } - /// Set the substrate sponsor of the collection. - /// - /// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. - /// - /// @param sponsor Substrate address of the sponsor from whose account funds will be debited for operations with the contract. - /// @dev EVM selector for this function is: 0xc74d6751, - /// or in textual repr: setCollectionSponsorSubstrate(uint256) - function setCollectionSponsorSubstrate(uint256 sponsor) public { - require(false, stub_error); - sponsor; - dummy = 0; - } - /// Whether there is a pending sponsor. /// @dev EVM selector for this function is: 0x058ac185, /// or in textual repr: hasCollectionPendingSponsor() @@ -240,26 +227,6 @@ return 0x0000000000000000000000000000000000000000; } - /// Add collection admin by substrate address. - /// @param newAdmin Substrate administrator address. - /// @dev EVM selector for this function is: 0x5730062b, - /// or in textual repr: addCollectionAdminSubstrate(uint256) - function addCollectionAdminSubstrate(uint256 newAdmin) public { - require(false, stub_error); - newAdmin; - dummy = 0; - } - - /// Remove collection admin by substrate address. - /// @param admin Substrate administrator address. - /// @dev EVM selector for this function is: 0x4048fcf9, - /// or in textual repr: removeCollectionAdminSubstrate(uint256) - function removeCollectionAdminSubstrate(uint256 admin) public { - require(false, stub_error); - admin; - dummy = 0; - } - /// Add collection admin. /// @param newAdmin Address of the added administrator. /// @dev EVM selector for this function is: 0x92e462c7, @@ -335,17 +302,6 @@ /// @dev EVM selector for this function is: 0x67844fe6, /// or in textual repr: addToCollectionAllowList(address) function addToCollectionAllowList(address user) public { - require(false, stub_error); - user; - dummy = 0; - } - - /// Add substrate user to allowed list. - /// - /// @param user User substrate address. - /// @dev EVM selector for this function is: 0xd06ad267, - /// or in textual repr: addToCollectionAllowListSubstrate(uint256) - function addToCollectionAllowListSubstrate(uint256 user) public { require(false, stub_error); user; dummy = 0; @@ -362,17 +318,6 @@ dummy = 0; } - /// Remove substrate user from allowed list. - /// - /// @param user User substrate address. - /// @dev EVM selector for this function is: 0xa31913ed, - /// or in textual repr: removeFromCollectionAllowListSubstrate(uint256) - function removeFromCollectionAllowListSubstrate(uint256 user) public { - require(false, stub_error); - user; - dummy = 0; - } - /// Switch permission for minting. /// /// @param mode Enable if "true". @@ -397,19 +342,6 @@ return false; } - /// Check that substrate account is the owner or admin of the collection - /// - /// @param user account to verify - /// @return "true" if account is the owner or admin - /// @dev EVM selector for this function is: 0x68910e00, - /// or in textual repr: isOwnerOrAdminSubstrate(uint256) - function isOwnerOrAdminSubstrate(uint256 user) public view returns (bool) { - require(false, stub_error); - user; - dummy; - return false; - } - /// Returns collection type /// /// @return `Fungible` or `NFT` or `ReFungible` @@ -440,18 +372,6 @@ /// @dev EVM selector for this function is: 0x13af4035, /// or in textual repr: setOwner(address) function setOwner(address newOwner) public { - require(false, stub_error); - newOwner; - dummy = 0; - } - - /// Changes collection owner to another substrate account - /// - /// @dev Owner can be changed only by current owner - /// @param newOwner new owner substrate account - /// @dev EVM selector for this function is: 0xb212138f, - /// or in textual repr: setOwnerSubstrate(uint256) - function setOwnerSubstrate(uint256 newOwner) public { require(false, stub_error); newOwner; dummy = 0; --- a/tests/src/eth/allowlist.test.ts +++ b/tests/src/eth/allowlist.test.ts @@ -95,20 +95,21 @@ expect(await collectionEvm.methods.allowed(user).call({from: owner})).to.be.false; }); - itEth('Collection allowlist can be added and removed by [sub] address', async ({helper}) => { - const owner = await helper.eth.createAccountWithBalance(donor); - const user = donor; + // TODO: Temprorary off. Need refactor + // itEth('Collection allowlist can be added and removed by [sub] address', async ({helper}) => { + // const owner = await helper.eth.createAccountWithBalance(donor); + // const user = donor; - const {collectionAddress, collectionId} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); - const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); + // const {collectionAddress, collectionId} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); + // const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); - expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.false; - await collectionEvm.methods.addToCollectionAllowListSubstrate(user.addressRaw).send({from: owner}); - expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.true; + // expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.false; + // await collectionEvm.methods.addToCollectionAllowListSubstrate(user.addressRaw).send({from: owner}); + // expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.true; - await collectionEvm.methods.removeFromCollectionAllowListSubstrate(user.addressRaw).send({from: owner}); - expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.false; - }); + // await collectionEvm.methods.removeFromCollectionAllowListSubstrate(user.addressRaw).send({from: owner}); + // expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.false; + // }); itEth('Collection allowlist can not be add and remove [eth] address by not owner', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); @@ -128,21 +129,22 @@ expect(await collectionEvm.methods.allowed(user).call({from: owner})).to.be.true; }); - itEth('Collection allowlist can not be add and remove [sub] address by not owner', async ({helper}) => { - const owner = await helper.eth.createAccountWithBalance(donor); - const notOwner = await helper.eth.createAccountWithBalance(donor); - const user = donor; + // TODO: Temprorary off. Need refactor + // itEth('Collection allowlist can not be add and remove [sub] address by not owner', async ({helper}) => { + // const owner = await helper.eth.createAccountWithBalance(donor); + // const notOwner = await helper.eth.createAccountWithBalance(donor); + // const user = donor; - const {collectionAddress, collectionId} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); - const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); + // const {collectionAddress, collectionId} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); + // const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); - expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.false; - await expect(collectionEvm.methods.addToCollectionAllowListSubstrate(user.addressRaw).call({from: notOwner})).to.be.rejectedWith('NoPermission'); - expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.false; - await collectionEvm.methods.addToCollectionAllowListSubstrate(user.addressRaw).send({from: owner}); + // expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.false; + // await expect(collectionEvm.methods.addToCollectionAllowListSubstrate(user.addressRaw).call({from: notOwner})).to.be.rejectedWith('NoPermission'); + // expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.false; + // await collectionEvm.methods.addToCollectionAllowListSubstrate(user.addressRaw).send({from: owner}); - expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.true; - await expect(collectionEvm.methods.removeFromCollectionAllowListSubstrate(user.addressRaw).call({from: notOwner})).to.be.rejectedWith('NoPermission'); - expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.true; - }); + // expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.true; + // await expect(collectionEvm.methods.removeFromCollectionAllowListSubstrate(user.addressRaw).call({from: notOwner})).to.be.rejectedWith('NoPermission'); + // expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.true; + // }); }); --- 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 0x47dbc105 +/// @dev the ERC-165 identifier for this interface is 0x3e1e8083 interface Collection is Dummy, ERC165 { /// Set collection property. /// @@ -48,15 +48,6 @@ /// @dev EVM selector for this function is: 0x7623402e, /// or in textual repr: setCollectionSponsor(address) function setCollectionSponsor(address sponsor) external; - - /// Set the substrate sponsor of the collection. - /// - /// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. - /// - /// @param sponsor Substrate address of the sponsor from whose account funds will be debited for operations with the contract. - /// @dev EVM selector for this function is: 0xc74d6751, - /// or in textual repr: setCollectionSponsorSubstrate(uint256) - function setCollectionSponsorSubstrate(uint256 sponsor) external; /// Whether there is a pending sponsor. /// @dev EVM selector for this function is: 0x058ac185, @@ -112,18 +103,6 @@ /// or in textual repr: contractAddress() function contractAddress() external view returns (address); - /// Add collection admin by substrate address. - /// @param newAdmin Substrate administrator address. - /// @dev EVM selector for this function is: 0x5730062b, - /// or in textual repr: addCollectionAdminSubstrate(uint256) - function addCollectionAdminSubstrate(uint256 newAdmin) external; - - /// Remove collection admin by substrate address. - /// @param admin Substrate administrator address. - /// @dev EVM selector for this function is: 0x4048fcf9, - /// or in textual repr: removeCollectionAdminSubstrate(uint256) - function removeCollectionAdminSubstrate(uint256 admin) external; - /// Add collection admin. /// @param newAdmin Address of the added administrator. /// @dev EVM selector for this function is: 0x92e462c7, @@ -174,13 +153,6 @@ /// or in textual repr: addToCollectionAllowList(address) function addToCollectionAllowList(address user) external; - /// Add substrate user to allowed list. - /// - /// @param user User substrate address. - /// @dev EVM selector for this function is: 0xd06ad267, - /// or in textual repr: addToCollectionAllowListSubstrate(uint256) - function addToCollectionAllowListSubstrate(uint256 user) external; - /// Remove the user from the allowed list. /// /// @param user Address of a removed user. @@ -188,13 +160,6 @@ /// or in textual repr: removeFromCollectionAllowList(address) function removeFromCollectionAllowList(address user) external; - /// Remove substrate user from allowed list. - /// - /// @param user User substrate address. - /// @dev EVM selector for this function is: 0xa31913ed, - /// or in textual repr: removeFromCollectionAllowListSubstrate(uint256) - function removeFromCollectionAllowListSubstrate(uint256 user) external; - /// Switch permission for minting. /// /// @param mode Enable if "true". @@ -209,14 +174,6 @@ /// @dev EVM selector for this function is: 0x9811b0c7, /// or in textual repr: isOwnerOrAdmin(address) function isOwnerOrAdmin(address user) external view returns (bool); - - /// Check that substrate account is the owner or admin of the collection - /// - /// @param user account to verify - /// @return "true" if account is the owner or admin - /// @dev EVM selector for this function is: 0x68910e00, - /// or in textual repr: isOwnerOrAdminSubstrate(uint256) - function isOwnerOrAdminSubstrate(uint256 user) external view returns (bool); /// Returns collection type /// @@ -240,14 +197,6 @@ /// @dev EVM selector for this function is: 0x13af4035, /// or in textual repr: setOwner(address) function setOwner(address newOwner) external; - - /// Changes collection owner to another substrate account - /// - /// @dev Owner can be changed only by current owner - /// @param newOwner new owner substrate account - /// @dev EVM selector for this function is: 0xb212138f, - /// or in textual repr: setOwnerSubstrate(uint256) - function setOwnerSubstrate(uint256 newOwner) external; } /// @dev the ERC-165 identifier for this interface is 0x63034ac5 --- a/tests/src/eth/api/UniqueNFT.sol +++ b/tests/src/eth/api/UniqueNFT.sol @@ -62,7 +62,7 @@ } /// @title A contract that allows you to work with collections. -/// @dev the ERC-165 identifier for this interface is 0x47dbc105 +/// @dev the ERC-165 identifier for this interface is 0x3e1e8083 interface Collection is Dummy, ERC165 { /// Set collection property. /// @@ -97,15 +97,6 @@ /// @dev EVM selector for this function is: 0x7623402e, /// or in textual repr: setCollectionSponsor(address) function setCollectionSponsor(address sponsor) external; - - /// Set the substrate sponsor of the collection. - /// - /// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. - /// - /// @param sponsor Substrate address of the sponsor from whose account funds will be debited for operations with the contract. - /// @dev EVM selector for this function is: 0xc74d6751, - /// or in textual repr: setCollectionSponsorSubstrate(uint256) - function setCollectionSponsorSubstrate(uint256 sponsor) external; /// Whether there is a pending sponsor. /// @dev EVM selector for this function is: 0x058ac185, @@ -161,18 +152,6 @@ /// or in textual repr: contractAddress() function contractAddress() external view returns (address); - /// Add collection admin by substrate address. - /// @param newAdmin Substrate administrator address. - /// @dev EVM selector for this function is: 0x5730062b, - /// or in textual repr: addCollectionAdminSubstrate(uint256) - function addCollectionAdminSubstrate(uint256 newAdmin) external; - - /// Remove collection admin by substrate address. - /// @param admin Substrate administrator address. - /// @dev EVM selector for this function is: 0x4048fcf9, - /// or in textual repr: removeCollectionAdminSubstrate(uint256) - function removeCollectionAdminSubstrate(uint256 admin) external; - /// Add collection admin. /// @param newAdmin Address of the added administrator. /// @dev EVM selector for this function is: 0x92e462c7, @@ -223,13 +202,6 @@ /// or in textual repr: addToCollectionAllowList(address) function addToCollectionAllowList(address user) external; - /// Add substrate user to allowed list. - /// - /// @param user User substrate address. - /// @dev EVM selector for this function is: 0xd06ad267, - /// or in textual repr: addToCollectionAllowListSubstrate(uint256) - function addToCollectionAllowListSubstrate(uint256 user) external; - /// Remove the user from the allowed list. /// /// @param user Address of a removed user. @@ -237,13 +209,6 @@ /// or in textual repr: removeFromCollectionAllowList(address) function removeFromCollectionAllowList(address user) external; - /// Remove substrate user from allowed list. - /// - /// @param user User substrate address. - /// @dev EVM selector for this function is: 0xa31913ed, - /// or in textual repr: removeFromCollectionAllowListSubstrate(uint256) - function removeFromCollectionAllowListSubstrate(uint256 user) external; - /// Switch permission for minting. /// /// @param mode Enable if "true". @@ -258,14 +223,6 @@ /// @dev EVM selector for this function is: 0x9811b0c7, /// or in textual repr: isOwnerOrAdmin(address) function isOwnerOrAdmin(address user) external view returns (bool); - - /// Check that substrate account is the owner or admin of the collection - /// - /// @param user account to verify - /// @return "true" if account is the owner or admin - /// @dev EVM selector for this function is: 0x68910e00, - /// or in textual repr: isOwnerOrAdminSubstrate(uint256) - function isOwnerOrAdminSubstrate(uint256 user) external view returns (bool); /// Returns collection type /// @@ -289,14 +246,6 @@ /// @dev EVM selector for this function is: 0x13af4035, /// or in textual repr: setOwner(address) function setOwner(address newOwner) external; - - /// Changes collection owner to another substrate account - /// - /// @dev Owner can be changed only by current owner - /// @param newOwner new owner substrate account - /// @dev EVM selector for this function is: 0xb212138f, - /// or in textual repr: setOwnerSubstrate(uint256) - function setOwnerSubstrate(uint256 newOwner) external; } /// @dev anonymous struct --- a/tests/src/eth/api/UniqueRefungible.sol +++ b/tests/src/eth/api/UniqueRefungible.sol @@ -62,7 +62,7 @@ } /// @title A contract that allows you to work with collections. -/// @dev the ERC-165 identifier for this interface is 0x47dbc105 +/// @dev the ERC-165 identifier for this interface is 0x3e1e8083 interface Collection is Dummy, ERC165 { /// Set collection property. /// @@ -97,15 +97,6 @@ /// @dev EVM selector for this function is: 0x7623402e, /// or in textual repr: setCollectionSponsor(address) function setCollectionSponsor(address sponsor) external; - - /// Set the substrate sponsor of the collection. - /// - /// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. - /// - /// @param sponsor Substrate address of the sponsor from whose account funds will be debited for operations with the contract. - /// @dev EVM selector for this function is: 0xc74d6751, - /// or in textual repr: setCollectionSponsorSubstrate(uint256) - function setCollectionSponsorSubstrate(uint256 sponsor) external; /// Whether there is a pending sponsor. /// @dev EVM selector for this function is: 0x058ac185, @@ -161,18 +152,6 @@ /// or in textual repr: contractAddress() function contractAddress() external view returns (address); - /// Add collection admin by substrate address. - /// @param newAdmin Substrate administrator address. - /// @dev EVM selector for this function is: 0x5730062b, - /// or in textual repr: addCollectionAdminSubstrate(uint256) - function addCollectionAdminSubstrate(uint256 newAdmin) external; - - /// Remove collection admin by substrate address. - /// @param admin Substrate administrator address. - /// @dev EVM selector for this function is: 0x4048fcf9, - /// or in textual repr: removeCollectionAdminSubstrate(uint256) - function removeCollectionAdminSubstrate(uint256 admin) external; - /// Add collection admin. /// @param newAdmin Address of the added administrator. /// @dev EVM selector for this function is: 0x92e462c7, @@ -223,13 +202,6 @@ /// or in textual repr: addToCollectionAllowList(address) function addToCollectionAllowList(address user) external; - /// Add substrate user to allowed list. - /// - /// @param user User substrate address. - /// @dev EVM selector for this function is: 0xd06ad267, - /// or in textual repr: addToCollectionAllowListSubstrate(uint256) - function addToCollectionAllowListSubstrate(uint256 user) external; - /// Remove the user from the allowed list. /// /// @param user Address of a removed user. @@ -237,13 +209,6 @@ /// or in textual repr: removeFromCollectionAllowList(address) function removeFromCollectionAllowList(address user) external; - /// Remove substrate user from allowed list. - /// - /// @param user User substrate address. - /// @dev EVM selector for this function is: 0xa31913ed, - /// or in textual repr: removeFromCollectionAllowListSubstrate(uint256) - function removeFromCollectionAllowListSubstrate(uint256 user) external; - /// Switch permission for minting. /// /// @param mode Enable if "true". @@ -258,14 +223,6 @@ /// @dev EVM selector for this function is: 0x9811b0c7, /// or in textual repr: isOwnerOrAdmin(address) function isOwnerOrAdmin(address user) external view returns (bool); - - /// Check that substrate account is the owner or admin of the collection - /// - /// @param user account to verify - /// @return "true" if account is the owner or admin - /// @dev EVM selector for this function is: 0x68910e00, - /// or in textual repr: isOwnerOrAdminSubstrate(uint256) - function isOwnerOrAdminSubstrate(uint256 user) external view returns (bool); /// Returns collection type /// @@ -289,14 +246,6 @@ /// @dev EVM selector for this function is: 0x13af4035, /// or in textual repr: setOwner(address) function setOwner(address newOwner) external; - - /// Changes collection owner to another substrate account - /// - /// @dev Owner can be changed only by current owner - /// @param newOwner new owner substrate account - /// @dev EVM selector for this function is: 0xb212138f, - /// or in textual repr: setOwnerSubstrate(uint256) - function setOwnerSubstrate(uint256 newOwner) external; } /// @dev anonymous struct --- a/tests/src/eth/collectionAdmin.test.ts +++ b/tests/src/eth/collectionAdmin.test.ts @@ -44,23 +44,24 @@ .to.be.eq(newAdmin.toLocaleLowerCase()); }); - itWeb3('Add substrate admin by owner', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collectionHelper = evmCollectionHelpers(web3, owner); + // TODO: Temprorary off. Need refactor + // itWeb3('Add substrate admin by owner', async ({api, web3, privateKeyWrapper}) => { + // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const collectionHelper = evmCollectionHelpers(web3, owner); - const result = await collectionHelper.methods - .createNonfungibleCollection('A', 'B', 'C') - .send(); - const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); + // const result = await collectionHelper.methods + // .createNonfungibleCollection('A', 'B', 'C') + // .send(); + // const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); - const newAdmin = privateKeyWrapper('//Alice'); - const collectionEvm = evmCollection(web3, owner, collectionIdAddress); - await collectionEvm.methods.addCollectionAdminSubstrate(newAdmin.addressRaw).send(); + // const newAdmin = privateKeyWrapper('//Alice'); + // const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + // await collectionEvm.methods.addCollectionAdminSubstrate(newAdmin.addressRaw).send(); - const adminList = await api.rpc.unique.adminlist(collectionId); - expect(adminList[0].asSubstrate.toString().toLocaleLowerCase()) - .to.be.eq(newAdmin.address.toLocaleLowerCase()); - }); + // const adminList = await api.rpc.unique.adminlist(collectionId); + // expect(adminList[0].asSubstrate.toString().toLocaleLowerCase()) + // .to.be.eq(newAdmin.address.toLocaleLowerCase()); + // }); itWeb3('Verify owner or admin', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); @@ -121,47 +122,49 @@ expect(adminList.length).to.be.eq(0); }); - itWeb3('(!negative tests!) Add substrate admin by ADMIN is not allowed', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collectionHelper = evmCollectionHelpers(web3, owner); + // TODO: Temprorary off. Need refactor + // itWeb3('(!negative tests!) Add substrate admin by ADMIN is not allowed', async ({api, web3, privateKeyWrapper}) => { + // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const collectionHelper = evmCollectionHelpers(web3, owner); - const result = await collectionHelper.methods - .createNonfungibleCollection('A', 'B', 'C') - .send(); - const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); + // const result = await collectionHelper.methods + // .createNonfungibleCollection('A', 'B', 'C') + // .send(); + // const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); - const admin = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collectionEvm = evmCollection(web3, owner, collectionIdAddress); - await collectionEvm.methods.addCollectionAdmin(admin).send(); + // const admin = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + // await collectionEvm.methods.addCollectionAdmin(admin).send(); - const notAdmin = privateKey('//Alice'); - await expect(collectionEvm.methods.addCollectionAdminSubstrate(notAdmin.addressRaw).call({from: admin})) - .to.be.rejectedWith('NoPermission'); + // const notAdmin = privateKey('//Alice'); + // await expect(collectionEvm.methods.addCollectionAdminSubstrate(notAdmin.addressRaw).call({from: admin})) + // .to.be.rejectedWith('NoPermission'); - const adminList = await api.rpc.unique.adminlist(collectionId); - expect(adminList.length).to.be.eq(1); - expect(adminList[0].asEthereum.toString().toLocaleLowerCase()) - .to.be.eq(admin.toLocaleLowerCase()); - }); + // const adminList = await api.rpc.unique.adminlist(collectionId); + // expect(adminList.length).to.be.eq(1); + // expect(adminList[0].asEthereum.toString().toLocaleLowerCase()) + // .to.be.eq(admin.toLocaleLowerCase()); + // }); - itWeb3('(!negative tests!) Add substrate admin by USER is not allowed', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collectionHelper = evmCollectionHelpers(web3, owner); + // TODO: Temprorary off. Need refactor + // itWeb3('(!negative tests!) Add substrate admin by USER is not allowed', async ({api, web3, privateKeyWrapper}) => { + // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const collectionHelper = evmCollectionHelpers(web3, owner); - const result = await collectionHelper.methods - .createNonfungibleCollection('A', 'B', 'C') - .send(); - const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); + // const result = await collectionHelper.methods + // .createNonfungibleCollection('A', 'B', 'C') + // .send(); + // const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); - const notAdmin0 = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collectionEvm = evmCollection(web3, owner, collectionIdAddress); - const notAdmin1 = privateKey('//Alice'); - await expect(collectionEvm.methods.addCollectionAdminSubstrate(notAdmin1.addressRaw).call({from: notAdmin0})) - .to.be.rejectedWith('NoPermission'); + // const notAdmin0 = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + // const notAdmin1 = privateKey('//Alice'); + // await expect(collectionEvm.methods.addCollectionAdminSubstrate(notAdmin1.addressRaw).call({from: notAdmin0})) + // .to.be.rejectedWith('NoPermission'); - const adminList = await api.rpc.unique.adminlist(collectionId); - expect(adminList.length).to.be.eq(0); - }); + // const adminList = await api.rpc.unique.adminlist(collectionId); + // expect(adminList.length).to.be.eq(0); + // }); }); describe('Remove collection admins', () => { @@ -189,28 +192,29 @@ expect(adminList.length).to.be.eq(0); }); - itWeb3('Remove substrate admin by owner', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collectionHelper = evmCollectionHelpers(web3, owner); + // TODO: Temprorary off. Need refactor + // itWeb3('Remove substrate admin by owner', async ({api, web3, privateKeyWrapper}) => { + // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const collectionHelper = evmCollectionHelpers(web3, owner); - const result = await collectionHelper.methods - .createNonfungibleCollection('A', 'B', 'C') - .send(); - const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); + // const result = await collectionHelper.methods + // .createNonfungibleCollection('A', 'B', 'C') + // .send(); + // const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); - const newAdmin = privateKeyWrapper('//Alice'); - const collectionEvm = evmCollection(web3, owner, collectionIdAddress); - await collectionEvm.methods.addCollectionAdminSubstrate(newAdmin.addressRaw).send(); - { - const adminList = await api.rpc.unique.adminlist(collectionId); - expect(adminList[0].asSubstrate.toString().toLocaleLowerCase()) - .to.be.eq(newAdmin.address.toLocaleLowerCase()); - } + // const newAdmin = privateKeyWrapper('//Alice'); + // const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + // await collectionEvm.methods.addCollectionAdminSubstrate(newAdmin.addressRaw).send(); + // { + // const adminList = await api.rpc.unique.adminlist(collectionId); + // expect(adminList[0].asSubstrate.toString().toLocaleLowerCase()) + // .to.be.eq(newAdmin.address.toLocaleLowerCase()); + // } - await collectionEvm.methods.removeCollectionAdminSubstrate(newAdmin.addressRaw).send(); - const adminList = await api.rpc.unique.adminlist(collectionId); - expect(adminList.length).to.be.eq(0); - }); + // await collectionEvm.methods.removeCollectionAdminSubstrate(newAdmin.addressRaw).send(); + // const adminList = await api.rpc.unique.adminlist(collectionId); + // expect(adminList.length).to.be.eq(0); + // }); itWeb3('(!negative tests!) Remove admin by ADMIN is not allowed', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); @@ -264,53 +268,55 @@ } }); - itWeb3('(!negative tests!) Remove substrate admin by ADMIN is not allowed', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collectionHelper = evmCollectionHelpers(web3, owner); + // TODO: Temprorary off. Need refactor + // itWeb3('(!negative tests!) Remove substrate admin by ADMIN is not allowed', async ({api, web3, privateKeyWrapper}) => { + // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const collectionHelper = evmCollectionHelpers(web3, owner); - const result = await collectionHelper.methods - .createNonfungibleCollection('A', 'B', 'C') - .send(); - const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); + // const result = await collectionHelper.methods + // .createNonfungibleCollection('A', 'B', 'C') + // .send(); + // const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); - const adminSub = privateKeyWrapper('//Alice'); - const collectionEvm = evmCollection(web3, owner, collectionIdAddress); - await collectionEvm.methods.addCollectionAdminSubstrate(adminSub.addressRaw).send(); - const adminEth = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - await collectionEvm.methods.addCollectionAdmin(adminEth).send(); + // const adminSub = privateKeyWrapper('//Alice'); + // const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + // await collectionEvm.methods.addCollectionAdminSubstrate(adminSub.addressRaw).send(); + // const adminEth = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // await collectionEvm.methods.addCollectionAdmin(adminEth).send(); - await expect(collectionEvm.methods.removeCollectionAdminSubstrate(adminSub.addressRaw).call({from: adminEth})) - .to.be.rejectedWith('NoPermission'); + // await expect(collectionEvm.methods.removeCollectionAdminSubstrate(adminSub.addressRaw).call({from: adminEth})) + // .to.be.rejectedWith('NoPermission'); - const adminList = await api.rpc.unique.adminlist(collectionId); - expect(adminList.length).to.be.eq(2); - expect(adminList.toString().toLocaleLowerCase()) - .to.be.deep.contains(adminSub.address.toLocaleLowerCase()) - .to.be.deep.contains(adminEth.toLocaleLowerCase()); - }); + // const adminList = await api.rpc.unique.adminlist(collectionId); + // expect(adminList.length).to.be.eq(2); + // expect(adminList.toString().toLocaleLowerCase()) + // .to.be.deep.contains(adminSub.address.toLocaleLowerCase()) + // .to.be.deep.contains(adminEth.toLocaleLowerCase()); + // }); - itWeb3('(!negative tests!) Remove substrate admin by USER is not allowed', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collectionHelper = evmCollectionHelpers(web3, owner); + // TODO: Temprorary off. Need refactor + // itWeb3('(!negative tests!) Remove substrate admin by USER is not allowed', async ({api, web3, privateKeyWrapper}) => { + // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const collectionHelper = evmCollectionHelpers(web3, owner); - const result = await collectionHelper.methods - .createNonfungibleCollection('A', 'B', 'C') - .send(); - const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); + // const result = await collectionHelper.methods + // .createNonfungibleCollection('A', 'B', 'C') + // .send(); + // const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); - const adminSub = privateKeyWrapper('//Alice'); - const collectionEvm = evmCollection(web3, owner, collectionIdAddress); - await collectionEvm.methods.addCollectionAdminSubstrate(adminSub.addressRaw).send(); - const notAdminEth = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const adminSub = privateKeyWrapper('//Alice'); + // const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + // await collectionEvm.methods.addCollectionAdminSubstrate(adminSub.addressRaw).send(); + // const notAdminEth = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - await expect(collectionEvm.methods.removeCollectionAdminSubstrate(adminSub.addressRaw).call({from: notAdminEth})) - .to.be.rejectedWith('NoPermission'); + // await expect(collectionEvm.methods.removeCollectionAdminSubstrate(adminSub.addressRaw).call({from: notAdminEth})) + // .to.be.rejectedWith('NoPermission'); - const adminList = await api.rpc.unique.adminlist(collectionId); - expect(adminList.length).to.be.eq(1); - expect(adminList[0].asSubstrate.toString().toLocaleLowerCase()) - .to.be.eq(adminSub.address.toLocaleLowerCase()); - }); + // const adminList = await api.rpc.unique.adminlist(collectionId); + // expect(adminList.length).to.be.eq(1); + // expect(adminList[0].asSubstrate.toString().toLocaleLowerCase()) + // .to.be.eq(adminSub.address.toLocaleLowerCase()); + // }); }); describe('Change owner tests', () => { @@ -361,52 +367,55 @@ }); describe('Change substrate owner tests', () => { - itWeb3('Change owner', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const newOwner = privateKeyWrapper('//Alice'); - const collectionHelper = evmCollectionHelpers(web3, owner); - const result = await collectionHelper.methods - .createNonfungibleCollection('A', 'B', 'C') - .send(); - const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); - const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + // TODO: Temprorary off. Need refactor + // itWeb3('Change owner', async ({api, web3, privateKeyWrapper}) => { + // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const newOwner = privateKeyWrapper('//Alice'); + // const collectionHelper = evmCollectionHelpers(web3, owner); + // const result = await collectionHelper.methods + // .createNonfungibleCollection('A', 'B', 'C') + // .send(); + // const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); + // const collectionEvm = evmCollection(web3, owner, collectionIdAddress); - expect(await collectionEvm.methods.isOwnerOrAdmin(owner).call()).to.be.true; - expect(await collectionEvm.methods.isOwnerOrAdminSubstrate(newOwner.addressRaw).call()).to.be.false; + // expect(await collectionEvm.methods.isOwnerOrAdmin(owner).call()).to.be.true; + // expect(await collectionEvm.methods.isOwnerOrAdminSubstrate(newOwner.addressRaw).call()).to.be.false; - await collectionEvm.methods.setOwnerSubstrate(newOwner.addressRaw).send(); + // await collectionEvm.methods.setOwnerSubstrate(newOwner.addressRaw).send(); - expect(await collectionEvm.methods.isOwnerOrAdmin(owner).call()).to.be.false; - expect(await collectionEvm.methods.isOwnerOrAdminSubstrate(newOwner.addressRaw).call()).to.be.true; - }); + // expect(await collectionEvm.methods.isOwnerOrAdmin(owner).call()).to.be.false; + // expect(await collectionEvm.methods.isOwnerOrAdminSubstrate(newOwner.addressRaw).call()).to.be.true; + // }); - itWeb3('change owner call fee', async ({web3, api, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const newOwner = privateKeyWrapper('//Alice'); - const collectionHelper = evmCollectionHelpers(web3, owner); - const result = await collectionHelper.methods - .createNonfungibleCollection('A', 'B', 'C') - .send(); - const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); - const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + // TODO: Temprorary off. Need refactor + // itWeb3('change owner call fee', async ({web3, api, privateKeyWrapper}) => { + // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const newOwner = privateKeyWrapper('//Alice'); + // const collectionHelper = evmCollectionHelpers(web3, owner); + // const result = await collectionHelper.methods + // .createNonfungibleCollection('A', 'B', 'C') + // .send(); + // const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); + // const collectionEvm = evmCollection(web3, owner, collectionIdAddress); - const cost = await recordEthFee(api, owner, () => collectionEvm.methods.setOwnerSubstrate(newOwner.addressRaw).send()); - expect(cost < BigInt(0.2 * Number(UNIQUE))); - expect(cost > 0); - }); + // const cost = await recordEthFee(api, owner, () => collectionEvm.methods.setOwnerSubstrate(newOwner.addressRaw).send()); + // expect(cost < BigInt(0.2 * Number(UNIQUE))); + // expect(cost > 0); + // }); - itWeb3('(!negative tests!) call setOwner by non owner', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const otherReceiver = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const newOwner = privateKeyWrapper('//Alice'); - const collectionHelper = evmCollectionHelpers(web3, owner); - const result = await collectionHelper.methods - .createNonfungibleCollection('A', 'B', 'C') - .send(); - const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); - const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + // TODO: Temprorary off. Need refactor + // itWeb3('(!negative tests!) call setOwner by non owner', async ({api, web3, privateKeyWrapper}) => { + // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const otherReceiver = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const newOwner = privateKeyWrapper('//Alice'); + // const collectionHelper = evmCollectionHelpers(web3, owner); + // const result = await collectionHelper.methods + // .createNonfungibleCollection('A', 'B', 'C') + // .send(); + // const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); + // const collectionEvm = evmCollection(web3, owner, collectionIdAddress); - await expect(collectionEvm.methods.setOwnerSubstrate(newOwner.addressRaw).send({from: otherReceiver})).to.be.rejected; - expect(await collectionEvm.methods.isOwnerOrAdminSubstrate(newOwner.addressRaw).call()).to.be.false; - }); + // await expect(collectionEvm.methods.setOwnerSubstrate(newOwner.addressRaw).send({from: otherReceiver})).to.be.rejected; + // expect(await collectionEvm.methods.isOwnerOrAdminSubstrate(newOwner.addressRaw).call()).to.be.false; + // }); }); \ No newline at end of file --- a/tests/src/eth/collectionSponsoring.test.ts +++ b/tests/src/eth/collectionSponsoring.test.ts @@ -40,25 +40,26 @@ ]); }); - itWeb3('Set substrate sponsor', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collectionHelpers = evmCollectionHelpers(web3, owner); - let result = await collectionHelpers.methods.createNonfungibleCollection('Sponsor collection', '1', '1').send(); - const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); - const sponsor = privateKeyWrapper('//Alice'); - const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + // TODO: Temprorary off. Need refactor + // itWeb3('Set substrate sponsor', async ({api, web3, privateKeyWrapper}) => { + // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const collectionHelpers = evmCollectionHelpers(web3, owner); + // let result = await collectionHelpers.methods.createNonfungibleCollection('Sponsor collection', '1', '1').send(); + // const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); + // const sponsor = privateKeyWrapper('//Alice'); + // const collectionEvm = evmCollection(web3, owner, collectionIdAddress); - expect(await collectionEvm.methods.hasCollectionPendingSponsor().call({from: owner})).to.be.false; - result = await collectionEvm.methods.setCollectionSponsorSubstrate(sponsor.addressRaw).send({from: owner}); - expect(await collectionEvm.methods.hasCollectionPendingSponsor().call({from: owner})).to.be.true; + // expect(await collectionEvm.methods.hasCollectionPendingSponsor().call({from: owner})).to.be.false; + // result = await collectionEvm.methods.setCollectionSponsorSubstrate(sponsor.addressRaw).send({from: owner}); + // expect(await collectionEvm.methods.hasCollectionPendingSponsor().call({from: owner})).to.be.true; - const confirmTx = await api.tx.unique.confirmSponsorship(collectionId); - await submitTransactionAsync(sponsor, confirmTx); - expect(await collectionEvm.methods.hasCollectionPendingSponsor().call({from: owner})).to.be.false; + // const confirmTx = await api.tx.unique.confirmSponsorship(collectionId); + // await submitTransactionAsync(sponsor, confirmTx); + // expect(await collectionEvm.methods.hasCollectionPendingSponsor().call({from: owner})).to.be.false; - const sponsorTuple = await collectionEvm.methods.collectionSponsor().call({from: owner}); - expect(bigIntToSub(api, BigInt(sponsorTuple[1]))).to.be.eq(sponsor.address); - }); + // const sponsorTuple = await collectionEvm.methods.collectionSponsor().call({from: owner}); + // expect(bigIntToSub(api, BigInt(sponsorTuple[1]))).to.be.eq(sponsor.address); + // }); itWeb3('Remove sponsor', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); @@ -150,60 +151,61 @@ } }); - itWeb3('Sponsoring collection from substrate address via access list', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collectionHelpers = evmCollectionHelpers(web3, owner); - const result = await collectionHelpers.methods.createNonfungibleCollection('Sponsor collection', '1', '1').send(); - const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); - const sponsor = privateKeyWrapper('//Alice'); - const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + // TODO: Temprorary off. Need refactor + // itWeb3('Sponsoring collection from substrate address via access list', async ({api, web3, privateKeyWrapper}) => { + // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const collectionHelpers = evmCollectionHelpers(web3, owner); + // const result = await collectionHelpers.methods.createNonfungibleCollection('Sponsor collection', '1', '1').send(); + // const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); + // const sponsor = privateKeyWrapper('//Alice'); + // const collectionEvm = evmCollection(web3, owner, collectionIdAddress); - await collectionEvm.methods.setCollectionSponsorSubstrate(sponsor.addressRaw).send({from: owner}); + // await collectionEvm.methods.setCollectionSponsorSubstrate(sponsor.addressRaw).send({from: owner}); - const confirmTx = await api.tx.unique.confirmSponsorship(collectionId); - await submitTransactionAsync(sponsor, confirmTx); + // const confirmTx = await api.tx.unique.confirmSponsorship(collectionId); + // await submitTransactionAsync(sponsor, confirmTx); - const user = createEthAccount(web3); - const nextTokenId = await collectionEvm.methods.nextTokenId().call(); - expect(nextTokenId).to.be.equal('1'); + // const user = createEthAccount(web3); + // const nextTokenId = await collectionEvm.methods.nextTokenId().call(); + // expect(nextTokenId).to.be.equal('1'); - await collectionEvm.methods.setCollectionAccess(1 /*'AllowList'*/).send({from: owner}); - await collectionEvm.methods.addToCollectionAllowList(user).send({from: owner}); - await collectionEvm.methods.setCollectionMintMode(true).send({from: owner}); + // await collectionEvm.methods.setCollectionAccess(1 /*'AllowList'*/).send({from: owner}); + // await collectionEvm.methods.addToCollectionAllowList(user).send({from: owner}); + // await collectionEvm.methods.setCollectionMintMode(true).send({from: owner}); - const ownerBalanceBefore = await ethBalanceViaSub(api, owner); - const sponsorBalanceBefore = (await getBalance(api, [sponsor.address]))[0]; + // const ownerBalanceBefore = await ethBalanceViaSub(api, owner); + // const sponsorBalanceBefore = (await getBalance(api, [sponsor.address]))[0]; - { - const nextTokenId = await collectionEvm.methods.nextTokenId().call(); - expect(nextTokenId).to.be.equal('1'); - const result = await collectionEvm.methods.mintWithTokenURI( - user, - nextTokenId, - 'Test URI', - ).send({from: user}); - const events = normalizeEvents(result.events); + // { + // const nextTokenId = await collectionEvm.methods.nextTokenId().call(); + // expect(nextTokenId).to.be.equal('1'); + // const result = await collectionEvm.methods.mintWithTokenURI( + // user, + // nextTokenId, + // 'Test URI', + // ).send({from: user}); + // const events = normalizeEvents(result.events); - expect(events).to.be.deep.equal([ - { - address: collectionIdAddress, - event: 'Transfer', - args: { - from: '0x0000000000000000000000000000000000000000', - to: user, - tokenId: nextTokenId, - }, - }, - ]); + // expect(events).to.be.deep.equal([ + // { + // address: collectionIdAddress, + // event: 'Transfer', + // args: { + // from: '0x0000000000000000000000000000000000000000', + // to: user, + // tokenId: nextTokenId, + // }, + // }, + // ]); - const ownerBalanceAfter = await ethBalanceViaSub(api, owner); - const sponsorBalanceAfter = (await getBalance(api, [sponsor.address]))[0]; + // const ownerBalanceAfter = await ethBalanceViaSub(api, owner); + // const sponsorBalanceAfter = (await getBalance(api, [sponsor.address]))[0]; - expect(await collectionEvm.methods.tokenURI(nextTokenId).call()).to.be.equal('Test URI'); - expect(ownerBalanceBefore).to.be.eq(ownerBalanceAfter); - expect(sponsorBalanceBefore > sponsorBalanceAfter).to.be.true; - } - }); + // expect(await collectionEvm.methods.tokenURI(nextTokenId).call()).to.be.equal('Test URI'); + // expect(ownerBalanceBefore).to.be.eq(ownerBalanceAfter); + // expect(sponsorBalanceBefore > sponsorBalanceAfter).to.be.true; + // } + // }); itWeb3('Check that transaction via EVM spend money from sponsor address', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); --- a/tests/src/eth/fungibleAbi.json +++ b/tests/src/eth/fungibleAbi.json @@ -60,27 +60,9 @@ }, { "inputs": [ - { "internalType": "uint256", "name": "newAdmin", "type": "uint256" } - ], - "name": "addCollectionAdminSubstrate", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ { "internalType": "address", "name": "user", "type": "address" } ], "name": "addToCollectionAllowList", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "user", "type": "uint256" } - ], - "name": "addToCollectionAllowListSubstrate", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -214,15 +196,6 @@ { "internalType": "address", "name": "user", "type": "address" } ], "name": "isOwnerOrAdmin", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "user", "type": "uint256" } - ], - "name": "isOwnerOrAdminSubstrate", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" @@ -271,15 +244,6 @@ "type": "function" }, { - "inputs": [ - { "internalType": "uint256", "name": "admin", "type": "uint256" } - ], - "name": "removeCollectionAdminSubstrate", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { "inputs": [], "name": "removeCollectionSponsor", "outputs": [], @@ -291,15 +255,6 @@ { "internalType": "address", "name": "user", "type": "address" } ], "name": "removeFromCollectionAllowList", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "user", "type": "uint256" } - ], - "name": "removeFromCollectionAllowListSubstrate", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -380,27 +335,9 @@ }, { "inputs": [ - { "internalType": "uint256", "name": "sponsor", "type": "uint256" } - ], - "name": "setCollectionSponsorSubstrate", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ { "internalType": "address", "name": "newOwner", "type": "address" } ], "name": "setOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "newOwner", "type": "uint256" } - ], - "name": "setOwnerSubstrate", "outputs": [], "stateMutability": "nonpayable", "type": "function" --- a/tests/src/eth/nonFungibleAbi.json +++ b/tests/src/eth/nonFungibleAbi.json @@ -91,27 +91,9 @@ }, { "inputs": [ - { "internalType": "uint256", "name": "newAdmin", "type": "uint256" } - ], - "name": "addCollectionAdminSubstrate", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ { "internalType": "address", "name": "user", "type": "address" } ], "name": "addToCollectionAllowList", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "user", "type": "uint256" } - ], - "name": "addToCollectionAllowListSubstrate", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -273,15 +255,6 @@ { "internalType": "address", "name": "user", "type": "address" } ], "name": "isOwnerOrAdmin", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "user", "type": "uint256" } - ], - "name": "isOwnerOrAdminSubstrate", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" @@ -385,15 +358,6 @@ "type": "function" }, { - "inputs": [ - { "internalType": "uint256", "name": "admin", "type": "uint256" } - ], - "name": "removeCollectionAdminSubstrate", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { "inputs": [], "name": "removeCollectionSponsor", "outputs": [], @@ -405,15 +369,6 @@ { "internalType": "address", "name": "user", "type": "address" } ], "name": "removeFromCollectionAllowList", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "user", "type": "uint256" } - ], - "name": "removeFromCollectionAllowListSubstrate", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -527,27 +482,9 @@ }, { "inputs": [ - { "internalType": "uint256", "name": "sponsor", "type": "uint256" } - ], - "name": "setCollectionSponsorSubstrate", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ { "internalType": "address", "name": "newOwner", "type": "address" } ], "name": "setOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "newOwner", "type": "uint256" } - ], - "name": "setOwnerSubstrate", "outputs": [], "stateMutability": "nonpayable", "type": "function" --- a/tests/src/eth/reFungibleAbi.json +++ b/tests/src/eth/reFungibleAbi.json @@ -91,27 +91,9 @@ }, { "inputs": [ - { "internalType": "uint256", "name": "newAdmin", "type": "uint256" } - ], - "name": "addCollectionAdminSubstrate", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ { "internalType": "address", "name": "user", "type": "address" } ], "name": "addToCollectionAllowList", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "user", "type": "uint256" } - ], - "name": "addToCollectionAllowListSubstrate", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -273,15 +255,6 @@ { "internalType": "address", "name": "user", "type": "address" } ], "name": "isOwnerOrAdmin", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "user", "type": "uint256" } - ], - "name": "isOwnerOrAdminSubstrate", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" @@ -385,15 +358,6 @@ "type": "function" }, { - "inputs": [ - { "internalType": "uint256", "name": "admin", "type": "uint256" } - ], - "name": "removeCollectionAdminSubstrate", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { "inputs": [], "name": "removeCollectionSponsor", "outputs": [], @@ -405,15 +369,6 @@ { "internalType": "address", "name": "user", "type": "address" } ], "name": "removeFromCollectionAllowList", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "user", "type": "uint256" } - ], - "name": "removeFromCollectionAllowListSubstrate", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -527,27 +482,9 @@ }, { "inputs": [ - { "internalType": "uint256", "name": "sponsor", "type": "uint256" } - ], - "name": "setCollectionSponsorSubstrate", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ { "internalType": "address", "name": "newOwner", "type": "address" } ], "name": "setOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "newOwner", "type": "uint256" } - ], - "name": "setOwnerSubstrate", "outputs": [], "stateMutability": "nonpayable", "type": "function" -- gitstuff