difftreelog
add `collectionHelperAddress` method to `ERC721` & `ERC20` interfaces.
in: master
14 files changed
pallets/fungible/src/erc.rsdiffbeforeafterboth1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617//! ERC-20 standart support implementation.1819extern crate alloc;20use core::char::{REPLACEMENT_CHARACTER, decode_utf16};21use core::convert::TryInto;22use evm_coder::{23 abi::AbiType, ToLog, execution::*, generate_stubgen, solidity, solidity_interface, types::*,24 weight,25};26use up_data_structs::CollectionMode;27use pallet_common::erc::{CommonEvmHandler, PrecompileResult};28use sp_std::vec::Vec;29use pallet_evm::{account::CrossAccountId, PrecompileHandle};30use pallet_evm_coder_substrate::{call, dispatch_to_evm};31use pallet_structure::{SelfWeightOf as StructureWeight, weights::WeightInfo as _};32use pallet_common::{CollectionHandle, erc::CollectionCall};3334use crate::{35 Allowance, Balance, Config, FungibleHandle, Pallet, SelfWeightOf, TotalSupply,36 weights::WeightInfo,37};3839#[derive(ToLog)]40pub enum ERC20Events {41 Transfer {42 #[indexed]43 from: address,44 #[indexed]45 to: address,46 value: uint256,47 },48 Approval {49 #[indexed]50 owner: address,51 #[indexed]52 spender: address,53 value: uint256,54 },55}5657#[solidity_interface(name = ERC20, events(ERC20Events))]58impl<T: Config> FungibleHandle<T> {59 fn name(&self) -> Result<string> {60 Ok(decode_utf16(self.name.iter().copied())61 .map(|r| r.unwrap_or(REPLACEMENT_CHARACTER))62 .collect::<string>())63 }64 fn symbol(&self) -> Result<string> {65 Ok(string::from_utf8_lossy(&self.token_prefix).into())66 }67 fn total_supply(&self) -> Result<uint256> {68 self.consume_store_reads(1)?;69 Ok(<TotalSupply<T>>::get(self.id).into())70 }7172 fn decimals(&self) -> Result<uint8> {73 Ok(if let CollectionMode::Fungible(decimals) = &self.mode {74 *decimals75 } else {76 unreachable!()77 })78 }79 fn balance_of(&self, owner: address) -> Result<uint256> {80 self.consume_store_reads(1)?;81 let owner = T::CrossAccountId::from_eth(owner);82 let balance = <Balance<T>>::get((self.id, owner));83 Ok(balance.into())84 }85 #[weight(<SelfWeightOf<T>>::transfer())]86 fn transfer(&mut self, caller: caller, to: address, amount: uint256) -> Result<bool> {87 let caller = T::CrossAccountId::from_eth(caller);88 let to = T::CrossAccountId::from_eth(to);89 let amount = amount.try_into().map_err(|_| "amount overflow")?;90 let budget = self91 .recorder92 .weight_calls_budget(<StructureWeight<T>>::find_parent());9394 <Pallet<T>>::transfer(self, &caller, &to, amount, &budget).map_err(|_| "transfer error")?;95 Ok(true)96 }9798 #[weight(<SelfWeightOf<T>>::transfer_from())]99 fn transfer_from(100 &mut self,101 caller: caller,102 from: address,103 to: address,104 amount: uint256,105 ) -> Result<bool> {106 let caller = T::CrossAccountId::from_eth(caller);107 let from = T::CrossAccountId::from_eth(from);108 let to = T::CrossAccountId::from_eth(to);109 let amount = amount.try_into().map_err(|_| "amount overflow")?;110 let budget = self111 .recorder112 .weight_calls_budget(<StructureWeight<T>>::find_parent());113114 <Pallet<T>>::transfer_from(self, &caller, &from, &to, amount, &budget)115 .map_err(dispatch_to_evm::<T>)?;116 Ok(true)117 }118 #[weight(<SelfWeightOf<T>>::approve())]119 fn approve(&mut self, caller: caller, spender: address, amount: uint256) -> Result<bool> {120 let caller = T::CrossAccountId::from_eth(caller);121 let spender = T::CrossAccountId::from_eth(spender);122 let amount = amount.try_into().map_err(|_| "amount overflow")?;123124 <Pallet<T>>::set_allowance(self, &caller, &spender, amount)125 .map_err(dispatch_to_evm::<T>)?;126 Ok(true)127 }128 fn allowance(&self, owner: address, spender: address) -> Result<uint256> {129 self.consume_store_reads(1)?;130 let owner = T::CrossAccountId::from_eth(owner);131 let spender = T::CrossAccountId::from_eth(spender);132133 Ok(<Allowance<T>>::get((self.id, owner, spender)).into())134 }135}136137#[solidity_interface(name = ERC20Mintable)]138impl<T: Config> FungibleHandle<T> {139 /// Mint tokens for `to` account.140 /// @param to account that will receive minted tokens141 /// @param amount amount of tokens to mint142 #[weight(<SelfWeightOf<T>>::create_item())]143 fn mint(&mut self, caller: caller, to: address, amount: uint256) -> Result<bool> {144 let caller = T::CrossAccountId::from_eth(caller);145 let to = T::CrossAccountId::from_eth(to);146 let amount = amount.try_into().map_err(|_| "amount overflow")?;147 let budget = self148 .recorder149 .weight_calls_budget(<StructureWeight<T>>::find_parent());150 <Pallet<T>>::create_item(&self, &caller, (to, amount), &budget)151 .map_err(dispatch_to_evm::<T>)?;152 Ok(true)153 }154}155156#[solidity_interface(name = ERC20UniqueExtensions)]157impl<T: Config> FungibleHandle<T>158where159 T::AccountId: From<[u8; 32]>,160{161 /// @notice A description for the collection.162 fn description(&self) -> Result<string> {163 Ok(decode_utf16(self.description.iter().copied())164 .map(|r| r.unwrap_or(REPLACEMENT_CHARACTER))165 .collect::<string>())166 }167168 #[weight(<SelfWeightOf<T>>::approve())]169 fn approve_cross(170 &mut self,171 caller: caller,172 spender: EthCrossAccount,173 amount: uint256,174 ) -> Result<bool> {175 let caller = T::CrossAccountId::from_eth(caller);176 let spender = spender.into_sub_cross_account::<T>()?;177 let amount = amount.try_into().map_err(|_| "amount overflow")?;178179 <Pallet<T>>::set_allowance(self, &caller, &spender, amount)180 .map_err(dispatch_to_evm::<T>)?;181 Ok(true)182 }183184 /// Burn tokens from account185 /// @dev Function that burns an `amount` of the tokens of a given account,186 /// deducting from the sender's allowance for said account.187 /// @param from The account whose tokens will be burnt.188 /// @param amount The amount that will be burnt.189 #[solidity(hide)]190 #[weight(<SelfWeightOf<T>>::burn_from())]191 fn burn_from(&mut self, caller: caller, from: address, amount: uint256) -> Result<bool> {192 let caller = T::CrossAccountId::from_eth(caller);193 let from = T::CrossAccountId::from_eth(from);194 let amount = amount.try_into().map_err(|_| "amount overflow")?;195 let budget = self196 .recorder197 .weight_calls_budget(<StructureWeight<T>>::find_parent());198199 <Pallet<T>>::burn_from(self, &caller, &from, amount, &budget)200 .map_err(dispatch_to_evm::<T>)?;201 Ok(true)202 }203204 /// Burn tokens from account205 /// @dev Function that burns an `amount` of the tokens of a given account,206 /// deducting from the sender's allowance for said account.207 /// @param from The account whose tokens will be burnt.208 /// @param amount The amount that will be burnt.209 #[weight(<SelfWeightOf<T>>::burn_from())]210 fn burn_from_cross(211 &mut self,212 caller: caller,213 from: EthCrossAccount,214 amount: uint256,215 ) -> Result<bool> {216 let caller = T::CrossAccountId::from_eth(caller);217 let from = from.into_sub_cross_account::<T>()?;218 let amount = amount.try_into().map_err(|_| "amount overflow")?;219 let budget = self220 .recorder221 .weight_calls_budget(<StructureWeight<T>>::find_parent());222223 <Pallet<T>>::burn_from(self, &caller, &from, amount, &budget)224 .map_err(dispatch_to_evm::<T>)?;225 Ok(true)226 }227228 /// Mint tokens for multiple accounts.229 /// @param amounts array of pairs of account address and amount230 #[weight(<SelfWeightOf<T>>::create_multiple_items_ex(amounts.len() as u32))]231 fn mint_bulk(&mut self, caller: caller, amounts: Vec<(address, uint256)>) -> Result<bool> {232 let caller = T::CrossAccountId::from_eth(caller);233 let budget = self234 .recorder235 .weight_calls_budget(<StructureWeight<T>>::find_parent());236 let amounts = amounts237 .into_iter()238 .map(|(to, amount)| {239 Ok((240 T::CrossAccountId::from_eth(to),241 amount.try_into().map_err(|_| "amount overflow")?,242 ))243 })244 .collect::<Result<_>>()?;245246 <Pallet<T>>::create_multiple_items(&self, &caller, amounts, &budget)247 .map_err(dispatch_to_evm::<T>)?;248 Ok(true)249 }250251 #[weight(<SelfWeightOf<T>>::transfer())]252 fn transfer_cross(253 &mut self,254 caller: caller,255 to: EthCrossAccount,256 amount: uint256,257 ) -> Result<bool> {258 let caller = T::CrossAccountId::from_eth(caller);259 let to = to.into_sub_cross_account::<T>()?;260 let amount = amount.try_into().map_err(|_| "amount overflow")?;261 let budget = self262 .recorder263 .weight_calls_budget(<StructureWeight<T>>::find_parent());264265 <Pallet<T>>::transfer(self, &caller, &to, amount, &budget).map_err(|_| "transfer error")?;266 Ok(true)267 }268269 #[weight(<SelfWeightOf<T>>::transfer_from())]270 fn transfer_from_cross(271 &mut self,272 caller: caller,273 from: EthCrossAccount,274 to: EthCrossAccount,275 amount: uint256,276 ) -> Result<bool> {277 let caller = T::CrossAccountId::from_eth(caller);278 let from = from.into_sub_cross_account::<T>()?;279 let to = to.into_sub_cross_account::<T>()?;280 let amount = amount.try_into().map_err(|_| "amount overflow")?;281 let budget = self282 .recorder283 .weight_calls_budget(<StructureWeight<T>>::find_parent());284285 <Pallet<T>>::transfer_from(self, &caller, &from, &to, amount, &budget)286 .map_err(dispatch_to_evm::<T>)?;287 Ok(true)288 }289}290291#[solidity_interface(292 name = UniqueFungible,293 is(294 ERC20,295 ERC20Mintable,296 ERC20UniqueExtensions,297 Collection(via(common_mut returns CollectionHandle<T>)),298 )299)]300impl<T: Config> FungibleHandle<T> where T::AccountId: From<[u8; 32]> + AsRef<[u8; 32]> {}301302generate_stubgen!(gen_impl, UniqueFungibleCall<()>, true);303generate_stubgen!(gen_iface, UniqueFungibleCall<()>, false);304305impl<T: Config> CommonEvmHandler for FungibleHandle<T>306where307 T::AccountId: From<[u8; 32]> + AsRef<[u8; 32]>,308{309 const CODE: &'static [u8] = include_bytes!("./stubs/UniqueFungible.raw");310311 fn call(self, handle: &mut impl PrecompileHandle) -> Option<PrecompileResult> {312 call::<T, UniqueFungibleCall<T>, _, _>(handle, self)313 }314}pallets/fungible/src/stubs/UniqueFungible.soldiffbeforeafterboth--- a/pallets/fungible/src/stubs/UniqueFungible.sol
+++ b/pallets/fungible/src/stubs/UniqueFungible.sol
@@ -547,7 +547,7 @@
event Approval(address indexed owner, address indexed spender, uint256 value);
}
-/// @dev the ERC-165 identifier for this interface is 0x942e8b22
+/// @dev the ERC-165 identifier for this interface is 0x8cb847c4
contract ERC20 is Dummy, ERC165, ERC20Events {
/// @dev EVM selector for this function is: 0x06fdde03,
/// or in textual repr: name()
@@ -634,6 +634,15 @@
dummy;
return 0;
}
+
+ /// @notice Returns collection helper contract address
+ /// @dev EVM selector for this function is: 0x1896cce6,
+ /// or in textual repr: collectionHelperAddress()
+ function collectionHelperAddress() public view returns (address) {
+ require(false, stub_error);
+ dummy;
+ return 0x0000000000000000000000000000000000000000;
+ }
}
contract UniqueFungible is Dummy, ERC165, ERC20, ERC20Mintable, ERC20UniqueExtensions, Collection {}
pallets/nonfungible/src/erc.rsdiffbeforeafterboth--- a/pallets/nonfungible/src/erc.rs
+++ b/pallets/nonfungible/src/erc.rs
@@ -42,6 +42,7 @@
use pallet_evm::{account::CrossAccountId, PrecompileHandle};
use pallet_evm_coder_substrate::call;
use pallet_structure::{SelfWeightOf as StructureWeight, weights::WeightInfo as _};
+use sp_core::Get;
use crate::{
AccountBalance, Config, CreateItemData, NonfungibleHandle, Pallet, TokenData, TokensMinted,
@@ -489,6 +490,11 @@
// TODO: Not implemetable
Err("not implemented".into())
}
+
+ /// @notice Returns collection helper contract address
+ fn collection_helper_address(&self) -> Result<address> {
+ Ok(T::ContractAddress::get())
+ }
}
/// @title ERC721 Token that can be irreversibly burned (destroyed).
pallets/nonfungible/src/stubs/UniqueNFT.soldiffbeforeafterboth--- a/pallets/nonfungible/src/stubs/UniqueNFT.sol
+++ b/pallets/nonfungible/src/stubs/UniqueNFT.sol
@@ -920,7 +920,7 @@
/// @title ERC-721 Non-Fungible Token Standard
/// @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md
-/// @dev the ERC-165 identifier for this interface is 0x80ac58cd
+/// @dev the ERC-165 identifier for this interface is 0x983a942b
contract ERC721 is Dummy, ERC165, ERC721Events {
/// @notice Count all NFTs assigned to an owner
/// @dev NFTs assigned to the zero address are considered invalid, and this
@@ -1050,6 +1050,15 @@
dummy;
return 0x0000000000000000000000000000000000000000;
}
+
+ /// @notice Returns collection helper contract address
+ /// @dev EVM selector for this function is: 0x1896cce6,
+ /// or in textual repr: collectionHelperAddress()
+ function collectionHelperAddress() public view returns (address) {
+ require(false, stub_error);
+ dummy;
+ return 0x0000000000000000000000000000000000000000;
+ }
}
contract UniqueNFT is
pallets/refungible/src/erc.rsdiffbeforeafterboth--- a/pallets/refungible/src/erc.rs
+++ b/pallets/refungible/src/erc.rs
@@ -38,7 +38,7 @@
use pallet_evm::{account::CrossAccountId, PrecompileHandle};
use pallet_evm_coder_substrate::{call, dispatch_to_evm};
use pallet_structure::{SelfWeightOf as StructureWeight, weights::WeightInfo as _};
-use sp_core::H160;
+use sp_core::{H160, Get};
use sp_std::{collections::btree_map::BTreeMap, vec::Vec, vec};
use up_data_structs::{
CollectionId, CollectionPropertiesVec, mapping::TokenAddressMapping, Property, PropertyKey,
@@ -482,6 +482,11 @@
// TODO: Not implemetable
Err("not implemented".into())
}
+
+ /// @notice Returns collection helper contract address
+ fn collection_helper_address(&self) -> Result<address> {
+ Ok(T::ContractAddress::get())
+ }
}
/// Returns amount of pieces of `token` that `owner` have
pallets/refungible/src/stubs/UniqueRefungible.soldiffbeforeafterboth--- a/pallets/refungible/src/stubs/UniqueRefungible.sol
+++ b/pallets/refungible/src/stubs/UniqueRefungible.sol
@@ -919,7 +919,7 @@
/// @title ERC-721 Non-Fungible Token Standard
/// @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md
-/// @dev the ERC-165 identifier for this interface is 0x58800161
+/// @dev the ERC-165 identifier for this interface is 0x4016cd87
contract ERC721 is Dummy, ERC165, ERC721Events {
/// @notice Count all RFTs assigned to an owner
/// @dev RFTs assigned to the zero address are considered invalid, and this
@@ -1047,6 +1047,15 @@
dummy;
return 0x0000000000000000000000000000000000000000;
}
+
+ /// @notice Returns collection helper contract address
+ /// @dev EVM selector for this function is: 0x1896cce6,
+ /// or in textual repr: collectionHelperAddress()
+ function collectionHelperAddress() public view returns (address) {
+ require(false, stub_error);
+ dummy;
+ return 0x0000000000000000000000000000000000000000;
+ }
}
contract UniqueRefungible is
tests/src/apiConsts.test.tsdiffbeforeafterboth--- a/tests/src/apiConsts.test.ts
+++ b/tests/src/apiConsts.test.ts
@@ -117,4 +117,4 @@
function checkConst<T>(constValue: any, expectedValue: T) {
expect(constValue.toBigInt()).equal(expectedValue);
-}
+}
\ No newline at end of file
tests/src/eth/abi/fungible.jsondiffbeforeafterboth--- a/tests/src/eth/abi/fungible.json
+++ b/tests/src/eth/abi/fungible.json
@@ -201,6 +201,13 @@
},
{
"inputs": [],
+ "name": "collectionHelperAddress",
+ "outputs": [{ "internalType": "address", "name": "", "type": "address" }],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [],
"name": "collectionOwner",
"outputs": [
{
tests/src/eth/abi/nonFungible.jsondiffbeforeafterboth--- a/tests/src/eth/abi/nonFungible.json
+++ b/tests/src/eth/abi/nonFungible.json
@@ -231,6 +231,13 @@
},
{
"inputs": [],
+ "name": "collectionHelperAddress",
+ "outputs": [{ "internalType": "address", "name": "", "type": "address" }],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [],
"name": "collectionOwner",
"outputs": [
{
tests/src/eth/abi/reFungible.jsondiffbeforeafterboth--- a/tests/src/eth/abi/reFungible.json
+++ b/tests/src/eth/abi/reFungible.json
@@ -213,6 +213,13 @@
},
{
"inputs": [],
+ "name": "collectionHelperAddress",
+ "outputs": [{ "internalType": "address", "name": "", "type": "address" }],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [],
"name": "collectionOwner",
"outputs": [
{
tests/src/eth/api/UniqueFungible.soldiffbeforeafterboth--- a/tests/src/eth/api/UniqueFungible.sol
+++ b/tests/src/eth/api/UniqueFungible.sol
@@ -354,7 +354,7 @@
event Approval(address indexed owner, address indexed spender, uint256 value);
}
-/// @dev the ERC-165 identifier for this interface is 0x942e8b22
+/// @dev the ERC-165 identifier for this interface is 0x8cb847c4
interface ERC20 is Dummy, ERC165, ERC20Events {
/// @dev EVM selector for this function is: 0x06fdde03,
/// or in textual repr: name()
@@ -395,6 +395,11 @@
/// @dev EVM selector for this function is: 0xdd62ed3e,
/// or in textual repr: allowance(address,address)
function allowance(address owner, address spender) external view returns (uint256);
+
+ /// @notice Returns collection helper contract address
+ /// @dev EVM selector for this function is: 0x1896cce6,
+ /// or in textual repr: collectionHelperAddress()
+ function collectionHelperAddress() external view returns (address);
}
interface UniqueFungible is Dummy, ERC165, ERC20, ERC20Mintable, ERC20UniqueExtensions, Collection {}
tests/src/eth/api/UniqueNFT.soldiffbeforeafterboth--- a/tests/src/eth/api/UniqueNFT.sol
+++ b/tests/src/eth/api/UniqueNFT.sol
@@ -605,7 +605,7 @@
/// @title ERC-721 Non-Fungible Token Standard
/// @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md
-/// @dev the ERC-165 identifier for this interface is 0x80ac58cd
+/// @dev the ERC-165 identifier for this interface is 0x983a942b
interface ERC721 is Dummy, ERC165, ERC721Events {
/// @notice Count all NFTs assigned to an owner
/// @dev NFTs assigned to the zero address are considered invalid, and this
@@ -685,6 +685,11 @@
/// @dev EVM selector for this function is: 0xe985e9c5,
/// or in textual repr: isApprovedForAll(address,address)
function isApprovedForAll(address owner, address operator) external view returns (address);
+
+ /// @notice Returns collection helper contract address
+ /// @dev EVM selector for this function is: 0x1896cce6,
+ /// or in textual repr: collectionHelperAddress()
+ function collectionHelperAddress() external view returns (address);
}
interface UniqueNFT is
tests/src/eth/api/UniqueRefungible.soldiffbeforeafterboth--- a/tests/src/eth/api/UniqueRefungible.sol
+++ b/tests/src/eth/api/UniqueRefungible.sol
@@ -604,7 +604,7 @@
/// @title ERC-721 Non-Fungible Token Standard
/// @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md
-/// @dev the ERC-165 identifier for this interface is 0x58800161
+/// @dev the ERC-165 identifier for this interface is 0x4016cd87
interface ERC721 is Dummy, ERC165, ERC721Events {
/// @notice Count all RFTs assigned to an owner
/// @dev RFTs assigned to the zero address are considered invalid, and this
@@ -682,6 +682,11 @@
/// @dev EVM selector for this function is: 0xe985e9c5,
/// or in textual repr: isApprovedForAll(address,address)
function isApprovedForAll(address owner, address operator) external view returns (address);
+
+ /// @notice Returns collection helper contract address
+ /// @dev EVM selector for this function is: 0x1896cce6,
+ /// or in textual repr: collectionHelperAddress()
+ function collectionHelperAddress() external view returns (address);
}
interface UniqueRefungible is
tests/src/eth/collectionHelperAddress.test.tsdiffbeforeafterboth--- /dev/null
+++ b/tests/src/eth/collectionHelperAddress.test.ts
@@ -0,0 +1,57 @@
+// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
+// This file is part of Unique Network.
+
+// Unique Network is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// Unique Network is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
+
+import {itEth, usingEthPlaygrounds, expect} from './util';
+import {IKeyringPair} from '@polkadot/types/types';
+
+const EVM_COLLECTION_HELPERS_ADDRESS = '0x6c4e9fe1ae37a41e93cee429e8e1881abdcbb54f';
+
+describe('[eth]CollectionHelerpAddress test: ERC721 ', () => {
+ let donor: IKeyringPair;
+
+ before(async function() {
+ await usingEthPlaygrounds(async (helper, privateKey) => {
+ donor = await privateKey({filename: __filename});
+ });
+ });
+
+ itEth('NFT\\RFT', async ({helper}) => {
+ const owner = await helper.eth.createAccountWithBalance(donor);
+
+ const {collectionAddress: nftCollectionAddress} = await helper.eth.createNFTCollection(owner, 'Sponsor', 'absolutely anything', 'ROC');
+ const nftCollection = helper.ethNativeContract.collection(nftCollectionAddress, 'nft', owner);
+
+ const {collectionAddress: rftCollectionAddress} = await helper.eth.createRFTCollection(owner, 'Sponsor', 'absolutely anything', 'ROC');
+ const rftCollection = helper.ethNativeContract.collection(rftCollectionAddress, 'rft', owner);
+
+ expect((await nftCollection.methods.collectionHelperAddress().call())
+ .toString().toLowerCase()).to.be.equal(EVM_COLLECTION_HELPERS_ADDRESS);
+
+ expect((await rftCollection.methods.collectionHelperAddress().call())
+ .toString().toLowerCase()).to.be.equal(EVM_COLLECTION_HELPERS_ADDRESS);
+ });
+
+ itEth('FT', async ({helper}) => {
+ const owner = await helper.eth.createAccountWithBalance(donor);
+
+ const {collectionAddress} = await helper.eth.createFungibleCollection(owner, 'Sponsor', 18, 'absolutely anything', 'ROC');
+ const collection = helper.ethNativeContract.collection(collectionAddress, 'ft', owner);
+
+ expect((await collection.methods.collectionHelperAddress().call())
+ .toString().toLowerCase()).to.be.equal(EVM_COLLECTION_HELPERS_ADDRESS);
+ });
+
+});