git.delta.rocks / unique-network / refs/commits / 8c337cff2bc8

difftreelog

refactor rename function

Trubnikov Sergey2022-09-13parent: #8a59560.patch.diff
in: master

11 files changed

modifiedpallets/unique/src/eth/mod.rsdiffbeforeafterboth
--- a/pallets/unique/src/eth/mod.rs
+++ b/pallets/unique/src/eth/mod.rs
@@ -245,6 +245,7 @@
 	}
 
 	#[weight(<SelfWeightOf<T>>::create_collection())]
+	#[solidity(rename_selector = "createRFTCollection")]
 	fn create_refungible_collection(
 		&mut self,
 		caller: caller,
modifiedpallets/unique/src/eth/stubs/CollectionHelpers.rawdiffbeforeafterboth

binary blob — no preview

modifiedpallets/unique/src/eth/stubs/CollectionHelpers.soldiffbeforeafterboth
--- a/pallets/unique/src/eth/stubs/CollectionHelpers.sol
+++ b/pallets/unique/src/eth/stubs/CollectionHelpers.sol
@@ -30,7 +30,7 @@
 }
 
 /// @title Contract, which allows users to operate with collections
-/// @dev the ERC-165 identifier for this interface is 0x675f3074
+/// @dev the ERC-165 identifier for this interface is 0x88ee8ef1
 contract CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents {
 	/// Create an NFT collection
 	/// @param name Name of the collection
@@ -69,9 +69,9 @@
 		return 0x0000000000000000000000000000000000000000;
 	}
 
