git.delta.rocks / unique-network / refs/commits / dae8a5f4351f

difftreelog

Merge pull request #629 from UniqueNetwork/feature/eth-tests-playgrnds

ut-akuznetsov2022-10-05parents: #ab38216 #5721d4c.patch.diff
in: master
Feature/eth tests playgrnds

7 files changed

modifiedtests/src/eth/collectionSponsoring.test.tsdiffbeforeafterboth
before · tests/src/eth/collectionSponsoring.test.ts
1import {addToAllowListExpectSuccess, confirmSponsorshipExpectSuccess, createCollectionExpectSuccess, enablePublicMintingExpectSuccess, getDetailedCollectionInfo, setCollectionSponsorExpectSuccess, UNIQUE} from '../util/helpers';2import {itWeb3, createEthAccount, collectionIdToAddress, GAS_ARGS, normalizeEvents, createEthAccountWithBalance, evmCollectionHelpers, getCollectionAddressFromResult, evmCollection, ethBalanceViaSub} from './util/helpers';3import nonFungibleAbi from './nonFungibleAbi.json';4import {expect} from 'chai';5import {evmToAddress} from '@polkadot/util-crypto';67describe('evm collection sponsoring', () => {8  itWeb3('sponsors mint transactions', async ({web3, privateKeyWrapper}) => {9    const alice = privateKeyWrapper('//Alice');1011    const collection = await createCollectionExpectSuccess();12    await setCollectionSponsorExpectSuccess(collection, alice.address);13    await confirmSponsorshipExpectSuccess(collection);1415    const minter = createEthAccount(web3);16    expect(await web3.eth.getBalance(minter)).to.equal('0');1718    const address = collectionIdToAddress(collection);19    const contract = new web3.eth.Contract(nonFungibleAbi as any, collectionIdToAddress(collection), {from: minter, ...GAS_ARGS});2021    await enablePublicMintingExpectSuccess(alice, collection);22    await addToAllowListExpectSuccess(alice, collection, {Ethereum: minter});2324    const nextTokenId = await contract.methods.nextTokenId().call();25    expect(nextTokenId).to.equal('1');26    const result = await contract.methods.mint(minter, nextTokenId).send();27    const events = normalizeEvents(result.events);28    expect(events).to.be.deep.equal([29      {30        address,31        event: 'Transfer',32        args: {33          from: '0x0000000000000000000000000000000000000000',34          to: minter,35          tokenId: nextTokenId,36        },37      },38    ]);39  });4041  // TODO: Temprorary off. Need refactor42  // itWeb3('Set substrate sponsor', async ({api, web3, privateKeyWrapper}) => {43  //   const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);44  //   const collectionHelpers = evmCollectionHelpers(web3, owner);45  //   let result = await collectionHelpers.methods.createNonfungibleCollection('Sponsor collection', '1', '1').send();46  //   const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result);47  //   const sponsor = privateKeyWrapper('//Alice');48  //   const collectionEvm = evmCollection(web3, owner, collectionIdAddress);4950  //   expect(await collectionEvm.methods.hasCollectionPendingSponsor().call({from: owner})).to.be.false;51  //   result = await collectionEvm.methods.setCollectionSponsorSubstrate(sponsor.addressRaw).send({from: owner});52  //   expect(await collectionEvm.methods.hasCollectionPendingSponsor().call({from: owner})).to.be.true;53    54  //   const confirmTx = await api.tx.unique.confirmSponsorship(collectionId);55  //   await submitTransactionAsync(sponsor, confirmTx);56  //   expect(await collectionEvm.methods.hasCollectionPendingSponsor().call({from: owner})).to.be.false;57    58  //   const sponsorTuple = await collectionEvm.methods.collectionSponsor().call({from: owner});59  //   expect(bigIntToSub(api, BigInt(sponsorTuple[1]))).to.be.eq(sponsor.address);60  // });6162  itWeb3('Remove sponsor', async ({api, web3, privateKeyWrapper}) => {63    const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);64    const collectionHelpers = evmCollectionHelpers(web3, owner);65    let result = await collectionHelpers.methods.createNonfungibleCollection('Sponsor collection', '1', '1').send({value: Number(2n * UNIQUE)});66    const {collectionIdAddress} = await getCollectionAddressFromResult(api, result);67    const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper);68    const collectionEvm = evmCollection(web3, owner, collectionIdAddress);6970    expect(await collectionEvm.methods.hasCollectionPendingSponsor().call({from: owner})).to.be.false;71    result = await collectionEvm.methods.setCollectionSponsor(sponsor).send({from: owner});72    expect(await collectionEvm.methods.hasCollectionPendingSponsor().call({from: owner})).to.be.true;73    74    await collectionEvm.methods.confirmCollectionSponsorship().send({from: sponsor});75    expect(await collectionEvm.methods.hasCollectionPendingSponsor().call({from: owner})).to.be.false;76    77    await collectionEvm.methods.removeCollectionSponsor().send({from: owner});78    79    const sponsorTuple = await collectionEvm.methods.collectionSponsor().call({from: owner});80    expect(sponsorTuple.field_0).to.be.eq('0x0000000000000000000000000000000000000000');81  });8283  itWeb3('Sponsoring collection from evm address via access list', async ({api, web3, privateKeyWrapper}) => {84    const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);85    const collectionHelpers = evmCollectionHelpers(web3, owner);86    let result = await collectionHelpers.methods.createNonfungibleCollection('Sponsor collection', '1', '1').send({value: Number(2n * UNIQUE)});87    const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result);88    const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper);89    const collectionEvm = evmCollection(web3, owner, collectionIdAddress);90    result = await collectionEvm.methods.setCollectionSponsor(sponsor).send({from: owner});91    let collectionSub = (await getDetailedCollectionInfo(api, collectionId))!;92    const ss58Format = (api.registry.getChainProperties())!.toJSON().ss58Format;93    expect(collectionSub.sponsorship.isUnconfirmed).to.be.true;94    expect(collectionSub.sponsorship.asUnconfirmed.toHuman()).to.be.eq(evmToAddress(sponsor, Number(ss58Format)));95    await expect(collectionEvm.methods.confirmCollectionSponsorship().call()).to.be.rejectedWith('caller is not set as sponsor');9697    await collectionEvm.methods.confirmCollectionSponsorship().send({from: sponsor});98    collectionSub = (await getDetailedCollectionInfo(api, collectionId))!;99    expect(collectionSub.sponsorship.isConfirmed).to.be.true;100    expect(collectionSub.sponsorship.asConfirmed.toHuman()).to.be.eq(evmToAddress(sponsor, Number(ss58Format)));101102    const user = createEthAccount(web3);103    const nextTokenId = await collectionEvm.methods.nextTokenId().call();104    expect(nextTokenId).to.be.equal('1');105106    const oldPermissions = (await getDetailedCollectionInfo(api, collectionId))!.permissions.toHuman();107    expect(oldPermissions.mintMode).to.be.false;108    expect(oldPermissions.access).to.be.equal('Normal');109110    await collectionEvm.methods.setCollectionAccess(1 /*'AllowList'*/).send({from: owner});111    await collectionEvm.methods.addToCollectionAllowList(user).send({from: owner});112    await collectionEvm.methods.setCollectionMintMode(true).send({from: owner});113114    const newPermissions = (await getDetailedCollectionInfo(api, collectionId))!.permissions.toHuman();115    expect(newPermissions.mintMode).to.be.true;116    expect(newPermissions.access).to.be.equal('AllowList');117118    const ownerBalanceBefore = await ethBalanceViaSub(api, owner);119    const sponsorBalanceBefore = await ethBalanceViaSub(api, sponsor);120121    {122      const nextTokenId = await collectionEvm.methods.nextTokenId().call();123      expect(nextTokenId).to.be.equal('1');124      const result = await collectionEvm.methods.mintWithTokenURI(125        user,126        nextTokenId,127        'Test URI',128      ).send({from: user});129      const events = normalizeEvents(result.events);130131      expect(events).to.be.deep.equal([132        {133          address: collectionIdAddress,134          event: 'Transfer',135          args: {136            from: '0x0000000000000000000000000000000000000000',137            to: user,138            tokenId: nextTokenId,139          },140        },141      ]);142143      const ownerBalanceAfter = await ethBalanceViaSub(api, owner);144      const sponsorBalanceAfter = await ethBalanceViaSub(api, sponsor);145146      expect(await collectionEvm.methods.tokenURI(nextTokenId).call()).to.be.equal('Test URI');147      expect(ownerBalanceBefore).to.be.eq(ownerBalanceAfter);148      expect(sponsorBalanceBefore > sponsorBalanceAfter).to.be.true;149    }150  });151152  // TODO: Temprorary off. Need refactor153  // itWeb3('Sponsoring collection from substrate address via access list', async ({api, web3, privateKeyWrapper}) => {154  //   const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);155  //   const collectionHelpers = evmCollectionHelpers(web3, owner);156  //   const result = await collectionHelpers.methods.createNonfungibleCollection('Sponsor collection', '1', '1').send();157  //   const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result);158  //   const sponsor = privateKeyWrapper('//Alice');159  //   const collectionEvm = evmCollection(web3, owner, collectionIdAddress);160161  //   await collectionEvm.methods.setCollectionSponsorSubstrate(sponsor.addressRaw).send({from: owner});162    163  //   const confirmTx = await api.tx.unique.confirmSponsorship(collectionId);164  //   await submitTransactionAsync(sponsor, confirmTx);165    166  //   const user = createEthAccount(web3);167  //   const nextTokenId = await collectionEvm.methods.nextTokenId().call();168  //   expect(nextTokenId).to.be.equal('1');169170  //   await collectionEvm.methods.setCollectionAccess(1 /*'AllowList'*/).send({from: owner});171  //   await collectionEvm.methods.addToCollectionAllowList(user).send({from: owner});172  //   await collectionEvm.methods.setCollectionMintMode(true).send({from: owner});173174  //   const ownerBalanceBefore = await ethBalanceViaSub(api, owner);175  //   const sponsorBalanceBefore = (await getBalance(api, [sponsor.address]))[0];176177  //   {178  //     const nextTokenId = await collectionEvm.methods.nextTokenId().call();179  //     expect(nextTokenId).to.be.equal('1');180  //     const result = await collectionEvm.methods.mintWithTokenURI(181  //       user,182  //       nextTokenId,183  //       'Test URI',184  //     ).send({from: user});185  //     const events = normalizeEvents(result.events);186187  //     expect(events).to.be.deep.equal([188  //       {189  //         address: collectionIdAddress,190  //         event: 'Transfer',191  //         args: {192  //           from: '0x0000000000000000000000000000000000000000',193  //           to: user,194  //           tokenId: nextTokenId,195  //         },196  //       },197  //     ]);198199  //     const ownerBalanceAfter = await ethBalanceViaSub(api, owner);200  //     const sponsorBalanceAfter = (await getBalance(api, [sponsor.address]))[0];201202  //     expect(await collectionEvm.methods.tokenURI(nextTokenId).call()).to.be.equal('Test URI');203  //     expect(ownerBalanceBefore).to.be.eq(ownerBalanceAfter);204  //     expect(sponsorBalanceBefore > sponsorBalanceAfter).to.be.true;205  //   }206  // });207208  itWeb3('Check that transaction via EVM spend money from sponsor address', async ({api, web3, privateKeyWrapper}) => {209    const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);210    const collectionHelpers = evmCollectionHelpers(web3, owner);211    let result = await collectionHelpers.methods.createNonfungibleCollection('Sponsor collection', '1', '1').send({value: Number(2n * UNIQUE)});212    const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result);213    const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper);214    const collectionEvm = evmCollection(web3, owner, collectionIdAddress);215    result = await collectionEvm.methods.setCollectionSponsor(sponsor).send();216    let collectionSub = (await getDetailedCollectionInfo(api, collectionId))!;217    const ss58Format = (api.registry.getChainProperties())!.toJSON().ss58Format;218    expect(collectionSub.sponsorship.isUnconfirmed).to.be.true;219    expect(collectionSub.sponsorship.asUnconfirmed.toHuman()).to.be.eq(evmToAddress(sponsor, Number(ss58Format)));220    await expect(collectionEvm.methods.confirmCollectionSponsorship().call()).to.be.rejectedWith('caller is not set as sponsor');221    const sponsorCollection = evmCollection(web3, sponsor, collectionIdAddress);222    await sponsorCollection.methods.confirmCollectionSponsorship().send();223    collectionSub = (await getDetailedCollectionInfo(api, collectionId))!;224    expect(collectionSub.sponsorship.isConfirmed).to.be.true;225    expect(collectionSub.sponsorship.asConfirmed.toHuman()).to.be.eq(evmToAddress(sponsor, Number(ss58Format)));226227    const user = createEthAccount(web3);228    await collectionEvm.methods.addCollectionAdmin(user).send();229    230    const ownerBalanceBefore = await ethBalanceViaSub(api, owner);231    const sponsorBalanceBefore = await ethBalanceViaSub(api, sponsor);232    233  234    const userCollectionEvm = evmCollection(web3, user, collectionIdAddress);235    const nextTokenId = await userCollectionEvm.methods.nextTokenId().call();236    expect(nextTokenId).to.be.equal('1');237    result = await userCollectionEvm.methods.mintWithTokenURI(238      user,239      nextTokenId,240      'Test URI',241    ).send();242243    const events = normalizeEvents(result.events);244    const address = collectionIdToAddress(collectionId);245246    expect(events).to.be.deep.equal([247      {248        address,249        event: 'Transfer',250        args: {251          from: '0x0000000000000000000000000000000000000000',252          to: user,253          tokenId: nextTokenId,254        },255      },256    ]);257    expect(await userCollectionEvm.methods.tokenURI(nextTokenId).call()).to.be.equal('Test URI');258  259    const ownerBalanceAfter = await ethBalanceViaSub(api, owner);260    expect(ownerBalanceAfter).to.be.eq(ownerBalanceBefore);261    const sponsorBalanceAfter = await ethBalanceViaSub(api, sponsor);262    expect(sponsorBalanceAfter < sponsorBalanceBefore).to.be.true;263  });264});
after · tests/src/eth/collectionSponsoring.test.ts
1import {IKeyringPair} from '@polkadot/types/types';2import {usingPlaygrounds} from './../util/playgrounds/index';3import {itEth, expect} from '../eth/util/playgrounds';45describe('evm collection sponsoring', () => {6  let donor: IKeyringPair;7  let alice: IKeyringPair;8  let nominal: bigint;910  before(async () => {11    await usingPlaygrounds(async (helper, privateKey) => {12      donor = privateKey('//Alice');13      nominal = helper.balance.getOneTokenNominal();14    });15  });1617  beforeEach(async () => {18    await usingPlaygrounds(async (helper) => {19      [alice] = await helper.arrange.createAccounts([1000n], donor);20    });21  });2223  itEth('sponsors mint transactions', async ({helper}) => {24    const collection = await helper.nft.mintCollection(alice, {tokenPrefix: 'spnr', permissions: {mintMode: true}});25    await collection.setSponsor(alice, alice.address);26    await collection.confirmSponsorship(alice);2728    const minter = helper.eth.createAccount();29    expect(await helper.balance.getEthereum(minter)).to.equal(0n);3031    const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId);32    const contract = helper.ethNativeContract.collection(collectionAddress, 'nft', minter);3334    await collection.addToAllowList(alice, {Ethereum: minter});3536    const nextTokenId = await contract.methods.nextTokenId().call();37    expect(nextTokenId).to.equal('1');38    const result = await contract.methods.mint(minter, nextTokenId).send();39    const events = helper.eth.normalizeEvents(result.events);40    expect(events).to.be.deep.equal([41      {42        address: collectionAddress,43        event: 'Transfer',44        args: {45          from: '0x0000000000000000000000000000000000000000',46          to: minter,47          tokenId: nextTokenId,48        },49      },50    ]);51  });5253  // TODO: Temprorary off. Need refactor54  // itWeb3('Set substrate sponsor', async ({api, web3, privateKeyWrapper}) => {55  //   const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);56  //   const collectionHelpers = evmCollectionHelpers(web3, owner);57  //   let result = await collectionHelpers.methods.createNonfungibleCollection('Sponsor collection', '1', '1').send();58  //   const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result);59  //   const sponsor = privateKeyWrapper('//Alice');60  //   const collectionEvm = evmCollection(web3, owner, collectionIdAddress);6162  //   expect(await collectionEvm.methods.hasCollectionPendingSponsor().call({from: owner})).to.be.false;63  //   result = await collectionEvm.methods.setCollectionSponsorSubstrate(sponsor.addressRaw).send({from: owner});64  //   expect(await collectionEvm.methods.hasCollectionPendingSponsor().call({from: owner})).to.be.true;65    66  //   const confirmTx = await api.tx.unique.confirmSponsorship(collectionId);67  //   await submitTransactionAsync(sponsor, confirmTx);68  //   expect(await collectionEvm.methods.hasCollectionPendingSponsor().call({from: owner})).to.be.false;69    70  //   const sponsorTuple = await collectionEvm.methods.collectionSponsor().call({from: owner});71  //   expect(bigIntToSub(api, BigInt(sponsorTuple[1]))).to.be.eq(sponsor.address);72  // });7374  itEth('Remove sponsor', async ({helper}) => {75    const owner = await helper.eth.createAccountWithBalance(donor);76    const collectionHelpers = helper.ethNativeContract.collectionHelpers(owner);7778    let result = await collectionHelpers.methods.createNonfungibleCollection('Sponsor collection', '1', '1').send({value: Number(2n * nominal)});79    const collectionIdAddress = helper.ethAddress.normalizeAddress(result.events.CollectionCreated.returnValues.collectionId);80    const sponsor = await helper.eth.createAccountWithBalance(donor);81    const collectionEvm = helper.ethNativeContract.collection(collectionIdAddress, 'nft', owner);8283    expect(await collectionEvm.methods.hasCollectionPendingSponsor().call({from: owner})).to.be.false;84    result = await collectionEvm.methods.setCollectionSponsor(sponsor).send({from: owner});85    expect(await collectionEvm.methods.hasCollectionPendingSponsor().call({from: owner})).to.be.true;86    87    await collectionEvm.methods.confirmCollectionSponsorship().send({from: sponsor});88    expect(await collectionEvm.methods.hasCollectionPendingSponsor().call({from: owner})).to.be.false;89    90    await collectionEvm.methods.removeCollectionSponsor().send({from: owner});91    92    const sponsorTuple = await collectionEvm.methods.collectionSponsor().call({from: owner});93    expect(sponsorTuple.field_0).to.be.eq('0x0000000000000000000000000000000000000000');94  });9596  itEth('Sponsoring collection from evm address via access list', async ({helper}) => {97    const owner = await helper.eth.createAccountWithBalance(donor);98    const collectionHelpers = helper.ethNativeContract.collectionHelpers(owner);99100    let result = await collectionHelpers.methods.createNonfungibleCollection('Sponsor collection', '1', '1').send({value: Number(2n * nominal)});101    const collectionIdAddress = helper.ethAddress.normalizeAddress(result.events.CollectionCreated.returnValues.collectionId);102    const collectionId = helper.ethAddress.extractCollectionId(collectionIdAddress);103    const collection = helper.nft.getCollectionObject(collectionId);104    const sponsor = await helper.eth.createAccountWithBalance(donor);105    const collectionEvm = helper.ethNativeContract.collection(collectionIdAddress, 'nft', owner);106107    result = await collectionEvm.methods.setCollectionSponsor(sponsor).send({from: owner});108    let collectionData = (await collection.getData())!;109    expect(collectionData.raw.sponsorship.Unconfirmed).to.be.eq(helper.address.ethToSubstrate(sponsor, true));110    await expect(collectionEvm.methods.confirmCollectionSponsorship().call()).to.be.rejectedWith('caller is not set as sponsor');111112    await collectionEvm.methods.confirmCollectionSponsorship().send({from: sponsor});113    collectionData = (await collection.getData())!;114    expect(collectionData.raw.sponsorship.Confirmed).to.be.eq(helper.address.ethToSubstrate(sponsor, true));115116    const user = helper.eth.createAccount();117    const nextTokenId = await collectionEvm.methods.nextTokenId().call();118    expect(nextTokenId).to.be.equal('1');119120    const oldPermissions = (await collection.getData())!.raw.permissions; // (await getDetailedCollectionInfo(api, collectionId))!.permissions.toHuman();121    expect(oldPermissions.mintMode).to.be.false;122    expect(oldPermissions.access).to.be.equal('Normal');123124    await collectionEvm.methods.setCollectionAccess(1 /*'AllowList'*/).send({from: owner});125    await collectionEvm.methods.addToCollectionAllowList(user).send({from: owner});126    await collectionEvm.methods.setCollectionMintMode(true).send({from: owner});127128    const newPermissions = (await collection.getData())!.raw.permissions; // (await getDetailedCollectionInfo(api, collectionId))!.permissions.toHuman();129    expect(newPermissions.mintMode).to.be.true;130    expect(newPermissions.access).to.be.equal('AllowList');131132    const ownerBalanceBefore = await helper.balance.getSubstrate(helper.address.ethToSubstrate(owner));133    const sponsorBalanceBefore = await helper.balance.getSubstrate(helper.address.ethToSubstrate(sponsor));134135    {136      const nextTokenId = await collectionEvm.methods.nextTokenId().call();137      expect(nextTokenId).to.be.equal('1');138      const result = await collectionEvm.methods.mintWithTokenURI(139        user,140        nextTokenId,141        'Test URI',142      ).send({from: user});143      const events = helper.eth.normalizeEvents(result.events);144145      expect(events).to.be.deep.equal([146        {147          address: collectionIdAddress,148          event: 'Transfer',149          args: {150            from: '0x0000000000000000000000000000000000000000',151            to: user,152            tokenId: nextTokenId,153          },154        },155      ]);156157      const ownerBalanceAfter = await helper.balance.getSubstrate(await helper.address.ethToSubstrate(owner));158      const sponsorBalanceAfter = await helper.balance.getSubstrate(await helper.address.ethToSubstrate(sponsor));159160      expect(await collectionEvm.methods.tokenURI(nextTokenId).call()).to.be.equal('Test URI');161      expect(ownerBalanceBefore).to.be.eq(ownerBalanceAfter);162      expect(sponsorBalanceBefore > sponsorBalanceAfter).to.be.true;163    }164  });165166  // TODO: Temprorary off. Need refactor167  // itWeb3('Sponsoring collection from substrate address via access list', async ({api, web3, privateKeyWrapper}) => {168  //   const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);169  //   const collectionHelpers = evmCollectionHelpers(web3, owner);170  //   const result = await collectionHelpers.methods.createNonfungibleCollection('Sponsor collection', '1', '1').send();171  //   const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result);172  //   const sponsor = privateKeyWrapper('//Alice');173  //   const collectionEvm = evmCollection(web3, owner, collectionIdAddress);174175  //   await collectionEvm.methods.setCollectionSponsorSubstrate(sponsor.addressRaw).send({from: owner});176    177  //   const confirmTx = await api.tx.unique.confirmSponsorship(collectionId);178  //   await submitTransactionAsync(sponsor, confirmTx);179    180  //   const user = createEthAccount(web3);181  //   const nextTokenId = await collectionEvm.methods.nextTokenId().call();182  //   expect(nextTokenId).to.be.equal('1');183184  //   await collectionEvm.methods.setCollectionAccess(1 /*'AllowList'*/).send({from: owner});185  //   await collectionEvm.methods.addToCollectionAllowList(user).send({from: owner});186  //   await collectionEvm.methods.setCollectionMintMode(true).send({from: owner});187188  //   const ownerBalanceBefore = await ethBalanceViaSub(api, owner);189  //   const sponsorBalanceBefore = (await getBalance(api, [sponsor.address]))[0];190191  //   {192  //     const nextTokenId = await collectionEvm.methods.nextTokenId().call();193  //     expect(nextTokenId).to.be.equal('1');194  //     const result = await collectionEvm.methods.mintWithTokenURI(195  //       user,196  //       nextTokenId,197  //       'Test URI',198  //     ).send({from: user});199  //     const events = normalizeEvents(result.events);200201  //     expect(events).to.be.deep.equal([202  //       {203  //         address: collectionIdAddress,204  //         event: 'Transfer',205  //         args: {206  //           from: '0x0000000000000000000000000000000000000000',207  //           to: user,208  //           tokenId: nextTokenId,209  //         },210  //       },211  //     ]);212213  //     const ownerBalanceAfter = await ethBalanceViaSub(api, owner);214  //     const sponsorBalanceAfter = (await getBalance(api, [sponsor.address]))[0];215216  //     expect(await collectionEvm.methods.tokenURI(nextTokenId).call()).to.be.equal('Test URI');217  //     expect(ownerBalanceBefore).to.be.eq(ownerBalanceAfter);218  //     expect(sponsorBalanceBefore > sponsorBalanceAfter).to.be.true;219  //   }220  // });221222  itEth('Check that transaction via EVM spend money from sponsor address', async ({helper}) => {223    const owner = await helper.eth.createAccountWithBalance(donor);224    const collectionHelpers = helper.ethNativeContract.collectionHelpers(owner);225226    let result = await collectionHelpers.methods.createNonfungibleCollection('Sponsor collection', '1', '1').send({value: Number(2n * nominal)});227    const collectionIdAddress = helper.ethAddress.normalizeAddress(result.events.CollectionCreated.returnValues.collectionId);228    const collectionId = helper.ethAddress.extractCollectionId(collectionIdAddress);229    const collection = helper.nft.getCollectionObject(collectionId);230    const sponsor = await helper.eth.createAccountWithBalance(donor);231    const collectionEvm = helper.ethNativeContract.collection(collectionIdAddress, 'nft', owner);232233    result = await collectionEvm.methods.setCollectionSponsor(sponsor).send();234    let collectionData = (await collection.getData())!;235    expect(collectionData.raw.sponsorship.Unconfirmed).to.be.eq(helper.address.ethToSubstrate(sponsor, true));236    await expect(collectionEvm.methods.confirmCollectionSponsorship().call()).to.be.rejectedWith('caller is not set as sponsor');237238    const sponsorCollection = helper.ethNativeContract.collection(collectionIdAddress, 'nft', sponsor);239    await sponsorCollection.methods.confirmCollectionSponsorship().send();240    collectionData = (await collection.getData())!;241    expect(collectionData.raw.sponsorship.Confirmed).to.be.eq(helper.address.ethToSubstrate(sponsor, true));242243    const user = helper.eth.createAccount();244    await collectionEvm.methods.addCollectionAdmin(user).send();245    246    const ownerBalanceBefore = await helper.balance.getSubstrate(helper.address.ethToSubstrate(owner));247    const sponsorBalanceBefore = await helper.balance.getSubstrate(helper.address.ethToSubstrate(sponsor));248249    const userCollectionEvm = helper.ethNativeContract.collection(collectionIdAddress, 'nft', user);250    const nextTokenId = await userCollectionEvm.methods.nextTokenId().call();251    expect(nextTokenId).to.be.equal('1');252    result = await userCollectionEvm.methods.mintWithTokenURI(253      user,254      nextTokenId,255      'Test URI',256    ).send();257258    const events = helper.eth.normalizeEvents(result.events);259    const address = helper.ethAddress.fromCollectionId(collectionId);260261    expect(events).to.be.deep.equal([262      {263        address,264        event: 'Transfer',265        args: {266          from: '0x0000000000000000000000000000000000000000',267          to: user,268          tokenId: nextTokenId,269        },270      },271    ]);272    expect(await userCollectionEvm.methods.tokenURI(nextTokenId).call()).to.be.equal('Test URI');273  274    const ownerBalanceAfter = await helper.balance.getSubstrate(helper.address.ethToSubstrate(owner));275    expect(ownerBalanceAfter).to.be.eq(ownerBalanceBefore);276    const sponsorBalanceAfter = await helper.balance.getSubstrate(helper.address.ethToSubstrate(sponsor));277    expect(sponsorBalanceAfter < sponsorBalanceBefore).to.be.true;278  });279});
modifiedtests/src/eth/contractSponsoring.test.tsdiffbeforeafterboth
--- a/tests/src/eth/contractSponsoring.test.ts
+++ b/tests/src/eth/contractSponsoring.test.ts
@@ -14,45 +14,39 @@
 // 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 {IKeyringPair} from '@polkadot/types/types';
 import * as solc from 'solc';
-import {expect} from 'chai';
-import {expectSubstrateEventsAtBlock} from '../util/helpers';
-import Web3 from 'web3';
+import {EthUniqueHelper} from './util/playgrounds/unique.dev';
+import {itEth, expect, SponsoringMode, usingEthPlaygrounds} from '../eth/util/playgrounds';
+import {usingPlaygrounds} from '../util/playgrounds';
+import {CompiledContract} from './util/playgrounds/types';
 
-import {
-  contractHelpers,
-  createEthAccountWithBalance,
-  transferBalanceToEth,
-  deployFlipper,
-  itWeb3,
-  SponsoringMode,
-  createEthAccount,
-  ethBalanceViaSub,
-  normalizeEvents,
-  CompiledContract,
-  GAS_ARGS,
-  subToEth,
-} from './util/helpers';
-import {submitTransactionAsync} from '../substrate/substrate-api';
+describe('Sponsoring EVM contracts', () => {
+  let donor: IKeyringPair;
+
+  before(async () => {
+    await usingPlaygrounds(async (_helper, privateKey) => {
+      donor = privateKey('//Alice');
+    });
+  });
+
+  itEth('Self sponsored can be set by the address that deployed the contract', async ({helper, privateKey}) => {
+    const owner = await helper.eth.createAccountWithBalance(donor);
+    const flipper = await helper.eth.deployFlipper(owner);
+    const helpers = helper.ethNativeContract.contractHelpers(owner);
 
-describe('Sponsoring EVM contracts', () => {
-  itWeb3('Self sponsored can be set by the address that deployed the contract', async ({api, web3, privateKeyWrapper}) => {
-    const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-    const flipper = await deployFlipper(web3, owner);
-    const helpers = contractHelpers(web3, owner);
     expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.false;
     await expect(helpers.methods.selfSponsoredEnable(flipper.options.address).send()).to.be.not.rejected;
     expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.true;
   });
 
-  itWeb3('Set self sponsored events', async ({api, web3, privateKeyWrapper}) => {
-    const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-    const flipper = await deployFlipper(web3, owner);
-    const helpers = contractHelpers(web3, owner);
+  itEth('Set self sponsored events', async ({helper}) => {
+    const owner = await helper.eth.createAccountWithBalance(donor);
+    const flipper = await helper.eth.deployFlipper(owner);
+    const helpers = helper.ethNativeContract.contractHelpers(owner);
     
     const result = await helpers.methods.selfSponsoredEnable(flipper.options.address).send();
-    // console.log(result);
-    const ethEvents = normalizeEvents(result.events);
+    const ethEvents = helper.eth.helper.eth.normalizeEvents(result.events);
     expect(ethEvents).to.be.deep.equal([
       {
         address: flipper.options.address,
@@ -71,62 +65,59 @@
         },
       },
     ]);
-
-    await expectSubstrateEventsAtBlock(
-      api, 
-      result.blockNumber,
-      'evmContractHelpers',
-      ['ContractSponsorSet','ContractSponsorshipConfirmed'],
-    );
   });
 
-  itWeb3('Self sponsored can not be set by the address that did not deployed the contract', async ({api, web3, privateKeyWrapper}) => {
-    const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-    const notOwner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-    const flipper = await deployFlipper(web3, owner);
-    const helpers = contractHelpers(web3, owner);
+  itEth('Self sponsored can not be set by the address that did not deployed the contract', async ({helper}) => {
+    const owner = await helper.eth.createAccountWithBalance(donor);
+    const notOwner = await helper.eth.createAccountWithBalance(donor);
+    const helpers = helper.ethNativeContract.contractHelpers(owner);
+    const flipper = await helper.eth.deployFlipper(owner);
+
     expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.false;
     await expect(helpers.methods.selfSponsoredEnable(flipper.options.address).call({from: notOwner})).to.be.rejectedWith('NoPermission');
     expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.false;
   });
 
-  itWeb3('Sponsoring can be set by the address that has deployed the contract', async ({api, web3, privateKeyWrapper}) => {
-    const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-    const flipper = await deployFlipper(web3, owner);
-    const helpers = contractHelpers(web3, owner);
+  itEth('Sponsoring can be set by the address that has deployed the contract', async ({helper}) => {
+    const owner = await helper.eth.createAccountWithBalance(donor);
+    const helpers = helper.ethNativeContract.contractHelpers(owner);
+    const flipper = await helper.eth.deployFlipper(owner);
+
     expect(await helpers.methods.sponsoringEnabled(flipper.options.address).call()).to.be.false;
     await expect(helpers.methods.setSponsoringMode(flipper.options.address, SponsoringMode.Allowlisted).send({from: owner})).to.be.not.rejected;
     expect(await helpers.methods.sponsoringEnabled(flipper.options.address).call()).to.be.true;
   });
 
-  itWeb3('Sponsoring cannot be set by the address that did not deployed the contract', async ({api, web3, privateKeyWrapper}) => {
-    const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-    const notOwner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-    const flipper = await deployFlipper(web3, owner);
-    const helpers = contractHelpers(web3, owner);
+  itEth('Sponsoring cannot be set by the address that did not deployed the contract', async ({helper}) => {
+    const owner = await helper.eth.createAccountWithBalance(donor);
+    const notOwner = await helper.eth.createAccountWithBalance(donor);
+    const helpers = helper.ethNativeContract.contractHelpers(owner);
+    const flipper = await helper.eth.deployFlipper(owner);
+
     expect(await helpers.methods.sponsoringEnabled(flipper.options.address).call()).to.be.false;
     await expect(helpers.methods.setSponsoringMode(notOwner, SponsoringMode.Allowlisted).call({from: notOwner})).to.be.rejectedWith('NoPermission');
     expect(await helpers.methods.sponsoringEnabled(flipper.options.address).call()).to.be.false;
   });
   
-  itWeb3('Sponsor can be set by the address that deployed the contract', async ({api, web3, privateKeyWrapper}) => {
-    const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-    const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-    const flipper = await deployFlipper(web3, owner);
-    const helpers = contractHelpers(web3, owner);
+  itEth('Sponsor can be set by the address that deployed the contract', async ({helper}) => {
+    const owner = await helper.eth.createAccountWithBalance(donor);
+    const sponsor = await helper.eth.createAccountWithBalance(donor);
+    const helpers = helper.ethNativeContract.contractHelpers(owner);
+    const flipper = await helper.eth.deployFlipper(owner);
+
     expect(await helpers.methods.hasPendingSponsor(flipper.options.address).call()).to.be.false;
     await expect(helpers.methods.setSponsor(flipper.options.address, sponsor).send()).to.be.not.rejected;
     expect(await helpers.methods.hasPendingSponsor(flipper.options.address).call()).to.be.true;
   });
   
-  itWeb3('Set sponsor event', async ({api, web3, privateKeyWrapper}) => {
-    const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-    const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-    const flipper = await deployFlipper(web3, owner);
-    const helpers = contractHelpers(web3, owner);
+  itEth('Set sponsor event', async ({helper}) => {
+    const owner = await helper.eth.createAccountWithBalance(donor);
+    const sponsor = await helper.eth.createAccountWithBalance(donor);
+    const helpers = helper.ethNativeContract.contractHelpers(owner);
+    const flipper = await helper.eth.deployFlipper(owner);
     
     const result = await helpers.methods.setSponsor(flipper.options.address, sponsor).send();
-    const events = normalizeEvents(result.events);
+    const events = helper.eth.normalizeEvents(result.events);
     expect(events).to.be.deep.equal([
       {
         address: flipper.options.address,
@@ -137,45 +128,41 @@
         },
       },
     ]);
-
-    await expectSubstrateEventsAtBlock(
-      api, 
-      result.blockNumber,
-      'evmContractHelpers',
-      ['ContractSponsorSet'],
-    );
   });
   
-  itWeb3('Sponsor can not be set by the address that did not deployed the contract', async ({api, web3, privateKeyWrapper}) => {
-    const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-    const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-    const notOwner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-    const flipper = await deployFlipper(web3, owner);
-    const helpers = contractHelpers(web3, owner);
+  itEth('Sponsor can not be set by the address that did not deployed the contract', async ({helper}) => {
+    const owner = await helper.eth.createAccountWithBalance(donor);
+    const sponsor = await helper.eth.createAccountWithBalance(donor);
+    const notOwner = await helper.eth.createAccountWithBalance(donor);
+    const helpers = helper.ethNativeContract.contractHelpers(owner);
+    const flipper = await helper.eth.deployFlipper(owner);
+
     expect(await helpers.methods.hasPendingSponsor(flipper.options.address).call()).to.be.false;
     await expect(helpers.methods.setSponsor(flipper.options.address, sponsor).call({from: notOwner})).to.be.rejectedWith('NoPermission');
     expect(await helpers.methods.hasPendingSponsor(flipper.options.address).call()).to.be.false;
   });
 
-  itWeb3('Sponsorship can be confirmed by the address that pending as sponsor', async ({api, web3, privateKeyWrapper}) => {
-    const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-    const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-    const flipper = await deployFlipper(web3, owner);
-    const helpers = contractHelpers(web3, owner);
+  itEth('Sponsorship can be confirmed by the address that pending as sponsor', async ({helper}) => {
+    const owner = await helper.eth.createAccountWithBalance(donor);
+    const sponsor = await helper.eth.createAccountWithBalance(donor);
+    const helpers = helper.ethNativeContract.contractHelpers(owner);
+    const flipper = await helper.eth.deployFlipper(owner);
+
     expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.false;
     await expect(helpers.methods.setSponsor(flipper.options.address, sponsor).send()).to.be.not.rejected;
     await expect(helpers.methods.confirmSponsorship(flipper.options.address).send({from: sponsor})).to.be.not.rejected;
     expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.true;
   });
 
-  itWeb3('Confirm sponsorship event', async ({api, web3, privateKeyWrapper}) => {
-    const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-    const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-    const flipper = await deployFlipper(web3, owner);
-    const helpers = contractHelpers(web3, owner);
+  itEth('Confirm sponsorship event', async ({helper}) => {
+    const owner = await helper.eth.createAccountWithBalance(donor);
+    const sponsor = await helper.eth.createAccountWithBalance(donor);
+    const helpers = helper.ethNativeContract.contractHelpers(owner);
+    const flipper = await helper.eth.deployFlipper(owner);
+
     await expect(helpers.methods.setSponsor(flipper.options.address, sponsor).send()).to.be.not.rejected;
     const result = await helpers.methods.confirmSponsorship(flipper.options.address).send({from: sponsor});
-    const events = normalizeEvents(result.events);
+    const events = helper.eth.normalizeEvents(result.events);
     expect(events).to.be.deep.equal([
       {
         address: flipper.options.address,
@@ -186,41 +173,37 @@
         },
       },
     ]);
+  });
 
-    await expectSubstrateEventsAtBlock(
-      api, 
-      result.blockNumber,
-      'evmContractHelpers',
-      ['ContractSponsorshipConfirmed'],
-    );
-  });
+  itEth('Sponsorship can not be confirmed by the address that not pending as sponsor', async ({helper}) => {
+    const owner = await helper.eth.createAccountWithBalance(donor);
+    const sponsor = await helper.eth.createAccountWithBalance(donor);
+    const notSponsor = await helper.eth.createAccountWithBalance(donor);
+    const helpers = helper.ethNativeContract.contractHelpers(owner);
+    const flipper = await helper.eth.deployFlipper(owner);
 
-  itWeb3('Sponsorship can not be confirmed by the address that not pending as sponsor', async ({api, web3, privateKeyWrapper}) => {
-    const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-    const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-    const notSponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-    const flipper = await deployFlipper(web3, owner);
-    const helpers = contractHelpers(web3, owner);
     expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.false;
     await expect(helpers.methods.setSponsor(flipper.options.address, sponsor).send()).to.be.not.rejected;
     await expect(helpers.methods.confirmSponsorship(flipper.options.address).call({from: notSponsor})).to.be.rejectedWith('NoPermission');
     expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.false;
   });
 
-  itWeb3('Sponsorship can not be confirmed by the address that not set as sponsor', async ({api, web3, privateKeyWrapper}) => {
-    const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-    const notSponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-    const flipper = await deployFlipper(web3, owner);
-    const helpers = contractHelpers(web3, owner);
+  itEth('Sponsorship can not be confirmed by the address that not set as sponsor', async ({helper}) => {
+    const owner = await helper.eth.createAccountWithBalance(donor);
+    const notSponsor = await helper.eth.createAccountWithBalance(donor);
+    const helpers = helper.ethNativeContract.contractHelpers(owner);
+    const flipper = await helper.eth.deployFlipper(owner);
+
     expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.false;
     await expect(helpers.methods.confirmSponsorship(flipper.options.address).call({from: notSponsor})).to.be.rejectedWith('NoPendingSponsor');
     expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.false;
   });
 
-  itWeb3('Get self sponsored sponsor', async ({api, web3, privateKeyWrapper}) => {
-    const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-    const flipper = await deployFlipper(web3, owner);
-    const helpers = contractHelpers(web3, owner);
+  itEth('Get self sponsored sponsor', async ({helper}) => {
+    const owner = await helper.eth.createAccountWithBalance(donor);
+    const helpers = helper.ethNativeContract.contractHelpers(owner);
+    const flipper = await helper.eth.deployFlipper(owner);
+
     await helpers.methods.selfSponsoredEnable(flipper.options.address).send();
     
     const result = await helpers.methods.sponsor(flipper.options.address).call();
@@ -229,11 +212,12 @@
     expect(result[1]).to.be.eq('0');
   });
 
-  itWeb3('Get confirmed sponsor', async ({api, web3, privateKeyWrapper}) => {
-    const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-    const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-    const flipper = await deployFlipper(web3, owner);
-    const helpers = contractHelpers(web3, owner);
+  itEth('Get confirmed sponsor', async ({helper}) => {
+    const owner = await helper.eth.createAccountWithBalance(donor);
+    const sponsor = await helper.eth.createAccountWithBalance(donor);
+    const helpers = helper.ethNativeContract.contractHelpers(owner);
+    const flipper = await helper.eth.deployFlipper(owner);
+
     await helpers.methods.setSponsor(flipper.options.address, sponsor).send();
     await helpers.methods.confirmSponsorship(flipper.options.address).send({from: sponsor});
     
@@ -243,11 +227,11 @@
     expect(result[1]).to.be.eq('0');
   });
 
-  itWeb3('Sponsor can be removed by the address that deployed the contract', async ({api, web3, privateKeyWrapper}) => {
-    const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-    const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-    const flipper = await deployFlipper(web3, owner);
-    const helpers = contractHelpers(web3, owner);
+  itEth('Sponsor can be removed by the address that deployed the contract', async ({helper}) => {
+    const owner = await helper.eth.createAccountWithBalance(donor);
+    const sponsor = await helper.eth.createAccountWithBalance(donor);
+    const helpers = helper.ethNativeContract.contractHelpers(owner);
+    const flipper = await helper.eth.deployFlipper(owner);
 
     expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.false;
     await helpers.methods.setSponsor(flipper.options.address, sponsor).send();
@@ -258,17 +242,17 @@
     expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.false;
   });
 
-  itWeb3('Remove sponsor event', async ({api, web3, privateKeyWrapper}) => {
-    const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-    const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-    const flipper = await deployFlipper(web3, owner);
-    const helpers = contractHelpers(web3, owner);
+  itEth('Remove sponsor event', async ({helper}) => {
+    const owner = await helper.eth.createAccountWithBalance(donor);
+    const sponsor = await helper.eth.createAccountWithBalance(donor);
+    const helpers = helper.ethNativeContract.contractHelpers(owner);
+    const flipper = await helper.eth.deployFlipper(owner);
 
     await helpers.methods.setSponsor(flipper.options.address, sponsor).send();
     await helpers.methods.confirmSponsorship(flipper.options.address).send({from: sponsor});
     
     const result = await helpers.methods.removeSponsor(flipper.options.address).send();
-    const events = normalizeEvents(result.events);
+    const events = helper.eth.normalizeEvents(result.events);
     expect(events).to.be.deep.equal([
       {
         address: flipper.options.address,
@@ -278,21 +262,14 @@
         },
       },
     ]);
-
-    await expectSubstrateEventsAtBlock(
-      api, 
-      result.blockNumber,
-      'evmContractHelpers',
-      ['ContractSponsorRemoved'],
-    );
   });
 
-  itWeb3('Sponsor can not be removed by the address that did not deployed the contract', async ({api, web3, privateKeyWrapper}) => {
-    const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-    const notOwner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-    const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-    const flipper = await deployFlipper(web3, owner);
-    const helpers = contractHelpers(web3, owner);
+  itEth('Sponsor can not be removed by the address that did not deployed the contract', async ({helper}) => {
+    const owner = await helper.eth.createAccountWithBalance(donor);
+    const notOwner = await helper.eth.createAccountWithBalance(donor);
+    const sponsor = await helper.eth.createAccountWithBalance(donor);
+    const helpers = helper.ethNativeContract.contractHelpers(owner);
+    const flipper = await helper.eth.deployFlipper(owner);
 
     expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.false;
     await helpers.methods.setSponsor(flipper.options.address, sponsor).send();
@@ -303,14 +280,12 @@
     expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.true;
   });
 
-  itWeb3('In generous mode, non-allowlisted user transaction will be sponsored', async ({api, web3, privateKeyWrapper}) => {
-    const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-    const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-    const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-
-    const flipper = await deployFlipper(web3, owner);
-
-    const helpers = contractHelpers(web3, owner);
+  itEth('In generous mode, non-allowlisted user transaction will be sponsored', async ({helper}) => {
+    const owner = await helper.eth.createAccountWithBalance(donor);
+    const sponsor = await helper.eth.createAccountWithBalance(donor);
+    const caller = await helper.eth.createAccountWithBalance(donor);
+    const helpers = helper.ethNativeContract.contractHelpers(owner);
+    const flipper = await helper.eth.deployFlipper(owner);
 
     await helpers.methods.setSponsor(flipper.options.address, sponsor).send();
     await helpers.methods.confirmSponsorship(flipper.options.address).send({from: sponsor});
@@ -318,57 +293,52 @@
     await helpers.methods.setSponsoringMode(flipper.options.address, SponsoringMode.Generous).send({from: owner});
     await helpers.methods.setSponsoringRateLimit(flipper.options.address, 0).send({from: owner});
 
-    const sponsorBalanceBefore = await ethBalanceViaSub(api, sponsor);
-    const callerBalanceBefore = await ethBalanceViaSub(api, caller);
+    const sponsorBalanceBefore = await helper.balance.getSubstrate(await helper.address.ethToSubstrate(sponsor));
+    const callerBalanceBefore = await helper.balance.getSubstrate(await helper.address.ethToSubstrate(caller));
 
     await flipper.methods.flip().send({from: caller});
     expect(await flipper.methods.getValue().call()).to.be.true;
 
     // Balance should be taken from sponsor instead of caller
-    const sponsorBalanceAfter = await ethBalanceViaSub(api, sponsor);
-    const callerBalanceAfter = await ethBalanceViaSub(api, caller);
+    const sponsorBalanceAfter = await helper.balance.getSubstrate(await helper.address.ethToSubstrate(sponsor));
+    const callerBalanceAfter = await helper.balance.getSubstrate(await helper.address.ethToSubstrate(caller));
     expect(sponsorBalanceAfter < sponsorBalanceBefore).to.be.true;
     expect(callerBalanceAfter).to.be.eq(callerBalanceBefore);
   });
-
-  itWeb3('In generous mode, non-allowlisted user transaction will be self sponsored', async ({api, web3, privateKeyWrapper}) => {
-    const alice = privateKeyWrapper('//Alice');
-
-    const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-    const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-
-    const flipper = await deployFlipper(web3, owner);
 
-    const helpers = contractHelpers(web3, owner);
+  itEth('In generous mode, non-allowlisted user transaction will be self sponsored', async ({helper}) => {
+    const owner = await helper.eth.createAccountWithBalance(donor);
+    const caller = await helper.eth.createAccountWithBalance(donor);
+    const helpers = helper.ethNativeContract.contractHelpers(owner);
+    const flipper = await helper.eth.deployFlipper(owner);
 
     await helpers.methods.selfSponsoredEnable(flipper.options.address).send();
 
     await helpers.methods.setSponsoringMode(flipper.options.address, SponsoringMode.Generous).send({from: owner});
     await helpers.methods.setSponsoringRateLimit(flipper.options.address, 0).send({from: owner});
 
-    await transferBalanceToEth(api, alice, flipper.options.address);
+    await helper.eth.transferBalanceFromSubstrate(donor, flipper.options.address);
 
-    const contractBalanceBefore = await ethBalanceViaSub(api, flipper.options.address);
-    const callerBalanceBefore = await ethBalanceViaSub(api, caller);
+    const contractBalanceBefore = await helper.balance.getSubstrate(await helper.address.ethToSubstrate(flipper.options.address));
+    const callerBalanceBefore = await helper.balance.getSubstrate(await helper.address.ethToSubstrate(caller));
 
     await flipper.methods.flip().send({from: caller});
     expect(await flipper.methods.getValue().call()).to.be.true;
 
     // Balance should be taken from sponsor instead of caller
-    const contractBalanceAfter = await ethBalanceViaSub(api, flipper.options.address);
-    const callerBalanceAfter = await ethBalanceViaSub(api, caller);
+    const contractBalanceAfter = await helper.balance.getSubstrate(await helper.address.ethToSubstrate(flipper.options.address));
+    const callerBalanceAfter = await helper.balance.getSubstrate(await helper.address.ethToSubstrate(caller));
     expect(contractBalanceAfter < contractBalanceBefore).to.be.true;
     expect(callerBalanceAfter).to.be.eq(callerBalanceBefore);
   });
 
-  itWeb3('Sponsoring is set, an address that has no UNQ can send a transaction and it works. Sponsor balance should decrease (allowlisted)', async ({api, web3, privateKeyWrapper}) => {
-    const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-    const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-    const caller = createEthAccount(web3);
-
-    const flipper = await deployFlipper(web3, owner);
+  itEth('Sponsoring is set, an address that has no UNQ can send a transaction and it works. Sponsor balance should decrease (allowlisted)', async ({helper}) => {
+    const owner = await helper.eth.createAccountWithBalance(donor);
+    const sponsor = await helper.eth.createAccountWithBalance(donor);
+    const caller = helper.eth.createAccount();
+    const helpers = helper.ethNativeContract.contractHelpers(owner);
+    const flipper = await helper.eth.deployFlipper(owner);
 
-    const helpers = contractHelpers(web3, owner);
     await helpers.methods.toggleAllowlist(flipper.options.address, true).send({from: owner});
     await helpers.methods.toggleAllowed(flipper.options.address, caller, true).send({from: owner});
 
@@ -378,51 +348,47 @@
     await helpers.methods.setSponsor(flipper.options.address, sponsor).send();
     await helpers.methods.confirmSponsorship(flipper.options.address).send({from: sponsor});
 
-    const sponsorBalanceBefore = await ethBalanceViaSub(api, sponsor);
+    const sponsorBalanceBefore = await helper.balance.getSubstrate(await helper.address.ethToSubstrate(sponsor));
     expect(sponsorBalanceBefore).to.be.not.equal('0');
 
     await flipper.methods.flip().send({from: caller});
     expect(await flipper.methods.getValue().call()).to.be.true;
 
     // Balance should be taken from flipper instead of caller
-    const sponsorBalanceAfter = await ethBalanceViaSub(api, sponsor);
+    const sponsorBalanceAfter = await helper.balance.getSubstrate(await helper.address.ethToSubstrate(sponsor));
     expect(sponsorBalanceAfter < sponsorBalanceBefore).to.be.true;
   });
 
-  itWeb3('Sponsoring is set, an address that has no UNQ can send a transaction and it works. Sponsor balance should not decrease (non-allowlisted)', async ({api, web3, privateKeyWrapper}) => {
-    const alice = privateKeyWrapper('//Alice');
-
-    const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-    const caller = createEthAccount(web3);
-
-    const flipper = await deployFlipper(web3, owner);
+  itEth('Sponsoring is set, an address that has no UNQ can send a transaction and it works. Sponsor balance should not decrease (non-allowlisted)', async ({helper}) => {
+    const owner = await helper.eth.createAccountWithBalance(donor);
+    const caller = await helper.eth.createAccount();
+    const helpers = helper.ethNativeContract.contractHelpers(owner);
+    const flipper = await helper.eth.deployFlipper(owner);
 
-    const helpers = contractHelpers(web3, owner);
-
     await helpers.methods.setSponsoringMode(flipper.options.address, SponsoringMode.Allowlisted).send({from: owner});
     await helpers.methods.setSponsoringRateLimit(flipper.options.address, 0).send({from: owner});
 
-    await transferBalanceToEth(api, alice, flipper.options.address);
+    await helper.eth.transferBalanceFromSubstrate(donor, flipper.options.address);
 
-    const originalFlipperBalance = await web3.eth.getBalance(flipper.options.address);
+    const originalFlipperBalance = await helper.balance.getEthereum(flipper.options.address);
     expect(originalFlipperBalance).to.be.not.equal('0');
 
     await expect(flipper.methods.flip().send({from: caller})).to.be.rejectedWith(/InvalidTransaction::Payment/);
     expect(await flipper.methods.getValue().call()).to.be.false;
 
     // Balance should be taken from flipper instead of caller
-    const balanceAfter = await web3.eth.getBalance(flipper.options.address);
-    expect(+balanceAfter).to.be.equals(+originalFlipperBalance);
+    // FIXME the comment is wrong! What check should be here?
+    const balanceAfter = await helper.balance.getEthereum(flipper.options.address);
+    expect(balanceAfter).to.be.equals(originalFlipperBalance);
   });
 
-  itWeb3('Sponsoring is set, an address that has UNQ can send a transaction and it works. User balance should not change', async ({api, web3, privateKeyWrapper}) => {
-    const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-    const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-    const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-
-    const flipper = await deployFlipper(web3, owner);
+  itEth('Sponsoring is set, an address that has UNQ can send a transaction and it works. User balance should not change', async ({helper}) => {
+    const owner = await helper.eth.createAccountWithBalance(donor);
+    const sponsor = await helper.eth.createAccountWithBalance(donor);
+    const caller = await helper.eth.createAccountWithBalance(donor);
+    const helpers = helper.ethNativeContract.contractHelpers(owner);
+    const flipper = await helper.eth.deployFlipper(owner);
 
-    const helpers = contractHelpers(web3, owner);
     await helpers.methods.toggleAllowlist(flipper.options.address, true).send({from: owner});
     await helpers.methods.toggleAllowed(flipper.options.address, caller, true).send({from: owner});
 
@@ -432,27 +398,26 @@
     await helpers.methods.setSponsor(flipper.options.address, sponsor).send();
     await helpers.methods.confirmSponsorship(flipper.options.address).send({from: sponsor});
 
-    const sponsorBalanceBefore = await ethBalanceViaSub(api, sponsor);
-    const callerBalanceBefore = await ethBalanceViaSub(api, caller);
+    const sponsorBalanceBefore = await helper.balance.getSubstrate(await helper.address.ethToSubstrate(sponsor));
+    const callerBalanceBefore = await helper.balance.getSubstrate(await helper.address.ethToSubstrate(caller));
 
     await flipper.methods.flip().send({from: caller});
     expect(await flipper.methods.getValue().call()).to.be.true;
 
-    const sponsorBalanceAfter = await ethBalanceViaSub(api, sponsor);
-    const callerBalanceAfter = await ethBalanceViaSub(api, caller);
+    const sponsorBalanceAfter = await helper.balance.getSubstrate(await helper.address.ethToSubstrate(sponsor));
+    const callerBalanceAfter = await helper.balance.getSubstrate(await helper.address.ethToSubstrate(caller));
     expect(sponsorBalanceAfter < sponsorBalanceBefore).to.be.true;
     expect(callerBalanceAfter).to.be.equals(callerBalanceBefore);
   });
 
-  itWeb3('Sponsoring is limited, with setContractRateLimit. The limitation is working if transactions are sent more often, the sender pays the commission.', async ({api, web3, privateKeyWrapper}) => {
-    const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-    const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-    const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-    const originalCallerBalance = await web3.eth.getBalance(caller);
-
-    const flipper = await deployFlipper(web3, owner);
-
-    const helpers = contractHelpers(web3, owner);
+  itEth('Sponsoring is limited, with setContractRateLimit. The limitation is working if transactions are sent more often, the sender pays the commission.', async ({helper}) => {
+    const owner = await helper.eth.createAccountWithBalance(donor);
+    const sponsor = await helper.eth.createAccountWithBalance(donor);
+    const caller = await helper.eth.createAccountWithBalance(donor);
+    const helpers = helper.ethNativeContract.contractHelpers(owner);
+    const flipper = await helper.eth.deployFlipper(owner);
+    
+    const originalCallerBalance = await helper.balance.getEthereum(caller);
     await helpers.methods.toggleAllowlist(flipper.options.address, true).send({from: owner});
     await helpers.methods.toggleAllowed(flipper.options.address, caller, true).send({from: owner});
 
@@ -462,34 +427,36 @@
     await helpers.methods.setSponsor(flipper.options.address, sponsor).send();
     await helpers.methods.confirmSponsorship(flipper.options.address).send({from: sponsor});
 
-    const originalFlipperBalance = await web3.eth.getBalance(sponsor);
+    const originalFlipperBalance = await helper.balance.getEthereum(sponsor);
     expect(originalFlipperBalance).to.be.not.equal('0');
 
     await flipper.methods.flip().send({from: caller});
     expect(await flipper.methods.getValue().call()).to.be.true;
-    expect(await web3.eth.getBalance(caller)).to.be.equals(originalCallerBalance);
+    expect(await helper.balance.getEthereum(caller)).to.be.equals(originalCallerBalance);
 
-    const newFlipperBalance = await web3.eth.getBalance(sponsor);
+    const newFlipperBalance = await helper.balance.getEthereum(sponsor);
     expect(newFlipperBalance).to.be.not.equals(originalFlipperBalance);
 
     await flipper.methods.flip().send({from: caller});
-    expect(await web3.eth.getBalance(sponsor)).to.be.equal(newFlipperBalance);
-    expect(await web3.eth.getBalance(caller)).to.be.not.equals(originalCallerBalance);
+    expect(await helper.balance.getEthereum(sponsor)).to.be.equal(newFlipperBalance);
+    expect(await helper.balance.getEthereum(caller)).to.be.not.equals(originalCallerBalance);
   });
 
   // TODO: Find a way to calculate default rate limit
-  itWeb3('Default rate limit equals 7200', async ({api, web3, privateKeyWrapper}) => {
-    const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-    const flipper = await deployFlipper(web3, owner);
-    const helpers = contractHelpers(web3, owner);
+  itEth('Default rate limit equals 7200', async ({helper}) => {
+    const owner = await helper.eth.createAccountWithBalance(donor);
+    const helpers = helper.ethNativeContract.contractHelpers(owner);
+    const flipper = await helper.eth.deployFlipper(owner);
+
     expect(await helpers.methods.sponsoringRateLimit(flipper.options.address).call()).to.be.equals('7200');
   });
 });
 
 describe('Sponsoring Fee Limit', () => {
+  let donor: IKeyringPair;
+  let alice: IKeyringPair;
+  let DEFAULT_GAS: number;
 
-  let testContract: CompiledContract;
-  
   function compileTestContract() {
     if (!testContract) {
       const input = {
@@ -537,46 +504,67 @@
     return testContract;
   }
   
-  async function deployTestContract(web3: Web3, owner: string) {
+  async function deployTestContract(helper: EthUniqueHelper, owner: string) {
+    const web3 = helper.getWeb3();
     const compiled = compileTestContract();
     const testContract = new web3.eth.Contract(compiled.abi, undefined, {
       data: compiled.object,
       from: owner,
-      ...GAS_ARGS,
+      gas: DEFAULT_GAS,
     });
     return await testContract.deploy({data: compiled.object}).send({from: owner});
   }
 
-  itWeb3('Default fee limit', async ({api, web3, privateKeyWrapper}) => {
-    const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-    const flipper = await deployFlipper(web3, owner);
-    const helpers = contractHelpers(web3, owner);
+  before(async () => {
+    await usingEthPlaygrounds(async (helper, privateKey) => {
+      donor = privateKey('//Alice');
+      DEFAULT_GAS = helper.eth.DEFAULT_GAS;
+    });
+  });
+
+  beforeEach(async () => {
+    await usingPlaygrounds(async (helper) => {
+      [alice] = await helper.arrange.createAccounts([1000n], donor);
+    });
+  });
+
+  let testContract: CompiledContract;
+  
+
+
+  itEth('Default fee limit', async ({helper}) => {
+    const owner = await helper.eth.createAccountWithBalance(donor);
+    const helpers = helper.ethNativeContract.contractHelpers(owner);
+    const flipper = await helper.eth.deployFlipper(owner);
+
     expect(await helpers.methods.sponsoringFeeLimit(flipper.options.address).call()).to.be.equals('115792089237316195423570985008687907853269984665640564039457584007913129639935');
   });
 
-  itWeb3('Set fee limit', async ({api, web3, privateKeyWrapper}) => {
-    const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-    const flipper = await deployFlipper(web3, owner);
-    const helpers = contractHelpers(web3, owner);
+  itEth('Set fee limit', async ({helper}) => {
+    const owner = await helper.eth.createAccountWithBalance(donor);
+    const helpers = helper.ethNativeContract.contractHelpers(owner);
+    const flipper = await helper.eth.deployFlipper(owner);
+
     await helpers.methods.setSponsoringFeeLimit(flipper.options.address, 100).send();
     expect(await helpers.methods.sponsoringFeeLimit(flipper.options.address).call()).to.be.equals('100');
   });
 
-  itWeb3('Negative test - set fee limit by non-owner', async ({api, web3, privateKeyWrapper}) => {
-    const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-    const stranger = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-    const flipper = await deployFlipper(web3, owner);
-    const helpers = contractHelpers(web3, owner);
+  itEth('Negative test - set fee limit by non-owner', async ({helper}) => {
+    const owner = await helper.eth.createAccountWithBalance(donor);
+    const stranger = await helper.eth.createAccountWithBalance(donor);
+    const helpers = helper.ethNativeContract.contractHelpers(owner);
+    const flipper = await helper.eth.deployFlipper(owner);
+
     await expect(helpers.methods.setSponsoringFeeLimit(flipper.options.address, 100).send({from: stranger})).to.be.rejected;
   });
 
-  itWeb3('Negative test - check that eth transactions exceeding fee limit are not executed', async ({api, web3, privateKeyWrapper}) => {
-    const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-    const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-    const user = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
+  itEth('Negative test - check that eth transactions exceeding fee limit are not executed', async ({helper}) => {
+    const owner = await helper.eth.createAccountWithBalance(donor);
+    const sponsor = await helper.eth.createAccountWithBalance(donor);
+    const user = await helper.eth.createAccountWithBalance(donor);
+    const helpers = helper.ethNativeContract.contractHelpers(owner);
 
-    const testContract = await deployTestContract(web3, owner);
-    const helpers = contractHelpers(web3, owner);
+    const testContract = await deployTestContract(helper, owner);
     
     await helpers.methods.setSponsoringMode(testContract.options.address, SponsoringMode.Generous).send({from: owner});
     await helpers.methods.setSponsoringRateLimit(testContract.options.address, 0).send({from: owner});
@@ -584,24 +572,24 @@
     await helpers.methods.setSponsor(testContract.options.address, sponsor).send();
     await helpers.methods.confirmSponsorship(testContract.options.address).send({from: sponsor});
 
-    const gasPrice = BigInt(await web3.eth.getGasPrice());
+    const gasPrice = BigInt(await helper.getWeb3().eth.getGasPrice());
 
     await helpers.methods.setSponsoringFeeLimit(testContract.options.address, 2_000_000n * gasPrice).send();
 
-    const originalUserBalance = await web3.eth.getBalance(user);
+    const originalUserBalance = await helper.balance.getEthereum(user);
     await testContract.methods.test(100).send({from: user, gas: 2_000_000});
-    expect(await web3.eth.getBalance(user)).to.be.equal(originalUserBalance);
+    expect(await helper.balance.getEthereum(user)).to.be.equal(originalUserBalance);
 
     await testContract.methods.test(100).send({from: user, gas: 2_100_000});
-    expect(await web3.eth.getBalance(user)).to.not.be.equal(originalUserBalance);
+    expect(await helper.balance.getEthereum(user)).to.not.be.equal(originalUserBalance);
   });
 
-  itWeb3('Negative test - check that evm.call transactions exceeding fee limit are not executed', async ({api, web3, privateKeyWrapper}) => {
-    const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-    const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
+  itEth('Negative test - check that evm.call transactions exceeding fee limit are not executed', async ({helper, privateKey}) => {
+    const owner = await helper.eth.createAccountWithBalance(donor);
+    const sponsor = await helper.eth.createAccountWithBalance(donor);
+    const helpers = helper.ethNativeContract.contractHelpers(owner);
 
-    const testContract = await deployTestContract(web3, owner);
-    const helpers = contractHelpers(web3, owner);
+    const testContract = await deployTestContract(helper, owner);
     
     await helpers.methods.setSponsoringMode(testContract.options.address, SponsoringMode.Generous).send({from: owner});
     await helpers.methods.setSponsoringRateLimit(testContract.options.address, 0).send({from: owner});
@@ -609,43 +597,29 @@
     await helpers.methods.setSponsor(testContract.options.address, sponsor).send();
     await helpers.methods.confirmSponsorship(testContract.options.address).send({from: sponsor});
 
-    const gasPrice = BigInt(await web3.eth.getGasPrice());
+    const gasPrice = BigInt(await helper.getWeb3().eth.getGasPrice());
 
     await helpers.methods.setSponsoringFeeLimit(testContract.options.address, 2_000_000n * gasPrice).send();
 
-    const alice = privateKeyWrapper('//Alice');
-    const originalAliceBalance = (await api.query.system.account(alice.address)).data.free.toBigInt();
-    
-    await submitTransactionAsync(
+    const originalAliceBalance = await helper.balance.getSubstrate(alice.address);
+
+    await helper.eth.sendEVM(
       alice,
-      api.tx.evm.call(
-        subToEth(alice.address),
-        testContract.options.address,
-        testContract.methods.test(100).encodeABI(),
-        Uint8Array.from([]),
-        2_000_000n,
-        gasPrice,
-        null,
-        null,
-        [],
-      ),
+      testContract.options.address,
+      testContract.methods.test(100).encodeABI(),
+      '0',
+      2_000_000,
     );
-    expect((await api.query.system.account(alice.address)).data.free.toBigInt()).to.be.equal(originalAliceBalance);
+    // expect((await api.query.system.account(alice.address)).data.free.toBigInt()).to.be.equal(originalAliceBalance);
+    expect(await helper.balance.getSubstrate(alice.address)).to.be.equal(originalAliceBalance);
     
-    await submitTransactionAsync(
+    await helper.eth.sendEVM(
       alice,
-      api.tx.evm.call(
-        subToEth(alice.address),
-        testContract.options.address,
-        testContract.methods.test(100).encodeABI(),
-        Uint8Array.from([]),
-        2_100_000n,
-        gasPrice,
-        null,
-        null,
-        [],
-      ),
+      testContract.options.address,
+      testContract.methods.test(100).encodeABI(),
+      '0',
+      2_100_000,
     );
-    expect((await api.query.system.account(alice.address)).data.free.toBigInt()).to.not.be.equal(originalAliceBalance);
+    expect(await helper.balance.getSubstrate(alice.address)).to.not.be.equal(originalAliceBalance);
   });
 });
modifiedtests/src/eth/scheduling.test.tsdiffbeforeafterboth
--- a/tests/src/eth/scheduling.test.ts
+++ b/tests/src/eth/scheduling.test.ts
@@ -18,7 +18,8 @@
 import {createEthAccountWithBalance, deployFlipper, GAS_ARGS, itWeb3, subToEth, transferBalanceToEth} from './util/helpers';
 import {scheduleExpectSuccess, waitNewBlocks, requirePallets, Pallets} from '../util/helpers';
 
-describe('Scheduing EVM smart contracts', () => {
+// TODO mrshiposha update this test in #581
+describe.skip('Scheduing EVM smart contracts', () => {
   before(async function() {
     await requirePallets(this, [Pallets.Scheduler]);
   });
modifiedtests/src/eth/sponsoring.test.tsdiffbeforeafterboth
--- a/tests/src/eth/sponsoring.test.ts
+++ b/tests/src/eth/sponsoring.test.ts
@@ -14,20 +14,31 @@
 // 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 {expect} from 'chai';
-import {contractHelpers, createEthAccount, createEthAccountWithBalance, deployCollector, deployFlipper, itWeb3, SponsoringMode} from './util/helpers';
+import {IKeyringPair} from '@polkadot/types/types';
+import {itEth, expect, SponsoringMode} from '../eth/util/playgrounds';
+import {usingPlaygrounds} from './../util/playgrounds/index';
 
 describe('EVM sponsoring', () => {
-  itWeb3('Fee is deducted from contract if sponsoring is enabled', async ({api, web3, privateKeyWrapper}) => {
-    const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-    const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-    const caller = createEthAccount(web3);
-    const originalCallerBalance = await web3.eth.getBalance(caller);
-    expect(originalCallerBalance).to.be.equal('0');
+  let donor: IKeyringPair;
 
-    const flipper = await deployFlipper(web3, owner);
+  before(async () => {
+    await usingPlaygrounds(async (helper, privateKey) => {
+      donor = privateKey('//Alice');
+    });
+  });
+
+  itEth('Fee is deducted from contract if sponsoring is enabled', async ({helper}) => {
+    const owner = await helper.eth.createAccountWithBalance(donor);
+    const sponsor = await helper.eth.createAccountWithBalance(donor);
+    const caller = helper.eth.createAccount();
+    const originalCallerBalance = await helper.balance.getEthereum(caller);
+
+    expect(originalCallerBalance).to.be.equal(0n);
+
+    const flipper = await helper.eth.deployFlipper(owner);
+
+    const helpers = helper.ethNativeContract.contractHelpers(owner);
 
-    const helpers = contractHelpers(web3, owner);
     await helpers.methods.toggleAllowlist(flipper.options.address, true).send({from: owner});
     await helpers.methods.toggleAllowed(flipper.options.address, caller, true).send({from: owner});
     
@@ -39,27 +50,29 @@
     await helpers.methods.setSponsoringRateLimit(flipper.options.address, 0).send({from: owner});
     expect(await helpers.methods.sponsoringEnabled(flipper.options.address).call()).to.be.true;
 
-    const originalSponsorBalance = await web3.eth.getBalance(sponsor);
-    expect(originalSponsorBalance).to.be.not.equal('0');
+    const originalSponsorBalance = await helper.balance.getEthereum(sponsor);
+    expect(originalSponsorBalance).to.be.not.equal(0n);
 
     await flipper.methods.flip().send({from: caller});
     expect(await flipper.methods.getValue().call()).to.be.true;
 
     // Balance should be taken from flipper instead of caller
-    expect(await web3.eth.getBalance(caller)).to.be.equals(originalCallerBalance);
-    expect(await web3.eth.getBalance(sponsor)).to.be.not.equals(originalSponsorBalance);
+    expect(await helper.balance.getEthereum(caller)).to.be.equal(originalCallerBalance);
+    expect(await helper.balance.getEthereum(sponsor)).to.be.not.equal(originalSponsorBalance);
   });
 
-  itWeb3('...but this doesn\'t applies to payable value', async ({api, web3, privateKeyWrapper}) => {
-    const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-    const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-    const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-    const originalCallerBalance = await web3.eth.getBalance(caller);
-    expect(originalCallerBalance).to.be.not.equal('0');
+  itEth('...but this doesn\'t applies to payable value', async ({helper}) => {
+    const owner = await helper.eth.createAccountWithBalance(donor);
+    const sponsor = await helper.eth.createAccountWithBalance(donor);
+    const caller = await helper.eth.createAccountWithBalance(donor);
+    const originalCallerBalance = await helper.balance.getEthereum(caller);
+
+    expect(originalCallerBalance).to.be.not.equal(0n);
+
+    const collector = await helper.eth.deployCollectorContract(owner);
 
-    const collector = await deployCollector(web3, owner);
+    const helpers = helper.ethNativeContract.contractHelpers(owner);
 
-    const helpers = contractHelpers(web3, owner);
     await helpers.methods.toggleAllowlist(collector.options.address, true).send({from: owner});
     await helpers.methods.toggleAllowed(collector.options.address, caller, true).send({from: owner});
 
@@ -71,14 +84,14 @@
     await helpers.methods.setSponsor(collector.options.address, sponsor).send({from: owner});
     await helpers.methods.confirmSponsorship(collector.options.address).send({from: sponsor});
 
-    const originalSponsorBalance = await web3.eth.getBalance(sponsor);
-    expect(originalSponsorBalance).to.be.not.equal('0');
+    const originalSponsorBalance = await helper.balance.getEthereum(sponsor);
+    expect(originalSponsorBalance).to.be.not.equal(0n);
 
     await collector.methods.giveMoney().send({from: caller, value: '10000'});
 
     // Balance will be taken from both caller (value) and from collector (fee)
-    expect(await web3.eth.getBalance(caller)).to.be.equals((BigInt(originalCallerBalance) - 10000n).toString());
-    expect(await web3.eth.getBalance(sponsor)).to.be.not.equals(originalSponsorBalance);
+    expect(await helper.balance.getEthereum(caller)).to.be.equals((originalCallerBalance - 10000n));
+    expect(await helper.balance.getEthereum(sponsor)).to.be.not.equals(originalSponsorBalance);
     expect(await collector.methods.getCollected().call()).to.be.equal('10000');
   });
 });
modifiedtests/src/eth/tokenProperties.test.tsdiffbeforeafterboth
--- a/tests/src/eth/tokenProperties.test.ts
+++ b/tests/src/eth/tokenProperties.test.ts
@@ -1,94 +1,119 @@
-import {addCollectionAdminExpectSuccess, createCollectionExpectSuccess, createItemExpectSuccess} from '../util/helpers';
-import {cartesian, collectionIdToAddress, createEthAccount, createEthAccountWithBalance, GAS_ARGS, itWeb3} from './util/helpers';
-import nonFungibleAbi from './nonFungibleAbi.json';
-import {expect} from 'chai';
-import {executeTransaction} from '../substrate/substrate-api';
+import {IKeyringPair} from '@polkadot/types/types';
+import {usingPlaygrounds} from './../util/playgrounds/index';
+import {itEth, expect} from '../eth/util/playgrounds';
 
 describe('EVM token properties', () => {
-  itWeb3('Can be reconfigured', async({web3, api, privateKeyWrapper}) => {
-    const alice = privateKeyWrapper('//Alice');
-    const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
+  let donor: IKeyringPair;
+  let alice: IKeyringPair;
+
+  before(async () => {
+    await usingPlaygrounds(async (helper, privateKey) => {
+      donor = privateKey('//Alice');
+      [alice] = await helper.arrange.createAccounts([1000n], donor);
+    });
+  });
+
+  itEth('Can be reconfigured', async({helper}) => {
+    const caller = await helper.eth.createAccountWithBalance(donor);
+
     for(const [mutable,collectionAdmin, tokenOwner] of cartesian([], [false, true], [false, true], [false, true])) {
-      const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}});
-      await addCollectionAdminExpectSuccess(alice, collection, {Ethereum: caller});
-      
-      const address = collectionIdToAddress(collection);
-      const contract = new web3.eth.Contract(nonFungibleAbi as any, address, {from: caller, ...GAS_ARGS});
-  
+      const collection = await helper.nft.mintCollection(alice, {tokenPrefix: 'ethp'});
+      await collection.addAdmin(alice, {Ethereum: caller});
+
+      const address = helper.ethAddress.fromCollectionId(collection.collectionId);
+      const contract = helper.ethNativeContract.collection(address, 'nft', caller);
+
       await contract.methods.setTokenPropertyPermission('testKey', mutable, collectionAdmin, tokenOwner).send({from: caller});
   
-      const state = (await api.query.common.collectionPropertyPermissions(collection)).toJSON();
-      expect(state).to.be.deep.equal({
-        [web3.utils.toHex('testKey')]: {mutable, collectionAdmin, tokenOwner},
-      });
+      const state = await collection.getPropertyPermissions();
+      expect(state).to.be.deep.equal([{
+        key: 'testKey',
+        permission: {mutable, collectionAdmin, tokenOwner},
+      }]);
     }
   });
-  itWeb3('Can be set', async({web3, api, privateKeyWrapper}) => {
-    const alice = privateKeyWrapper('//Alice');
-    const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-    const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}});
-    const token = await createItemExpectSuccess(alice, collection, 'NFT');
 
-    await executeTransaction(api, alice, api.tx.unique.setTokenPropertyPermissions(collection, [{
-      key: 'testKey',
-      permission: {
-        collectionAdmin: true,
-      },
-    }]));
+  itEth('Can be set', async({helper}) => {
+    const caller = await helper.eth.createAccountWithBalance(donor);
+    const collection = await helper.nft.mintCollection(alice, {
+      tokenPrefix: 'ethp',
+      tokenPropertyPermissions: [{
+        key: 'testKey',
+        permission: {
+          collectionAdmin: true,
+        },
+      }],
+    });
+    const token = await collection.mintToken(alice);
 
-    await addCollectionAdminExpectSuccess(alice, collection, {Ethereum: caller});
+    await collection.addAdmin(alice, {Ethereum: caller});
 
-    const address = collectionIdToAddress(collection);
-    const contract = new web3.eth.Contract(nonFungibleAbi as any, address, {from: caller, ...GAS_ARGS});
+    const address = helper.ethAddress.fromCollectionId(collection.collectionId);
+    const contract = helper.ethNativeContract.collection(address, 'nft', caller);
 
-    await contract.methods.setProperty(token, 'testKey', Buffer.from('testValue')).send({from: caller});
+    await contract.methods.setProperty(token.tokenId, 'testKey', Buffer.from('testValue')).send({from: caller});
 
-    const [{value}] = (await api.rpc.unique.tokenProperties(collection, token, ['testKey'])).toHuman()! as any;
+    const [{value}] = await token.getProperties(['testKey']);
     expect(value).to.equal('testValue');
   });
-  itWeb3('Can be deleted', async({web3, api, privateKeyWrapper}) => {
-    const alice = privateKeyWrapper('//Alice');
-    const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-    const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}});
-    const token = await createItemExpectSuccess(alice, collection, 'NFT');
 
-    await executeTransaction(api, alice, api.tx.unique.setTokenPropertyPermissions(collection, [{
-      key: 'testKey',
-      permission: {
-        mutable: true,
-        collectionAdmin: true,
-      },
-    }]));
-    await executeTransaction(api, alice, api.tx.unique.setTokenProperties(collection, token, [{key: 'testKey', value: 'testValue'}]));
+  itEth('Can be deleted', async({helper}) => {
+    const caller = await helper.eth.createAccountWithBalance(donor);
+    const collection = await helper.nft.mintCollection(alice, {
+      tokenPrefix: 'ethp',
+      tokenPropertyPermissions: [{
+        key: 'testKey',
+        permission: {
+          mutable: true,
+          collectionAdmin: true,
+        },
+      }],
+    });
+
+    await collection.addAdmin(alice, {Ethereum: caller});
 
-    await addCollectionAdminExpectSuccess(alice, collection, {Ethereum: caller});
+    const token = await collection.mintToken(alice);
+    await token.setProperties(alice, [{key: 'testKey', value: 'testValue'}]);
 
-    const address = collectionIdToAddress(collection);
-    const contract = new web3.eth.Contract(nonFungibleAbi as any, address, {from: caller, ...GAS_ARGS});
+    const address = helper.ethAddress.fromCollectionId(collection.collectionId);
+    const contract = helper.ethNativeContract.collection(address, 'nft', caller);
 
-    await contract.methods.deleteProperty(token, 'testKey').send({from: caller});
+    await contract.methods.deleteProperty(token.tokenId, 'testKey').send({from: caller});
 
-    const result = (await api.rpc.unique.tokenProperties(collection, token, ['testKey'])).toJSON()! as any;
+    const result = await token.getProperties(['testKey']);
     expect(result.length).to.equal(0);
   });
-  itWeb3('Can be read', async({web3, api, privateKeyWrapper}) => {
-    const alice = privateKeyWrapper('//Alice');
-    const caller = createEthAccount(web3);
-    const collection = await createCollectionExpectSuccess({mode: {type:'NFT'}});
-    const token = await createItemExpectSuccess(alice, collection, 'NFT');
 
-    await executeTransaction(api, alice, api.tx.unique.setTokenPropertyPermissions(collection, [{
-      key: 'testKey',
-      permission: {
-        collectionAdmin: true,
-      },
-    }]));
-    await executeTransaction(api, alice, api.tx.unique.setTokenProperties(collection, token, [{key: 'testKey', value: 'testValue'}]));
+  itEth('Can be read', async({helper}) => {
+    const caller = await helper.eth.createAccountWithBalance(donor);
+    const collection = await helper.nft.mintCollection(alice, {
+      tokenPrefix: 'ethp',
+      tokenPropertyPermissions: [{
+        key: 'testKey',
+        permission: {
+          collectionAdmin: true,
+        },
+      }],
+    });
+    const token = await collection.mintToken(alice);
+    await token.setProperties(alice, [{key: 'testKey', value: 'testValue'}]);
 
-    const address = collectionIdToAddress(collection);
-    const contract = new web3.eth.Contract(nonFungibleAbi as any, address, {from: caller, ...GAS_ARGS});
+    const address = helper.ethAddress.fromCollectionId(collection.collectionId);
+    const contract = helper.ethNativeContract.collection(address, 'nft', caller);
 
-    const value = await contract.methods.property(token, 'testKey').call();
-    expect(value).to.equal(web3.utils.toHex('testValue'));
+    const value = await contract.methods.property(token.tokenId, 'testKey').call();
+    expect(value).to.equal(helper.getWeb3().utils.toHex('testValue'));
   });
 });
+
+
+type ElementOf<A> = A extends readonly (infer T)[] ? T : never;
+function* cartesian<T extends Array<Array<any>>, R extends Array<any>>(internalRest: [...R], ...args: [...T]): Generator<[...R, ...{[K in keyof T]: ElementOf<T[K]>}]> {
+  if(args.length === 0) {
+    yield internalRest as any;
+    return;
+  }
+  for(const value of args[0]) {
+    yield* cartesian([...internalRest, value], ...args.slice(1)) as any;
+  }
+}
\ No newline at end of file
modifiedtests/src/eth/util/playgrounds/types.tsdiffbeforeafterboth
--- a/tests/src/eth/util/playgrounds/types.ts
+++ b/tests/src/eth/util/playgrounds/types.ts
@@ -6,4 +6,10 @@
 export interface CompiledContract {
   abi: any;
   object: string;
-}
\ No newline at end of file
+}
+
+export type NormalizedEvent = {
+  address: string,
+  event: string,
+  args: { [key: string]: string }
+};
modifiedtests/src/eth/util/playgrounds/unique.dev.tsdiffbeforeafterboth
--- a/tests/src/eth/util/playgrounds/unique.dev.ts
+++ b/tests/src/eth/util/playgrounds/unique.dev.ts
@@ -18,7 +18,7 @@
 
 import {DevUniqueHelper} from '../../../util/playgrounds/unique.dev';
 
-import {ContractImports, CompiledContract} from './types';
+import {ContractImports, CompiledContract, NormalizedEvent} from './types';
 
 // Native contracts ABI
 import collectionHelpersAbi from '../../collectionHelpersAbi.json';
@@ -252,6 +252,33 @@
 
     return before - after;
   }
+
+  normalizeEvents(events: any): NormalizedEvent[] {
+    const output = [];
+    for (const key of Object.keys(events)) {
+      if (key.match(/^[0-9]+$/)) {
+        output.push(events[key]);
+      } else if (Array.isArray(events[key])) {
+        output.push(...events[key]);
+      } else {
+        output.push(events[key]);
+      }
+    }
+    output.sort((a, b) => a.logIndex - b.logIndex);
+    return output.map(({address, event, returnValues}) => {
+      const args: { [key: string]: string } = {};
+      for (const key of Object.keys(returnValues)) {
+        if (!key.match(/^[0-9]+$/)) {
+          args[key] = returnValues[key];
+        }
+      }
+      return {
+        address,
+        event,
+        args,
+      };
+    });
+  }
 }  
 
 class EthAddressGroup extends EthGroupBase {