git.delta.rocks / unique-network / refs/commits / 49182bd0a7fd

difftreelog

source

tests/src/eth/fractionalizer/fractionalizer.test.ts23.8 KiBsourcehistory
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.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/>.161718import {readFile} from 'fs/promises';1920import {IKeyringPair} from '@polkadot/types/types';21import {evmToAddress} from '@polkadot/util-crypto';2223import {Contract} from 'web3-eth-contract';2425import {usingEthPlaygrounds, expect, itEth, EthUniqueHelper} from '../util';26import {CompiledContract} from '../util/playgrounds/types';27import {requirePalletsOrSkip, Pallets} from '../../util';282930let compiledFractionalizer: CompiledContract;3132const compileContract = async (helper: EthUniqueHelper): Promise<CompiledContract> => {33  if(!compiledFractionalizer) {34    compiledFractionalizer = await helper.ethContract.compile('Fractionalizer', (await readFile(`${__dirname}/Fractionalizer.sol`)).toString(), [35      {solPath: 'api/CollectionHelpers.sol', fsPath: `${__dirname}/../api/CollectionHelpers.sol`},36      {solPath: 'api/ContractHelpers.sol', fsPath: `${__dirname}/../api/ContractHelpers.sol`},37      {solPath: 'api/UniqueRefungibleToken.sol', fsPath: `${__dirname}/../api/UniqueRefungibleToken.sol`},38      {solPath: 'api/UniqueRefungible.sol', fsPath: `${__dirname}/../api/UniqueRefungible.sol`},39      {solPath: 'api/UniqueNFT.sol', fsPath: `${__dirname}/../api/UniqueNFT.sol`},40    ]);41  }42  return compiledFractionalizer;43};444546const deployContract = async (helper: EthUniqueHelper, owner: string): Promise<Contract> => {47  const compiled = await compileContract(helper);48  return await helper.ethContract.deployByAbi(owner, compiled.abi, compiled.object);49};505152const initContract = async (helper: EthUniqueHelper, owner: string): Promise<{contract: Contract, rftCollectionAddress: string}> => {53  const fractionalizer = await deployContract(helper, owner);54  const amount = 10n * helper.balance.getOneTokenNominal();55  const web3 = helper.getWeb3();56  await web3.eth.sendTransaction({from: owner, to: fractionalizer.options.address, value: `${amount}`, gas: helper.eth.DEFAULT_GAS});57  const result = await fractionalizer.methods.createAndSetRFTCollection('A', 'B', 'C').send({value: Number(2n * helper.balance.getOneTokenNominal())});58  const rftCollectionAddress = result.events.RFTCollectionSet.returnValues._collection;59  return {contract: fractionalizer, rftCollectionAddress};60};6162const mintRFTToken = async (helper: EthUniqueHelper, owner: string, fractionalizer: Contract, amount: bigint): Promise<{63  nftCollectionAddress: string, nftTokenId: number, rftTokenAddress: string64}> => {65  const nftCollection = await helper.eth.createNFTCollection(owner, 'nft', 'NFT collection', 'NFT');66  const nftContract = helper.ethNativeContract.collection(nftCollection.collectionAddress, 'nft', owner);67  const mintResult = await nftContract.methods.mint(owner).send({from: owner});68  const nftTokenId = mintResult.events.Transfer.returnValues.tokenId;6970  await fractionalizer.methods.setNftCollectionIsAllowed(nftCollection.collectionAddress, true).send({from: owner});71  await nftContract.methods.approve(fractionalizer.options.address, nftTokenId).send({from: owner});72  const result = await fractionalizer.methods.nft2rft(nftCollection.collectionAddress, nftTokenId, amount).send({from: owner});73  const {_collection, _tokenId, _rftToken} = result.events.Fractionalized.returnValues;74  return {75    nftCollectionAddress: _collection,76    nftTokenId: _tokenId,77    rftTokenAddress: _rftToken,78  };79};808182describe('Fractionalizer contract usage', () => {83  let donor: IKeyringPair;8485  before(async function() {86    await usingEthPlaygrounds(async (helper: EthUniqueHelper, privateKey) => {87      requirePalletsOrSkip(this, helper, [Pallets.ReFungible]);88      donor = await privateKey({filename: __filename});89    });90  });9192  itEth('Set RFT collection', async ({helper}) => {93    const owner = await helper.eth.createAccountWithBalance(donor, 10n);94    const fractionalizer = await deployContract(helper, owner);95    const rftCollection = await helper.eth.createRFTCollection(owner, 'rft', 'RFT collection', 'RFT');96    const rftContract = helper.ethNativeContract.collection(rftCollection.collectionAddress, 'rft', owner);9798    const fractionalizerAddressCross = helper.ethCrossAccount.fromAddress(fractionalizer.options.address);99    await rftContract.methods.addCollectionAdminCross(fractionalizerAddressCross).send({from: owner});100    const result = await fractionalizer.methods.setRFTCollection(rftCollection.collectionAddress).send({from: owner});101    expect(result.events).to.be.like({102      RFTCollectionSet: {103        returnValues: {104          _collection: rftCollection.collectionAddress,105        },106      },107    });108  });109110  itEth('Mint RFT collection', async ({helper}) => {111    const owner = await helper.eth.createAccountWithBalance(donor, 10n);112    const fractionalizer = await deployContract(helper, owner);113    await helper.balance.transferToSubstrate(donor, evmToAddress(fractionalizer.options.address), 10n * helper.balance.getOneTokenNominal());114115    const result = await fractionalizer.methods.createAndSetRFTCollection('A', 'B', 'C').send({from: owner, value: Number(2n * helper.balance.getOneTokenNominal())});116    expect(result.events).to.be.like({117      RFTCollectionSet: {},118    });119    expect(result.events.RFTCollectionSet.returnValues._collection).to.be.ok;120  });121122  itEth('Set Allowlist', async ({helper}) => {123    const owner = await helper.eth.createAccountWithBalance(donor, 20n);124    const {contract: fractionalizer} = await initContract(helper, owner);125    const nftCollection = await helper.eth.createNFTCollection(owner, 'nft', 'NFT collection', 'NFT');126127    const result1 = await fractionalizer.methods.setNftCollectionIsAllowed(nftCollection.collectionAddress, true).send({from: owner});128    expect(result1.events).to.be.like({129      AllowListSet: {130        returnValues: {131          _collection: nftCollection.collectionAddress,132          _status: true,133        },134      },135    });136    const result2 = await fractionalizer.methods.setNftCollectionIsAllowed(nftCollection.collectionAddress, false).send({from: owner});137    expect(result2.events).to.be.like({138      AllowListSet: {139        returnValues: {140          _collection: nftCollection.collectionAddress,141          _status: false,142        },143      },144    });145  });146147  itEth('NFT to RFT', async ({helper}) => {148    const owner = await helper.eth.createAccountWithBalance(donor, 20n);149150    const nftCollection = await helper.eth.createNFTCollection(owner, 'nft', 'NFT collection', 'NFT');151    const nftContract = helper.ethNativeContract.collection(nftCollection.collectionAddress, 'nft', owner);152    const mintResult = await nftContract.methods.mint(owner).send({from: owner});153    const nftTokenId = mintResult.events.Transfer.returnValues.tokenId;154155    const {contract: fractionalizer} = await initContract(helper, owner);156157    await fractionalizer.methods.setNftCollectionIsAllowed(nftCollection.collectionAddress, true).send({from: owner});158    await nftContract.methods.approve(fractionalizer.options.address, nftTokenId).send({from: owner});159    const result = await fractionalizer.methods.nft2rft(nftCollection.collectionAddress, nftTokenId, 100).send({from: owner});160    expect(result.events).to.be.like({161      Fractionalized: {162        returnValues: {163          _collection: nftCollection.collectionAddress,164          _tokenId: nftTokenId,165          _amount: '100',166        },167      },168    });169    const rftTokenAddress = result.events.Fractionalized.returnValues._rftToken;170171    const rftTokenContract = helper.ethNativeContract.rftToken(rftTokenAddress);172    expect(await rftTokenContract.methods.balanceOf(owner).call()).to.equal('100');173  });174175  itEth('RFT to NFT', async ({helper}) => {176    const owner = await helper.eth.createAccountWithBalance(donor, 20n);177178    const {contract: fractionalizer, rftCollectionAddress} = await initContract(helper, owner);179    const {rftTokenAddress, nftCollectionAddress, nftTokenId} = await mintRFTToken(helper, owner, fractionalizer, 100n);180181    const {collectionId, tokenId} = helper.ethAddress.extractTokenId(rftTokenAddress);182    const refungibleAddress = helper.ethAddress.fromCollectionId(collectionId);183    expect(rftCollectionAddress).to.be.equal(refungibleAddress);184    const refungibleTokenContract = helper.ethNativeContract.rftToken(rftTokenAddress, owner);185    await refungibleTokenContract.methods.approve(fractionalizer.options.address, 100).send({from: owner});186    const result = await fractionalizer.methods.rft2nft(refungibleAddress, tokenId).send({from: owner});187    expect(result.events).to.be.like({188      Defractionalized: {189        returnValues: {190          _rftToken: rftTokenAddress,191          _nftCollection: nftCollectionAddress,192          _nftTokenId: nftTokenId,193        },194      },195    });196  });197198  itEth('Test fractionalizer NFT <-> RFT mapping ', async ({helper}) => {199    const owner = await helper.eth.createAccountWithBalance(donor, 20n);200201    const {contract: fractionalizer, rftCollectionAddress} = await initContract(helper, owner);202    const {rftTokenAddress, nftCollectionAddress, nftTokenId} = await mintRFTToken(helper, owner, fractionalizer, 100n);203204    const {collectionId, tokenId} = helper.ethAddress.extractTokenId(rftTokenAddress);205    const refungibleAddress = helper.ethAddress.fromCollectionId(collectionId);206    expect(rftCollectionAddress).to.be.equal(refungibleAddress);207    const refungibleTokenContract = helper.ethNativeContract.rftToken(rftTokenAddress, owner);208    await refungibleTokenContract.methods.approve(fractionalizer.options.address, 100).send({from: owner});209210    const rft2nft = await fractionalizer.methods.rft2nftMapping(rftTokenAddress).call();211    expect(rft2nft).to.be.like({212      _collection: nftCollectionAddress,213      _tokenId: nftTokenId,214    });215216    const nft2rft = await fractionalizer.methods.nft2rftMapping(nftCollectionAddress, nftTokenId).call();217    expect(nft2rft).to.be.eq(tokenId.toString());218  });219});220221222223describe('Negative Integration Tests for fractionalizer', () => {224  let donor: IKeyringPair;225226  before(async function() {227    await usingEthPlaygrounds(async (helper: EthUniqueHelper, privateKey) => {228      requirePalletsOrSkip(this, helper, [Pallets.ReFungible]);229      donor = await privateKey({filename: __filename});230    });231  });232233  itEth('call setRFTCollection twice', async ({helper}) => {234    const owner = await helper.eth.createAccountWithBalance(donor, 20n);235    const rftCollection = await helper.eth.createRFTCollection(owner, 'rft', 'RFT collection', 'RFT');236    const refungibleContract = helper.ethNativeContract.collection(rftCollection.collectionAddress, 'rft', owner);237238    const fractionalizer = await deployContract(helper, owner);239    const fractionalizerAddressCross = helper.ethCrossAccount.fromAddress(fractionalizer.options.address);240    await refungibleContract.methods.addCollectionAdminCross(fractionalizerAddressCross).send({from: owner});241    await fractionalizer.methods.setRFTCollection(rftCollection.collectionAddress).send({from: owner});242243    await expect(fractionalizer.methods.setRFTCollection(rftCollection.collectionAddress).call())244      .to.be.rejectedWith(/RFT collection is already set$/g);245  });246247  itEth('call setRFTCollection with NFT collection', async ({helper}) => {248    const owner = await helper.eth.createAccountWithBalance(donor, 20n);249    const nftCollection = await helper.eth.createNFTCollection(owner, 'nft', 'NFT collection', 'NFT');250    const nftContract = helper.ethNativeContract.collection(nftCollection.collectionAddress, 'nft', owner);251252    const fractionalizer = await deployContract(helper, owner);253    const fractionalizerAddressCross = helper.ethCrossAccount.fromAddress(fractionalizer.options.address);254    await nftContract.methods.addCollectionAdminCross(fractionalizerAddressCross).send({from: owner});255256    await expect(fractionalizer.methods.setRFTCollection(nftCollection.collectionAddress).call())257      .to.be.rejectedWith(/Wrong collection type. Collection is not refungible.$/g);258  });259260  itEth('call setRFTCollection while not collection admin', async ({helper}) => {261    const owner = await helper.eth.createAccountWithBalance(donor, 20n);262    const fractionalizer = await deployContract(helper, owner);263    const rftCollection = await helper.eth.createRFTCollection(owner, 'rft', 'RFT collection', 'RFT');264265    await expect(fractionalizer.methods.setRFTCollection(rftCollection.collectionAddress).call())266      .to.be.rejectedWith(/Fractionalizer contract should be an admin of the collection$/g);267  });268269  itEth('call setRFTCollection after createAndSetRFTCollection', async ({helper}) => {270    const owner = await helper.eth.createAccountWithBalance(donor, 20n);271    const fractionalizer = await deployContract(helper, owner);272    await helper.balance.transferToSubstrate(donor, evmToAddress(fractionalizer.options.address), 10n * helper.balance.getOneTokenNominal());273274    const result = await fractionalizer.methods.createAndSetRFTCollection('A', 'B', 'C').send({from: owner, value: Number(2n * helper.balance.getOneTokenNominal())});275    const collectionIdAddress = result.events.RFTCollectionSet.returnValues._collection;276277    await expect(fractionalizer.methods.setRFTCollection(collectionIdAddress).call())278      .to.be.rejectedWith(/RFT collection is already set$/g);279  });280281  itEth('call nft2rft without setting RFT collection for contract', async ({helper}) => {282    const owner = await helper.eth.createAccountWithBalance(donor, 20n);283284    const nftCollection = await helper.eth.createNFTCollection(owner, 'nft', 'NFT collection', 'NFT');285    const nftContract = helper.ethNativeContract.collection(nftCollection.collectionAddress, 'nft', owner);286    const mintResult = await nftContract.methods.mint(owner).send({from: owner});287    const nftTokenId = mintResult.events.Transfer.returnValues.tokenId;288289    const fractionalizer = await deployContract(helper, owner);290291    await expect(fractionalizer.methods.nft2rft(nftCollection.collectionAddress, nftTokenId, 100).call())292      .to.be.rejectedWith(/RFT collection is not set$/g);293  });294295  itEth('call nft2rft while not owner of NFT token', async ({helper}) => {296    const owner = await helper.eth.createAccountWithBalance(donor, 20n);297    const nftOwner = await helper.eth.createAccountWithBalance(donor, 10n);298299    const nftCollection = await helper.eth.createNFTCollection(owner, 'nft', 'NFT collection', 'NFT');300    const nftContract = helper.ethNativeContract.collection(nftCollection.collectionAddress, 'nft', owner);301    const mintResult = await nftContract.methods.mint(owner).send({from: owner});302    const nftTokenId = mintResult.events.Transfer.returnValues.tokenId;303    await nftContract.methods.transfer(nftOwner, 1).send({from: owner});304305306    const {contract: fractionalizer} = await initContract(helper, owner);307    await fractionalizer.methods.setNftCollectionIsAllowed(nftCollection.collectionAddress, true).send({from: owner});308309    await expect(fractionalizer.methods.nft2rft(nftCollection.collectionAddress, nftTokenId, 100).call({from: owner}))310      .to.be.rejectedWith(/Only token owner could fractionalize it$/g);311  });312313  itEth('call nft2rft while not in list of allowed accounts', async ({helper}) => {314    const owner = await helper.eth.createAccountWithBalance(donor, 20n);315316    const nftCollection = await helper.eth.createNFTCollection(owner, 'nft', 'NFT collection', 'NFT');317    const nftContract = helper.ethNativeContract.collection(nftCollection.collectionAddress, 'nft', owner);318    const mintResult = await nftContract.methods.mint(owner).send({from: owner});319    const nftTokenId = mintResult.events.Transfer.returnValues.tokenId;320321    const {contract: fractionalizer} = await initContract(helper, owner);322323    await nftContract.methods.approve(fractionalizer.options.address, nftTokenId).send({from: owner});324    await expect(fractionalizer.methods.nft2rft(nftCollection.collectionAddress, nftTokenId, 100).call())325      .to.be.rejectedWith(/Fractionalization of this collection is not allowed by admin$/g);326  });327328  itEth('call nft2rft while fractionalizer doesnt have approval for nft token', async ({helper}) => {329    const owner = await helper.eth.createAccountWithBalance(donor, 20n);330331    const nftCollection = await helper.eth.createNFTCollection(owner, 'nft', 'NFT collection', 'NFT');332    const nftContract = helper.ethNativeContract.collection(nftCollection.collectionAddress, 'nft', owner);333    const mintResult = await nftContract.methods.mint(owner).send({from: owner});334    const nftTokenId = mintResult.events.Transfer.returnValues.tokenId;335336    const {contract: fractionalizer} = await initContract(helper, owner);337338    await fractionalizer.methods.setNftCollectionIsAllowed(nftCollection.collectionAddress, true).send({from: owner});339    await expect(fractionalizer.methods.nft2rft(nftCollection.collectionAddress, nftTokenId, 100).call())340      .to.be.rejectedWith(/ApprovedValueTooLow$/g);341  });342343  itEth('call rft2nft without setting RFT collection for contract', async ({helper}) => {344    const owner = await helper.eth.createAccountWithBalance(donor, 20n);345346    const fractionalizer = await deployContract(helper, owner);347    const rftCollection = await helper.eth.createRFTCollection(owner, 'rft', 'RFT collection', 'RFT');348    const refungibleContract = helper.ethNativeContract.collection(rftCollection.collectionAddress, 'rft', owner);349    const mintResult = await refungibleContract.methods.mint(owner).send({from: owner});350    const rftTokenId = mintResult.events.Transfer.returnValues.tokenId;351352    await expect(fractionalizer.methods.rft2nft(rftCollection.collectionAddress, rftTokenId).call({from: owner}))353      .to.be.rejectedWith(/RFT collection is not set$/g);354  });355356  itEth('call rft2nft for RFT token that is not from configured RFT collection', async ({helper}) => {357    const owner = await helper.eth.createAccountWithBalance(donor, 20n);358359    const {contract: fractionalizer} = await initContract(helper, owner);360    const rftCollection = await helper.eth.createRFTCollection(owner, 'rft', 'RFT collection', 'RFT');361    const refungibleContract = helper.ethNativeContract.collection(rftCollection.collectionAddress, 'rft', owner);362    const mintResult = await refungibleContract.methods.mint(owner).send({from: owner});363    const rftTokenId = mintResult.events.Transfer.returnValues.tokenId;364365    await expect(fractionalizer.methods.rft2nft(rftCollection.collectionAddress, rftTokenId).call())366      .to.be.rejectedWith(/Wrong RFT collection$/g);367  });368369  itEth('call rft2nft for RFT token that was not minted by fractionalizer contract', async ({helper}) => {370    const owner = await helper.eth.createAccountWithBalance(donor, 20n);371    const rftCollection = await helper.eth.createRFTCollection(owner, 'rft', 'RFT collection', 'RFT');372    const refungibleContract = helper.ethNativeContract.collection(rftCollection.collectionAddress, 'rft', owner);373374    const fractionalizer = await deployContract(helper, owner);375376    const fractionalizerAddressCross = helper.ethCrossAccount.fromAddress(fractionalizer.options.address);377    await refungibleContract.methods.addCollectionAdminCross(fractionalizerAddressCross).send({from: owner});378    await fractionalizer.methods.setRFTCollection(rftCollection.collectionAddress).send({from: owner});379380    const mintResult = await refungibleContract.methods.mint(owner).send({from: owner});381    const rftTokenId = mintResult.events.Transfer.returnValues.tokenId;382383    await expect(fractionalizer.methods.rft2nft(rftCollection.collectionAddress, rftTokenId).call())384      .to.be.rejectedWith(/No corresponding NFT token found$/g);385  });386387  itEth('call rft2nft without owning all RFT pieces', async ({helper}) => {388    const owner = await helper.eth.createAccountWithBalance(donor, 20n);389    const receiver = await helper.eth.createAccountWithBalance(donor, 10n);390391    const {contract: fractionalizer, rftCollectionAddress} = await initContract(helper, owner);392    const {rftTokenAddress} = await mintRFTToken(helper, owner, fractionalizer, 100n);393394    const {tokenId} = helper.ethAddress.extractTokenId(rftTokenAddress);395    const refungibleTokenContract = helper.ethNativeContract.rftToken(rftTokenAddress, owner);396    await refungibleTokenContract.methods.transfer(receiver, 50).send({from: owner});397    await refungibleTokenContract.methods.approve(fractionalizer.options.address, 50).send({from: receiver});398    await expect(fractionalizer.methods.rft2nft(rftCollectionAddress, tokenId).call({from: receiver}))399      .to.be.rejectedWith(/Not all pieces are owned by the caller$/g);400  });401402  itEth('send QTZ/UNQ to contract from non owner', async ({helper}) => {403    const owner = await helper.eth.createAccountWithBalance(donor, 20n);404    const payer = await helper.eth.createAccountWithBalance(donor, 10n);405406    const fractionalizer = await deployContract(helper, owner);407    const amount = 10n * helper.balance.getOneTokenNominal();408    const web3 = helper.getWeb3();409    await expect(web3.eth.sendTransaction({from: payer, to: fractionalizer.options.address, value: `${amount}`, gas: helper.eth.DEFAULT_GAS})).to.be.rejected;410  });411412  itEth('fractionalize NFT with NFT transfers disallowed', async ({helper}) => {413    const nftCollection = await helper.nft.mintCollection(donor, {name: 'A', description: 'B', tokenPrefix: 'C'});414415    const owner = await helper.eth.createAccountWithBalance(donor, 20n);416    const nftToken = await nftCollection.mintToken(donor, {Ethereum: owner});417    await helper.executeExtrinsic(donor, 'api.tx.unique.setTransfersEnabledFlag', [nftCollection.collectionId, false], true);418    const nftCollectionAddress = helper.ethAddress.fromCollectionId(nftCollection.collectionId);419    const {contract: fractionalizer} = await initContract(helper, owner);420    await fractionalizer.methods.setNftCollectionIsAllowed(nftCollectionAddress, true).send({from: owner});421422    const nftContract = helper.ethNativeContract.collection(nftCollectionAddress, 'nft', owner);423    await nftContract.methods.approve(fractionalizer.options.address, nftToken.tokenId).send({from: owner});424    await expect(fractionalizer.methods.nft2rft(nftCollectionAddress, nftToken.tokenId, 100).call())425      .to.be.rejectedWith(/TransferNotAllowed$/g);426  });427428  itEth('fractionalize NFT with RFT transfers disallowed', async ({helper}) => {429    const owner = await helper.eth.createAccountWithBalance(donor, 20n);430431    const rftCollection = await helper.rft.mintCollection(donor, {name: 'A', description: 'B', tokenPrefix: 'C'});432    const rftCollectionAddress = helper.ethAddress.fromCollectionId(rftCollection.collectionId);433    const fractionalizer = await deployContract(helper, owner);434    await rftCollection.addAdmin(donor, {Ethereum: fractionalizer.options.address});435436    await fractionalizer.methods.setRFTCollection(rftCollectionAddress).send({from: owner});437    await helper.executeExtrinsic(donor, 'api.tx.unique.setTransfersEnabledFlag', [rftCollection.collectionId, false], true);438439    const nftCollection = await helper.eth.createNFTCollection(owner, 'nft', 'NFT collection', 'NFT');440    const nftContract = helper.ethNativeContract.collection(nftCollection.collectionAddress, 'nft', owner);441    const mintResult = await nftContract.methods.mint(owner).send({from: owner});442    const nftTokenId = mintResult.events.Transfer.returnValues.tokenId;443444    await fractionalizer.methods.setNftCollectionIsAllowed(nftCollection.collectionAddress, true).send({from: owner});445    await nftContract.methods.approve(fractionalizer.options.address, nftTokenId).send({from: owner});446447    await expect(fractionalizer.methods.nft2rft(nftCollection.collectionAddress, nftTokenId, 100n).call())448      .to.be.rejectedWith(/TransferNotAllowed$/g);449  });450});