-	/// @dev EVM selector for this function is: 0x44a68ad5,
-	///  or in textual repr: createRefungibleCollection(string,string,string)
-	function createRefungibleCollection(
+	/// @dev EVM selector for this function is: 0xab173450,
+	///  or in textual repr: createRFTCollection(string,string,string)
+	function createRFTCollection(
 		string memory name,
 		string memory description,
 		string memory tokenPrefix
modifiedtests/src/eth/api/CollectionHelpers.soldiffbeforeafterboth
--- a/tests/src/eth/api/CollectionHelpers.sol
+++ b/tests/src/eth/api/CollectionHelpers.sol
@@ -21,7 +21,7 @@
 }
 
 /// @title Contract, which allows users to operate with collections
-/// @dev the ERC-165 identifier for this interface is 0x675f3074
+/// @dev the ERC-165 identifier for this interface is 0x88ee8ef1
 interface CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents {
 	/// Create an NFT collection
 	/// @param name Name of the collection
@@ -45,9 +45,9 @@
 		string memory baseUri
 	) external returns (address);
 
-	/// @dev EVM selector for this function is: 0x44a68ad5,
-	///  or in textual repr: createRefungibleCollection(string,string,string)
-	function createRefungibleCollection(
+	/// @dev EVM selector for this function is: 0xab173450,
+	///  or in textual repr: createRFTCollection(string,string,string)
+	function createRFTCollection(
 		string memory name,
 		string memory description,
 		string memory tokenPrefix
modifiedtests/src/eth/collectionHelpersAbi.jsondiffbeforeafterboth
--- a/tests/src/eth/collectionHelpersAbi.json
+++ b/tests/src/eth/collectionHelpersAbi.json
@@ -59,7 +59,7 @@
       { "internalType": "string", "name": "description", "type": "string" },
       { "internalType": "string", "name": "tokenPrefix", "type": "string" }
     ],
-    "name": "createRefungibleCollection",
+    "name": "createRFTCollection",
     "outputs": [{ "internalType": "address", "name": "", "type": "address" }],
     "stateMutability": "nonpayable",
     "type": "function"
modifiedtests/src/eth/createRFTCollection.test.tsdiffbeforeafterboth
before · tests/src/eth/createRFTCollection.test.ts
1// 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.8//9// 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/>.1617import {evmToAddress} from '@polkadot/util-crypto';18import {expect} from 'chai';19import {getCreatedCollectionCount, getDetailedCollectionInfo, requirePallets, Pallets} from '../util/helpers';20import {21  evmCollectionHelpers,22  collectionIdToAddress,23  createEthAccount,24  createEthAccountWithBalance,25  evmCollection,26  itWeb3,27  getCollectionAddressFromResult,28} from './util/helpers';2930describe('Create RFT collection from EVM', () => {31  before(async function() {32    await requirePallets(this, [Pallets.ReFungible]);33  });3435  itWeb3('Create collection', async ({api, web3, privateKeyWrapper}) => {36    const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);37    const collectionHelper = evmCollectionHelpers(web3, owner);38    const collectionName = 'CollectionEVM';39    const description = 'Some description';40    const tokenPrefix = 'token prefix';41  42    const collectionCountBefore = await getCreatedCollectionCount(api);43    const result = await collectionHelper.methods44      .createRefungibleCollection(collectionName, description, tokenPrefix)45      .send();46    const collectionCountAfter = await getCreatedCollectionCount(api);47  48    const {collectionId, collection} = await getCollectionAddressFromResult(api, result);49    expect(collectionCountAfter - collectionCountBefore).to.be.eq(1);50    expect(collectionId).to.be.eq(collectionCountAfter);51    expect(collection.name.map(v => String.fromCharCode(v.toNumber())).join('')).to.be.eq(collectionName);52    expect(collection.description.map(v => String.fromCharCode(v.toNumber())).join('')).to.be.eq(description);53    expect(collection.tokenPrefix.toHuman()).to.be.eq(tokenPrefix);54    expect(collection.mode.isReFungible).to.be.true;55  });5657  itWeb3('Check collection address exist', async ({api, web3, privateKeyWrapper}) => {58    const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);59    const collectionHelpers = evmCollectionHelpers(web3, owner);60  61    const expectedCollectionId = await getCreatedCollectionCount(api) + 1;62    const expectedCollectionAddress = collectionIdToAddress(expectedCollectionId);63    expect(await collectionHelpers.methods64      .isCollectionExist(expectedCollectionAddress)65      .call()).to.be.false;6667    await collectionHelpers.methods68      .createRefungibleCollection('A', 'A', 'A')69      .send();70    71    expect(await collectionHelpers.methods72      .isCollectionExist(expectedCollectionAddress)73      .call()).to.be.true;74  });75  76  itWeb3('Set sponsorship', async ({api, web3, privateKeyWrapper}) => {77    const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);78    const collectionHelpers = evmCollectionHelpers(web3, owner);79    let result = await collectionHelpers.methods.createRefungibleCollection('Sponsor collection', '1', '1').send();80    const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result);81    const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper);82    const collectionEvm = evmCollection(web3, owner, collectionIdAddress, {type: 'ReFungible'});83    result = await collectionEvm.methods.setCollectionSponsor(sponsor).send();84    let collectionSub = (await getDetailedCollectionInfo(api, collectionId))!;85    expect(collectionSub.sponsorship.isUnconfirmed).to.be.true;86    const ss58Format = (api.registry.getChainProperties())!.toJSON().ss58Format;87    expect(collectionSub.sponsorship.asUnconfirmed.toHuman()).to.be.eq(evmToAddress(sponsor, Number(ss58Format)));88    await expect(collectionEvm.methods.confirmCollectionSponsorship().call()).to.be.rejectedWith('caller is not set as sponsor');89    const sponsorCollection = evmCollection(web3, sponsor, collectionIdAddress);90    await sponsorCollection.methods.confirmCollectionSponsorship().send();91    collectionSub = (await getDetailedCollectionInfo(api, collectionId))!;92    expect(collectionSub.sponsorship.isConfirmed).to.be.true;93    expect(collectionSub.sponsorship.asConfirmed.toHuman()).to.be.eq(evmToAddress(sponsor, Number(ss58Format)));94  });9596  itWeb3('Set limits', async ({api, web3, privateKeyWrapper}) => {97    const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);98    const collectionHelpers = evmCollectionHelpers(web3, owner);99    const result = await collectionHelpers.methods.createRefungibleCollection('Const collection', '5', '5').send();100    const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result);101    const limits = {102      accountTokenOwnershipLimit: 1000,103      sponsoredDataSize: 1024,104      sponsoredDataRateLimit: 30,105      tokenLimit: 1000000,106      sponsorTransferTimeout: 6,107      sponsorApproveTimeout: 6,108      ownerCanTransfer: false,109      ownerCanDestroy: false,110      transfersEnabled: false,111    };112113    const collectionEvm = evmCollection(web3, owner, collectionIdAddress, {type: 'ReFungible'});114    await collectionEvm.methods['setCollectionLimit(string,uint32)']('accountTokenOwnershipLimit', limits.accountTokenOwnershipLimit).send();115    await collectionEvm.methods['setCollectionLimit(string,uint32)']('sponsoredDataSize', limits.sponsoredDataSize).send();116    await collectionEvm.methods['setCollectionLimit(string,uint32)']('sponsoredDataRateLimit', limits.sponsoredDataRateLimit).send();117    await collectionEvm.methods['setCollectionLimit(string,uint32)']('tokenLimit', limits.tokenLimit).send();118    await collectionEvm.methods['setCollectionLimit(string,uint32)']('sponsorTransferTimeout', limits.sponsorTransferTimeout).send();119    await collectionEvm.methods['setCollectionLimit(string,uint32)']('sponsorApproveTimeout', limits.sponsorApproveTimeout).send();120    await collectionEvm.methods['setCollectionLimit(string,bool)']('ownerCanTransfer', limits.ownerCanTransfer).send();121    await collectionEvm.methods['setCollectionLimit(string,bool)']('ownerCanDestroy', limits.ownerCanDestroy).send();122    await collectionEvm.methods['setCollectionLimit(string,bool)']('transfersEnabled', limits.transfersEnabled).send();123    124    const collectionSub = (await getDetailedCollectionInfo(api, collectionId))!;125    expect(collectionSub.limits.accountTokenOwnershipLimit.unwrap().toNumber()).to.be.eq(limits.accountTokenOwnershipLimit);126    expect(collectionSub.limits.sponsoredDataSize.unwrap().toNumber()).to.be.eq(limits.sponsoredDataSize);127    expect(collectionSub.limits.sponsoredDataRateLimit.unwrap().asBlocks.toNumber()).to.be.eq(limits.sponsoredDataRateLimit);128    expect(collectionSub.limits.tokenLimit.unwrap().toNumber()).to.be.eq(limits.tokenLimit);129    expect(collectionSub.limits.sponsorTransferTimeout.unwrap().toNumber()).to.be.eq(limits.sponsorTransferTimeout);130    expect(collectionSub.limits.sponsorApproveTimeout.unwrap().toNumber()).to.be.eq(limits.sponsorApproveTimeout);131    expect(collectionSub.limits.ownerCanTransfer.toHuman()).to.be.eq(limits.ownerCanTransfer);132    expect(collectionSub.limits.ownerCanDestroy.toHuman()).to.be.eq(limits.ownerCanDestroy);133    expect(collectionSub.limits.transfersEnabled.toHuman()).to.be.eq(limits.transfersEnabled);134  });135136  itWeb3('Collection address exist', async ({api, web3, privateKeyWrapper}) => {137    const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);138    const collectionAddressForNonexistentCollection = '0x17C4E6453CC49AAAAEACA894E6D9683E00112233';139    const collectionHelpers = evmCollectionHelpers(web3, owner);140    expect(await collectionHelpers.methods141      .isCollectionExist(collectionAddressForNonexistentCollection).call())142      .to.be.false;143    144    const result = await collectionHelpers.methods.createRefungibleCollection('Collection address exist', '7', '7').send();145    const {collectionIdAddress} = await getCollectionAddressFromResult(api, result);146    expect(await collectionHelpers.methods147      .isCollectionExist(collectionIdAddress).call())148      .to.be.true;149  });150});151152describe('(!negative tests!) Create RFT collection from EVM', () => {153  before(async function() {154    await requirePallets(this, [Pallets.ReFungible]);155  });156157  itWeb3('(!negative test!) Create collection (bad lengths)', async ({api, web3, privateKeyWrapper}) => {158    const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);159    const helper = evmCollectionHelpers(web3, owner);160    {161      const MAX_NAME_LENGHT = 64;162      const collectionName = 'A'.repeat(MAX_NAME_LENGHT + 1);163      const description = 'A';164      const tokenPrefix = 'A';165    166      await expect(helper.methods167        .createRefungibleCollection(collectionName, description, tokenPrefix)168        .call()).to.be.rejectedWith('name is too long. Max length is ' + MAX_NAME_LENGHT);169      170    }171    {  172      const MAX_DESCRIPTION_LENGHT = 256;173      const collectionName = 'A';174      const description = 'A'.repeat(MAX_DESCRIPTION_LENGHT + 1);175      const tokenPrefix = 'A';176      await expect(helper.methods177        .createRefungibleCollection(collectionName, description, tokenPrefix)178        .call()).to.be.rejectedWith('description is too long. Max length is ' + MAX_DESCRIPTION_LENGHT);179    }180    {  181      const MAX_TOKEN_PREFIX_LENGHT = 16;182      const collectionName = 'A';183      const description = 'A';184      const tokenPrefix = 'A'.repeat(MAX_TOKEN_PREFIX_LENGHT + 1);185      await expect(helper.methods186        .createRefungibleCollection(collectionName, description, tokenPrefix)187        .call()).to.be.rejectedWith('token_prefix is too long. Max length is ' + MAX_TOKEN_PREFIX_LENGHT);188    }189  });190  191  itWeb3('(!negative test!) Create collection (no funds)', async ({web3}) => {192    const owner = createEthAccount(web3);193    const helper = evmCollectionHelpers(web3, owner);194    const collectionName = 'A';195    const description = 'A';196    const tokenPrefix = 'A';197    198    await expect(helper.methods199      .createRefungibleCollection(collectionName, description, tokenPrefix)200      .call()).to.be.rejectedWith('NotSufficientFounds');201  });202203  itWeb3('(!negative test!) Check owner', async ({api, web3, privateKeyWrapper}) => {204    const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);205    const notOwner = createEthAccount(web3);206    const collectionHelpers = evmCollectionHelpers(web3, owner);207    const result = await collectionHelpers.methods.createRefungibleCollection('A', 'A', 'A').send();208    const {collectionIdAddress} = await getCollectionAddressFromResult(api, result);209    const contractEvmFromNotOwner = evmCollection(web3, notOwner, collectionIdAddress, {type: 'ReFungible'});210    const EXPECTED_ERROR = 'NoPermission';211    {212      const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper);213      await expect(contractEvmFromNotOwner.methods214        .setCollectionSponsor(sponsor)215        .call()).to.be.rejectedWith(EXPECTED_ERROR);216      217      const sponsorCollection = evmCollection(web3, sponsor, collectionIdAddress);218      await expect(sponsorCollection.methods219        .confirmCollectionSponsorship()220        .call()).to.be.rejectedWith('caller is not set as sponsor');221    }222    {223      await expect(contractEvmFromNotOwner.methods224        .setCollectionLimit('account_token_ownership_limit', '1000')225        .call()).to.be.rejectedWith(EXPECTED_ERROR);226    }227  });228229  itWeb3('(!negative test!) Set limits', async ({api, web3, privateKeyWrapper}) => {230    const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);231    const collectionHelpers = evmCollectionHelpers(web3, owner);232    const result = await collectionHelpers.methods.createRefungibleCollection('Schema collection', 'A', 'A').send();233    const {collectionIdAddress} = await getCollectionAddressFromResult(api, result);234    const collectionEvm = evmCollection(web3, owner, collectionIdAddress, {type: 'ReFungible'});235    await expect(collectionEvm.methods236      .setCollectionLimit('badLimit', 'true')237      .call()).to.be.rejectedWith('unknown boolean limit "badLimit"');238  });239});
modifiedtests/src/eth/fractionalizer/Fractionalizer.soldiffbeforeafterboth
--- a/tests/src/eth/fractionalizer/Fractionalizer.sol
+++ b/tests/src/eth/fractionalizer/Fractionalizer.sol
@@ -25,7 +25,9 @@
     /// @dev Method modifier to only allow contract owner to call it.
     modifier onlyOwner() {
         address contracthelpersAddress = 0x842899ECF380553E8a4de75bF534cdf6fBF64049;
-        ContractHelpers contractHelpers = ContractHelpers(contracthelpersAddress);
+        ContractHelpers contractHelpers = ContractHelpers(
+            contracthelpersAddress
+        );
         address contractOwner = contractHelpers.contractOwner(address(this));
         require(msg.sender == contractOwner, "Only owner can");
         _;
@@ -38,10 +40,19 @@
     event AllowListSet(address _collection, bool _status);
 
     /// @dev This emits when NFT token is fractionalized by contract.
-    event Fractionalized(address _collection, uint256 _tokenId, address _rftToken, uint128 _amount);
+    event Fractionalized(
+        address _collection,
+        uint256 _tokenId,
+        address _rftToken,
+        uint128 _amount
+    );
 
     /// @dev This emits when NFT token is defractionalized by contract.
-    event Defractionalized(address _rftToken, address _nftCollection, uint256 _nftTokenId);
+    event Defractionalized(
+        address _rftToken,
+        address _nftCollection,
+        uint256 _nftTokenId
+    );
 
     /// Set RFT collection that contract will work with. RFT tokens for fractionalized NFT tokens
     /// would be created in this collection.
@@ -52,13 +63,11 @@
     ///  Can only be called by contract owner.
     /// @param _collection address of RFT collection.
     function setRFTCollection(address _collection) public onlyOwner {
-        require(
-            rftCollection == address(0),
-            "RFT collection is already set"
-        );
+        require(rftCollection == address(0), "RFT collection is already set");
         UniqueRefungible refungibleContract = UniqueRefungible(_collection);
-        string memory collectionType = refungibleContract.uniqueCollectionType();
-        
+        string memory collectionType = refungibleContract
+            .uniqueCollectionType();
+
         require(
             keccak256(bytes(collectionType)) == refungibleCollectionType,
             "Wrong collection type. Collection is not refungible."
@@ -78,13 +87,15 @@
     /// @param _name name for created RFT collection.
     /// @param _description description for created RFT collection.
     /// @param _tokenPrefix token prefix for created RFT collection.
-    function createAndSetRFTCollection(string calldata _name, string calldata _description, string calldata _tokenPrefix) public onlyOwner {
-        require(
-            rftCollection == address(0),
-            "RFT collection is already set"
-        );
+    function createAndSetRFTCollection(
+        string calldata _name,
+        string calldata _description,
+        string calldata _tokenPrefix
+    ) public onlyOwner {
+        require(rftCollection == address(0), "RFT collection is already set");
         address collectionHelpers = 0x6C4E9fE1AE37a41E93CEE429e8E1881aBdcbb54F;
-        rftCollection = CollectionHelpers(collectionHelpers).createRefungibleCollection(_name, _description, _tokenPrefix);
+        rftCollection = CollectionHelpers(collectionHelpers)
+            .createRFTCollection(_name, _description, _tokenPrefix);
         emit RFTCollectionSet(rftCollection);
     }
 
@@ -92,7 +103,10 @@
     /// @dev Can only be called by contract owner.
     /// @param collection NFT token address.
     /// @param status `true` to allow and `false` to disallow NFT token.
-    function setNftCollectionIsAllowed(address collection, bool status) public onlyOwner {
+    function setNftCollectionIsAllowed(address collection, bool status)
+        public
+        onlyOwner
+    {
         nftCollectionAllowList[collection] = status;
         emit AllowListSet(collection, status);
     }
@@ -107,12 +121,15 @@
     /// @param  _collection NFT collection address
     /// @param  _token id of NFT token to be fractionalized
     /// @param  _pieces number of pieces new RFT token would have
-    function nft2rft(address _collection, uint256 _token, uint128 _pieces) public {
-        require(
-            rftCollection != address(0),
-            "RFT collection is not set"
+    function nft2rft(
+        address _collection,
+        uint256 _token,
+        uint128 _pieces
+    ) public {
+        require(rftCollection != address(0), "RFT collection is not set");
+        UniqueRefungible rftCollectionContract = UniqueRefungible(
+            rftCollection
         );
-        UniqueRefungible rftCollectionContract = UniqueRefungible(rftCollection);
         require(
             nftCollectionAllowList[_collection] == true,
             "Fractionalization of this collection is not allowed by admin"
@@ -121,25 +138,25 @@
             UniqueNFT(_collection).ownerOf(_token) == msg.sender,
             "Only token owner could fractionalize it"
         );
-        UniqueNFT(_collection).transferFrom(
-            msg.sender,
-            address(this),
-            _token
-        );
+        UniqueNFT(_collection).transferFrom(msg.sender, address(this), _token);
         uint256 rftTokenId;
         address rftTokenAddress;
         UniqueRefungibleToken rftTokenContract;
         if (nft2rftMapping[_collection][_token] == 0) {
             rftTokenId = rftCollectionContract.nextTokenId();
             rftCollectionContract.mint(address(this), rftTokenId);
-            rftTokenAddress = rftCollectionContract.tokenContractAddress(rftTokenId);
+            rftTokenAddress = rftCollectionContract.tokenContractAddress(
+                rftTokenId
+            );
             nft2rftMapping[_collection][_token] = rftTokenId;
             rft2nftMapping[rftTokenAddress] = Token(_collection, _token);
 
             rftTokenContract = UniqueRefungibleToken(rftTokenAddress);
         } else {
             rftTokenId = nft2rftMapping[_collection][_token];
-            rftTokenAddress = rftCollectionContract.tokenContractAddress(rftTokenId);
+            rftTokenAddress = rftCollectionContract.tokenContractAddress(
+                rftTokenId
+            );
             rftTokenContract = UniqueRefungibleToken(rftTokenAddress);
         }
         rftTokenContract.repartition(_pieces);
@@ -157,24 +174,25 @@
     /// @param _collection RFT collection address
     /// @param _token id of RFT token
     function rft2nft(address _collection, uint256 _token) public {
-        require(
-            rftCollection != address(0),
-            "RFT collection is not set"
+        require(rftCollection != address(0), "RFT collection is not set");
+        require(rftCollection == _collection, "Wrong RFT collection");
+        UniqueRefungible rftCollectionContract = UniqueRefungible(
+            rftCollection
         );
-        require(
-            rftCollection == _collection,
-            "Wrong RFT collection"
+        address rftTokenAddress = rftCollectionContract.tokenContractAddress(
+            _token
         );
-        UniqueRefungible rftCollectionContract = UniqueRefungible(rftCollection);
-        address rftTokenAddress = rftCollectionContract.tokenContractAddress(_token);
         Token memory nftToken = rft2nftMapping[rftTokenAddress];
         require(
             nftToken._collection != address(0),
             "No corresponding NFT token found"
         );
-        UniqueRefungibleToken rftTokenContract = UniqueRefungibleToken(rftTokenAddress);
+        UniqueRefungibleToken rftTokenContract = UniqueRefungibleToken(
+            rftTokenAddress
+        );
         require(
-            rftTokenContract.balanceOf(msg.sender) == rftTokenContract.totalSupply(),
+            rftTokenContract.balanceOf(msg.sender) ==
+                rftTokenContract.totalSupply(),
             "Not all pieces are owned by the caller"
         );
         rftCollectionContract.transferFrom(msg.sender, address(this), _token);
@@ -183,6 +201,10 @@
             msg.sender,
             nftToken._tokenId
         );
-        emit Defractionalized(rftTokenAddress, nftToken._collection, nftToken._tokenId);
+        emit Defractionalized(
+            rftTokenAddress,
+            nftToken._collection,
+            nftToken._tokenId
+        );
     }
-}
\ No newline at end of file
+}
modifiedtests/src/eth/fractionalizer/fractionalizer.test.tsdiffbeforeafterboth
--- a/tests/src/eth/fractionalizer/fractionalizer.test.ts
+++ b/tests/src/eth/fractionalizer/fractionalizer.test.ts
@@ -21,7 +21,7 @@
 import {readFile} from 'fs/promises';
 import {executeTransaction, submitTransactionAsync} from '../../substrate/substrate-api';
 import {getCreateCollectionResult, getCreateItemResult, UNIQUE, requirePallets, Pallets} from '../../util/helpers';
-import {collectionIdToAddress, CompiledContract, createEthAccountWithBalance, createNonfungibleCollection, createRefungibleCollection, GAS_ARGS, itWeb3, tokenIdFromAddress, uniqueNFT, uniqueRefungible, uniqueRefungibleToken} from '../util/helpers';
+import {collectionIdToAddress, CompiledContract, createEthAccountWithBalance, createNonfungibleCollection, createRFTCollection, GAS_ARGS, itWeb3, tokenIdFromAddress, uniqueNFT, uniqueRefungible, uniqueRefungibleToken} from '../util/helpers';
 import {Contract} from 'web3-eth-contract';
 import * as solc from 'solc';
 
@@ -123,7 +123,7 @@
   itWeb3('Set RFT collection', async ({api, web3, privateKeyWrapper}) => {
     const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
     const fractionalizer = await deployFractionalizer(web3, owner);
-    const {collectionIdAddress} = await createRefungibleCollection(api, web3, owner);
+    const {collectionIdAddress} = await createRFTCollection(api, web3, owner);
     const refungibleContract = uniqueRefungible(web3, collectionIdAddress, owner);
     await refungibleContract.methods.addCollectionAdmin(fractionalizer.options.address).send();
     const result = await fractionalizer.methods.setRFTCollection(collectionIdAddress).send();
@@ -256,7 +256,7 @@
 
   itWeb3('call setRFTCollection twice', async ({api, web3, privateKeyWrapper}) => {
     const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-    const {collectionIdAddress} = await createRefungibleCollection(api, web3, owner);
+    const {collectionIdAddress} = await createRFTCollection(api, web3, owner);
     const refungibleContract = uniqueRefungible(web3, collectionIdAddress, owner);
 
     const fractionalizer = await deployFractionalizer(web3, owner);
@@ -282,7 +282,7 @@
   itWeb3('call setRFTCollection while not collection admin', async ({api, web3, privateKeyWrapper}) => {
     const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
     const fractionalizer = await deployFractionalizer(web3, owner);
-    const {collectionIdAddress} = await createRefungibleCollection(api, web3, owner);
+    const {collectionIdAddress} = await createRFTCollection(api, web3, owner);
 
     await expect(fractionalizer.methods.setRFTCollection(collectionIdAddress).call())
       .to.be.rejectedWith(/Fractionalizer contract should be an admin of the collection$/g);
@@ -368,7 +368,7 @@
     const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
 
     const fractionalizer = await deployFractionalizer(web3, owner);
-    const {collectionIdAddress: rftCollectionAddress} = await createRefungibleCollection(api, web3, owner);
+    const {collectionIdAddress: rftCollectionAddress} = await createRFTCollection(api, web3, owner);
     const refungibleContract = uniqueRefungible(web3, rftCollectionAddress, owner);
     const rftTokenId = await refungibleContract.methods.nextTokenId().call();
     await refungibleContract.methods.mint(owner, rftTokenId).send();
@@ -381,7 +381,7 @@
     const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
 
     const {fractionalizer} = await initFractionalizer(api, web3, privateKeyWrapper, owner);
-    const {collectionIdAddress: rftCollectionAddress} = await createRefungibleCollection(api, web3, owner);
+    const {collectionIdAddress: rftCollectionAddress} = await createRFTCollection(api, web3, owner);
     const refungibleContract = uniqueRefungible(web3, rftCollectionAddress, owner);
     const rftTokenId = await refungibleContract.methods.nextTokenId().call();
     await refungibleContract.methods.mint(owner, rftTokenId).send();
@@ -392,7 +392,7 @@
 
   itWeb3('call rft2nft for RFT token that was not minted by fractionalizer contract', async ({api, web3, privateKeyWrapper}) => {
     const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-    const {collectionIdAddress: rftCollectionAddress} = await createRefungibleCollection(api, web3, owner);
+    const {collectionIdAddress: rftCollectionAddress} = await createRFTCollection(api, web3, owner);
 
     const fractionalizer = await deployFractionalizer(web3, owner);
     const refungibleContract = uniqueRefungible(web3, rftCollectionAddress, owner);
modifiedtests/src/eth/reFungible.test.tsdiffbeforeafterboth
--- a/tests/src/eth/reFungible.test.ts
+++ b/tests/src/eth/reFungible.test.ts
@@ -26,7 +26,7 @@
   itWeb3('totalSupply', async ({api, web3, privateKeyWrapper}) => {
     const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
     const helper = evmCollectionHelpers(web3, caller);
-    const result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send();
+    const result = await helper.methods.createRFTCollection('Mint collection', '6', '6').send();
     const {collectionIdAddress} = await getCollectionAddressFromResult(api, result);
     const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'});
     const nextTokenId = await contract.methods.nextTokenId().call();
@@ -38,7 +38,7 @@
   itWeb3('balanceOf', async ({api, web3, privateKeyWrapper}) => {
     const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
     const helper = evmCollectionHelpers(web3, caller);
-    const result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send();
+    const result = await helper.methods.createRFTCollection('Mint collection', '6', '6').send();
     const {collectionIdAddress} = await getCollectionAddressFromResult(api, result);
     const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'});
 
@@ -63,7 +63,7 @@
   itWeb3('ownerOf', async ({api, web3, privateKeyWrapper}) => {
     const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
     const helper = evmCollectionHelpers(web3, caller);
-    const result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send();
+    const result = await helper.methods.createRFTCollection('Mint collection', '6', '6').send();
     const {collectionIdAddress} = await getCollectionAddressFromResult(api, result);
     const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'});
 
@@ -79,7 +79,7 @@
     const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
     const receiver = createEthAccount(web3);
     const helper = evmCollectionHelpers(web3, caller);
-    const result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send();
+    const result = await helper.methods.createRFTCollection('Mint collection', '6', '6').send();
     const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result);
     const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'});
 
@@ -103,7 +103,7 @@
     const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
     const receiver = createEthAccount(web3);
     const helper = evmCollectionHelpers(web3, caller);
-    const result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send();
+    const result = await helper.methods.createRFTCollection('Mint collection', '6', '6').send();
     const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result);
     const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'});
 
@@ -130,7 +130,7 @@
   itWeb3('Can perform mint()', async ({web3, api, privateKeyWrapper}) => {
     const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
     const helper = evmCollectionHelpers(web3, owner);
-    let result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send();
+    let result = await helper.methods.createRFTCollection('Mint collection', '6', '6').send();
     const {collectionIdAddress} = await getCollectionAddressFromResult(api, result);
     const receiver = createEthAccount(web3);
     const contract = evmCollection(web3, owner, collectionIdAddress, {type: 'ReFungible'});
@@ -163,7 +163,7 @@
   itWeb3('Can perform mintBulk()', async ({web3, api, privateKeyWrapper}) => {
     const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
     const helper = evmCollectionHelpers(web3, caller);
-    const result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send();
+    const result = await helper.methods.createRFTCollection('Mint collection', '6', '6').send();
     const {collectionIdAddress} = await getCollectionAddressFromResult(api, result);
     const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'});
 
@@ -221,7 +221,7 @@
   itWeb3('Can perform burn()', async ({web3, api, privateKeyWrapper}) => {
     const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
     const helper = evmCollectionHelpers(web3, caller);
-    const result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send();
+    const result = await helper.methods.createRFTCollection('Mint collection', '6', '6').send();
     const {collectionIdAddress} = await getCollectionAddressFromResult(api, result);
     const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'});
 
@@ -247,7 +247,7 @@
   itWeb3('Can perform transferFrom()', async ({web3, api, privateKeyWrapper}) => {
     const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
     const helper = evmCollectionHelpers(web3, caller);
-    const result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send();
+    const result = await helper.methods.createRFTCollection('Mint collection', '6', '6').send();
     const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result);
     const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'});
 
@@ -304,7 +304,7 @@
   itWeb3('Can perform transfer()', async ({web3, api, privateKeyWrapper}) => {
     const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
     const helper = evmCollectionHelpers(web3, caller);
-    const result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send();
+    const result = await helper.methods.createRFTCollection('Mint collection', '6', '6').send();
     const {collectionIdAddress} = await getCollectionAddressFromResult(api, result);
     const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'});
 
@@ -344,7 +344,7 @@
     const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
     const receiver = createEthAccount(web3);
     const helper = evmCollectionHelpers(web3, caller);
-    const result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send();
+    const result = await helper.methods.createRFTCollection('Mint collection', '6', '6').send();
     const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result);
     const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'});
 
@@ -376,7 +376,7 @@
     const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
     const receiver = createEthAccount(web3);
     const helper = evmCollectionHelpers(web3, caller);
-    const result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send();
+    const result = await helper.methods.createRFTCollection('Mint collection', '6', '6').send();
     const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result);
     const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'});
 
@@ -413,7 +413,7 @@
   itWeb3('transferFrom() call fee is less than 0.2UNQ', async ({web3, api, privateKeyWrapper}) => {
     const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
     const helper = evmCollectionHelpers(web3, caller);
-    const result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send();
+    const result = await helper.methods.createRFTCollection('Mint collection', '6', '6').send();
     const {collectionIdAddress} = await getCollectionAddressFromResult(api, result);
     const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'});
 
@@ -430,7 +430,7 @@
   itWeb3('transfer() call fee is less than 0.2UNQ', async ({web3, api, privateKeyWrapper}) => {
     const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
     const helper = evmCollectionHelpers(web3, caller);
-    const result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send();
+    const result = await helper.methods.createRFTCollection('Mint collection', '6', '6').send();
     const {collectionIdAddress} = await getCollectionAddressFromResult(api, result);
     const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'});
 
modifiedtests/src/eth/reFungibleToken.test.tsdiffbeforeafterboth
--- a/tests/src/eth/reFungibleToken.test.ts
+++ b/tests/src/eth/reFungibleToken.test.ts
@@ -15,7 +15,7 @@
 // along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
 
 import {approve, createCollection, createRefungibleToken, transfer, transferFrom, UNIQUE, requirePallets, Pallets} from '../util/helpers';
-import {collectionIdToAddress, createEthAccount, createEthAccountWithBalance, createRefungibleCollection, evmCollection, evmCollectionHelpers, getCollectionAddressFromResult, itWeb3, normalizeEvents, recordEthFee, recordEvents, subToEth, tokenIdToAddress, transferBalanceToEth, uniqueRefungible, uniqueRefungibleToken} from './util/helpers';
+import {collectionIdToAddress, createEthAccount, createEthAccountWithBalance, createRFTCollection, evmCollection, evmCollectionHelpers, getCollectionAddressFromResult, itWeb3, normalizeEvents, recordEthFee, recordEvents, subToEth, tokenIdToAddress, transferBalanceToEth, uniqueRefungible, uniqueRefungibleToken} from './util/helpers';
 
 import chai from 'chai';
 import chaiAsPromised from 'chai-as-promised';
@@ -458,7 +458,7 @@
     const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
     const receiver = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
     const helper = evmCollectionHelpers(web3, caller);
-    const result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send();
+    const result = await helper.methods.createRFTCollection('Mint collection', '6', '6').send();
     const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result);
     const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'});
 
@@ -658,7 +658,7 @@
   itWeb3('Default parent token address and id', async ({api, web3, privateKeyWrapper}) => {
     const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
 
-    const {collectionIdAddress, collectionId} = await createRefungibleCollection(api, web3, owner);
+    const {collectionIdAddress, collectionId} = await createRFTCollection(api, web3, owner);
     const refungibleContract = uniqueRefungible(web3, collectionIdAddress, owner);
     const refungibleTokenId = await refungibleContract.methods.nextTokenId().call();
     await refungibleContract.methods.mint(owner, refungibleTokenId).send();
modifiedtests/src/eth/util/helpers.tsdiffbeforeafterboth
--- a/tests/src/eth/util/helpers.ts
+++ b/tests/src/eth/util/helpers.ts
@@ -141,10 +141,10 @@
   expect(result.success).to.be.true;
 }
 
-export async function createRefungibleCollection(api: ApiPromise, web3: Web3, owner: string) {
+export async function createRFTCollection(api: ApiPromise, web3: Web3, owner: string) {
   const collectionHelper = evmCollectionHelpers(web3, owner);
   const result = await collectionHelper.methods
-    .createRefungibleCollection('A', 'B', 'C')
+    .createRFTCollection('A', 'B', 'C')
     .send();
   return await getCollectionAddressFromResult(api, result);
 }