difftreelog
refactor remove variable data from tests
in: master
17 files changed
tests/package.jsondiffbeforeafterboth40 "testMigrationStructure": "mocha --timeout 9999999 -r ts-node/register ./**/nesting/migration-check.test.ts",40 "testMigrationStructure": "mocha --timeout 9999999 -r ts-node/register ./**/nesting/migration-check.test.ts",41 "testAddCollectionAdmin": "mocha --timeout 9999999 -r ts-node/register ./**/addCollectionAdmin.test.ts",41 "testAddCollectionAdmin": "mocha --timeout 9999999 -r ts-node/register ./**/addCollectionAdmin.test.ts",42 "testSetSchemaVersion": "mocha --timeout 9999999 -r ts-node/register ./**/setSchemaVersion.test.ts",42 "testSetSchemaVersion": "mocha --timeout 9999999 -r ts-node/register ./**/setSchemaVersion.test.ts",43 "testSetVariableMetaData": "mocha --timeout 9999999 -r ts-node/register ./**/setVariableMetaData.test.ts",44 "testSetCollectionLimits": "mocha --timeout 9999999 -r ts-node/register ./**/setCollectionLimits.test.ts",43 "testSetCollectionLimits": "mocha --timeout 9999999 -r ts-node/register ./**/setCollectionLimits.test.ts",45 "testSetCollectionSponsor": "mocha --timeout 9999999 -r ts-node/register ./**/setCollectionSponsor.test.ts",44 "testSetCollectionSponsor": "mocha --timeout 9999999 -r ts-node/register ./**/setCollectionSponsor.test.ts",46 "testConfirmSponsorship": "mocha --timeout 9999999 -r ts-node/register ./**/confirmSponsorship.test.ts",45 "testConfirmSponsorship": "mocha --timeout 9999999 -r ts-node/register ./**/confirmSponsorship.test.ts",tests/src/contracts.test.tsdiffbeforeafterboth111 await addToAllowListExpectSuccess(alice, collectionId, contract.address);111 await addToAllowListExpectSuccess(alice, collectionId, contract.address);112 await addToAllowListExpectSuccess(alice, collectionId, bob.address);112 await addToAllowListExpectSuccess(alice, collectionId, bob.address);113113114 const transferTx = contract.tx.createItem(value, gasLimit, bob.address, collectionId, {Nft: {const_data: '0x010203', variable_data: '0x020304'}});114 const transferTx = contract.tx.createItem(value, gasLimit, bob.address, collectionId, {Nft: {const_data: '0x010203'}});115 const events = await submitTransactionAsync(alice, transferTx);115 const events = await submitTransactionAsync(alice, transferTx);116 const result = getGenericResult(events);116 const result = getGenericResult(events);117 expect(result.success).to.be.true;117 expect(result.success).to.be.true;121 {121 {122 owner: bob.address,122 owner: bob.address,123 constData: '0x010203',123 constData: '0x010203',124 variableData: '0x020304',125 },124 },126 ]);125 ]);127 });126 });140 await addToAllowListExpectSuccess(alice, collectionId, bob.address);139 await addToAllowListExpectSuccess(alice, collectionId, bob.address);141140142 const transferTx = contract.tx.createMultipleItems(value, gasLimit, bob.address, collectionId, [141 const transferTx = contract.tx.createMultipleItems(value, gasLimit, bob.address, collectionId, [143 {Nft: {const_data: '0x010203', variable_data: '0x020304'}},142 {Nft: {const_data: '0x010203'}},144 {Nft: {const_data: '0x010204', variable_data: '0x020305'}},143 {Nft: {const_data: '0x010204'}},145 {Nft: {const_data: '0x010205', variable_data: '0x020306'}},144 {Nft: {const_data: '0x010205'}},146 ]);145 ]);147 const events = await submitTransactionAsync(alice, transferTx);146 const events = await submitTransactionAsync(alice, transferTx);148 const result = getGenericResult(events);147 const result = getGenericResult(events);155 {154 {156 Owner: bob.address,155 Owner: bob.address,157 ConstData: '0x010203',156 ConstData: '0x010203',158 VariableData: '0x020304',159 },157 },160 {158 {161 Owner: bob.address,159 Owner: bob.address,162 ConstData: '0x010204',160 ConstData: '0x010204',163 VariableData: '0x020305',164 },161 },165 {162 {166 Owner: bob.address,163 Owner: bob.address,167 ConstData: '0x010205',164 ConstData: '0x010205',168 VariableData: '0x020306',169 },165 },170 ]);166 ]);171 });167 });211 });207 });212 });208 });213214 it('SetVariableMetaData CE', async () => {215 await usingApi(async api => {216 const alice = privateKey('//Alice');217218 const collectionId = await createCollectionExpectSuccess();219 const [contract] = await deployTransferContract(api);220 const tokenId = await createItemExpectSuccess(alice, collectionId, 'NFT', contract.address.toString());221222 const transferTx = contract.tx.setVariableMetaData(value, gasLimit, collectionId, tokenId, '0x121314');223 const events = await submitTransactionAsync(alice, transferTx);224 const result = getGenericResult(events);225 expect(result.success).to.be.true;226227 const token: any = (await api.query.unique.nftItemList(collectionId, tokenId) as any).unwrap();228 expect(token.variableData.toString()).to.be.equal('0x121314');229 });230 });231209232 it('ToggleAllowList CE', async () => {210 it('ToggleAllowList CE', async () => {233 await usingApi(async api => {211 await usingApi(async api => {tests/src/createMultipleItems.test.tsdiffbeforeafterboth30 getBalance,30 getBalance,31 getTokenOwner,31 getTokenOwner,32 getLastTokenId,32 getLastTokenId,33 getVariableMetadata,34 getConstMetadata,33 getConstMetadata,35 getCreatedCollectionCount,34 getCreatedCollectionCount,36 createCollectionWithPropsExpectSuccess,35 createCollectionWithPropsExpectSuccess,47 const itemsListIndexBefore = await getLastTokenId(api, collectionId);46 const itemsListIndexBefore = await getLastTokenId(api, collectionId);48 expect(itemsListIndexBefore).to.be.equal(0);47 expect(itemsListIndexBefore).to.be.equal(0);49 const alice = privateKey('//Alice');48 const alice = privateKey('//Alice');50 const args = [{Nft: {const_data: '0x31', variable_data: '0x31'}},49 const args = [{Nft: {const_data: '0x31'}},51 {Nft: {const_data: '0x32', variable_data: '0x32'}},50 {Nft: {const_data: '0x32'}},52 {Nft: {const_data: '0x33', variable_data: '0x33'}}];51 {Nft: {const_data: '0x33'}}];53 const createMultipleItemsTx = api.tx.unique52 const createMultipleItemsTx = api.tx.unique54 .createMultipleItems(collectionId, normalizeAccountId(alice.address), args);53 .createMultipleItems(collectionId, normalizeAccountId(alice.address), args);55 await submitTransactionAsync(alice, createMultipleItemsTx);54 await submitTransactionAsync(alice, createMultipleItemsTx);64 expect(await getConstMetadata(api, collectionId, 2)).to.be.deep.equal([0x32]);63 expect(await getConstMetadata(api, collectionId, 2)).to.be.deep.equal([0x32]);65 expect(await getConstMetadata(api, collectionId, 3)).to.be.deep.equal([0x33]);64 expect(await getConstMetadata(api, collectionId, 3)).to.be.deep.equal([0x33]);6667 expect(await getVariableMetadata(api, collectionId, 1)).to.be.deep.equal([0x31]);68 expect(await getVariableMetadata(api, collectionId, 2)).to.be.deep.equal([0x32]);69 expect(await getVariableMetadata(api, collectionId, 3)).to.be.deep.equal([0x33]);70 });65 });71 });66 });726797 expect(itemsListIndexBefore).to.be.equal(0);92 expect(itemsListIndexBefore).to.be.equal(0);98 const alice = privateKey('//Alice');93 const alice = privateKey('//Alice');99 const args = [94 const args = [100 {ReFungible: {const_data: [0x31], variable_data: [0x31], pieces: 1}},95 {ReFungible: {const_data: [0x31], pieces: 1}},101 {ReFungible: {const_data: [0x32], variable_data: [0x32], pieces: 1}},96 {ReFungible: {const_data: [0x32], pieces: 1}},102 {ReFungible: {const_data: [0x33], variable_data: [0x33], pieces: 1}},97 {ReFungible: {const_data: [0x33], pieces: 1}},103 ];98 ];104 const createMultipleItemsTx = api.tx.unique99 const createMultipleItemsTx = api.tx.unique105 .createMultipleItems(collectionId, normalizeAccountId(alice.address), args);100 .createMultipleItems(collectionId, normalizeAccountId(alice.address), args);115 expect(await getConstMetadata(api, collectionId, 2)).to.be.deep.equal([0x32]);110 expect(await getConstMetadata(api, collectionId, 2)).to.be.deep.equal([0x32]);116 expect(await getConstMetadata(api, collectionId, 3)).to.be.deep.equal([0x33]);111 expect(await getConstMetadata(api, collectionId, 3)).to.be.deep.equal([0x33]);117118 expect(await getVariableMetadata(api, collectionId, 1)).to.be.deep.equal([0x31]);119 expect(await getVariableMetadata(api, collectionId, 2)).to.be.deep.equal([0x32]);120 expect(await getVariableMetadata(api, collectionId, 3)).to.be.deep.equal([0x33]);121 });112 });122 });113 });123114130 tokenLimit: 2,121 tokenLimit: 2,131 });122 });132 const args = [123 const args = [133 {NFT: {const_data: 'A', variable_data: 'A'}},124 {NFT: {const_data: 'A'}},134 {NFT: {const_data: 'B', variable_data: 'B'}},125 {NFT: {const_data: 'B'}},135 ];126 ];136 const createMultipleItemsTx = api.tx.unique.createMultipleItems(collectionId, normalizeAccountId(alice.address), args);127 const createMultipleItemsTx = api.tx.unique.createMultipleItems(collectionId, normalizeAccountId(alice.address), args);137 const events = await submitTransactionAsync(alice, createMultipleItemsTx);128 const events = await submitTransactionAsync(alice, createMultipleItemsTx);146 const itemsListIndexBefore = await getLastTokenId(api, collectionId);137 const itemsListIndexBefore = await getLastTokenId(api, collectionId);147 expect(itemsListIndexBefore).to.be.equal(0);138 expect(itemsListIndexBefore).to.be.equal(0);148 const alice = privateKey('//Alice');139 const alice = privateKey('//Alice');140 const bob = privateKey('//Bob');149 const args = [{Nft: {const_data: '0x31', variable_data: '0x31'}},141 const args = [{Nft: {const_data: '0x31'}},150 {Nft: {const_data: '0x32', variable_data: '0x32'}},142 {Nft: {const_data: '0x32'}},151 {Nft: {const_data: '0x33', variable_data: '0x33'}}];143 {Nft: {const_data: '0x33'}}];152 const createMultipleItemsTx = api.tx.unique144 const createMultipleItemsTx = api.tx.unique153 .createMultipleItems(collectionId, normalizeAccountId(alice.address), args);145 .createMultipleItems(collectionId, normalizeAccountId(alice.address), args);154 await submitTransactionAsync(alice, createMultipleItemsTx);146 await submitTransactionAsync(alice, createMultipleItemsTx);169 expect(await getConstMetadata(api, collectionId, 2)).to.be.deep.equal([0x32]);161 expect(await getConstMetadata(api, collectionId, 2)).to.be.deep.equal([0x32]);170 expect(await getConstMetadata(api, collectionId, 3)).to.be.deep.equal([0x33]);162 expect(await getConstMetadata(api, collectionId, 3)).to.be.deep.equal([0x33]);171172 expect(await getVariableMetadata(api, collectionId, 1)).to.be.deep.equal([0x31]);173 expect(await getVariableMetadata(api, collectionId, 2)).to.be.deep.equal([0x32]);174 expect(await getVariableMetadata(api, collectionId, 3)).to.be.deep.equal([0x33]);175 });163 });176 });164 });177165181 const itemsListIndexBefore = await getLastTokenId(api, collectionId);169 const itemsListIndexBefore = await getLastTokenId(api, collectionId);182 expect(itemsListIndexBefore).to.be.equal(0);170 expect(itemsListIndexBefore).to.be.equal(0);183 const alice = privateKey('//Alice');171 const alice = privateKey('//Alice');172 const bob = privateKey('//Bob');184 const args = [{Nft: {const_data: '0x31', variable_data: '0x31'}},173 const args = [{Nft: {const_data: '0x31'}},185 {Nft: {const_data: '0x32', variable_data: '0x32'}},174 {Nft: {const_data: '0x32'}},186 {Nft: {const_data: '0x33', variable_data: '0x33'}}];175 {Nft: {const_data: '0x33'}}];187 const createMultipleItemsTx = api.tx.unique176 const createMultipleItemsTx = api.tx.unique188 .createMultipleItems(collectionId, normalizeAccountId(alice.address), args);177 .createMultipleItems(collectionId, normalizeAccountId(alice.address), args);189 await submitTransactionAsync(alice, createMultipleItemsTx);178 await submitTransactionAsync(alice, createMultipleItemsTx);204 expect(await getConstMetadata(api, collectionId, 2)).to.be.deep.equal([0x32]);193 expect(await getConstMetadata(api, collectionId, 2)).to.be.deep.equal([0x32]);205 expect(await getConstMetadata(api, collectionId, 3)).to.be.deep.equal([0x33]);194 expect(await getConstMetadata(api, collectionId, 3)).to.be.deep.equal([0x33]);206207 expect(await getVariableMetadata(api, collectionId, 1)).to.be.deep.equal([0x31]);208 expect(await getVariableMetadata(api, collectionId, 2)).to.be.deep.equal([0x32]);209 expect(await getVariableMetadata(api, collectionId, 3)).to.be.deep.equal([0x33]);210 });195 });211 });196 });212197216 const itemsListIndexBefore = await getLastTokenId(api, collectionId);201 const itemsListIndexBefore = await getLastTokenId(api, collectionId);217 expect(itemsListIndexBefore).to.be.equal(0);202 expect(itemsListIndexBefore).to.be.equal(0);218 const alice = privateKey('//Alice');203 const alice = privateKey('//Alice');204 const bob = privateKey('//Bob');219 const args = [{Nft: {const_data: '0x31', variable_data: '0x31'}},205 const args = [{Nft: {const_data: '0x31'}},220 {Nft: {const_data: '0x32', variable_data: '0x32'}},206 {Nft: {const_data: '0x32'}},221 {Nft: {const_data: '0x33', variable_data: '0x33'}}];207 {Nft: {const_data: '0x33'}}];222 const createMultipleItemsTx = api.tx.unique208 const createMultipleItemsTx = api.tx.unique223 .createMultipleItems(collectionId, normalizeAccountId(alice.address), args);209 .createMultipleItems(collectionId, normalizeAccountId(alice.address), args);224 await submitTransactionAsync(alice, createMultipleItemsTx);210 await submitTransactionAsync(alice, createMultipleItemsTx);239 expect(await getConstMetadata(api, collectionId, 2)).to.be.deep.equal([0x32]);225 expect(await getConstMetadata(api, collectionId, 2)).to.be.deep.equal([0x32]);240 expect(await getConstMetadata(api, collectionId, 3)).to.be.deep.equal([0x33]);226 expect(await getConstMetadata(api, collectionId, 3)).to.be.deep.equal([0x33]);241242 expect(await getVariableMetadata(api, collectionId, 1)).to.be.deep.equal([0x31]);243 expect(await getVariableMetadata(api, collectionId, 2)).to.be.deep.equal([0x32]);244 expect(await getVariableMetadata(api, collectionId, 3)).to.be.deep.equal([0x33]);245 });227 });246 });228 });247});229});264 const itemsListIndexBefore = await getLastTokenId(api, collectionId);246 const itemsListIndexBefore = await getLastTokenId(api, collectionId);265 expect(itemsListIndexBefore).to.be.equal(0);247 expect(itemsListIndexBefore).to.be.equal(0);266 await addCollectionAdminExpectSuccess(alice, collectionId, bob.address);248 await addCollectionAdminExpectSuccess(alice, collectionId, bob.address);267 const args = [{Nft: {const_data: '0x31', variable_data: '0x31'}},249 const args = [{Nft: {const_data: '0x31'}},268 {Nft: {const_data: '0x32', variable_data: '0x32'}},250 {Nft: {const_data: '0x32'}},269 {Nft: {const_data: '0x33', variable_data: '0x33'}}];251 {Nft: {const_data: '0x33'}}];270 const createMultipleItemsTx = api.tx.unique252 const createMultipleItemsTx = api.tx.unique271 .createMultipleItems(collectionId, normalizeAccountId(bob.address), args);253 .createMultipleItems(collectionId, normalizeAccountId(bob.address), args);272 await submitTransactionAsync(bob, createMultipleItemsTx);254 await submitTransactionAsync(bob, createMultipleItemsTx);281 expect(await getConstMetadata(api, collectionId, 2)).to.be.deep.equal([0x32]);263 expect(await getConstMetadata(api, collectionId, 2)).to.be.deep.equal([0x32]);282 expect(await getConstMetadata(api, collectionId, 3)).to.be.deep.equal([0x33]);264 expect(await getConstMetadata(api, collectionId, 3)).to.be.deep.equal([0x33]);283284 expect(await getVariableMetadata(api, collectionId, 1)).to.be.deep.equal([0x31]);285 expect(await getVariableMetadata(api, collectionId, 2)).to.be.deep.equal([0x32]);286 expect(await getVariableMetadata(api, collectionId, 3)).to.be.deep.equal([0x33]);287 });265 });288 });266 });289267314 expect(itemsListIndexBefore).to.be.equal(0);292 expect(itemsListIndexBefore).to.be.equal(0);315 await addCollectionAdminExpectSuccess(alice, collectionId, bob.address);293 await addCollectionAdminExpectSuccess(alice, collectionId, bob.address);316 const args = [294 const args = [317 {ReFungible: {const_data: [0x31], variable_data: [0x31], pieces: 1}},295 {ReFungible: {const_data: [0x31], pieces: 1}},318 {ReFungible: {const_data: [0x32], variable_data: [0x32], pieces: 1}},296 {ReFungible: {const_data: [0x32], pieces: 1}},319 {ReFungible: {const_data: [0x33], variable_data: [0x33], pieces: 1}},297 {ReFungible: {const_data: [0x33], pieces: 1}},320 ];298 ];321 const createMultipleItemsTx = api.tx.unique299 const createMultipleItemsTx = api.tx.unique322 .createMultipleItems(collectionId, normalizeAccountId(bob.address), args);300 .createMultipleItems(collectionId, normalizeAccountId(bob.address), args);332 expect(await getConstMetadata(api, collectionId, 2)).to.be.deep.equal([0x32]);310 expect(await getConstMetadata(api, collectionId, 2)).to.be.deep.equal([0x32]);333 expect(await getConstMetadata(api, collectionId, 3)).to.be.deep.equal([0x33]);311 expect(await getConstMetadata(api, collectionId, 3)).to.be.deep.equal([0x33]);334335 expect(await getVariableMetadata(api, collectionId, 1)).to.be.deep.equal([0x31]);336 expect(await getVariableMetadata(api, collectionId, 2)).to.be.deep.equal([0x32]);337 expect(await getVariableMetadata(api, collectionId, 3)).to.be.deep.equal([0x33]);338 });312 });339 });313 });340});314});356 const collectionId = await createCollectionExpectSuccess();330 const collectionId = await createCollectionExpectSuccess();357 const itemsListIndexBefore = await getLastTokenId(api, collectionId);331 const itemsListIndexBefore = await getLastTokenId(api, collectionId);358 expect(itemsListIndexBefore).to.be.equal(0);332 expect(itemsListIndexBefore).to.be.equal(0);359 const args = [{Nft: {const_data: '0x31', variable_data: '0x31'}},333 const args = [{Nft: {const_data: '0x31'}},360 {Nft: {const_data: '0x32', variable_data: '0x32'}},334 {Nft: {const_data: '0x32'}},361 {Nft: {const_data: '0x33', variable_data: '0x33'}}];335 {Nft: {const_data: '0x33'}}];362 const createMultipleItemsTx = api.tx.unique336 const createMultipleItemsTx = api.tx.unique363 .createMultipleItems(collectionId, normalizeAccountId(alice.address), args);337 .createMultipleItems(collectionId, normalizeAccountId(alice.address), args);364 await expect(submitTransactionAsync(bob, createMultipleItemsTx)).to.be.rejected;338 await expect(submitTransactionAsync(bob, createMultipleItemsTx)).to.be.rejected;387 const itemsListIndexBefore = await getLastTokenId(api, collectionId);361 const itemsListIndexBefore = await getLastTokenId(api, collectionId);388 expect(itemsListIndexBefore).to.be.equal(0);362 expect(itemsListIndexBefore).to.be.equal(0);389 const args = [363 const args = [390 {ReFungible: {const_data: [0x31], variable_data: [0x31], pieces: 1}},364 {ReFungible: {const_data: [0x31], pieces: 1}},391 {ReFungible: {const_data: [0x32], variable_data: [0x32], pieces: 1}},365 {ReFungible: {const_data: [0x32], pieces: 1}},392 {ReFungible: {const_data: [0x33], variable_data: [0x33], pieces: 1}},366 {ReFungible: {const_data: [0x33], pieces: 1}},393 ];367 ];394 const createMultipleItemsTx = api.tx.unique368 const createMultipleItemsTx = api.tx.unique395 .createMultipleItems(collectionId, normalizeAccountId(alice.address), args);369 .createMultipleItems(collectionId, normalizeAccountId(alice.address), args);412 const collectionId = await createCollectionExpectSuccess();386 const collectionId = await createCollectionExpectSuccess();413 const alice = privateKey('//Alice');387 const alice = privateKey('//Alice');414 const args = [388 const args = [415 {NFT: {const_data: 'A'.repeat(2049), variable_data: 'A'.repeat(2049)}},389 {NFT: {const_data: 'A'.repeat(2049)}},416 {NFT: {const_data: 'B'.repeat(2049), variable_data: 'B'.repeat(2049)}},390 {NFT: {const_data: 'B'.repeat(2049)}},417 {NFT: {const_data: 'C'.repeat(2049), variable_data: 'C'.repeat(2049)}},391 {NFT: {const_data: 'C'.repeat(2049)}},418 ];392 ];419 const createMultipleItemsTx = api.tx.unique393 const createMultipleItemsTx = api.tx.unique420 .createMultipleItems(collectionId, normalizeAccountId(alice.address), args);394 .createMultipleItems(collectionId, normalizeAccountId(alice.address), args);424 const collectionIdReFungible =398 const collectionIdReFungible =425 await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});399 await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});426 const argsReFungible = [400 const argsReFungible = [427 {ReFungible: ['1'.repeat(2049), '1'.repeat(2049), 10]},401 {ReFungible: ['1'.repeat(2049), 10]},428 {ReFungible: ['2'.repeat(2049), '2'.repeat(2049), 10]},402 {ReFungible: ['2'.repeat(2049), 10]},429 {ReFungible: ['3'.repeat(2049), '3'.repeat(2049), 10]},403 {ReFungible: ['3'.repeat(2049), 10]},430 ];404 ];431 const createMultipleItemsTxFungible = api.tx.unique405 const createMultipleItemsTxFungible = api.tx.unique432 .createMultipleItems(collectionIdReFungible, normalizeAccountId(alice.address), argsReFungible);406 .createMultipleItems(collectionIdReFungible, normalizeAccountId(alice.address), argsReFungible);449 await usingApi(async (api: ApiPromise) => {423 await usingApi(async (api: ApiPromise) => {450 const collectionId = await createCollectionExpectSuccess();424 const collectionId = await createCollectionExpectSuccess();451 const args = [425 const args = [452 {NFT: {const_data: 'A', variable_data: 'A'}},426 {NFT: {const_data: 'A'}},453 {NFT: {const_data: 'B', variable_data: 'B'.repeat(2049)}},427 {NFT: {const_data: 'B'.repeat(2049)}},454 {NFT: {const_data: 'C'.repeat(2049), variable_data: 'C'}},455 ];428 ];456 const createMultipleItemsTx = await api.tx.unique429 const createMultipleItemsTx = await api.tx.unique457 .createMultipleItems(collectionId, normalizeAccountId(alice.address), args);430 .createMultipleItems(collectionId, normalizeAccountId(alice.address), args);467 tokenLimit: 1,440 tokenLimit: 1,468 });441 });469 const args = [442 const args = [470 {NFT: {const_data: 'A', variable_data: 'A'}},443 {NFT: {const_data: 'A'}},471 {NFT: {const_data: 'B', variable_data: 'B'}},444 {NFT: {const_data: 'B'}},472 ];445 ];473 const createMultipleItemsTx = api.tx.unique.createMultipleItems(collectionId, normalizeAccountId(alice.address), args);446 const createMultipleItemsTx = api.tx.unique.createMultipleItems(collectionId, normalizeAccountId(alice.address), args);474 await expect(submitTransactionExpectFailAsync(alice, createMultipleItemsTx)).to.be.rejected;447 await expect(submitTransactionExpectFailAsync(alice, createMultipleItemsTx)).to.be.rejected;482 const itemsListIndexBefore = await getLastTokenId(api, collectionId);455 const itemsListIndexBefore = await getLastTokenId(api, collectionId);483 expect(itemsListIndexBefore).to.be.equal(0);456 expect(itemsListIndexBefore).to.be.equal(0);484 await addCollectionAdminExpectSuccess(alice, collectionId, bob.address);457 await addCollectionAdminExpectSuccess(alice, collectionId, bob.address);485 const args = [{Nft: {const_data: '0x31', variable_data: '0x31'}},458 const args = [{Nft: {const_data: '0x31'}},486 {Nft: {const_data: '0x32', variable_data: '0x32'}},459 {Nft: {const_data: '0x32'}},487 {Nft: {const_data: '0x33', variable_data: '0x33'}}];460 {Nft: {const_data: '0x33'}}];488 461489 const createMultipleItemsTx = api.tx.unique.createMultipleItems(collectionId, normalizeAccountId(alice.address), args);462 const createMultipleItemsTx = api.tx.unique.createMultipleItems(collectionId, normalizeAccountId(alice.address), args);490463510 const itemsListIndexBefore = await getLastTokenId(api, collectionId);483 const itemsListIndexBefore = await getLastTokenId(api, collectionId);511 expect(itemsListIndexBefore).to.be.equal(0);484 expect(itemsListIndexBefore).to.be.equal(0);512 await addCollectionAdminExpectSuccess(alice, collectionId, bob.address);485 await addCollectionAdminExpectSuccess(alice, collectionId, bob.address);513 const args = [{Nft: {const_data: '0x31', variable_data: '0x31'}},486 const args = [{Nft: {const_data: '0x31'}},514 {Nft: {const_data: '0x32', variable_data: '0x32'}},487 {Nft: {const_data: '0x32'}},515 {Nft: {const_data: '0x33', variable_data: '0x33'}}];488 {Nft: {const_data: '0x33'}}];516 489517 const createMultipleItemsTx = api.tx.unique.createMultipleItems(collectionId, normalizeAccountId(alice.address), args);490 const createMultipleItemsTx = api.tx.unique.createMultipleItems(collectionId, normalizeAccountId(alice.address), args);518491535 const itemsListIndexBefore = await getLastTokenId(api, collectionId);508 const itemsListIndexBefore = await getLastTokenId(api, collectionId);536 await addCollectionAdminExpectSuccess(alice, collectionId, bob.address);509 await addCollectionAdminExpectSuccess(alice, collectionId, bob.address);537 expect(itemsListIndexBefore).to.be.equal(0);510 expect(itemsListIndexBefore).to.be.equal(0);538 const args = [{Nft: {const_data: '0x31', variable_data: '0x31'}},511 const args = [{Nft: {const_data: '0x31'}},539 {Nft: {const_data: '0x32', variable_data: '0x32'}},512 {Nft: {const_data: '0x32'}},540 {Nft: {const_data: '0x33', variable_data: '0x33'}}];513 {Nft: {const_data: '0x33'}}];541 514542 const createMultipleItemsTx = api.tx.unique.createMultipleItems(collectionId, normalizeAccountId(alice.address), args);515 const createMultipleItemsTx = api.tx.unique.createMultipleItems(collectionId, normalizeAccountId(alice.address), args);543516562 expect(itemsListIndexBefore).to.be.equal(0);535 expect(itemsListIndexBefore).to.be.equal(0);563 await addCollectionAdminExpectSuccess(alice, collectionId, bob.address);536 await addCollectionAdminExpectSuccess(alice, collectionId, bob.address);564537565 const args = [{Nft: {const_data: '0x31', variable_data: '0x31'}},538 const args = [{Nft: {const_data: '0x31'}},566 {Nft: {const_data: '0x32', variable_data: '0x32'}},539 {Nft: {const_data: '0x32'}},567 {Nft: {const_data: '0x33', variable_data: '0x33'}}];540 {Nft: {const_data: '0x33'}}];568 541569 const createMultipleItemsTx = api.tx.unique.createMultipleItems(collectionId, normalizeAccountId(alice.address), args);542 const createMultipleItemsTx = api.tx.unique.createMultipleItems(collectionId, normalizeAccountId(alice.address), args);570 const events = await submitTransactionAsync(alice, createMultipleItemsTx);543 const events = await submitTransactionAsync(alice, createMultipleItemsTx);595 propPerm: [{key: 'key1', mutable: true, collectionAdmin: false, tokenOwner: false}]});568 propPerm: [{key: 'key1', mutable: true, collectionAdmin: false, tokenOwner: false}]});596 const itemsListIndexBefore = await getLastTokenId(api, collectionId);569 const itemsListIndexBefore = await getLastTokenId(api, collectionId);597 expect(itemsListIndexBefore).to.be.equal(0);570 expect(itemsListIndexBefore).to.be.equal(0);598 const args = [{Nft: {const_data: '0x31', variable_data: '0x31'}},571 const args = [{Nft: {const_data: '0x31'}},599 {Nft: {const_data: '0x32', variable_data: '0x32'}},572 {Nft: {const_data: '0x32'}},600 {Nft: {const_data: '0x33', variable_data: '0x33'}}];573 {Nft: {const_data: '0x33'}}];601 574602 const createMultipleItemsTx = api.tx.unique.createMultipleItems(collectionId, normalizeAccountId(alice.address), args);575 const createMultipleItemsTx = api.tx.unique.createMultipleItems(collectionId, normalizeAccountId(alice.address), args);603576tests/src/createMultipleItemsEx.test.tsdiffbeforeafterboth30 {30 {31 owner: {substrate: alice.address},31 owner: {substrate: alice.address},32 constData: '0x0000',32 constData: '0x0000',33 variableData: '0x1111',34 }, {33 }, {35 owner: {substrate: bob.address},34 owner: {substrate: bob.address},36 constData: '0x2222',35 constData: '0x2222',37 variableData: '0x3333',38 }, {36 }, {39 owner: {substrate: charlie.address},37 owner: {substrate: charlie.address},40 constData: '0x4444',38 constData: '0x4444',41 variableData: '0x5555',42 },39 },43 ];40 ];444161 {58 {62 owner: {substrate: alice.address},59 owner: {substrate: alice.address},63 constData: '0x0000',60 constData: '0x0000',64 variableData: '0x1111',65 }, {61 }, {66 owner: {substrate: bob.address},62 owner: {substrate: bob.address},67 constData: '0x2222',63 constData: '0x2222',68 variableData: '0x3333',69 }, {64 }, {70 owner: {substrate: charlie.address},65 owner: {substrate: charlie.address},71 constData: '0x4444',66 constData: '0x4444',72 variableData: '0x5555',73 },67 },74 ];68 ];756998 {92 {99 owner: {substrate: alice.address},93 owner: {substrate: alice.address},100 constData: '0x0000',94 constData: '0x0000',101 variableData: '0x1111',102 }, {95 }, {103 owner: {substrate: bob.address},96 owner: {substrate: bob.address},104 constData: '0x2222',97 constData: '0x2222',105 variableData: '0x3333',106 }, {98 }, {107 owner: {substrate: charlie.address},99 owner: {substrate: charlie.address},108 constData: '0x4444',100 constData: '0x4444',109 variableData: '0x5555',110 },101 },111 ];102 ];112 await expect(executeTransaction(103 await expect(executeTransaction(136 {127 {137 owner: {substrate: alice.address},128 owner: {substrate: alice.address},138 constData: '0x0000',129 constData: '0x0000',139 variableData: '0x1111',140 }, {130 }, {141 owner: {substrate: bob.address},131 owner: {substrate: bob.address},142 constData: '0x2222',132 constData: '0x2222',143 variableData: '0x3333',144 }, {133 }, {145 owner: {substrate: charlie.address},134 owner: {substrate: charlie.address},146 constData: '0x4444',135 constData: '0x4444',147 variableData: '0x5555',148 },136 },149 ];137 ];150 await expect(executeTransaction(138 await expect(executeTransaction(355 {343 {356 owner: {substrate: alice.address},344 owner: {substrate: alice.address},357 constData: '0x0000',345 constData: '0x0000',358 variableData: '0x1111',359 }, {346 }, {360 owner: {substrate: bob.address},347 owner: {substrate: bob.address},361 constData: '0x2222',348 constData: '0x2222',362 variableData: '0x3333',363 }, {349 }, {364 owner: {substrate: charlie.address},350 owner: {substrate: charlie.address},365 constData: '0x4444',351 constData: '0x4444',366 variableData: '0x5555',367 },352 },368 ];353 ];369354386 {371 {387 owner: {substrate: alice.address},372 owner: {substrate: alice.address},388 constData: '0x0000',373 constData: '0x0000',389 variableData: '0x1111',390 }, {374 }, {391 owner: {substrate: bob.address},375 owner: {substrate: bob.address},392 constData: '0x2222',376 constData: '0x2222',393 variableData: '0x3333',394 }, {377 }, {395 owner: {substrate: charlie.address},378 owner: {substrate: charlie.address},396 constData: '0x4444',379 constData: '0x4444',397 variableData: '0x5555',398 },380 },399 ];381 ];400382tests/src/eth/api/UniqueFungible.soldiffbeforeafterboth22 );22 );23}23}2425// Selector: 56fd500b26interface CollectionProperties is Dummy, ERC165 {27 // Selector: setProperty(string,string) 62d9491f28 function setProperty(string memory key, string memory value) external;2930 // Selector: deleteProperty(string) 3424191431 function deleteProperty(string memory key) external;32}3334// Selector: 79cc679035interface ERC20UniqueExtensions is Dummy, ERC165 {36 // Selector: burnFrom(address,uint256) 79cc679037 function burnFrom(address from, uint256 amount) external returns (bool);38}243925// Selector: 942e8b2240// Selector: 942e8b2226interface ERC20 is Dummy, ERC165, ERC20Events {41interface ERC20 is Dummy, ERC165, ERC20Events {62interface UniqueFungible is Dummy, ERC165, ERC20 {}77interface UniqueFungible is78 Dummy,79 ERC165,80 ERC20,81 ERC20UniqueExtensions,82 CollectionProperties83{}6384tests/src/eth/api/UniqueNFT.soldiffbeforeafterboth48 function burn(uint256 tokenId) external;48 function burn(uint256 tokenId) external;49}49}5051// Selector: 56fd500b52interface CollectionProperties is Dummy, ERC165 {53 // Selector: setProperty(string,string) 62d9491f54 function setProperty(string memory key, string memory value) external;5556 // Selector: deleteProperty(string) 3424191457 function deleteProperty(string memory key) external;58}505951// Selector: 5880016160// Selector: 5880016152interface ERC721 is Dummy, ERC165, ERC721Events {61interface ERC721 is Dummy, ERC165, ERC721Events {162 function totalSupply() external view returns (uint256);171 function totalSupply() external view returns (uint256);163}172}164173165// Selector: e562194d174// Selector: d74d154f166interface ERC721UniqueExtensions is Dummy, ERC165 {175interface ERC721UniqueExtensions is Dummy, ERC165 {167 // Selector: transfer(address,uint256) a9059cbb176 // Selector: transfer(address,uint256) a9059cbb168 function transfer(address to, uint256 tokenId) external;177 function transfer(address to, uint256 tokenId) external;173 // Selector: nextTokenId() 75794a3c182 // Selector: nextTokenId() 75794a3c174 function nextTokenId() external view returns (uint256);183 function nextTokenId() external view returns (uint256);175176 // Selector: setVariableMetadata(uint256,bytes) d4eac26d177 function setVariableMetadata(uint256 tokenId, bytes memory data) external;178179 // Selector: getVariableMetadata(uint256) e6c5ce6f180 function getVariableMetadata(uint256 tokenId)181 external182 view183 returns (bytes memory);184184185 // Selector: mintBulk(address,uint256[]) 44a9945e185 // Selector: mintBulk(address,uint256[]) 44a9945e186 function mintBulk(address to, uint256[] memory tokenIds)186 function mintBulk(address to, uint256[] memory tokenIds)201 ERC721Enumerable,201 ERC721Enumerable,202 ERC721UniqueExtensions,202 ERC721UniqueExtensions,203 ERC721Mintable,203 ERC721Mintable,204 ERC721Burnable204 ERC721Burnable,205 CollectionProperties205{}206{}206207tests/src/eth/base.test.tsdiffbeforeafterboth101 });101 });102102103 itWeb3('ERC721UniqueExtensions support', async ({web3}) => {103 itWeb3('ERC721UniqueExtensions support', async ({web3}) => {104 expect(await contract(web3).methods.supportsInterface('0xe562194d').call()).to.be.true;104 expect(await contract(web3).methods.supportsInterface('0xd74d154f').call()).to.be.true;105 });105 });106106107 itWeb3('ERC721Burnable support', async ({web3}) => {107 itWeb3('ERC721Burnable support', async ({web3}) => {tests/src/eth/nonFungible.test.tsdiffbeforeafterboth15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.161617import privateKey from '../substrate/privateKey';17import privateKey from '../substrate/privateKey';18import {approveExpectSuccess, burnItemExpectSuccess, createCollectionExpectSuccess, createItemExpectSuccess, setVariableMetaDataExpectSuccess, transferExpectSuccess, transferFromExpectSuccess, UNIQUE, setMetadataUpdatePermissionFlagExpectSuccess} from '../util/helpers';18import {approveExpectSuccess, burnItemExpectSuccess, createCollectionExpectSuccess, createItemExpectSuccess, transferExpectSuccess, transferFromExpectSuccess, UNIQUE, setMetadataUpdatePermissionFlagExpectSuccess} from '../util/helpers';19import {collectionIdToAddress, createEthAccount, createEthAccountWithBalance, GAS_ARGS, itWeb3, normalizeEvents, recordEthFee, recordEvents, subToEth, transferBalanceToEth} from './util/helpers';19import {collectionIdToAddress, createEthAccount, createEthAccountWithBalance, GAS_ARGS, itWeb3, normalizeEvents, recordEthFee, recordEvents, subToEth, transferBalanceToEth} from './util/helpers';20import nonFungibleAbi from './nonFungibleAbi.json';20import nonFungibleAbi from './nonFungibleAbi.json';21import {expect} from 'chai';21import {expect} from 'chai';333 }333 }334 });334 });335336 itWeb3('Can perform getVariableMetadata', async ({web3, api}) => {337 const collection = await createCollectionExpectSuccess({338 mode: {type: 'NFT'},339 });340 const alice = privateKey('//Alice');341342 const owner = await createEthAccountWithBalance(api, web3);343344 const item = await createItemExpectSuccess(alice, collection, 'NFT', {Ethereum: owner});345 await setMetadataUpdatePermissionFlagExpectSuccess(alice, collection, 'Admin');346 await setVariableMetaDataExpectSuccess(alice, collection, item, [1, 2, 3]);347348 const address = collectionIdToAddress(collection);349 const contract = new web3.eth.Contract(nonFungibleAbi as any, address, {from: owner, ...GAS_ARGS});350351 expect(await contract.methods.getVariableMetadata(item).call()).to.be.equal('0x010203');352 });353354 itWeb3('Can perform setVariableMetadata', async ({web3, api}) => {355 const collection = await createCollectionExpectSuccess({356 mode: {type: 'NFT'},357 });358 const alice = privateKey('//Alice');359360 const owner = await createEthAccountWithBalance(api, web3);361362 const item = await createItemExpectSuccess(alice, collection, 'NFT', {Ethereum: owner});363364 const address = collectionIdToAddress(collection);365 const contract = new web3.eth.Contract(nonFungibleAbi as any, address, {from: owner, ...GAS_ARGS});366367 expect(await contract.methods.setVariableMetadata(item, '0x010203').send({from: owner}));368 expect(await contract.methods.getVariableMetadata(item).call()).to.be.equal('0x010203');369 });370});335});371336372describe('NFT: Fees', () => {337describe('NFT: Fees', () => {tests/src/eth/proxy/UniqueNFTProxy.abidiffbeforeafterboth1[{"inputs":[{"internalType":"address","name":"_proxied","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[],"name":"MintingFinished","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"address","name":"approved","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"finishMinting","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getVariableMetadata","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"mint","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"mintBulk","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"components":[{"internalType":"uint256","name":"field_0","type":"uint256"},{"internalType":"string","name":"field_1","type":"string"}],"internalType":"struct Tuple0[]","name":"tokens","type":"tuple[]"}],"name":"mintBulkWithTokenURI","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"string","name":"tokenUri","type":"string"}],"name":"mintWithTokenURI","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"mintingFinished","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nextTokenId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFromWithData","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"setVariableMetadata","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"interfaceId","type":"uint32"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"}]1[{"inputs":[{"internalType":"address","name":"_proxied","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[],"name":"MintingFinished","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"address","name":"approved","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"burnFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"key","type":"string"}],"name":"deleteProperty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"finishMinting","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"mint","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"mintBulk","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"components":[{"internalType":"uint256","name":"field_0","type":"uint256"},{"internalType":"string","name":"field_1","type":"string"}],"internalType":"struct Tuple0[]","name":"tokens","type":"tuple[]"}],"name":"mintBulkWithTokenURI","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"string","name":"tokenUri","type":"string"}],"name":"mintWithTokenURI","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"mintingFinished","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nextTokenId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFromWithData","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"key","type":"string"},{"internalType":"string","name":"value","type":"string"}],"name":"setProperty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"}]tests/src/eth/proxy/UniqueNFTProxy.bindiffbeforeafterboth1608060405234801561001057600080fd5b5060405161168d38038061168d83398101604081905261002f91610054565b600080546001600160a01b0319166001600160a01b0392909216919091179055610084565b60006020828403121561006657600080fd5b81516001600160a01b038116811461007d57600080fd5b9392505050565b6115fa806100936000396000f3fe608060405234801561001057600080fd5b50600436106101a95760003560e01c806350bb4e7f116100f9578063a22cb46511610097578063d4eac26d11610071578063d4eac26d1461036b578063e6c5ce6f1461037e578063e985e9c514610391578063f4f4b500146103a457600080fd5b8063a22cb46514610332578063a9059cbb14610345578063c87b56dd1461035857600080fd5b806370a08231116100d357806370a082311461030757806375794a3c1461031a5780637d64bcb41461032257806395d89b411461032a57600080fd5b806350bb4e7f146102ce57806360a11672146102e15780636352211e146102f457600080fd5b80632f745c591161016657806342842e0e1161014057806342842e0e1461028257806342966c681461029557806344a9945e146102a85780634f6ccce7146102bb57600080fd5b80632f745c5914610249578063365430061461025c57806340c10f191461026f57600080fd5b806305d2035b146101ae57806306fdde03146101cb578063081812fc146101e0578063095ea7b31461020b57806318160ddd1461022057806323b872dd14610236575b600080fd5b6101b66103b7565b60405190151581526020015b60405180910390f35b6101d3610443565b6040516101c2919061148a565b6101f36101ee366004611277565b6104c3565b6040516001600160a01b0390911681526020016101c2565b61021e61021936600461118c565b610547565b005b6102286105b2565b6040519081526020016101c2565b61021e610244366004610eff565b610639565b61022861025736600461118c565b6106ad565b6101b661026a366004610fac565b610739565b6101b661027d36600461118c565b6107be565b61021e610290366004610eff565b6107f8565b61021e6102a3366004611277565b610839565b6101b66102b63660046110b1565b61089a565b6102286102c9366004611277565b6108cd565b6101b66102dc3660046111b8565b61094b565b61021e6102ef366004610f40565b6109da565b6101f3610302366004611277565b610a49565b610228610315366004610e8c565b610a7b565b610228610aae565b6101b6610afd565b6101d3610b62565b61021e61034036600461115e565b610ba6565b61021e61035336600461118c565b610be0565b6101d3610366366004611277565b610c19565b61021e6103793660046112a9565b610c9b565b6101d361038c366004611277565b610ccd565b6101f361039f366004610ec6565b610cff565b6101b66103b23660046112f0565b610d85565b60008060009054906101000a90046001600160a01b03166001600160a01b03166305d2035b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561040657600080fd5b505afa15801561041a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061043e9190611211565b905090565b60008054604080516306fdde0360e01b815290516060936001600160a01b03909316926306fdde039260048082019391829003018186803b15801561048757600080fd5b505afa15801561049b573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261043e919081019061122e565b6000805460405163020604bf60e21b8152600481018490526001600160a01b039091169063081812fc906024015b60206040518083038186803b15801561050957600080fd5b505afa15801561051d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105419190610ea9565b92915050565b60005460405163095ea7b360e01b81526001600160a01b038481166004830152602482018490529091169063095ea7b3906044015b600060405180830381600087803b15801561059657600080fd5b505af11580156105aa573d6000803e3d6000fd5b505050505050565b60008060009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561060157600080fd5b505afa158015610615573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061043e9190611290565b6000546040516323b872dd60e01b81526001600160a01b038581166004830152848116602483015260448201849052909116906323b872dd906064015b600060405180830381600087803b15801561069057600080fd5b505af11580156106a4573d6000803e3d6000fd5b50505050505050565b60008054604051632f745c5960e01b81526001600160a01b0385811660048301526024820185905290911690632f745c599060440160206040518083038186803b1580156106fa57600080fd5b505afa15801561070e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107329190611290565b9392505050565b60008054604051631b2a180360e11b81526001600160a01b039091169063365430069061076c908690869060040161137f565b602060405180830381600087803b15801561078657600080fd5b505af115801561079a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107329190611211565b600080546040516340c10f1960e01b81526001600160a01b03858116600483015260248201859052909116906340c10f199060440161076c565b600054604051632142170760e11b81526001600160a01b038581166004830152848116602483015260448201849052909116906342842e0e90606401610676565b600054604051630852cd8d60e31b8152600481018390526001600160a01b03909116906342966c6890602401600060405180830381600087803b15801561087f57600080fd5b505af1158015610893573d6000803e3d6000fd5b5050505050565b60008054604051632254ca2f60e11b81526001600160a01b03909116906344a9945e9061076c9086908690600401611404565b60008054604051634f6ccce760e01b8152600481018490526001600160a01b0390911690634f6ccce7906024015b60206040518083038186803b15801561091357600080fd5b505afa158015610927573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105419190611290565b600080546040516350bb4e7f60e01b81526001600160a01b03909116906350bb4e7f906109809087908790879060040161145a565b602060405180830381600087803b15801561099a57600080fd5b505af11580156109ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109d29190611211565b949350505050565b6000546040516330508b3960e11b81526001600160a01b03909116906360a1167290610a10908790879087908790600401611342565b600060405180830381600087803b158015610a2a57600080fd5b505af1158015610a3e573d6000803e3d6000fd5b505050505b50505050565b600080546040516331a9108f60e11b8152600481018490526001600160a01b0390911690636352211e906024016104f1565b600080546040516370a0823160e01b81526001600160a01b038481166004830152909116906370a08231906024016108fb565b60008060009054906101000a90046001600160a01b03166001600160a01b03166375794a3c6040518163ffffffff1660e01b815260040160206040518083038186803b15801561060157600080fd5b60008060009054906101000a90046001600160a01b03166001600160a01b0316637d64bcb46040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610b4e57600080fd5b505af115801561041a573d6000803e3d6000fd5b60008054604080516395d89b4160e01b815290516060936001600160a01b03909316926395d89b419260048082019391829003018186803b15801561048757600080fd5b60005460405163a22cb46560e01b81526001600160a01b03848116600483015283151560248301529091169063a22cb4659060440161057c565b60005460405163a9059cbb60e01b81526001600160a01b038481166004830152602482018490529091169063a9059cbb9060440161057c565b60005460405163c87b56dd60e01b8152600481018390526060916001600160a01b03169063c87b56dd906024015b60006040518083038186803b158015610c5f57600080fd5b505afa158015610c73573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610541919081019061122e565b60005460405163d4eac26d60e01b81526001600160a01b039091169063d4eac26d9061057c908590859060040161149d565b60005460405163e6c5ce6f60e01b8152600481018390526060916001600160a01b03169063e6c5ce6f90602401610c47565b6000805460405163e985e9c560e01b81526001600160a01b03858116600483015284811660248301529091169063e985e9c59060440160206040518083038186803b158015610d4d57600080fd5b505afa158015610d61573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107329190610ea9565b6000805460405162f4f4b560e81b815263ffffffff841660048201526001600160a01b039091169063f4f4b5009060240160206040518083038186803b158015610dce57600080fd5b505afa158015610de2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105419190611211565b6000610e19610e1484611534565b6114df565b9050828152838383011115610e2d57600080fd5b61073283602083018461155c565b600082601f830112610e4c57600080fd5b8135610e5a610e1482611534565b818152846020838601011115610e6f57600080fd5b816020850160208301376000918101602001919091529392505050565b600060208284031215610e9e57600080fd5b81356107328161159e565b600060208284031215610ebb57600080fd5b81516107328161159e565b60008060408385031215610ed957600080fd5b8235610ee48161159e565b91506020830135610ef48161159e565b809150509250929050565b600080600060608486031215610f1457600080fd5b8335610f1f8161159e565b92506020840135610f2f8161159e565b929592945050506040919091013590565b60008060008060808587031215610f5657600080fd5b8435610f618161159e565b93506020850135610f718161159e565b925060408501359150606085013567ffffffffffffffff811115610f9457600080fd5b610fa087828801610e3b565b91505092959194509250565b60008060408385031215610fbf57600080fd5b8235610fca8161159e565b915060208381013567ffffffffffffffff80821115610fe857600080fd5b818601915086601f830112610ffc57600080fd5b813561100a610e1482611510565b8082825285820191508585018a878560051b880101111561102a57600080fd5b60005b848110156110a05781358681111561104457600080fd5b87016040818e03601f1901121561105a57600080fd5b6110626114b6565b89820135815260408201358881111561107a57600080fd5b6110888f8c83860101610e3b565b828c015250855250928701929087019060010161102d565b50979a909950975050505050505050565b600080604083850312156110c457600080fd5b82356110cf8161159e565b915060208381013567ffffffffffffffff8111156110ec57600080fd5b8401601f810186136110fd57600080fd5b803561110b610e1482611510565b80828252848201915084840189868560051b870101111561112b57600080fd5b600094505b8385101561114e578035835260019490940193918501918501611130565b5080955050505050509250929050565b6000806040838503121561117157600080fd5b823561117c8161159e565b91506020830135610ef4816115b6565b6000806040838503121561119f57600080fd5b82356111aa8161159e565b946020939093013593505050565b6000806000606084860312156111cd57600080fd5b83356111d88161159e565b925060208401359150604084013567ffffffffffffffff8111156111fb57600080fd5b61120786828701610e3b565b9150509250925092565b60006020828403121561122357600080fd5b8151610732816115b6565b60006020828403121561124057600080fd5b815167ffffffffffffffff81111561125757600080fd5b8201601f8101841361126857600080fd5b6109d284825160208401610e06565b60006020828403121561128957600080fd5b5035919050565b6000602082840312156112a257600080fd5b5051919050565b600080604083850312156112bc57600080fd5b82359150602083013567ffffffffffffffff8111156112da57600080fd5b6112e685828601610e3b565b9150509250929050565b60006020828403121561130257600080fd5b813563ffffffff8116811461073257600080fd5b6000815180845261132e81602086016020860161155c565b601f01601f19169290920160200192915050565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061137590830184611316565b9695505050505050565b6001600160a01b0383168152604060208083018290528351828401819052600092916060600583901b860181019290860190878301865b828110156113f557888603605f190184528151805187528501518587018890526113e288880182611316565b96505092840192908401906001016113b6565b50939998505050505050505050565b6001600160a01b038316815260406020808301829052835191830182905260009184820191906060850190845b8181101561144d57845183529383019391830191600101611431565b5090979650505050505050565b60018060a01b03841681528260208201526060604082015260006114816060830184611316565b95945050505050565b6020815260006107326020830184611316565b8281526040602082015260006109d26040830184611316565b6040805190810167ffffffffffffffff811182821017156114d9576114d9611588565b60405290565b604051601f8201601f1916810167ffffffffffffffff8111828210171561150857611508611588565b604052919050565b600067ffffffffffffffff82111561152a5761152a611588565b5060051b60200190565b600067ffffffffffffffff82111561154e5761154e611588565b50601f01601f191660200190565b60005b8381101561157757818101518382015260200161155f565b83811115610a435750506000910152565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146115b357600080fd5b50565b80151581146115b357600080fdfea2646970667358221220669a75a3efcdc6b60606caa5c7e41cab1d727e89a03fd231d1cda27f4de159a064736f6c634300080700331608060405234801561001057600080fd5b506040516116bb3803806116bb83398101604081905261002f91610054565b600080546001600160a01b0319166001600160a01b0392909216919091179055610084565b60006020828403121561006657600080fd5b81516001600160a01b038116811461007d57600080fd5b9392505050565b611628806100936000396000f3fe608060405234801561001057600080fd5b50600436106101c45760003560e01c80634f6ccce7116100f957806379cc679011610097578063a22cb46511610071578063a22cb46514610399578063a9059cbb146103ac578063c87b56dd146103bf578063e985e9c5146103d257600080fd5b806379cc6790146103765780637d64bcb41461038957806395d89b411461039157600080fd5b806362d9491f116100d357806362d9491f146103355780636352211e1461034857806370a082311461035b57806375794a3c1461036e57600080fd5b80634f6ccce7146102fc57806350bb4e7f1461030f57806360a116721461032257600080fd5b80632f745c591161016657806340c10f191161014057806340c10f19146102b057806342842e0e146102c357806342966c68146102d657806344a9945e146102e957600080fd5b80632f745c5914610277578063342419141461028a578063365430061461029d57600080fd5b8063081812fc116101a2578063081812fc1461020e578063095ea7b31461023957806318160ddd1461024e57806323b872dd1461026457600080fd5b806301ffc9a7146101c957806305d2035b146101f157806306fdde03146101f9575b600080fd5b6101dc6101d7366004610dca565b6103e5565b60405190151581526020015b60405180910390f35b6101dc610462565b6102016104df565b6040516101e89190610e4c565b61022161021c366004610e5f565b610550565b6040516001600160a01b0390911681526020016101e8565b61024c610247366004610e90565b6105bf565b005b61025661062a565b6040519081526020016101e8565b61024c610272366004610ebc565b6106a2565b610256610285366004610e90565b610716565b61024c610298366004610ff3565b610793565b6101dc6102ab36600461104c565b6107f8565b6101dc6102be366004610e90565b61086e565b61024c6102d1366004610ebc565b6108a8565b61024c6102e4366004610e5f565b6108e9565b6101dc6102f736600461114f565b61091a565b61025661030a366004610e5f565b61094d565b6101dc61031d3660046111f5565b6109bc565b61024c61033036600461124e565b610a3c565b61024c6103433660046112ce565b610aab565b610221610356366004610e5f565b610add565b610256610369366004611332565b610b0f565b610256610b42565b61024c610384366004610e90565b610b96565b6101dc610bcf565b610201610c25565b61024c6103a736600461135d565b610c6e565b61024c6103ba366004610e90565b610ca8565b6102016103cd366004610e5f565b610ce1565b6102216103e0366004611396565b610d53565b600080546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b03909116906301ffc9a790602401602060405180830381865afa158015610438573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061045c91906113c4565b92915050565b60008060009054906101000a90046001600160a01b03166001600160a01b03166305d2035b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156104b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104da91906113c4565b905090565b60008054604080516306fdde0360e01b815290516060936001600160a01b03909316926306fdde0392600480820193918290030181865afa158015610528573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526104da91908101906113e1565b6000805460405163020604bf60e21b8152600481018490526001600160a01b039091169063081812fc906024015b602060405180830381865afa15801561059b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061045c9190611458565b60005460405163095ea7b360e01b81526001600160a01b038481166004830152602482018490529091169063095ea7b3906044015b600060405180830381600087803b15801561060e57600080fd5b505af1158015610622573d6000803e3d6000fd5b505050505050565b60008060009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561067e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104da9190611475565b6000546040516323b872dd60e01b81526001600160a01b038581166004830152848116602483015260448201849052909116906323b872dd906064015b600060405180830381600087803b1580156106f957600080fd5b505af115801561070d573d6000803e3d6000fd5b50505050505050565b60008054604051632f745c5960e01b81526001600160a01b0385811660048301526024820185905290911690632f745c5990604401602060405180830381865afa158015610768573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061078c9190611475565b9392505050565b600054604051630d09064560e21b81526001600160a01b03909116906334241914906107c3908490600401610e4c565b600060405180830381600087803b1580156107dd57600080fd5b505af11580156107f1573d6000803e3d6000fd5b5050505050565b60008054604051631b2a180360e11b81526001600160a01b039091169063365430069061082b908690869060040161148e565b6020604051808303816000875af115801561084a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061078c91906113c4565b600080546040516340c10f1960e01b81526001600160a01b03858116600483015260248201859052909116906340c10f199060440161082b565b600054604051632142170760e11b81526001600160a01b038581166004830152848116602483015260448201849052909116906342842e0e906064016106df565b600054604051630852cd8d60e31b8152600481018390526001600160a01b03909116906342966c68906024016107c3565b60008054604051632254ca2f60e11b81526001600160a01b03909116906344a9945e9061082b9086908690600401611513565b60008054604051634f6ccce760e01b8152600481018490526001600160a01b0390911690634f6ccce7906024015b602060405180830381865afa158015610998573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061045c9190611475565b600080546040516350bb4e7f60e01b81526001600160a01b03909116906350bb4e7f906109f190879087908790600401611569565b6020604051808303816000875af1158015610a10573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a3491906113c4565b949350505050565b6000546040516330508b3960e11b81526001600160a01b03909116906360a1167290610a72908790879087908790600401611590565b600060405180830381600087803b158015610a8c57600080fd5b505af1158015610aa0573d6000803e3d6000fd5b505050505b50505050565b6000546040516362d9491f60e01b81526001600160a01b03909116906362d9491f906105f490859085906004016115cd565b600080546040516331a9108f60e11b8152600481018490526001600160a01b0390911690636352211e9060240161057e565b600080546040516370a0823160e01b81526001600160a01b038481166004830152909116906370a082319060240161097b565b60008060009054906101000a90046001600160a01b03166001600160a01b03166375794a3c6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561067e573d6000803e3d6000fd5b60005460405163079cc67960e41b81526001600160a01b03848116600483015260248201849052909116906379cc6790906044016105f4565b60008060009054906101000a90046001600160a01b03166001600160a01b0316637d64bcb46040518163ffffffff1660e01b81526004016020604051808303816000875af11580156104b6573d6000803e3d6000fd5b60008054604080516395d89b4160e01b815290516060936001600160a01b03909316926395d89b4192600480820193918290030181865afa158015610528573d6000803e3d6000fd5b60005460405163a22cb46560e01b81526001600160a01b03848116600483015283151560248301529091169063a22cb465906044016105f4565b60005460405163a9059cbb60e01b81526001600160a01b038481166004830152602482018490529091169063a9059cbb906044016105f4565b60005460405163c87b56dd60e01b8152600481018390526060916001600160a01b03169063c87b56dd90602401600060405180830381865afa158015610d2b573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261045c91908101906113e1565b6000805460405163e985e9c560e01b81526001600160a01b03858116600483015284811660248301529091169063e985e9c590604401602060405180830381865afa158015610da6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061078c9190611458565b600060208284031215610ddc57600080fd5b81356001600160e01b03198116811461078c57600080fd5b60005b83811015610e0f578181015183820152602001610df7565b83811115610aa55750506000910152565b60008151808452610e38816020860160208601610df4565b601f01601f19169290920160200192915050565b60208152600061078c6020830184610e20565b600060208284031215610e7157600080fd5b5035919050565b6001600160a01b0381168114610e8d57600080fd5b50565b60008060408385031215610ea357600080fd5b8235610eae81610e78565b946020939093013593505050565b600080600060608486031215610ed157600080fd5b8335610edc81610e78565b92506020840135610eec81610e78565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff81118282101715610f3657610f36610efd565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715610f6557610f65610efd565b604052919050565b600067ffffffffffffffff821115610f8757610f87610efd565b50601f01601f191660200190565b6000610fa8610fa384610f6d565b610f3c565b9050828152838383011115610fbc57600080fd5b828260208301376000602084830101529392505050565b600082601f830112610fe457600080fd5b61078c83833560208501610f95565b60006020828403121561100557600080fd5b813567ffffffffffffffff81111561101c57600080fd5b610a3484828501610fd3565b600067ffffffffffffffff82111561104257611042610efd565b5060051b60200190565b600080604080848603121561106057600080fd5b833561106b81610e78565b925060208481013567ffffffffffffffff8082111561108957600080fd5b818701915087601f83011261109d57600080fd5b81356110ab610fa382611028565b81815260059190911b8301840190848101908a8311156110ca57600080fd5b8585015b8381101561113d578035858111156110e65760008081fd5b8601808d03601f19018913156110fc5760008081fd5b611104610f13565b888201358152898201358781111561111c5760008081fd5b61112a8f8b83860101610fd3565b828b0152508452509186019186016110ce565b50809750505050505050509250929050565b6000806040838503121561116257600080fd5b823561116d81610e78565b915060208381013567ffffffffffffffff81111561118a57600080fd5b8401601f8101861361119b57600080fd5b80356111a9610fa382611028565b81815260059190911b820183019083810190888311156111c857600080fd5b928401925b828410156111e6578335825292840192908401906111cd565b80955050505050509250929050565b60008060006060848603121561120a57600080fd5b833561121581610e78565b925060208401359150604084013567ffffffffffffffff81111561123857600080fd5b61124486828701610fd3565b9150509250925092565b6000806000806080858703121561126457600080fd5b843561126f81610e78565b9350602085013561127f81610e78565b925060408501359150606085013567ffffffffffffffff8111156112a257600080fd5b8501601f810187136112b357600080fd5b6112c287823560208401610f95565b91505092959194509250565b600080604083850312156112e157600080fd5b823567ffffffffffffffff808211156112f957600080fd5b61130586838701610fd3565b9350602085013591508082111561131b57600080fd5b5061132885828601610fd3565b9150509250929050565b60006020828403121561134457600080fd5b813561078c81610e78565b8015158114610e8d57600080fd5b6000806040838503121561137057600080fd5b823561137b81610e78565b9150602083013561138b8161134f565b809150509250929050565b600080604083850312156113a957600080fd5b82356113b481610e78565b9150602083013561138b81610e78565b6000602082840312156113d657600080fd5b815161078c8161134f565b6000602082840312156113f357600080fd5b815167ffffffffffffffff81111561140a57600080fd5b8201601f8101841361141b57600080fd5b8051611429610fa382610f6d565b81815285602083850101111561143e57600080fd5b61144f826020830160208601610df4565b95945050505050565b60006020828403121561146a57600080fd5b815161078c81610e78565b60006020828403121561148757600080fd5b5051919050565b6001600160a01b0383168152604060208083018290528351828401819052600092916060600583901b860181019290860190878301865b8281101561150457888603605f190184528151805187528501518587018890526114f188880182610e20565b96505092840192908401906001016114c5565b50939998505050505050505050565b6001600160a01b038316815260406020808301829052835191830182905260009184820191906060850190845b8181101561155c57845183529383019391830191600101611540565b5090979650505050505050565b60018060a01b038416815282602082015260606040820152600061144f6060830184610e20565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906115c390830184610e20565b9695505050505050565b6040815260006115e06040830185610e20565b828103602084015261144f8185610e2056fea26469706673582212205bdf4275f4b714a1029ccfe77c0f9a0e20e121a932e1e5840cace97dfa886da964736f6c634300080d0033tests/src/eth/proxy/UniqueNFTProxy.soldiffbeforeafterboth148 return proxied.nextTokenId();148 return proxied.nextTokenId();149 }149 }150151 function supportsInterface(uint32 interfaceId)152 external153 view154 override155 returns (bool)156 {157 return proxied.supportsInterface(interfaceId);158 }159150160 function setVariableMetadata(uint256 tokenId, bytes memory data)151 function burnFrom(address from, uint256 tokenId) external override {161 external162 override163 {164 return proxied.setVariableMetadata(tokenId, data);152 return proxied.burnFrom(from, tokenId);165 }153 }166154167 function getVariableMetadata(uint256 tokenId)155 function supportsInterface(bytes4 interfaceId)168 external156 external169 view157 view170 override158 override171 returns (bytes memory)159 returns (bool)172 {160 {173 return proxied.getVariableMetadata(tokenId);161 return proxied.supportsInterface(interfaceId);174 }162 }175163176 function mintBulk(address to, uint256[] memory tokenIds)164 function mintBulk(address to, uint256[] memory tokenIds)189 return proxied.mintBulkWithTokenURI(to, tokens);177 return proxied.mintBulkWithTokenURI(to, tokens);190 }178 }179180 function setProperty(string memory key, string memory value) external override {181 return proxied.setProperty(key, value);182 }183184 function deleteProperty(string memory key) external override {185 return proxied.deleteProperty(key);186 }191}187}192188tests/src/eth/proxy/nonFungibleProxy.test.tsdiffbeforeafterboth15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.161617import privateKey from '../../substrate/privateKey';17import privateKey from '../../substrate/privateKey';18import {createCollectionExpectSuccess, createItemExpectSuccess, setVariableMetaDataExpectSuccess, setMetadataUpdatePermissionFlagExpectSuccess} from '../../util/helpers';18import {createCollectionExpectSuccess, createItemExpectSuccess, setMetadataUpdatePermissionFlagExpectSuccess} from '../../util/helpers';19import {collectionIdToAddress, createEthAccount, createEthAccountWithBalance, GAS_ARGS, itWeb3, normalizeEvents} from '../util/helpers';19import {collectionIdToAddress, createEthAccount, createEthAccountWithBalance, GAS_ARGS, itWeb3, normalizeEvents} from '../util/helpers';20import nonFungibleAbi from '../nonFungibleAbi.json';20import nonFungibleAbi from '../nonFungibleAbi.json';21import {expect} from 'chai';21import {expect} from 'chai';335 }335 }336 });336 });337338 itWeb3('Can perform getVariableMetadata', async ({web3, api}) => {339 const collection = await createCollectionExpectSuccess({340 mode: {type: 'NFT'},341 });342 const alice = privateKey('//Alice');343 const caller = await createEthAccountWithBalance(api, web3);344345 const address = collectionIdToAddress(collection);346 const contract = await proxyWrap(api, web3, new web3.eth.Contract(nonFungibleAbi as any, address, {from: caller, ...GAS_ARGS}));347 const item = await createItemExpectSuccess(alice, collection, 'NFT', {Ethereum: contract.options.address});348 await setMetadataUpdatePermissionFlagExpectSuccess(alice, collection, 'Admin');349 await setVariableMetaDataExpectSuccess(alice, collection, item, [1, 2, 3]);350351 expect(await contract.methods.getVariableMetadata(item).call()).to.be.equal('0x010203');352 });353354 itWeb3('Can perform setVariableMetadata', async ({web3, api}) => {355 const collection = await createCollectionExpectSuccess({356 mode: {type: 'NFT'},357 });358 const alice = privateKey('//Alice');359 const caller = await createEthAccountWithBalance(api, web3);360361 const address = collectionIdToAddress(collection);362 const contract = await proxyWrap(api, web3, new web3.eth.Contract(nonFungibleAbi as any, address, {from: caller, ...GAS_ARGS}));363 const item = await createItemExpectSuccess(alice, collection, 'NFT', {Ethereum: contract.options.address});364365 expect(await contract.methods.setVariableMetadata(item, '0x010203').send({from: caller}));366 expect(await contract.methods.getVariableMetadata(item).call()).to.be.equal('0x010203');367 });368});337});369338tests/src/metadataUpdate.test.tsdiffbeforeafterbothno changes
tests/src/nesting/rules-smoke.test.tsdiffbeforeafterboth39 it('called for nonfungible', async () => {39 it('called for nonfungible', async () => {40 await usingApi(async api => {40 await usingApi(async api => {41 const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}});41 const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}});42 await expect(executeTransaction(api, alice, api.tx.unique.createItem(collection, nestTarget, {NFT: {ConstData: [], VariableData: {}}})))42 await expect(executeTransaction(api, alice, api.tx.unique.createItem(collection, nestTarget, {NFT: {ConstData: []}})))43 .to.be.rejectedWith(/^common\.SourceCollectionIsNotAllowedToNest$/);43 .to.be.rejectedWith(/^common\.SourceCollectionIsNotAllowedToNest$/);444445 const token = await createItemExpectSuccess(alice, collection, 'NFT', {Substrate: alice.address});45 const token = await createItemExpectSuccess(alice, collection, 'NFT', {Substrate: alice.address});51 it('called for refungible', async () => {51 it('called for refungible', async () => {52 await usingApi(async api => {52 await usingApi(async api => {53 const collection = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});53 const collection = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});54 await expect(executeTransaction(api, alice, api.tx.unique.createItem(collection, nestTarget, {ReFungible: {ConstData: [], VariableData: {}}})))54 await expect(executeTransaction(api, alice, api.tx.unique.createItem(collection, nestTarget, {ReFungible: {ConstData: []}})))55 .to.be.rejectedWith(/^common\.SourceCollectionIsNotAllowedToNest$/);55 .to.be.rejectedWith(/^common\.SourceCollectionIsNotAllowedToNest$/);565657 const token = await createItemExpectSuccess(alice, collection, 'ReFungible', {Substrate: alice.address});57 const token = await createItemExpectSuccess(alice, collection, 'ReFungible', {Substrate: alice.address});tests/src/setVariableMetaData.test.tsdiffbeforeafterbothno changes
tests/src/setVariableMetadataSponsoringRateLimit.test.tsdiffbeforeafterbothno changes
tests/src/util/helpers.tsdiffbeforeafterboth142export interface IReFungibleTokenDataType {142export interface IReFungibleTokenDataType {143 owner: IReFungibleOwner[];143 owner: IReFungibleOwner[];144 constData: number[];144 constData: number[];145 variableData: number[];146}145}147146148export function uniqueEventMessage(events: EventRecord[]): IGetMessage {147export function uniqueEventMessage(events: EventRecord[]): IGetMessage {794 });793 });795}794}796797export async function setVariableMetaDataExpectSuccess(sender: IKeyringPair, collectionId: number, itemId: number, data: number[]) {798 await usingApi(async (api) => {799 const tx = api.tx.unique.setVariableMetaData(collectionId, itemId, '0x' + Buffer.from(data).toString('hex'));800 const events = await submitTransactionAsync(sender, tx);801 const result = getGenericResult(events);802803 expect(result.success).to.be.true;804 });805}806807export async function setVariableMetaDataExpectFailure(sender: IKeyringPair, collectionId: number, itemId: number, data: number[]) {808 await usingApi(async (api) => {809 const tx = api.tx.unique.setVariableMetaData(collectionId, itemId, '0x' + Buffer.from(data).toString('hex'));810 await expect(submitTransactionExpectFailAsync(sender, tx)).to.be.rejected;811 });812}813795814export async function setOffchainSchemaExpectSuccess(sender: IKeyringPair, collectionId: number, data: number[]) {796export async function setOffchainSchemaExpectSuccess(sender: IKeyringPair, collectionId: number, data: number[]) {815 await usingApi(async (api) => {797 await usingApi(async (api) => {1138): Promise<string[]> {1120): Promise<string[]> {1139 return (await api.rpc.unique.adminlist(collectionId)).toHuman() as any;1121 return (await api.rpc.unique.adminlist(collectionId)).toHuman() as any;1140}1122}1141export async function getVariableMetadata(1142 api: ApiPromise,1143 collectionId: number,1144 tokenId: number,1145): Promise<number[]> {1146 return [...(await api.rpc.unique.variableMetadata(collectionId, tokenId))];1147}1148export async function getConstMetadata(1123export async function getConstMetadata(1149 api: ApiPromise,1124 api: ApiPromise,1150 collectionId: number,1125 collectionId: number,1182 const createData = {fungible: {value: 10}};1157 const createData = {fungible: {value: 10}};1183 tx = api.tx.unique.createItem(collectionId, to, createData as any);1158 tx = api.tx.unique.createItem(collectionId, to, createData as any);1184 } else if (createMode === 'ReFungible') {1159 } else if (createMode === 'ReFungible') {1185 const createData = {refungible: {const_data: [], variable_data: [], pieces: 100}};1160 const createData = {refungible: {const_data: [], pieces: 100}};1186 tx = api.tx.unique.createItem(collectionId, to, createData as any);1161 tx = api.tx.unique.createItem(collectionId, to, createData as any);1187 } else {1162 } else {1188 const createData = {nft: {const_data: [], variable_data: []}};1163 const createData = {nft: {const_data: []}};1189 tx = api.tx.unique.createItem(collectionId, to, createData as any);1164 tx = api.tx.unique.createItem(collectionId, to, createData as any);1190 }1165 }11911166