From 2397767cecafe0f5eec199df32d912b6b0b82b60 Mon Sep 17 00:00:00 2001 From: steven2308 Date: Tue, 15 Aug 2023 14:25:56 -0500 Subject: [PATCH 01/19] Adds config for base networks on testing and prod. --- .env.example | 10 +++++-- hardhat.config.ts | 71 +++++++++++++++++++++++++++++++++++------------ 2 files changed, 60 insertions(+), 21 deletions(-) diff --git a/.env.example b/.env.example index dac6e0d9..ba0aef20 100644 --- a/.env.example +++ b/.env.example @@ -1,8 +1,12 @@ ETHERSCAN_API_KEY=ABC123ABC123ABC123ABC123ABC123ABC1 -SEPOLIA_URL= -ETHEREUM_URL= +SEPOLIA_URL=https://eth-sepolia.g.alchemy.com/v2/ +ETHEREUM_URL=https://eth-mainnet.g.alchemy.com/v2/ POLYGON_URL=https://polygon-mainnet.g.alchemy.com/v2/ +MUMBAI_URL= +BASE_URL= +BASE_GOERLI_URL= PRIVATE_KEY=0xabc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc1 MOONRIVER_MOONSCAN_APIKEY=ABC123 MOONBEAM_MOONSCAN_APIKEY=ABC123 -POLYGONSCAN_API_KEY=ABC123 \ No newline at end of file +POLYGONSCAN_API_KEY=ABC123 +BASE_API_KEY=ABC123 \ No newline at end of file diff --git a/hardhat.config.ts b/hardhat.config.ts index 12f2fb91..775a5f57 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -31,7 +31,7 @@ const config: HardhatUserConfig = { evmVersion: 'london', optimizer: { enabled: true, - runs: 200, + runs: 100, }, outputSelection: { '*': { @@ -41,20 +41,14 @@ const config: HardhatUserConfig = { }, }, networks: { - moonbaseAlpha: { - url: 'https://rpc.testnet.moonbeam.network', - accounts: process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [], - gasPrice: 1000000000, - }, - moonriver: { - url: 'https://rpc.api.moonriver.moonbeam.network', - chainId: 1285, // (hex: 0x505), - accounts: process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [], + hardhat: { + allowUnlimitedContractSize: true, }, - moonbeam: { - url: 'https://rpc.api.moonbeam.network', - chainId: 1284, // (hex: 0x504), + moonbaseAlpha: { + url: 'https://rpc.testnet.moonbeam.network/', + chainId: 1287, accounts: process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [], + gasPrice: 1100000000, }, sepolia: { url: process.env.SEPOLIA_URL || '', @@ -67,11 +61,27 @@ const config: HardhatUserConfig = { accounts: process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [], gasPrice: 135000000000, }, + baseGoerli: { + chainId: 84531, + url: process.env.BASE_GOERLI_URL || 'https://goerli.base.org', + accounts: process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [], + gasPrice: 2000000000, + }, + moonriver: { + url: 'https://rpc.api.moonriver.moonbeam.network', + chainId: 1285, // (hex: 0x505), + accounts: process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [], + }, + moonbeam: { + url: 'https://rpc.api.moonbeam.network', + chainId: 1284, // (hex: 0x504), + accounts: process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [], + }, mainnet: { url: process.env.ETHEREUM_URL || '', chainId: 1, accounts: process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [], - gasPrice: 12000000000, + gasPrice: 13000000000, }, polygon: { url: process.env.POLYGON_URL || '', @@ -79,6 +89,11 @@ const config: HardhatUserConfig = { accounts: process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [], gasPrice: 120000000000, }, + base: { + chainId: 8453, + url: process.env.BASE_URL, + accounts: process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [], + }, }, gasReporter: { enabled: process.env.REPORT_GAS !== undefined, @@ -88,14 +103,34 @@ const config: HardhatUserConfig = { }, etherscan: { apiKey: { - moonriver: process.env.MOONRIVER_MOONSCAN_APIKEY || '', // Moonriver Moonscan API Key moonbaseAlpha: process.env.MOONBEAM_MOONSCAN_APIKEY || '', // Moonbeam Moonscan API Key - moonbeam: process.env.MOONBEAM_MOONSCAN_APIKEY || '', // Moonbeam Moonscan API Key sepolia: process.env.ETHERSCAN_API_KEY || '', // Sepolia Etherscan API Key - polygonMumbai: process.env.POLYGONSCAN_API_KEY || '', // Polygon Mumbai Etherscan API Key + polygonMumbai: process.env.POLYGON_ETHERSCAN_API_KEY || '', // Polygon Mumbai Etherscan API Key + baseGoerli: process.env.BASE_API_KEY || '', // Base Goerli Etherscan API Key + moonriver: process.env.MOONRIVER_MOONSCAN_APIKEY || '', // Moonriver Moonscan API Key + moonbeam: process.env.MOONBEAM_MOONSCAN_APIKEY || '', // Moonbeam Moonscan API Key mainnet: process.env.ETHERSCAN_API_KEY || '', // Ethereum Etherscan API Key - polygon: process.env.POLYGONSCAN_API_KEY || '', // Polygon Etherscan API Key + polygon: process.env.POLYGON_ETHERSCAN_API_KEY || '', // Polygon Etherscan API Key + base: process.env.BASE_API_KEY || '', // Base Etherscan API Key }, + customChains: [ + { + network: "baseGoerli", + chainId: 84531, + urls: { + apiURL: "https://api-goerli.basescan.org/api", + browserURL: "https://goerli.basescan.org" + } + }, + { + network: "base", + chainId: 8453, + urls: { + apiURL: "https://api.basescan.org/api", + browserURL: "https://basescan.org" + } + } + ] }, dodoc: { runOnCompile: false, From 9d889ecda1b94bb21ca84de4a6ebf39053a59cc1 Mon Sep 17 00:00:00 2001 From: steven2308 Date: Wed, 16 Aug 2023 09:02:18 -0500 Subject: [PATCH 02/19] Adds sample URLs on .env.example. --- .env.example | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.env.example b/.env.example index ba0aef20..0e098988 100644 --- a/.env.example +++ b/.env.example @@ -2,9 +2,9 @@ ETHERSCAN_API_KEY=ABC123ABC123ABC123ABC123ABC123ABC1 SEPOLIA_URL=https://eth-sepolia.g.alchemy.com/v2/ ETHEREUM_URL=https://eth-mainnet.g.alchemy.com/v2/ POLYGON_URL=https://polygon-mainnet.g.alchemy.com/v2/ -MUMBAI_URL= -BASE_URL= -BASE_GOERLI_URL= +MUMBAI_URL=https://polygon-mumbai.g.alchemy.com/v2/ +BASE_URL=https://base-mainnet.g.alchemy.com/v2/ +BASE_GOERLI_URL=https://base-goerli.g.alchemy.com/v2/ PRIVATE_KEY=0xabc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc1 MOONRIVER_MOONSCAN_APIKEY=ABC123 MOONBEAM_MOONSCAN_APIKEY=ABC123 From e113ebc2c65626d7dafefa674cf8802c6903b7db Mon Sep 17 00:00:00 2001 From: steven2308 Date: Wed, 16 Aug 2023 09:14:50 -0500 Subject: [PATCH 03/19] Adds fallback value for BASE_URL. --- hardhat.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hardhat.config.ts b/hardhat.config.ts index 775a5f57..257f1395 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -91,7 +91,7 @@ const config: HardhatUserConfig = { }, base: { chainId: 8453, - url: process.env.BASE_URL, + url: process.env.BASE_URL || '', accounts: process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [], }, }, From e765c4cbb46c5d80f88b4bf9911ff0080e36d0ca Mon Sep 17 00:00:00 2001 From: steven2308 Date: Thu, 31 Aug 2023 16:23:54 -0500 Subject: [PATCH 04/19] Equip and Unequip are now gated for owner or approved for assets. Adds test demonstrating behavior when replacing equipped asset. Updates test to demostrate the use of different catalogs composable parent and child. --- contracts/RMRK/equippable/RMRKEquippable.sol | 4 +- .../equippable/RMRKMinifiedEquippable.sol | 4 +- test/behavior/equippableSlots.ts | 117 +++++++++++++++++- test/bulkWriter.ts | 16 +-- test/equippable.ts | 3 + test/minifiedEquippable.ts | 3 + test/setup/equippableSlots.ts | 6 +- 7 files changed, 133 insertions(+), 20 deletions(-) diff --git a/contracts/RMRK/equippable/RMRKEquippable.sol b/contracts/RMRK/equippable/RMRKEquippable.sol index e41a93e0..2b9ce57e 100644 --- a/contracts/RMRK/equippable/RMRKEquippable.sol +++ b/contracts/RMRK/equippable/RMRKEquippable.sol @@ -311,7 +311,7 @@ contract RMRKEquippable is */ function equip( IntakeEquip memory data - ) public virtual onlyApprovedOrOwner(data.tokenId) nonReentrant { + ) public virtual onlyApprovedForAssetsOrOwner(data.tokenId) nonReentrant { _equip(data); } @@ -409,7 +409,7 @@ contract RMRKEquippable is uint256 tokenId, uint64 assetId, uint64 slotPartId - ) public virtual onlyApprovedOrOwner(tokenId) { + ) public virtual onlyApprovedForAssetsOrOwner(tokenId) { _unequip(tokenId, assetId, slotPartId); } diff --git a/contracts/RMRK/equippable/RMRKMinifiedEquippable.sol b/contracts/RMRK/equippable/RMRKMinifiedEquippable.sol index 2f162f8a..fff3c167 100644 --- a/contracts/RMRK/equippable/RMRKMinifiedEquippable.sol +++ b/contracts/RMRK/equippable/RMRKMinifiedEquippable.sol @@ -1875,7 +1875,7 @@ contract RMRKMinifiedEquippable is */ function equip( IntakeEquip memory data - ) public virtual onlyApprovedOrOwner(data.tokenId) nonReentrant { + ) public virtual onlyApprovedForAssetsOrOwner(data.tokenId) nonReentrant { address catalogAddress = _catalogAddresses[data.assetId]; uint64 slotPartId = data.slotPartId; if ( @@ -1953,7 +1953,7 @@ contract RMRKMinifiedEquippable is uint256 tokenId, uint64 assetId, uint64 slotPartId - ) public virtual onlyApprovedOrOwner(tokenId) { + ) public virtual onlyApprovedForAssetsOrOwner(tokenId) { address targetCatalogAddress = _catalogAddresses[assetId]; Equipment memory equipment = _equipments[tokenId][targetCatalogAddress][ slotPartId diff --git a/test/behavior/equippableSlots.ts b/test/behavior/equippableSlots.ts index a5559618..0b1bc64f 100644 --- a/test/behavior/equippableSlots.ts +++ b/test/behavior/equippableSlots.ts @@ -163,7 +163,7 @@ async function shouldBehaveLikeEquippableWithSlots( const approved = addrs[1]; const childIndex = 0; const weaponResId = weaponAssetsEquip[0]; // This asset is assigned to weapon first weapon - await soldier.connect(soldierOwner).approve(approved.address, soldiersIds[0]); + await soldier.connect(soldierOwner).approveForAssets(approved.address, soldiersIds[0]); await equipWeaponAndCheckFromAddress(approved, childIndex, weaponResId); }); @@ -173,7 +173,7 @@ async function shouldBehaveLikeEquippableWithSlots( const approved = addrs[1]; const childIndex = 0; const weaponResId = weaponAssetsEquip[0]; // This asset is assigned to weapon first weapon - await soldier.connect(soldierOwner).setApprovalForAll(approved.address, true); + await soldier.connect(soldierOwner).setApprovalForAllForAssets(approved.address, true); await equipWeaponAndCheckFromAddress(approved, childIndex, weaponResId); }); @@ -329,7 +329,7 @@ async function shouldBehaveLikeEquippableWithSlots( soldierEquip .connect(addrs[1]) // Owner is addrs[0] .equip([soldiersIds[0], childIndex, soldierResId, partIdForWeapon, weaponResId]), - ).to.be.revertedWithCustomError(soldierEquip, 'ERC721NotApprovedOrOwner'); + ).to.be.revertedWithCustomError(soldierEquip, 'RMRKNotApprovedForAssetsOrOwner'); }); it('cannot equip 2 children into the same slot', async function () { @@ -371,6 +371,111 @@ async function shouldBehaveLikeEquippableWithSlots( .equip([soldiersIds[0], childIndex, soldierResId, partIdForWeapon, weaponResId]), ).to.be.revertedWithCustomError(soldierEquip, 'RMRKEquippableEquipNotAllowedByCatalog'); }); + + describe('With equipped children', async function () { + let soldierID: BigNumber; + let soldierOwner: SignerWithAddress; + let weaponChildIndex = 0; + let backgroundChildIndex = 1; + let weaponResId = weaponAssetsEquip[0]; // This asset is assigned to weapon first weapon + + beforeEach(async function () { + soldierID = soldiersIds[0]; + soldierOwner = addrs[0]; + + await soldierEquip + .connect(soldierOwner) + .equip([soldierID, weaponChildIndex, soldierResId, partIdForWeapon, weaponResId]); + await soldierEquip + .connect(soldierOwner) + .equip([ + soldierID, + backgroundChildIndex, + soldierResId, + partIdForBackground, + backgroundAssetId, + ]); + }); + + it('can replace parent equipped asset and still unequip it', async function () { + // Weapon is child on index 0, background on index 1 + const newSoldierResId = soldierResId + 1; + await soldierEquip.addEquippableAssetEntry( + newSoldierResId, + 0, + catalog.address, + 'ipfs:soldier/', + [partIdForBody, partIdForWeapon, partIdForBackground], + ); + await soldierEquip.addAssetToToken(soldierID, newSoldierResId, soldierResId); + await soldierEquip.connect(soldierOwner).acceptAsset(soldierID, 0, newSoldierResId); + + // Children still marked as equipped, so the cannot be transferred + expect(await soldierEquip.isChildEquipped(soldierID, weapon.address, weaponsIds[0])).to.eql( + true, + ); + expect( + await soldierEquip.isChildEquipped(soldierID, background.address, backgroundsIds[0]), + ).to.eql(true); + + await soldierEquip.connect(soldierOwner).unequip(soldierID, soldierResId, partIdForWeapon); + await soldierEquip + .connect(soldierOwner) + .unequip(soldierID, soldierResId, partIdForBackground); + expect(await soldierEquip.isChildEquipped(soldierID, weapon.address, weaponsIds[0])).to.eql( + false, + ); + expect( + await soldierEquip.isChildEquipped(soldierID, background.address, backgroundsIds[0]), + ).to.eql(false); + }); + + it('can replace child equipped asset and still unequip it', async function () { + // Weapon is child on index 0, background on index 1 + const newWeaponAssetId = weaponAssetsEquip[0] + 10; + const weaponId = weaponsIds[0]; + await weaponEquip.addEquippableAssetEntry( + newWeaponAssetId, + 1, // equippableGroupId + catalog.address, + 'ipfs:weapon/new', + [], + ); + await weaponEquip.addAssetToToken(weaponId, newWeaponAssetId, weaponAssetsEquip[0]); + await weaponEquip.connect(soldierOwner).acceptAsset(weaponId, 0, newWeaponAssetId); + + // Children still marked as equipped, so the cannot be transferred + expect(await soldierEquip.isChildEquipped(soldierID, weapon.address, weaponsIds[0])).to.eql( + true, + ); + + await soldierEquip.connect(soldierOwner).unequip(soldierID, soldierResId, partIdForWeapon); + + expect(await soldierEquip.isChildEquipped(soldierID, weapon.address, weaponsIds[0])).to.eql( + false, + ); + }); + + it('can replace parent equipped asset and cannot not re-equip on top', async function () { + // Weapon is child on index 0, background on index 1 + const newSoldierResId = soldierResId + 1; + await soldierEquip.addEquippableAssetEntry( + newSoldierResId, + 0, + catalog.address, + 'ipfs:soldier/', + [partIdForBody, partIdForWeapon, partIdForBackground], + ); + await soldierEquip.addAssetToToken(soldierID, newSoldierResId, soldierResId); + await soldierEquip.connect(soldierOwner).acceptAsset(soldierID, 0, newSoldierResId); + + await expect( + soldierEquip + .connect(soldierOwner) + .equip([soldierID, weaponChildIndex, newSoldierResId, partIdForWeapon, weaponResId]), + ).to.be.revertedWithCustomError(soldierEquip, 'RMRKSlotAlreadyUsed'); + }); + }); }); describe('Unequip', async function () { @@ -398,7 +503,7 @@ async function shouldBehaveLikeEquippableWithSlots( .connect(soldierOwner) .equip([soldiersIds[0], childIndex, soldierResId, partIdForWeapon, weaponResId]); - await soldier.connect(soldierOwner).approve(approved.address, soldiersIds[0]); + await soldier.connect(soldierOwner).approveForAssets(approved.address, soldiersIds[0]); await unequipWeaponAndCheckFromAddress(approved); }); @@ -413,7 +518,7 @@ async function shouldBehaveLikeEquippableWithSlots( .connect(soldierOwner) .equip([soldiersIds[0], childIndex, soldierResId, partIdForWeapon, weaponResId]); - await soldier.connect(soldierOwner).setApprovalForAll(approved.address, true); + await soldier.connect(soldierOwner).setApprovalForAllForAssets(approved.address, true); await unequipWeaponAndCheckFromAddress(approved); }); @@ -433,7 +538,7 @@ async function shouldBehaveLikeEquippableWithSlots( await expect( soldierEquip.connect(addrs[1]).unequip(soldiersIds[0], soldierResId, partIdForWeapon), - ).to.be.revertedWithCustomError(soldierEquip, 'ERC721NotApprovedOrOwner'); + ).to.be.revertedWithCustomError(soldierEquip, 'RMRKNotApprovedForAssetsOrOwner'); }); }); diff --git a/test/bulkWriter.ts b/test/bulkWriter.ts index caa9d91f..12c20e06 100644 --- a/test/bulkWriter.ts +++ b/test/bulkWriter.ts @@ -119,7 +119,7 @@ describe('Advanced Equip Render Utils', async function () { describe('With General Bulk Writer', async function () { beforeEach(async function () { - await kanaria.setApprovalForAll(bulkWriter.address, true); + await kanaria.setApprovalForAllForAssets(bulkWriter.address, true); }); it('can replace equip', async function () { @@ -255,7 +255,7 @@ describe('Advanced Equip Render Utils', async function () { }); it('cannot do operations if not writer is not approved', async function () { - await kanaria.setApprovalForAll(bulkWriter.address, false); + await kanaria.setApprovalForAllForAssets(bulkWriter.address, false); // On a single call we remove the gem from the first slot and add 2 gems on the other 2 slots await expect( @@ -278,7 +278,7 @@ describe('Advanced Equip Render Utils', async function () { }, ], ), - ).to.be.revertedWithCustomError(kanaria, 'ERC721NotApprovedOrOwner'); + ).to.be.revertedWithCustomError(kanaria, 'RMRKNotApprovedForAssetsOrOwner'); await expect( bulkWriter.replaceEquip(kanaria.address, { @@ -288,7 +288,7 @@ describe('Advanced Equip Render Utils', async function () { slotPartId: slotIdGemLeft, childAssetId: assetForGemALeft, }), - ).to.be.revertedWithCustomError(kanaria, 'ERC721NotApprovedOrOwner'); + ).to.be.revertedWithCustomError(kanaria, 'RMRKNotApprovedForAssetsOrOwner'); }); it('cannot do operations if not token owner', async function () { @@ -350,7 +350,7 @@ describe('Advanced Equip Render Utils', async function () { describe('With Bulk Writer Per Collection', async function () { beforeEach(async function () { - await kanaria.setApprovalForAll(bulkWriterPerCollection.address, true); + await kanaria.setApprovalForAllForAssets(bulkWriterPerCollection.address, true); }); it('can get managed collection', async function () { @@ -487,7 +487,7 @@ describe('Advanced Equip Render Utils', async function () { }); it('cannot do operations if not writer is not approved', async function () { - await kanaria.setApprovalForAll(bulkWriterPerCollection.address, false); + await kanaria.setApprovalForAllForAssets(bulkWriterPerCollection.address, false); // On a single call we remove the gem from the first slot and add 2 gems on the other 2 slots await expect( @@ -509,7 +509,7 @@ describe('Advanced Equip Render Utils', async function () { }, ], ), - ).to.be.revertedWithCustomError(kanaria, 'ERC721NotApprovedOrOwner'); + ).to.be.revertedWithCustomError(kanaria, 'RMRKNotApprovedForAssetsOrOwner'); await expect( bulkWriterPerCollection.replaceEquip({ @@ -519,7 +519,7 @@ describe('Advanced Equip Render Utils', async function () { slotPartId: slotIdGemLeft, childAssetId: assetForGemALeft, }), - ).to.be.revertedWithCustomError(kanaria, 'ERC721NotApprovedOrOwner'); + ).to.be.revertedWithCustomError(kanaria, 'RMRKNotApprovedForAssetsOrOwner'); }); it('cannot do operations if not token owner', async function () { diff --git a/test/equippable.ts b/test/equippable.ts index 9c0721ca..3f6d057a 100644 --- a/test/equippable.ts +++ b/test/equippable.ts @@ -83,6 +83,8 @@ async function slotsFixture() { // catalog const catalog = await catalogFactory.deploy(catalogSymbol, catalogType); await catalog.deployed(); + const catalogForWeapon = await catalogFactory.deploy(catalogSymbol, catalogType); + await catalogForWeapon.deployed(); // Soldier token const soldier = await equipFactory.deploy(); @@ -102,6 +104,7 @@ async function slotsFixture() { await setupContextForSlots( catalog, + catalogForWeapon, soldier, soldier, weapon, diff --git a/test/minifiedEquippable.ts b/test/minifiedEquippable.ts index 14fba944..03cf968e 100644 --- a/test/minifiedEquippable.ts +++ b/test/minifiedEquippable.ts @@ -91,6 +91,8 @@ async function slotsFixture() { // catalog const catalog = await catalogFactory.deploy(catalogSymbol, catalogType); await catalog.deployed(); + const catalogForWeapon = await catalogFactory.deploy(catalogSymbol, catalogType); + await catalogForWeapon.deployed(); // Soldier token const soldier = await equipFactory.deploy(); @@ -110,6 +112,7 @@ async function slotsFixture() { await setupContextForSlots( catalog, + catalogForWeapon, soldier, soldier, weapon, diff --git a/test/setup/equippableSlots.ts b/test/setup/equippableSlots.ts index d2d12cee..8b4454dd 100644 --- a/test/setup/equippableSlots.ts +++ b/test/setup/equippableSlots.ts @@ -35,6 +35,7 @@ let addrs: SignerWithAddress[]; async function setupContextForSlots( catalog: Contract, + catalogForWeapon: Contract, soldier: Contract, soldierEquip: Contract, weapon: Contract, @@ -102,9 +103,10 @@ async function setupContextForSlots( await catalog.addPartList([ { partId: partIdForBody, part: partForBody }, { partId: partIdForWeapon, part: partForWeapon }, - { partId: partIdForWeaponGem, part: partForWeaponGem }, { partId: partIdForBackground, part: partForBackground }, ]); + + await catalogForWeapon.addPartList([{ partId: partIdForWeaponGem, part: partForWeaponGem }]); } async function mintSoldiers(): Promise { @@ -178,7 +180,7 @@ async function setupContextForSlots( await weaponEquip.addEquippableAssetEntry( weaponAssetsEquip[i], equippableGroupId, - catalog.address, + catalogForWeapon.address, `ipfs:weapon/equip/${weaponAssetsEquip[i]}`, [partIdForWeaponGem], ); From f8862ce8ed9b17e53e8b6c822db2942acee27208 Mon Sep 17 00:00:00 2001 From: steven2308 Date: Thu, 31 Aug 2023 16:25:34 -0500 Subject: [PATCH 05/19] Prettifies hardhat config file. --- hardhat.config.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/hardhat.config.ts b/hardhat.config.ts index 257f1395..df28ad66 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -115,22 +115,22 @@ const config: HardhatUserConfig = { }, customChains: [ { - network: "baseGoerli", + network: 'baseGoerli', chainId: 84531, urls: { - apiURL: "https://api-goerli.basescan.org/api", - browserURL: "https://goerli.basescan.org" - } + apiURL: 'https://api-goerli.basescan.org/api', + browserURL: 'https://goerli.basescan.org', + }, }, { - network: "base", + network: 'base', chainId: 8453, urls: { - apiURL: "https://api.basescan.org/api", - browserURL: "https://basescan.org" - } - } - ] + apiURL: 'https://api.basescan.org/api', + browserURL: 'https://basescan.org', + }, + }, + ], }, dodoc: { runOnCompile: false, From 6295252c2633221a4eeae7c4f116ba5163951a26 Mon Sep 17 00:00:00 2001 From: steven2308 Date: Thu, 31 Aug 2023 16:25:54 -0500 Subject: [PATCH 06/19] Sets version to v2.1.0. --- contracts/RMRK/core/RMRKCore.sol | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/contracts/RMRK/core/RMRKCore.sol b/contracts/RMRK/core/RMRKCore.sol index 84a0646d..ca305dd5 100644 --- a/contracts/RMRK/core/RMRKCore.sol +++ b/contracts/RMRK/core/RMRKCore.sol @@ -13,6 +13,6 @@ contract RMRKCore { * @notice Version of the @rmrk-team/evm-contracts package * @return Version identifier of the smart contract */ - string public constant VERSION = "2.0.0"; + string public constant VERSION = "2.1.0"; bytes4 public constant RMRK_INTERFACE = 0x524D524B; // "RMRK" in ASCII hex } diff --git a/package.json b/package.json index 3c184f05..be82d149 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@rmrk-team/evm-contracts", - "version": "2.0.0", + "version": "2.1.0", "license": "Apache-2.0", "files": [ "contracts/RMRK/*", From abf0673e9ea6de8cacb35aa3d1bb0a87c1f90f4a Mon Sep 17 00:00:00 2001 From: steven2308 Date: Thu, 31 Aug 2023 16:26:09 -0500 Subject: [PATCH 07/19] Fixes test. --- test/behavior/nestable.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/behavior/nestable.ts b/test/behavior/nestable.ts index 73519ecd..4a751e7a 100644 --- a/test/behavior/nestable.ts +++ b/test/behavior/nestable.ts @@ -648,12 +648,12 @@ async function shouldBehaveLikeNestable( }); it('cannot transfer child from not existing parent', async function () { - const badChildId = 99; + const badTokenId = 999; const toOwner = tokenOwner.address; await expect( parent .connect(tokenOwner) - .transferChild(badChildId, toOwner, 0, 0, child.address, childId, false, '0x'), + .transferChild(badTokenId, toOwner, 0, 0, child.address, childId, false, '0x'), ).to.be.revertedWithCustomError(child, 'ERC721InvalidTokenId'); }); @@ -817,12 +817,12 @@ async function shouldBehaveLikeNestable( }); it('cannot transfer child from not existing parent', async function () { - const badChildId = 99; + const badTokenId = 999; const toOwner = tokenOwner.address; await expect( parent .connect(tokenOwner) - .transferChild(badChildId, toOwner, 0, 0, child.address, childId, true, '0x'), + .transferChild(badTokenId, toOwner, 0, 0, child.address, childId, true, '0x'), ).to.be.revertedWithCustomError(child, 'ERC721InvalidTokenId'); }); From d740f2648133aee81c7603ea0a888a195bc8f2ff Mon Sep 17 00:00:00 2001 From: steven2308 Date: Wed, 6 Sep 2023 11:12:24 -0500 Subject: [PATCH 08/19] Improves soulbound detection on RenderUtils.getExtendedNFT. --- contracts/RMRK/utils/RMRKRenderUtils.sol | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/contracts/RMRK/utils/RMRKRenderUtils.sol b/contracts/RMRK/utils/RMRKRenderUtils.sol index a7b3ce77..7fa0c536 100644 --- a/contracts/RMRK/utils/RMRKRenderUtils.sol +++ b/contracts/RMRK/utils/RMRKRenderUtils.sol @@ -124,17 +124,17 @@ contract RMRKRenderUtils { tokenId ); } + data.rootOwner = targetEquippable.ownerOf(tokenId); + if (data.directOwner == address(0x0)) { + data.directOwner = data.rootOwner; + } if (targetEquippable.supportsInterface(type(IERC6454).interfaceId)) { data.isSoulbound = !IERC6454(targetCollection).isTransferable( tokenId, - address(0), - address(0) + data.rootOwner, + 0x000000000000000000000000000000000000dEaD ); } - data.rootOwner = targetEquippable.ownerOf(tokenId); - if (data.directOwner == address(0x0)) { - data.directOwner = data.rootOwner; - } try targetCollectionData.name() returns (string memory name) { data.name = name; } catch { From c017ba74b05576ec8f3d98748f6d9112a972ef5f Mon Sep 17 00:00:00 2001 From: steven2308 Date: Fri, 8 Sep 2023 22:07:16 -0500 Subject: [PATCH 09/19] No longer restricts child catalog to match parent's to consider equippable. --- contracts/RMRK/utils/RMRKEquipRenderUtils.sol | 1 - test/renderUtils.ts | 13 ++++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/contracts/RMRK/utils/RMRKEquipRenderUtils.sol b/contracts/RMRK/utils/RMRKEquipRenderUtils.sol index 7e41f9f9..c33ebd15 100644 --- a/contracts/RMRK/utils/RMRKEquipRenderUtils.sol +++ b/contracts/RMRK/utils/RMRKEquipRenderUtils.sol @@ -813,7 +813,6 @@ contract RMRKEquipRenderUtils is .getAssetAndEquippableData(childId, childAssets[i]); for (uint256 j; j < parentSlotPartIds.length; ) { if ( - catalogAddress == parentAssetCatalog && childContract.canTokenBeEquippedWithAssetIntoSlot( parentAddress, childId, diff --git a/test/renderUtils.ts b/test/renderUtils.ts index 97903965..46bbef84 100644 --- a/test/renderUtils.ts +++ b/test/renderUtils.ts @@ -652,7 +652,7 @@ describe('Advanced Equip Render Utils', async function () { ]); }); - it('can get equippable slots from parent asset and excludes if catalog does not match', async function () { + it('can get equippable slots from parent asset even if catalog does not match', async function () { await setUpCatalog(catalog, gem.address); await setUpKanariaAsset(kanaria, kanariaId, catalog.address); await setUpGemAssets(gem, gemId1, gemId2, gemId3, kanaria.address, catalog.address); @@ -713,6 +713,17 @@ describe('Advanced Equip Render Utils', async function () { 'ipfs://gems/typeB/left.svg', 'ipfs://kanaria/full.svg', ], + [ + bn(slotIdGemLeft), + newResourceId, + bn(assetForKanariaFull), + bn(4), + catalog.address, // This is the catalog address of the parent, not the child + false, + 'ipfs://metadataSlotGemLeft', + 'ipfs://assetFromOtherCatalog.jpg', + 'ipfs://kanaria/full.svg', + ], ], ]); }); From ca3ffd2ef7e95b4f35e92c31aa68cd3121a87d57 Mon Sep 17 00:00:00 2001 From: Jan Turk Date: Fri, 8 Sep 2023 10:25:57 +0200 Subject: [PATCH 10/19] Update TokenPropertiesRepository to ERC-7508 Token properites repository has now been proposed as ERC-7508 and the changes in the commit reflect the new proposal. --- CHANGELOG.md | 12 +- .../RMRK/emotable/RMRKEmotesRepository.sol | 4 +- .../extension/tokenHolder/RMRKTokenHolder.sol | 2 +- ...nPropertiesRepository.sol => IERC7508.sol} | 496 +++---- ....sol => RMRKTokenAttributesRepository.sol} | 495 +++---- ...kenPropertiesRepository.md => IERC7508.md} | 542 +++---- .../RMRKTokenAttributesRepository.md | 1248 +++++++++++++++++ .../RMRKTokenPropertiesRepository.md | 1248 ----------------- hardhat.config.ts | 20 +- ...sitory.ts => tokenAttributesRepository.ts} | 674 ++++----- test/interfaces.ts | 4 +- 11 files changed, 2385 insertions(+), 2360 deletions(-) rename contracts/RMRK/extension/tokenProperties/{IRMRKTokenPropertiesRepository.sol => IERC7508.sol} (60%) rename contracts/RMRK/extension/tokenProperties/{RMRKTokenPropertiesRepository.sol => RMRKTokenAttributesRepository.sol} (67%) rename docs/RMRK/extension/tokenProperties/{IRMRKTokenPropertiesRepository.md => IERC7508.md} (51%) create mode 100644 docs/RMRK/extension/tokenProperties/RMRKTokenAttributesRepository.md delete mode 100644 docs/RMRK/extension/tokenProperties/RMRKTokenPropertiesRepository.md rename test/extensions/{tokenPropertiesRepository.ts => tokenAttributesRepository.ts} (66%) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee622fa9..0b0eae39 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,12 +46,12 @@ Core implementations updates include breaking changes as well; names and symbols - All contracts now use solidity version 0.8.21. - Upgrades dependencies. - Increases Istanbul code coverage: -| | **Previous** | **Current** | **Change** | -|:--------------: |:------------: |:-----------: |------------ | -| **Statements** | 100.00 % | 100.00 % | + 0.00 % | -| **Branches** | 95.53 % | 96.78 % | + 1.25 % | -| **Functions** | 99.60 % | 99.72 % | + 0.12 % | -| **Lines** | 99.63 % | 99.46 % | - 0.17 % | + | | **Previous** | **Current** | **Change** | + |:--------------: |:------------: |:-----------: |------------ | + | **Statements** | 100.00 % | 100.00 % | + 0.00 % | + | **Branches** | 95.53 % | 96.78 % | + 1.25 % | + | **Functions** | 99.60 % | 99.72 % | + 0.12 % | + | **Lines** | 99.63 % | 99.46 % | - 0.17 % | ### Fixed diff --git a/contracts/RMRK/emotable/RMRKEmotesRepository.sol b/contracts/RMRK/emotable/RMRKEmotesRepository.sol index 692e6083..7fbe0399 100644 --- a/contracts/RMRK/emotable/RMRKEmotesRepository.sol +++ b/contracts/RMRK/emotable/RMRKEmotesRepository.sol @@ -25,9 +25,9 @@ contract RMRKEmotesRepository is IRMRKEmotesRepository { ); // Used to avoid double emoting and control undoing - mapping(address emoter => mapping(address collection => mapping(uint256 tokenId => mapping(string emoji => uint256 state)))) + mapping(address => mapping(address => mapping(uint256 => mapping(string => uint256)))) private _emotesUsedByEmoter; // Cheaper than using a bool - mapping(address collection => mapping(uint256 tokenId => mapping(string emoji => uint256 count))) + mapping(address => mapping(uint256 => mapping(string => uint256))) private _emotesPerToken; /** diff --git a/contracts/RMRK/extension/tokenHolder/RMRKTokenHolder.sol b/contracts/RMRK/extension/tokenHolder/RMRKTokenHolder.sol index e2d3e816..20779b24 100644 --- a/contracts/RMRK/extension/tokenHolder/RMRKTokenHolder.sol +++ b/contracts/RMRK/extension/tokenHolder/RMRKTokenHolder.sol @@ -20,7 +20,7 @@ error InsufficientBalance(); * @dev The RMRKTokenHolder extension is capable of holding ERC-20, ERC-721, and ERC-1155 tokens. */ abstract contract RMRKTokenHolder is IRMRKTokenHolder { - mapping(uint256 tokenId => mapping(address tokenAddress => mapping(TokenType tokenType => mapping(uint256 heldTokenId => uint256 balance)))) + mapping(uint256 => mapping(address => mapping(TokenType => mapping(uint256 => uint256)))) private _balances; /** diff --git a/contracts/RMRK/extension/tokenProperties/IRMRKTokenPropertiesRepository.sol b/contracts/RMRK/extension/tokenProperties/IERC7508.sol similarity index 60% rename from contracts/RMRK/extension/tokenProperties/IRMRKTokenPropertiesRepository.sol rename to contracts/RMRK/extension/tokenProperties/IERC7508.sol index 042c4ca3..c8d59153 100644 --- a/contracts/RMRK/extension/tokenProperties/IRMRKTokenPropertiesRepository.sol +++ b/contracts/RMRK/extension/tokenProperties/IERC7508.sol @@ -5,11 +5,11 @@ pragma solidity ^0.8.21; import "@openzeppelin/contracts/utils/introspection/IERC165.sol"; /** - * @title IRMRKTokenPropertiesRepository + * @title IERC7508 * @author RMRK team * @notice Interface smart contract of the RMRK token properties extension. */ -interface IRMRKTokenPropertiesRepository is IERC165 { +interface IERC7508 is IERC165 { /** * @notice A list of supported access types. * @return The `Issuer` type, where only the issuer can manage the parameter. @@ -27,51 +27,51 @@ interface IRMRKTokenPropertiesRepository is IERC165 { } /** - * @notice Structure used to represent a string property. - * @return key The key of the property - * @return value The value of the property + * @notice Structure used to represent a string attribute. + * @return key The key of the attribute + * @return value The value of the attribute */ - struct StringProperty { + struct StringAttribute { string key; string value; } /** - * @notice Structure used to represent an uint property. - * @return key The key of the property - * @return value The value of the property + * @notice Structure used to represent an uint attribute. + * @return key The key of the attribute + * @return value The value of the attribute */ - struct UintProperty { + struct UintAttribute { string key; uint256 value; } /** - * @notice Structure used to represent a boolean property. - * @return key The key of the property - * @return value The value of the property + * @notice Structure used to represent a boolean attribute. + * @return key The key of the attribute + * @return value The value of the attribute */ - struct BoolProperty { + struct BoolAttribute { string key; bool value; } /** - * @notice Structure used to represent an address property. - * @return key The key of the property - * @return value The value of the property + * @notice Structure used to represent an address attribute. + * @return key The key of the attribute + * @return value The value of the attribute */ - struct AddressProperty { + struct AddressAttribute { string key; address value; } /** - * @notice Structure used to represent a bytes property. - * @return key The key of the property - * @return value The value of the property + * @notice Structure used to represent a bytes attribute. + * @return key The key of the attribute + * @return value The value of the attribute */ - struct BytesProperty { + struct BytesAttribute { string key; bytes value; } @@ -119,13 +119,13 @@ interface IRMRKTokenPropertiesRepository is IERC165 { ); /** - * @notice Used to notify listeners that a string property has been updated. + * @notice Used to notify listeners that a string attribute has been updated. * @param collection The collection address * @param tokenId The token ID - * @param key The key of the property - * @param value The new value of the property + * @param key The key of the attribute + * @param value The new value of the attribute */ - event StringPropertyUpdated( + event StringAttributeUpdated( address indexed collection, uint256 indexed tokenId, string key, @@ -133,13 +133,13 @@ interface IRMRKTokenPropertiesRepository is IERC165 { ); /** - * @notice Used to notify listeners that an uint property has been updated. + * @notice Used to notify listeners that an uint attribute has been updated. * @param collection The collection address * @param tokenId The token ID - * @param key The key of the property - * @param value The new value of the property + * @param key The key of the attribute + * @param value The new value of the attribute */ - event UintPropertyUpdated( + event UintAttributeUpdated( address indexed collection, uint256 indexed tokenId, string key, @@ -147,13 +147,13 @@ interface IRMRKTokenPropertiesRepository is IERC165 { ); /** - * @notice Used to notify listeners that a boolean property has been updated. + * @notice Used to notify listeners that a boolean attribute has been updated. * @param collection The collection address * @param tokenId The token ID - * @param key The key of the property - * @param value The new value of the property + * @param key The key of the attribute + * @param value The new value of the attribute */ - event BoolPropertyUpdated( + event BoolAttributeUpdated( address indexed collection, uint256 indexed tokenId, string key, @@ -161,13 +161,13 @@ interface IRMRKTokenPropertiesRepository is IERC165 { ); /** - * @notice Used to notify listeners that an address property has been updated. + * @notice Used to notify listeners that an address attribute has been updated. * @param collection The collection address * @param tokenId The token ID - * @param key The key of the property - * @param value The new value of the property + * @param key The key of the attribute + * @param value The new value of the attribute */ - event AddressPropertyUpdated( + event AddressAttributeUpdated( address indexed collection, uint256 indexed tokenId, string key, @@ -175,13 +175,13 @@ interface IRMRKTokenPropertiesRepository is IERC165 { ); /** - * @notice Used to notify listeners that a bytes property has been updated. + * @notice Used to notify listeners that a bytes attribute has been updated. * @param collection The collection address * @param tokenId The token ID - * @param key The key of the property - * @param value The new value of the property + * @param key The key of the attribute + * @param value The new value of the attribute */ - event BytesPropertyUpdated( + event BytesAttributeUpdated( address indexed collection, uint256 indexed tokenId, string key, @@ -189,10 +189,10 @@ interface IRMRKTokenPropertiesRepository is IERC165 { ); /** - * @notice Used to register a collection to use the RMRK token properties repository. + * @notice Used to register a collection to use the RMRK token attributes repository. * @dev If the collection does not implement the Ownable interface, the `useOwnable` value must be set to `false`. * @dev Emits an {AccessControlRegistration} event. - * @param collection The address of the collection that will use the RMRK token properties repository. + * @param collection The address of the collection that will use the RMRK token attributes repository. * @param issuer The address of the issuer of the collection. * @param useOwnable The boolean value to indicate if the collection implements the Ownable interface and whether it * should be used to validate that the caller is the issuer (`true`) or to use the manually set issuer address @@ -217,7 +217,7 @@ interface IRMRKTokenPropertiesRepository is IERC165 { * ] * @dev Emits an {AccessControlUpdated} event. * @param collection The address of the collection being managed. - * @param key The key of the property + * @param key The key of the attribute * @param accessType The type of access control to be applied to the parameter. * @param specificAddress The address to be added as a specific addresses allowed to manage the given * parameter. @@ -245,14 +245,14 @@ interface IRMRKTokenPropertiesRepository is IERC165 { ) external; /** - * @notice Used to set a number property. - * @dev Emits a {UintPropertyUpdated} event. - * @param collection Address of the collection receiving the property + * @notice Used to set a number attribute. + * @dev Emits a {UintAttributeUpdated} event. + * @param collection Address of the collection receiving the attribute * @param tokenId The token ID - * @param key The property key - * @param value The property value + * @param key The attribute key + * @param value The attribute value */ - function setUintProperty( + function setUintAttribute( address collection, uint256 tokenId, string memory key, @@ -260,14 +260,14 @@ interface IRMRKTokenPropertiesRepository is IERC165 { ) external; /** - * @notice Used to set a string property. - * @dev Emits a {StringPropertyUpdated} event. - * @param collection Address of the collection receiving the property + * @notice Used to set a string attribute. + * @dev Emits a {StringAttributeUpdated} event. + * @param collection Address of the collection receiving the attribute * @param tokenId The token ID - * @param key The property key - * @param value The property value + * @param key The attribute key + * @param value The attribute value */ - function setStringProperty( + function setStringAttribute( address collection, uint256 tokenId, string memory key, @@ -275,14 +275,14 @@ interface IRMRKTokenPropertiesRepository is IERC165 { ) external; /** - * @notice Used to set a boolean property. - * @dev Emits a {BoolPropertyUpdated} event. - * @param collection Address of the collection receiving the property + * @notice Used to set a boolean attribute. + * @dev Emits a {BoolAttributeUpdated} event. + * @param collection Address of the collection receiving the attribute * @param tokenId The token ID - * @param key The property key - * @param value The property value + * @param key The attribute key + * @param value The attribute value */ - function setBoolProperty( + function setBoolAttribute( address collection, uint256 tokenId, string memory key, @@ -290,14 +290,14 @@ interface IRMRKTokenPropertiesRepository is IERC165 { ) external; /** - * @notice Used to set an bytes property. - * @dev Emits a {BytesPropertyUpdated} event. - * @param collection Address of the collection receiving the property + * @notice Used to set an bytes attribute. + * @dev Emits a {BytesAttributeUpdated} event. + * @param collection Address of the collection receiving the attribute * @param tokenId The token ID - * @param key The property key - * @param value The property value + * @param key The attribute key + * @param value The attribute value */ - function setBytesProperty( + function setBytesAttribute( address collection, uint256 tokenId, string memory key, @@ -305,14 +305,14 @@ interface IRMRKTokenPropertiesRepository is IERC165 { ) external; /** - * @notice Used to set an address property. - * @dev Emits a {AddressPropertyUpdated} event. - * @param collection Address of the collection receiving the property + * @notice Used to set an address attribute. + * @dev Emits a {AddressAttributeUpdated} event. + * @param collection Address of the collection receiving the attribute * @param tokenId The token ID - * @param key The property key - * @param value The property value + * @param key The attribute key + * @param value The attribute value */ - function setAddressProperty( + function setAddressAttribute( address collection, uint256 tokenId, string memory key, @@ -320,94 +320,94 @@ interface IRMRKTokenPropertiesRepository is IERC165 { ) external; /** - * @notice Sets multiple string properties for a token at once. - * @dev The `StringProperty` struct contains the following fields: + * @notice Sets multiple string attributes for a token at once. + * @dev The `StringAttribute` struct contains the following fields: * [ * string key, * string value * ] * @param collection Address of the collection * @param tokenId ID of the token - * @param properties An array of `StringProperty` structs to be assigned to the given token + * @param attributes An array of `StringAttribute` structs to be assigned to the given token */ - function setStringProperties( + function setStringAttributes( address collection, uint256 tokenId, - StringProperty[] memory properties + StringAttribute[] memory attributes ) external; /** - * @notice Sets multiple uint properties for a token at once. - * @dev The `UintProperty` struct contains the following fields: + * @notice Sets multiple uint attributes for a token at once. + * @dev The `UintAttribute` struct contains the following fields: * [ * string key, * uint value * ] * @param collection Address of the collection * @param tokenId ID of the token - * @param properties An array of `UintProperty` structs to be assigned to the given token + * @param attributes An array of `UintAttribute` structs to be assigned to the given token */ - function setUintProperties( + function setUintAttributes( address collection, uint256 tokenId, - UintProperty[] memory properties + UintAttribute[] memory attributes ) external; /** - * @notice Sets multiple bool properties for a token at once. - * @dev The `BoolProperty` struct contains the following fields: + * @notice Sets multiple bool attributes for a token at once. + * @dev The `BoolAttribute` struct contains the following fields: * [ * string key, * bool value * ] * @param collection Address of the collection * @param tokenId ID of the token - * @param properties An array of `BoolProperty` structs to be assigned to the given token + * @param attributes An array of `BoolAttribute` structs to be assigned to the given token */ - function setBoolProperties( + function setBoolAttributes( address collection, uint256 tokenId, - BoolProperty[] memory properties + BoolAttribute[] memory attributes ) external; /** - * @notice Sets multiple address properties for a token at once. - * @dev The `AddressProperty` struct contains the following fields: + * @notice Sets multiple address attributes for a token at once. + * @dev The `AddressAttribute` struct contains the following fields: * [ * string key, * address value * ] * @param collection Address of the collection * @param tokenId ID of the token - * @param properties An array of `AddressProperty` structs to be assigned to the given token + * @param attributes An array of `AddressAttribute` structs to be assigned to the given token */ - function setAddressProperties( + function setAddressAttributes( address collection, uint256 tokenId, - AddressProperty[] memory properties + AddressAttribute[] memory attributes ) external; /** - * @notice Sets multiple bytes properties for a token at once. - * @dev The `BytesProperty` struct contains the following fields: + * @notice Sets multiple bytes attributes for a token at once. + * @dev The `BytesAttribute` struct contains the following fields: * [ * string key, * bytes value * ] * @param collection Address of the collection * @param tokenId ID of the token - * @param properties An array of `BytesProperty` structs to be assigned to the given token + * @param attributes An array of `BytesAttribute` structs to be assigned to the given token */ - function setBytesProperties( + function setBytesAttributes( address collection, uint256 tokenId, - BytesProperty[] memory properties + BytesAttribute[] memory attributes ) external; /** - * @notice Sets multiple properties of multiple types for a token at the same time. - * @dev Emits a separate event for each property set. - * @dev The `StringProperty`, `UintProperty`, `BoolProperty`, `AddressProperty` and `BytesProperty` structs consists + * @notice Sets multiple attributes of multiple types for a token at the same time. + * @dev Emits a separate event for each attribute set. + * @dev The `StringAttribute`, `UintAttribute`, `BoolAttribute`, `AddressAttribute` and `BytesAttribute` structs consists * to the following fields (where `value` is of the appropriate type): * [ * key, @@ -415,36 +415,36 @@ interface IRMRKTokenPropertiesRepository is IERC165 { * ] * @param collection The address of the collection * @param tokenId The token ID - * @param stringProperties An array of `StringProperty` structs containing string properties to set - * @param uintProperties An array of `UintProperty` structs containing uint properties to set - * @param boolProperties An array of `BoolProperty` structs containing bool properties to set - * @param addressProperties An array of `AddressProperty` structs containing address properties to set - * @param bytesProperties An array of `BytesProperty` structs containing bytes properties to set + * @param stringAttributes An array of `StringAttribute` structs containing string attributes to set + * @param uintAttributes An array of `UintAttribute` structs containing uint attributes to set + * @param boolAttributes An array of `BoolAttribute` structs containing bool attributes to set + * @param addressAttributes An array of `AddressAttribute` structs containing address attributes to set + * @param bytesAttributes An array of `BytesAttribute` structs containing bytes attributes to set */ - function setTokenProperties( + function setTokenAttributes( address collection, uint256 tokenId, - StringProperty[] memory stringProperties, - UintProperty[] memory uintProperties, - BoolProperty[] memory boolProperties, - AddressProperty[] memory addressProperties, - BytesProperty[] memory bytesProperties + StringAttribute[] memory stringAttributes, + UintAttribute[] memory uintAttributes, + BoolAttribute[] memory boolAttributes, + AddressAttribute[] memory addressAttributes, + BytesAttribute[] memory bytesAttributes ) external; /** - * @notice Used to set the uint property on behalf of an authorized account. - * @dev Emits a {UintPropertyUpdated} event. - * @param setter Address of the account that presigned the property change - * @param collection Address of the collection receiving the property - * @param tokenId The ID of the token receiving the property - * @param key The property key - * @param value The property value + * @notice Used to set the uint attribute on behalf of an authorized account. + * @dev Emits a {UintAttributeUpdated} event. + * @param setter Address of the account that presigned the attribute change + * @param collection Address of the collection receiving the attribute + * @param tokenId The ID of the token receiving the attribute + * @param key The attribute key + * @param value The attribute value * @param deadline The deadline timestamp for the presigned transaction * @param v `v` value of an ECDSA signature of the presigned message * @param r `r` value of an ECDSA signature of the presigned message * @param s `s` value of an ECDSA signature of the presigned message */ - function presignedSetUintProperty( + function presignedSetUintAttribute( address setter, address collection, uint256 tokenId, @@ -457,19 +457,19 @@ interface IRMRKTokenPropertiesRepository is IERC165 { ) external; /** - * @notice Used to set the string property on behalf of an authorized account. - * @dev Emits a {StringPropertyUpdated} event. - * @param setter Address of the account that presigned the property change - * @param collection Address of the collection receiving the property - * @param tokenId The ID of the token receiving the property - * @param key The property key - * @param value The property value + * @notice Used to set the string attribute on behalf of an authorized account. + * @dev Emits a {StringAttributeUpdated} event. + * @param setter Address of the account that presigned the attribute change + * @param collection Address of the collection receiving the attribute + * @param tokenId The ID of the token receiving the attribute + * @param key The attribute key + * @param value The attribute value * @param deadline The deadline timestamp for the presigned transaction * @param v `v` value of an ECDSA signature of the presigned message * @param r `r` value of an ECDSA signature of the presigned message * @param s `s` value of an ECDSA signature of the presigned message */ - function presignedSetStringProperty( + function presignedSetStringAttribute( address setter, address collection, uint256 tokenId, @@ -482,19 +482,19 @@ interface IRMRKTokenPropertiesRepository is IERC165 { ) external; /** - * @notice Used to set the bool property on behalf of an authorized account. - * @dev Emits a {BoolPropertyUpdated} event. - * @param setter Address of the account that presigned the property change - * @param collection Address of the collection receiving the property - * @param tokenId The ID of the token receiving the property - * @param key The property key - * @param value The property value + * @notice Used to set the bool attribute on behalf of an authorized account. + * @dev Emits a {BoolAttributeUpdated} event. + * @param setter Address of the account that presigned the attribute change + * @param collection Address of the collection receiving the attribute + * @param tokenId The ID of the token receiving the attribute + * @param key The attribute key + * @param value The attribute value * @param deadline The deadline timestamp for the presigned transaction * @param v `v` value of an ECDSA signature of the presigned message * @param r `r` value of an ECDSA signature of the presigned message * @param s `s` value of an ECDSA signature of the presigned message */ - function presignedSetBoolProperty( + function presignedSetBoolAttribute( address setter, address collection, uint256 tokenId, @@ -507,19 +507,19 @@ interface IRMRKTokenPropertiesRepository is IERC165 { ) external; /** - * @notice Used to set the bytes property on behalf of an authorized account. - * @dev Emits a {BytesPropertyUpdated} event. - * @param setter Address of the account that presigned the property change - * @param collection Address of the collection receiving the property - * @param tokenId The ID of the token receiving the property - * @param key The property key - * @param value The property value + * @notice Used to set the bytes attribute on behalf of an authorized account. + * @dev Emits a {BytesAttributeUpdated} event. + * @param setter Address of the account that presigned the attribute change + * @param collection Address of the collection receiving the attribute + * @param tokenId The ID of the token receiving the attribute + * @param key The attribute key + * @param value The attribute value * @param deadline The deadline timestamp for the presigned transaction * @param v `v` value of an ECDSA signature of the presigned message * @param r `r` value of an ECDSA signature of the presigned message * @param s `s` value of an ECDSA signature of the presigned message */ - function presignedSetBytesProperty( + function presignedSetBytesAttribute( address setter, address collection, uint256 tokenId, @@ -532,19 +532,19 @@ interface IRMRKTokenPropertiesRepository is IERC165 { ) external; /** - * @notice Used to set the address property on behalf of an authorized account. - * @dev Emits a {AddressPropertyUpdated} event. - * @param setter Address of the account that presigned the property change - * @param collection Address of the collection receiving the property - * @param tokenId The ID of the token receiving the property - * @param key The property key - * @param value The property value + * @notice Used to set the address attribute on behalf of an authorized account. + * @dev Emits a {AddressAttributeUpdated} event. + * @param setter Address of the account that presigned the attribute change + * @param collection Address of the collection receiving the attribute + * @param tokenId The ID of the token receiving the attribute + * @param key The attribute key + * @param value The attribute value * @param deadline The deadline timestamp for the presigned transaction * @param v `v` value of an ECDSA signature of the presigned message * @param r `r` value of an ECDSA signature of the presigned message * @param s `s` value of an ECDSA signature of the presigned message */ - function presignedSetAddressProperty( + function presignedSetAddressAttribute( address setter, address collection, uint256 tokenId, @@ -573,7 +573,7 @@ interface IRMRKTokenPropertiesRepository is IERC165 { * parameter. * @param specificAddress Address to be checked. * @param collection Address of the collection. - * @param key The key of the property + * @param key The key of the attribute * @return Boolean value indicating if the address is a specific address of the given collection's parameter * (`true`) or not (`false`). */ @@ -584,80 +584,80 @@ interface IRMRKTokenPropertiesRepository is IERC165 { ) external view returns (bool); /** - * @notice Used to retrieve the string type token properties. + * @notice Used to retrieve the string type token attributes. * @param collection The collection address * @param tokenId The token ID - * @param key The key of the property - * @return The value of the string property + * @param key The key of the attribute + * @return The value of the string attribute */ - function getStringTokenProperty( + function getStringTokenAttribute( address collection, uint256 tokenId, string memory key ) external view returns (string memory); /** - * @notice Used to retrieve the uint type token properties. + * @notice Used to retrieve the uint type token attributes. * @param collection The collection address * @param tokenId The token ID - * @param key The key of the property - * @return The value of the uint property + * @param key The key of the attribute + * @return The value of the uint attribute */ - function getUintTokenProperty( + function getUintTokenAttribute( address collection, uint256 tokenId, string memory key ) external view returns (uint256); /** - * @notice Used to retrieve the bool type token properties. + * @notice Used to retrieve the bool type token attributes. * @param collection The collection address * @param tokenId The token ID - * @param key The key of the property - * @return The value of the bool property + * @param key The key of the attribute + * @return The value of the bool attribute */ - function getBoolTokenProperty( + function getBoolTokenAttribute( address collection, uint256 tokenId, string memory key ) external view returns (bool); /** - * @notice Used to retrieve the address type token properties. + * @notice Used to retrieve the address type token attributes. * @param collection The collection address * @param tokenId The token ID - * @param key The key of the property - * @return The value of the address property + * @param key The key of the attribute + * @return The value of the address attribute */ - function getAddressTokenProperty( + function getAddressTokenAttribute( address collection, uint256 tokenId, string memory key ) external view returns (address); /** - * @notice Used to retrieve the bytes type token properties. + * @notice Used to retrieve the bytes type token attributes. * @param collection The collection address * @param tokenId The token ID - * @param key The key of the property - * @return The value of the bytes property + * @param key The key of the attribute + * @return The value of the bytes attribute */ - function getBytesTokenProperty( + function getBytesTokenAttribute( address collection, uint256 tokenId, string memory key ) external view returns (bytes memory); /** - * @notice Used to retrieve the message to be signed for submitting a presigned uint property change. - * @param collection The address of the collection smart contract of the token receiving the property - * @param tokenId The ID of the token receiving the property - * @param key The property key - * @param value The property value + * @notice Used to retrieve the message to be signed for submitting a presigned uint attribute change. + * @param collection The address of the collection smart contract of the token receiving the attribute + * @param tokenId The ID of the token receiving the attribute + * @param key The attribute key + * @param value The attribute value * @param deadline The deadline timestamp for the presigned transaction after which the message is invalid * @return Raw message to be signed by the authorized account */ - function prepareMessageToPresignUintProperty( + function prepareMessageToPresignUintAttribute( address collection, uint256 tokenId, string memory key, @@ -666,15 +666,15 @@ interface IRMRKTokenPropertiesRepository is IERC165 { ) external view returns (bytes32); /** - * @notice Used to retrieve the message to be signed for submitting a presigned string property change. - * @param collection The address of the collection smart contract of the token receiving the property - * @param tokenId The ID of the token receiving the property - * @param key The property key - * @param value The property value + * @notice Used to retrieve the message to be signed for submitting a presigned string attribute change. + * @param collection The address of the collection smart contract of the token receiving the attribute + * @param tokenId The ID of the token receiving the attribute + * @param key The attribute key + * @param value The attribute value * @param deadline The deadline timestamp for the presigned transaction after which the message is invalid * @return Raw message to be signed by the authorized account */ - function prepareMessageToPresignStringProperty( + function prepareMessageToPresignStringAttribute( address collection, uint256 tokenId, string memory key, @@ -683,15 +683,15 @@ interface IRMRKTokenPropertiesRepository is IERC165 { ) external view returns (bytes32); /** - * @notice Used to retrieve the message to be signed for submitting a presigned bool property change. - * @param collection The address of the collection smart contract of the token receiving the property - * @param tokenId The ID of the token receiving the property - * @param key The property key - * @param value The property value + * @notice Used to retrieve the message to be signed for submitting a presigned bool attribute change. + * @param collection The address of the collection smart contract of the token receiving the attribute + * @param tokenId The ID of the token receiving the attribute + * @param key The attribute key + * @param value The attribute value * @param deadline The deadline timestamp for the presigned transaction after which the message is invalid * @return Raw message to be signed by the authorized account */ - function prepareMessageToPresignBoolProperty( + function prepareMessageToPresignBoolAttribute( address collection, uint256 tokenId, string memory key, @@ -700,15 +700,15 @@ interface IRMRKTokenPropertiesRepository is IERC165 { ) external view returns (bytes32); /** - * @notice Used to retrieve the message to be signed for submitting a presigned bytes property change. - * @param collection The address of the collection smart contract of the token receiving the property - * @param tokenId The ID of the token receiving the property - * @param key The property key - * @param value The property value + * @notice Used to retrieve the message to be signed for submitting a presigned bytes attribute change. + * @param collection The address of the collection smart contract of the token receiving the attribute + * @param tokenId The ID of the token receiving the attribute + * @param key The attribute key + * @param value The attribute value * @param deadline The deadline timestamp for the presigned transaction after which the message is invalid * @return Raw message to be signed by the authorized account */ - function prepareMessageToPresignBytesProperty( + function prepareMessageToPresignBytesAttribute( address collection, uint256 tokenId, string memory key, @@ -717,15 +717,15 @@ interface IRMRKTokenPropertiesRepository is IERC165 { ) external view returns (bytes32); /** - * @notice Used to retrieve the message to be signed for submitting a presigned address property change. - * @param collection The address of the collection smart contract of the token receiving the property - * @param tokenId The ID of the token receiving the property - * @param key The property key - * @param value The property value + * @notice Used to retrieve the message to be signed for submitting a presigned address attribute change. + * @param collection The address of the collection smart contract of the token receiving the attribute + * @param tokenId The ID of the token receiving the attribute + * @param key The attribute key + * @param value The attribute value * @param deadline The deadline timestamp for the presigned transaction after which the message is invalid * @return Raw message to be signed by the authorized account */ - function prepareMessageToPresignAddressProperty( + function prepareMessageToPresignAddressAttribute( address collection, uint256 tokenId, string memory key, @@ -734,8 +734,8 @@ interface IRMRKTokenPropertiesRepository is IERC165 { ) external view returns (bytes32); /** - * @notice Used to retrieve multiple token properties of any type at once. - * @dev The `StringProperty`, `UintProperty`, `BoolProperty`, `AddressProperty` and `BytesProperty` structs consists + * @notice Used to retrieve multiple token attributes of any type at once. + * @dev The `StringAttribute`, `UintAttribute`, `BoolAttribute`, `AddressAttribute` and `BytesAttribute` structs consists * to the following fields (where `value` is of the appropriate type): * [ * key, @@ -743,18 +743,18 @@ interface IRMRKTokenPropertiesRepository is IERC165 { * ] * @param collection The collection address * @param tokenId The token ID - * @param stringKeys An array of string type property keys to retrieve - * @param uintKeys An array of uint type property keys to retrieve - * @param boolKeys An array of bool type property keys to retrieve - * @param addressKeys An array of address type property keys to retrieve - * @param bytesKeys An array of bytes type property keys to retrieve - * @return stringProperties An array of `StringProperty` structs containing the string type properties - * @return uintProperties An array of `UintProperty` structs containing the uint type properties - * @return boolProperties An array of `BoolProperty` structs containing the bool type properties - * @return addressProperties An array of `AddressProperty` structs containing the address type properties - * @return bytesProperties An array of `BytesProperty` structs containing the bytes type properties + * @param stringKeys An array of string type attribute keys to retrieve + * @param uintKeys An array of uint type attribute keys to retrieve + * @param boolKeys An array of bool type attribute keys to retrieve + * @param addressKeys An array of address type attribute keys to retrieve + * @param bytesKeys An array of bytes type attribute keys to retrieve + * @return stringAttributes An array of `StringAttribute` structs containing the string type attributes + * @return uintAttributes An array of `UintAttribute` structs containing the uint type attributes + * @return boolAttributes An array of `BoolAttribute` structs containing the bool type attributes + * @return addressAttributes An array of `AddressAttribute` structs containing the address type attributes + * @return bytesAttributes An array of `BytesAttribute` structs containing the bytes type attributes */ - function getTokenProperties( + function getTokenAttributes( address collection, uint256 tokenId, string[] memory stringKeys, @@ -766,100 +766,100 @@ interface IRMRKTokenPropertiesRepository is IERC165 { external view returns ( - StringProperty[] memory stringProperties, - UintProperty[] memory uintProperties, - BoolProperty[] memory boolProperties, - AddressProperty[] memory addressProperties, - BytesProperty[] memory bytesProperties + StringAttribute[] memory stringAttributes, + UintAttribute[] memory uintAttributes, + BoolAttribute[] memory boolAttributes, + AddressAttribute[] memory addressAttributes, + BytesAttribute[] memory bytesAttributes ); /** * @notice Used to get multiple sting parameter values for a token. - * @dev The `StringProperty` struct contains the following fields: + * @dev The `StringAttribute` struct contains the following fields: * [ * string key, * string value * ] * @param collection Address of the collection the token belongs to - * @param tokenId ID of the token for which the properties are being retrieved + * @param tokenId ID of the token for which the attributes are being retrieved * @param stringKeys An array of string keys to retrieve - * @return An array of `StringProperty` structs + * @return An array of `StringAttribute` structs */ - function getStringTokenProperties( + function getStringTokenAttributes( address collection, uint256 tokenId, string[] memory stringKeys - ) external view returns (StringProperty[] memory); + ) external view returns (StringAttribute[] memory); /** * @notice Used to get multiple uint parameter values for a token. - * @dev The `UintProperty` struct contains the following fields: + * @dev The `UintAttribute` struct contains the following fields: * [ * string key, * uint value * ] * @param collection Address of the collection the token belongs to - * @param tokenId ID of the token for which the properties are being retrieved + * @param tokenId ID of the token for which the attributes are being retrieved * @param uintKeys An array of uint keys to retrieve - * @return An array of `UintProperty` structs + * @return An array of `UintAttribute` structs */ - function getUintTokenProperties( + function getUintTokenAttributes( address collection, uint256 tokenId, string[] memory uintKeys - ) external view returns (UintProperty[] memory); + ) external view returns (UintAttribute[] memory); /** * @notice Used to get multiple bool parameter values for a token. - * @dev The `BoolProperty` struct contains the following fields: + * @dev The `BoolAttribute` struct contains the following fields: * [ * string key, * bool value * ] * @param collection Address of the collection the token belongs to - * @param tokenId ID of the token for which the properties are being retrieved + * @param tokenId ID of the token for which the attributes are being retrieved * @param boolKeys An array of bool keys to retrieve - * @return An array of `BoolProperty` structs + * @return An array of `BoolAttribute` structs */ - function getBoolTokenProperties( + function getBoolTokenAttributes( address collection, uint256 tokenId, string[] memory boolKeys - ) external view returns (BoolProperty[] memory); + ) external view returns (BoolAttribute[] memory); /** * @notice Used to get multiple address parameter values for a token. - * @dev The `AddressProperty` struct contains the following fields: + * @dev The `AddressAttribute` struct contains the following fields: * [ * string key, * address value * ] * @param collection Address of the collection the token belongs to - * @param tokenId ID of the token for which the properties are being retrieved + * @param tokenId ID of the token for which the attributes are being retrieved * @param addressKeys An array of address keys to retrieve - * @return An array of `AddressProperty` structs + * @return An array of `AddressAttribute` structs */ - function getAddressTokenProperties( + function getAddressTokenAttributes( address collection, uint256 tokenId, string[] memory addressKeys - ) external view returns (AddressProperty[] memory); + ) external view returns (AddressAttribute[] memory); /** * @notice Used to get multiple bytes parameter values for a token. - * @dev The `BytesProperty` struct contains the following fields: + * @dev The `BytesAttribute` struct contains the following fields: * [ * string key, * bytes value * ] * @param collection Address of the collection the token belongs to - * @param tokenId ID of the token for which the properties are being retrieved + * @param tokenId ID of the token for which the attributes are being retrieved * @param bytesKeys An array of bytes keys to retrieve - * @return An array of `BytesProperty` structs + * @return An array of `BytesAttribute` structs */ - function getBytesTokenProperties( + function getBytesTokenAttributes( address collection, uint256 tokenId, string[] memory bytesKeys - ) external view returns (BytesProperty[] memory); + ) external view returns (BytesAttribute[] memory); } diff --git a/contracts/RMRK/extension/tokenProperties/RMRKTokenPropertiesRepository.sol b/contracts/RMRK/extension/tokenProperties/RMRKTokenAttributesRepository.sol similarity index 67% rename from contracts/RMRK/extension/tokenProperties/RMRKTokenPropertiesRepository.sol rename to contracts/RMRK/extension/tokenProperties/RMRKTokenAttributesRepository.sol index a538dbba..b207d0a7 100644 --- a/contracts/RMRK/extension/tokenProperties/RMRKTokenPropertiesRepository.sol +++ b/contracts/RMRK/extension/tokenProperties/RMRKTokenAttributesRepository.sol @@ -7,42 +7,42 @@ import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/utils/introspection/IERC165.sol"; import "../../library/RMRKErrors.sol"; -import "./IRMRKTokenPropertiesRepository.sol"; +import "./IERC7508.sol"; /** - * @title RMRKTokenPropertiesRepository + * @title RMRKTokenAttributesRepository * @author RMRK team * @notice Smart contract of the RMRK Token property repository module. */ -contract RMRKTokenPropertiesRepository is IRMRKTokenPropertiesRepository { +contract RMRKTokenAttributesRepository is IERC7508 { bytes32 public immutable DOMAIN_SEPARATOR = keccak256( abi.encode( - "ERC-X: Public Non-Fungible Token Attributes Repository", + "ERC-7508: Public On-Chain NFT Attributes Repository", "1", block.chainid, address(this) ) ); - bytes32 public immutable SET_UINT_PROPERTY_TYPEHASH = + bytes32 public immutable SET_UINT_ATTRIBUTE_TYPEHASH = keccak256( - "setUintProperty(address collection,uint256 tokenId,string memory key,uint256 value)" + "setUintAttribute(address collection,uint256 tokenId,string memory key,uint256 value)" ); - bytes32 public immutable SET_STRING_PROPERTY_TYPEHASH = + bytes32 public immutable SET_STRING_ATTRIBUTE_TYPEHASH = keccak256( - "setStringProperty(address collection,uint256 tokenId,string memory key,string memory value)" + "setStringAttribute(address collection,uint256 tokenId,string memory key,string memory value)" ); - bytes32 public immutable SET_BOOL_PROPERTY_TYPEHASH = + bytes32 public immutable SET_BOOL_ATTRIBUTE_TYPEHASH = keccak256( - "setBoolProperty(address collection,uint256 tokenId,string memory key,bool value)" + "setBoolAttribute(address collection,uint256 tokenId,string memory key,bool value)" ); - bytes32 public immutable SET_BYTES_PROPERTY_TYPEHASH = + bytes32 public immutable SET_BYTES_ATTRIBUTE_TYPEHASH = keccak256( - "setBytesProperty(address collection,uint256 tokenId,string memory key,bytes memory value)" + "setBytesAttribute(address collection,uint256 tokenId,string memory key,bytes memory value)" ); - bytes32 public immutable SET_ADDRESS_PROPERTY_TYPEHASH = + bytes32 public immutable SET_ADDRESS_ATTRIBUTE_TYPEHASH = keccak256( - "setAddressProperty(address collection,uint256 tokenId,string memory key,address value)" + "setAddressAttribute(address collection,uint256 tokenId,string memory key,address value)" ); mapping(address => mapping(uint256 => AccessType)) @@ -55,7 +55,7 @@ contract RMRKTokenPropertiesRepository is IRMRKTokenPropertiesRepository { // For keys, we use a mapping from strings to IDs. // The purpose is to store unique string keys only once, since they are more expensive. mapping(string => uint256) private _keysToIds; - uint256 private _totalProperties; + uint256 private _totalAttributes; // For strings, we also use a mapping from strings to IDs, together with a reverse mapping // The purpose is to store unique string values only once, since they are more expensive, @@ -81,8 +81,31 @@ contract RMRKTokenPropertiesRepository is IRMRKTokenPropertiesRepository { address issuer; } + /// Used to signal that the smart contract interacting with the repository does not implement Ownable pattern. + error OwnableNotImplemented(); + /// Used to signal that the caller is not the issuer of the collection. + error NotCollectionIssuer(); + /// Used to signal that the collaborator and collaborator rights array are not of equal length. + error CollaboratorArraysNotEqualLength(); + /// Used to signal that the collection is not registered in the repository yet. + error CollectionNotRegistered(); + /// Used to signal that the collection is already registered in the repository. + error CollectionAlreadyRegistered(); + /// Used to signal that the caller is not aa collaborator of the collection. + error NotCollectionCollaborator(); + /// Used to signal that the caller is not the issuer or a collaborator of the collection. + error NotCollectionIssuerOrCollaborator(); + /// Used to signal that the caller is not the owner of the token. + error NotTokenOwner(); + /// Used to signal that the caller is not the specific address allowed to manage the attribute. + error NotSpecificAddress(); + /// Used to signal that the presigned message's signature is invalid. + error InvalidSignature(); + /// Used to signal that the presigned message's deadline has expired. + error ExpiredDeadline(); + /** - * @inheritdoc IRMRKTokenPropertiesRepository + * @inheritdoc IERC7508 */ function registerAccessControl( address collection, @@ -94,13 +117,13 @@ contract RMRKTokenPropertiesRepository is IRMRKTokenPropertiesRepository { ); if (address(uint160(uint256(bytes32(ownableReturn)))) == address(0)) { - revert RMRKOwnableNotImplemented(); + revert OwnableNotImplemented(); } if ( ownableSuccess && address(uint160(uint256(bytes32(ownableReturn)))) != msg.sender ) { - revert RMRKNotCollectionIssuer(); + revert NotCollectionIssuer(); } IssuerSetting storage issuerSetting = _issuerSettings[collection]; @@ -117,7 +140,7 @@ contract RMRKTokenPropertiesRepository is IRMRKTokenPropertiesRepository { } /** - * @inheritdoc IRMRKTokenPropertiesRepository + * @inheritdoc IERC7508 */ function manageAccessControl( address collection, @@ -134,7 +157,7 @@ contract RMRKTokenPropertiesRepository is IRMRKTokenPropertiesRepository { } /** - * @inheritdoc IRMRKTokenPropertiesRepository + * @inheritdoc IERC7508 */ function manageCollaborators( address collection, @@ -142,7 +165,7 @@ contract RMRKTokenPropertiesRepository is IRMRKTokenPropertiesRepository { bool[] memory collaboratorAddressAccess ) external onlyRegisteredCollection(collection) onlyIssuer(collection) { if (collaboratorAddresses.length != collaboratorAddressAccess.length) { - revert RMRKCollaboratorArraysNotEqualLength(); + revert CollaboratorArraysNotEqualLength(); } for (uint256 i; i < collaboratorAddresses.length; ) { _collaborators[collection][ @@ -160,7 +183,7 @@ contract RMRKTokenPropertiesRepository is IRMRKTokenPropertiesRepository { } /** - * @inheritdoc IRMRKTokenPropertiesRepository + * @inheritdoc IERC7508 */ function isCollaborator( address collaborator, @@ -170,7 +193,7 @@ contract RMRKTokenPropertiesRepository is IRMRKTokenPropertiesRepository { } /** - * @inheritdoc IRMRKTokenPropertiesRepository + * @inheritdoc IERC7508 */ function isSpecificAddress( address specificAddress, @@ -185,11 +208,11 @@ contract RMRKTokenPropertiesRepository is IRMRKTokenPropertiesRepository { /** * @notice Modifier to check if the caller is authorized to call the function. * @dev If the authorization is set to TokenOwner and the tokenId provided is of the non-existent token, the - * execution will revert with `ERC721InvalidTokenId` rather than `RMRKNotTokenOwner`. + * execution will revert with `ERC721InvalidTokenId` rather than `NotTokenOwner`. * @dev The tokenId parameter is only needed for the TokenOwner authorization type, other authorization types ignore * it. * @param collection The address of the collection. - * @param key Key of the property. + * @param key Key of the attribute. * @param tokenId The ID of the token. */ modifier onlyAuthorizedCaller( @@ -207,7 +230,7 @@ contract RMRKTokenPropertiesRepository is IRMRKTokenPropertiesRepository { */ modifier onlyRegisteredCollection(address collection) { if (!_issuerSettings[collection].registered) { - revert RMRKCollectionNotRegistered(); + revert CollectionNotRegistered(); } _; } @@ -218,7 +241,7 @@ contract RMRKTokenPropertiesRepository is IRMRKTokenPropertiesRepository { */ modifier onlyUnregisteredCollection(address collection) { if (_issuerSettings[collection].registered) { - revert RMRKCollectionAlreadyRegistered(); + revert CollectionAlreadyRegistered(); } _; } @@ -230,10 +253,10 @@ contract RMRKTokenPropertiesRepository is IRMRKTokenPropertiesRepository { modifier onlyIssuer(address collection) { if (_issuerSettings[collection].useOwnable) { if (Ownable(collection).owner() != msg.sender) { - revert RMRKNotCollectionIssuer(); + revert NotCollectionIssuer(); } } else if (_issuerSettings[collection].issuer != msg.sender) { - revert RMRKNotCollectionIssuer(); + revert NotCollectionIssuer(); } _; } @@ -241,7 +264,7 @@ contract RMRKTokenPropertiesRepository is IRMRKTokenPropertiesRepository { /** * @notice Function to check if the caller is authorized to mamage a given parameter. * @param collection The address of the collection. - * @param key Key of the property. + * @param key Key of the attribute. * @param tokenId The ID of the token. */ function _onlyAuthorizedCaller( @@ -261,12 +284,12 @@ contract RMRKTokenPropertiesRepository is IRMRKTokenPropertiesRepository { (!_issuerSettings[collection].useOwnable && _issuerSettings[collection].issuer != caller)) ) { - revert RMRKNotCollectionIssuer(); + revert NotCollectionIssuer(); } else if ( accessType == AccessType.Collaborator && !_collaborators[collection][caller] ) { - revert RMRKNotCollectionCollaborator(); + revert NotCollectionCollaborator(); } else if ( accessType == AccessType.IssuerOrCollaborator && ((_issuerSettings[collection].useOwnable && @@ -275,24 +298,24 @@ contract RMRKTokenPropertiesRepository is IRMRKTokenPropertiesRepository { _issuerSettings[collection].issuer != caller)) && !_collaborators[collection][caller] ) { - revert RMRKNotCollectionIssuerOrCollaborator(); + revert NotCollectionIssuerOrCollaborator(); } else if ( accessType == AccessType.TokenOwner && IERC721(collection).ownerOf(tokenId) != caller ) { - revert RMRKNotTokenOwner(); + revert NotTokenOwner(); } else if ( accessType == AccessType.SpecificAddress && !(_parameterSpecificAddress[collection][_keysToIds[key]] == caller) ) { - revert RMRKNotSpecificAddress(); + revert NotSpecificAddress(); } } /** - * @inheritdoc IRMRKTokenPropertiesRepository + * @inheritdoc IERC7508 */ - function getStringTokenProperty( + function getStringTokenAttribute( address collection, uint256 tokenId, string memory key @@ -304,9 +327,9 @@ contract RMRKTokenPropertiesRepository is IRMRKTokenPropertiesRepository { } /** - * @inheritdoc IRMRKTokenPropertiesRepository + * @inheritdoc IERC7508 */ - function getUintTokenProperty( + function getUintTokenAttribute( address collection, uint256 tokenId, string memory key @@ -315,9 +338,9 @@ contract RMRKTokenPropertiesRepository is IRMRKTokenPropertiesRepository { } /** - * @inheritdoc IRMRKTokenPropertiesRepository + * @inheritdoc IERC7508 */ - function getBoolTokenProperty( + function getBoolTokenAttribute( address collection, uint256 tokenId, string memory key @@ -326,9 +349,9 @@ contract RMRKTokenPropertiesRepository is IRMRKTokenPropertiesRepository { } /** - * @inheritdoc IRMRKTokenPropertiesRepository + * @inheritdoc IERC7508 */ - function getAddressTokenProperty( + function getAddressTokenAttribute( address collection, uint256 tokenId, string memory key @@ -337,9 +360,9 @@ contract RMRKTokenPropertiesRepository is IRMRKTokenPropertiesRepository { } /** - * @inheritdoc IRMRKTokenPropertiesRepository + * @inheritdoc IERC7508 */ - function getBytesTokenProperty( + function getBytesTokenAttribute( address collection, uint256 tokenId, string memory key @@ -348,9 +371,9 @@ contract RMRKTokenPropertiesRepository is IRMRKTokenPropertiesRepository { } /** - * @inheritdoc IRMRKTokenPropertiesRepository + * @inheritdoc IERC7508 */ - function getTokenProperties( + function getTokenAttributes( address collection, uint256 tokenId, string[] memory stringKeys, @@ -362,30 +385,30 @@ contract RMRKTokenPropertiesRepository is IRMRKTokenPropertiesRepository { external view returns ( - StringProperty[] memory stringProperties, - UintProperty[] memory uintProperties, - BoolProperty[] memory boolProperties, - AddressProperty[] memory addressProperties, - BytesProperty[] memory bytesProperties + StringAttribute[] memory stringAttributes, + UintAttribute[] memory uintAttributes, + BoolAttribute[] memory boolAttributes, + AddressAttribute[] memory addressAttributes, + BytesAttribute[] memory bytesAttributes ) { - stringProperties = getStringTokenProperties( + stringAttributes = getStringTokenAttributes( collection, tokenId, stringKeys ); - uintProperties = getUintTokenProperties(collection, tokenId, uintKeys); + uintAttributes = getUintTokenAttributes(collection, tokenId, uintKeys); - boolProperties = getBoolTokenProperties(collection, tokenId, boolKeys); + boolAttributes = getBoolTokenAttributes(collection, tokenId, boolKeys); - addressProperties = getAddressTokenProperties( + addressAttributes = getAddressTokenAttributes( collection, tokenId, addressKeys ); - bytesProperties = getBytesTokenProperties( + bytesAttributes = getBytesTokenAttributes( collection, tokenId, bytesKeys @@ -393,21 +416,21 @@ contract RMRKTokenPropertiesRepository is IRMRKTokenPropertiesRepository { } /** - * @inheritdoc IRMRKTokenPropertiesRepository + * @inheritdoc IERC7508 */ - function getStringTokenProperties( + function getStringTokenAttributes( address collection, uint256 tokenId, string[] memory stringKeys - ) public view returns (StringProperty[] memory) { + ) public view returns (StringAttribute[] memory) { uint256 stringLen = stringKeys.length; - StringProperty[] memory stringProperties = new StringProperty[]( + StringAttribute[] memory stringAttributes = new StringAttribute[]( stringLen ); for (uint i; i < stringLen; ) { - stringProperties[i] = StringProperty({ + stringAttributes[i] = StringAttribute({ key: stringKeys[i], value: _stringIdToValue[collection][ _stringValueIds[collection][tokenId][ @@ -420,23 +443,23 @@ contract RMRKTokenPropertiesRepository is IRMRKTokenPropertiesRepository { } } - return stringProperties; + return stringAttributes; } /** - * @inheritdoc IRMRKTokenPropertiesRepository + * @inheritdoc IERC7508 */ - function getUintTokenProperties( + function getUintTokenAttributes( address collection, uint256 tokenId, string[] memory uintKeys - ) public view returns (UintProperty[] memory) { + ) public view returns (UintAttribute[] memory) { uint256 uintLen = uintKeys.length; - UintProperty[] memory uintProperties = new UintProperty[](uintLen); + UintAttribute[] memory uintAttributes = new UintAttribute[](uintLen); for (uint i; i < uintLen; ) { - uintProperties[i] = UintProperty({ + uintAttributes[i] = UintAttribute({ key: uintKeys[i], value: _uintValues[collection][tokenId][_keysToIds[uintKeys[i]]] }); @@ -445,23 +468,23 @@ contract RMRKTokenPropertiesRepository is IRMRKTokenPropertiesRepository { } } - return uintProperties; + return uintAttributes; } /** - * @inheritdoc IRMRKTokenPropertiesRepository + * @inheritdoc IERC7508 */ - function getBoolTokenProperties( + function getBoolTokenAttributes( address collection, uint256 tokenId, string[] memory boolKeys - ) public view returns (BoolProperty[] memory) { + ) public view returns (BoolAttribute[] memory) { uint256 boolLen = boolKeys.length; - BoolProperty[] memory boolProperties = new BoolProperty[](boolLen); + BoolAttribute[] memory boolAttributes = new BoolAttribute[](boolLen); for (uint i; i < boolLen; ) { - boolProperties[i] = BoolProperty({ + boolAttributes[i] = BoolAttribute({ key: boolKeys[i], value: _boolValues[collection][tokenId][_keysToIds[boolKeys[i]]] }); @@ -470,25 +493,25 @@ contract RMRKTokenPropertiesRepository is IRMRKTokenPropertiesRepository { } } - return boolProperties; + return boolAttributes; } /** - * @inheritdoc IRMRKTokenPropertiesRepository + * @inheritdoc IERC7508 */ - function getAddressTokenProperties( + function getAddressTokenAttributes( address collection, uint256 tokenId, string[] memory addressKeys - ) public view returns (AddressProperty[] memory) { + ) public view returns (AddressAttribute[] memory) { uint256 addressLen = addressKeys.length; - AddressProperty[] memory addressProperties = new AddressProperty[]( + AddressAttribute[] memory addressAttributes = new AddressAttribute[]( addressLen ); for (uint i; i < addressLen; ) { - addressProperties[i] = AddressProperty({ + addressAttributes[i] = AddressAttribute({ key: addressKeys[i], value: _addressValues[collection][tokenId][ _keysToIds[addressKeys[i]] @@ -499,23 +522,25 @@ contract RMRKTokenPropertiesRepository is IRMRKTokenPropertiesRepository { } } - return addressProperties; + return addressAttributes; } /** - * @inheritdoc IRMRKTokenPropertiesRepository + * @inheritdoc IERC7508 */ - function getBytesTokenProperties( + function getBytesTokenAttributes( address collection, uint256 tokenId, string[] memory bytesKeys - ) public view returns (BytesProperty[] memory) { + ) public view returns (BytesAttribute[] memory) { uint256 bytesLen = bytesKeys.length; - BytesProperty[] memory bytesProperties = new BytesProperty[](bytesLen); + BytesAttribute[] memory bytesAttributes = new BytesAttribute[]( + bytesLen + ); for (uint i; i < bytesLen; ) { - bytesProperties[i] = BytesProperty({ + bytesAttributes[i] = BytesAttribute({ key: bytesKeys[i], value: _bytesValues[collection][tokenId][ _keysToIds[bytesKeys[i]] @@ -526,13 +551,13 @@ contract RMRKTokenPropertiesRepository is IRMRKTokenPropertiesRepository { } } - return bytesProperties; + return bytesAttributes; } /** - * @inheritdoc IRMRKTokenPropertiesRepository + * @inheritdoc IERC7508 */ - function prepareMessageToPresignUintProperty( + function prepareMessageToPresignUintAttribute( address collection, uint256 tokenId, string memory key, @@ -543,7 +568,7 @@ contract RMRKTokenPropertiesRepository is IRMRKTokenPropertiesRepository { keccak256( abi.encode( DOMAIN_SEPARATOR, - SET_UINT_PROPERTY_TYPEHASH, + SET_UINT_ATTRIBUTE_TYPEHASH, collection, tokenId, key, @@ -554,9 +579,9 @@ contract RMRKTokenPropertiesRepository is IRMRKTokenPropertiesRepository { } /** - * @inheritdoc IRMRKTokenPropertiesRepository + * @inheritdoc IERC7508 */ - function prepareMessageToPresignStringProperty( + function prepareMessageToPresignStringAttribute( address collection, uint256 tokenId, string memory key, @@ -567,7 +592,7 @@ contract RMRKTokenPropertiesRepository is IRMRKTokenPropertiesRepository { keccak256( abi.encode( DOMAIN_SEPARATOR, - SET_STRING_PROPERTY_TYPEHASH, + SET_STRING_ATTRIBUTE_TYPEHASH, collection, tokenId, key, @@ -578,9 +603,9 @@ contract RMRKTokenPropertiesRepository is IRMRKTokenPropertiesRepository { } /** - * @inheritdoc IRMRKTokenPropertiesRepository + * @inheritdoc IERC7508 */ - function prepareMessageToPresignBoolProperty( + function prepareMessageToPresignBoolAttribute( address collection, uint256 tokenId, string memory key, @@ -591,7 +616,7 @@ contract RMRKTokenPropertiesRepository is IRMRKTokenPropertiesRepository { keccak256( abi.encode( DOMAIN_SEPARATOR, - SET_BOOL_PROPERTY_TYPEHASH, + SET_BOOL_ATTRIBUTE_TYPEHASH, collection, tokenId, key, @@ -602,9 +627,9 @@ contract RMRKTokenPropertiesRepository is IRMRKTokenPropertiesRepository { } /** - * @inheritdoc IRMRKTokenPropertiesRepository + * @inheritdoc IERC7508 */ - function prepareMessageToPresignBytesProperty( + function prepareMessageToPresignBytesAttribute( address collection, uint256 tokenId, string memory key, @@ -615,7 +640,7 @@ contract RMRKTokenPropertiesRepository is IRMRKTokenPropertiesRepository { keccak256( abi.encode( DOMAIN_SEPARATOR, - SET_BYTES_PROPERTY_TYPEHASH, + SET_BYTES_ATTRIBUTE_TYPEHASH, collection, tokenId, key, @@ -626,9 +651,9 @@ contract RMRKTokenPropertiesRepository is IRMRKTokenPropertiesRepository { } /** - * @inheritdoc IRMRKTokenPropertiesRepository + * @inheritdoc IERC7508 */ - function prepareMessageToPresignAddressProperty( + function prepareMessageToPresignAddressAttribute( address collection, uint256 tokenId, string memory key, @@ -639,7 +664,7 @@ contract RMRKTokenPropertiesRepository is IRMRKTokenPropertiesRepository { keccak256( abi.encode( DOMAIN_SEPARATOR, - SET_ADDRESS_PROPERTY_TYPEHASH, + SET_ADDRESS_ATTRIBUTE_TYPEHASH, collection, tokenId, key, @@ -650,22 +675,22 @@ contract RMRKTokenPropertiesRepository is IRMRKTokenPropertiesRepository { } /** - * @inheritdoc IRMRKTokenPropertiesRepository + * @inheritdoc IERC7508 */ - function setUintProperty( + function setUintAttribute( address collection, uint256 tokenId, string memory key, uint256 value ) external onlyAuthorizedCaller(collection, key, tokenId) { _uintValues[collection][tokenId][_getIdForKey(key)] = value; - emit UintPropertyUpdated(collection, tokenId, key, value); + emit UintAttributeUpdated(collection, tokenId, key, value); } /** - * @inheritdoc IRMRKTokenPropertiesRepository + * @inheritdoc IERC7508 */ - function setStringProperty( + function setStringAttribute( address collection, uint256 tokenId, string memory key, @@ -674,65 +699,65 @@ contract RMRKTokenPropertiesRepository is IRMRKTokenPropertiesRepository { _stringValueIds[collection][tokenId][ _getIdForKey(key) ] = _getStringIdForValue(collection, value); - emit StringPropertyUpdated(collection, tokenId, key, value); + emit StringAttributeUpdated(collection, tokenId, key, value); } /** - * @inheritdoc IRMRKTokenPropertiesRepository + * @inheritdoc IERC7508 */ - function setBoolProperty( + function setBoolAttribute( address collection, uint256 tokenId, string memory key, bool value ) external onlyAuthorizedCaller(collection, key, tokenId) { _boolValues[collection][tokenId][_getIdForKey(key)] = value; - emit BoolPropertyUpdated(collection, tokenId, key, value); + emit BoolAttributeUpdated(collection, tokenId, key, value); } /** - * @inheritdoc IRMRKTokenPropertiesRepository + * @inheritdoc IERC7508 */ - function setBytesProperty( + function setBytesAttribute( address collection, uint256 tokenId, string memory key, bytes memory value ) external onlyAuthorizedCaller(collection, key, tokenId) { _bytesValues[collection][tokenId][_getIdForKey(key)] = value; - emit BytesPropertyUpdated(collection, tokenId, key, value); + emit BytesAttributeUpdated(collection, tokenId, key, value); } /** - * @inheritdoc IRMRKTokenPropertiesRepository + * @inheritdoc IERC7508 */ - function setAddressProperty( + function setAddressAttribute( address collection, uint256 tokenId, string memory key, address value ) external onlyAuthorizedCaller(collection, key, tokenId) { _addressValues[collection][tokenId][_getIdForKey(key)] = value; - emit AddressPropertyUpdated(collection, tokenId, key, value); + emit AddressAttributeUpdated(collection, tokenId, key, value); } /** - * @inheritdoc IRMRKTokenPropertiesRepository + * @inheritdoc IERC7508 */ - function setStringProperties( + function setStringAttributes( address collection, uint256 tokenId, - StringProperty[] memory properties + StringAttribute[] memory attributes ) external onlyAuthorizedCaller(collection, "", tokenId) { - for (uint256 i = 0; i < properties.length; ) { + for (uint256 i = 0; i < attributes.length; ) { _stringValueIds[collection][tokenId][ - _getIdForKey(properties[i].key) - ] = _getStringIdForValue(collection, properties[i].value); - emit StringPropertyUpdated( + _getIdForKey(attributes[i].key) + ] = _getStringIdForValue(collection, attributes[i].value); + emit StringAttributeUpdated( collection, tokenId, - properties[i].key, - properties[i].value + attributes[i].key, + attributes[i].value ); unchecked { ++i; @@ -741,22 +766,22 @@ contract RMRKTokenPropertiesRepository is IRMRKTokenPropertiesRepository { } /** - * @inheritdoc IRMRKTokenPropertiesRepository + * @inheritdoc IERC7508 */ - function setUintProperties( + function setUintAttributes( address collection, uint256 tokenId, - UintProperty[] memory properties + UintAttribute[] memory attributes ) external onlyAuthorizedCaller(collection, "", tokenId) { - for (uint256 i = 0; i < properties.length; ) { + for (uint256 i = 0; i < attributes.length; ) { _uintValues[collection][tokenId][ - _getIdForKey(properties[i].key) - ] = properties[i].value; - emit UintPropertyUpdated( + _getIdForKey(attributes[i].key) + ] = attributes[i].value; + emit UintAttributeUpdated( collection, tokenId, - properties[i].key, - properties[i].value + attributes[i].key, + attributes[i].value ); unchecked { ++i; @@ -765,22 +790,22 @@ contract RMRKTokenPropertiesRepository is IRMRKTokenPropertiesRepository { } /** - * @inheritdoc IRMRKTokenPropertiesRepository + * @inheritdoc IERC7508 */ - function setBoolProperties( + function setBoolAttributes( address collection, uint256 tokenId, - BoolProperty[] memory properties + BoolAttribute[] memory attributes ) external onlyAuthorizedCaller(collection, "", tokenId) { - for (uint256 i = 0; i < properties.length; ) { + for (uint256 i = 0; i < attributes.length; ) { _boolValues[collection][tokenId][ - _getIdForKey(properties[i].key) - ] = properties[i].value; - emit BoolPropertyUpdated( + _getIdForKey(attributes[i].key) + ] = attributes[i].value; + emit BoolAttributeUpdated( collection, tokenId, - properties[i].key, - properties[i].value + attributes[i].key, + attributes[i].value ); unchecked { ++i; @@ -789,22 +814,22 @@ contract RMRKTokenPropertiesRepository is IRMRKTokenPropertiesRepository { } /** - * @inheritdoc IRMRKTokenPropertiesRepository + * @inheritdoc IERC7508 */ - function setAddressProperties( + function setAddressAttributes( address collection, uint256 tokenId, - AddressProperty[] memory properties + AddressAttribute[] memory attributes ) external onlyAuthorizedCaller(collection, "", tokenId) { - for (uint256 i = 0; i < properties.length; ) { + for (uint256 i = 0; i < attributes.length; ) { _addressValues[collection][tokenId][ - _getIdForKey(properties[i].key) - ] = properties[i].value; - emit AddressPropertyUpdated( + _getIdForKey(attributes[i].key) + ] = attributes[i].value; + emit AddressAttributeUpdated( collection, tokenId, - properties[i].key, - properties[i].value + attributes[i].key, + attributes[i].value ); unchecked { ++i; @@ -813,22 +838,22 @@ contract RMRKTokenPropertiesRepository is IRMRKTokenPropertiesRepository { } /** - * @inheritdoc IRMRKTokenPropertiesRepository + * @inheritdoc IERC7508 */ - function setBytesProperties( + function setBytesAttributes( address collection, uint256 tokenId, - BytesProperty[] memory properties + BytesAttribute[] memory attributes ) external onlyAuthorizedCaller(collection, "", tokenId) { - for (uint256 i = 0; i < properties.length; ) { + for (uint256 i = 0; i < attributes.length; ) { _bytesValues[collection][tokenId][ - _getIdForKey(properties[i].key) - ] = properties[i].value; - emit BytesPropertyUpdated( + _getIdForKey(attributes[i].key) + ] = attributes[i].value; + emit BytesAttributeUpdated( collection, tokenId, - properties[i].key, - properties[i].value + attributes[i].key, + attributes[i].value ); unchecked { ++i; @@ -837,86 +862,86 @@ contract RMRKTokenPropertiesRepository is IRMRKTokenPropertiesRepository { } /** - * @inheritdoc IRMRKTokenPropertiesRepository + * @inheritdoc IERC7508 */ - function setTokenProperties( + function setTokenAttributes( address collection, uint256 tokenId, - StringProperty[] memory stringProperties, - UintProperty[] memory uintProperties, - BoolProperty[] memory boolProperties, - AddressProperty[] memory addressProperties, - BytesProperty[] memory bytesProperties + StringAttribute[] memory stringAttributes, + UintAttribute[] memory uintAttributes, + BoolAttribute[] memory boolAttributes, + AddressAttribute[] memory addressAttributes, + BytesAttribute[] memory bytesAttributes ) external onlyAuthorizedCaller(collection, "", tokenId) { - for (uint256 i = 0; i < stringProperties.length; ) { + for (uint256 i = 0; i < stringAttributes.length; ) { _stringValueIds[collection][tokenId][ - _getIdForKey(stringProperties[i].key) - ] = _getStringIdForValue(collection, stringProperties[i].value); - emit StringPropertyUpdated( + _getIdForKey(stringAttributes[i].key) + ] = _getStringIdForValue(collection, stringAttributes[i].value); + emit StringAttributeUpdated( collection, tokenId, - stringProperties[i].key, - stringProperties[i].value + stringAttributes[i].key, + stringAttributes[i].value ); unchecked { ++i; } } - for (uint256 i = 0; i < uintProperties.length; ) { + for (uint256 i = 0; i < uintAttributes.length; ) { _uintValues[collection][tokenId][ - _getIdForKey(uintProperties[i].key) - ] = uintProperties[i].value; - emit UintPropertyUpdated( + _getIdForKey(uintAttributes[i].key) + ] = uintAttributes[i].value; + emit UintAttributeUpdated( collection, tokenId, - uintProperties[i].key, - uintProperties[i].value + uintAttributes[i].key, + uintAttributes[i].value ); unchecked { ++i; } } - for (uint256 i = 0; i < boolProperties.length; ) { + for (uint256 i = 0; i < boolAttributes.length; ) { _boolValues[collection][tokenId][ - _getIdForKey(boolProperties[i].key) - ] = boolProperties[i].value; - emit BoolPropertyUpdated( + _getIdForKey(boolAttributes[i].key) + ] = boolAttributes[i].value; + emit BoolAttributeUpdated( collection, tokenId, - boolProperties[i].key, - boolProperties[i].value + boolAttributes[i].key, + boolAttributes[i].value ); unchecked { ++i; } } - for (uint256 i = 0; i < addressProperties.length; ) { + for (uint256 i = 0; i < addressAttributes.length; ) { _addressValues[collection][tokenId][ - _getIdForKey(addressProperties[i].key) - ] = addressProperties[i].value; - emit AddressPropertyUpdated( + _getIdForKey(addressAttributes[i].key) + ] = addressAttributes[i].value; + emit AddressAttributeUpdated( collection, tokenId, - addressProperties[i].key, - addressProperties[i].value + addressAttributes[i].key, + addressAttributes[i].value ); unchecked { ++i; } } - for (uint256 i = 0; i < bytesProperties.length; ) { + for (uint256 i = 0; i < bytesAttributes.length; ) { _bytesValues[collection][tokenId][ - _getIdForKey(bytesProperties[i].key) - ] = bytesProperties[i].value; - emit BytesPropertyUpdated( + _getIdForKey(bytesAttributes[i].key) + ] = bytesAttributes[i].value; + emit BytesAttributeUpdated( collection, tokenId, - bytesProperties[i].key, - bytesProperties[i].value + bytesAttributes[i].key, + bytesAttributes[i].value ); unchecked { ++i; @@ -925,9 +950,9 @@ contract RMRKTokenPropertiesRepository is IRMRKTokenPropertiesRepository { } /** - * @inheritdoc IRMRKTokenPropertiesRepository + * @inheritdoc IERC7508 */ - function presignedSetUintProperty( + function presignedSetUintAttribute( address setter, address collection, uint256 tokenId, @@ -939,7 +964,7 @@ contract RMRKTokenPropertiesRepository is IRMRKTokenPropertiesRepository { bytes32 s ) external { if (block.timestamp > deadline) { - revert RMRKExpiredDeadline(); + revert ExpiredDeadline(); } bytes32 digest = keccak256( @@ -948,7 +973,7 @@ contract RMRKTokenPropertiesRepository is IRMRKTokenPropertiesRepository { keccak256( abi.encode( DOMAIN_SEPARATOR, - SET_UINT_PROPERTY_TYPEHASH, + SET_UINT_ATTRIBUTE_TYPEHASH, collection, tokenId, key, @@ -960,18 +985,18 @@ contract RMRKTokenPropertiesRepository is IRMRKTokenPropertiesRepository { ); address signer = ecrecover(digest, v, r, s); if (signer != setter) { - revert RMRKInvalidSignature(); + revert InvalidSignature(); } _onlyAuthorizedCaller(signer, collection, key, tokenId); _uintValues[collection][tokenId][_getIdForKey(key)] = value; - emit UintPropertyUpdated(collection, tokenId, key, value); + emit UintAttributeUpdated(collection, tokenId, key, value); } /** - * @inheritdoc IRMRKTokenPropertiesRepository + * @inheritdoc IERC7508 */ - function presignedSetStringProperty( + function presignedSetStringAttribute( address setter, address collection, uint256 tokenId, @@ -983,7 +1008,7 @@ contract RMRKTokenPropertiesRepository is IRMRKTokenPropertiesRepository { bytes32 s ) external { if (block.timestamp > deadline) { - revert RMRKExpiredDeadline(); + revert ExpiredDeadline(); } bytes32 digest = keccak256( @@ -992,7 +1017,7 @@ contract RMRKTokenPropertiesRepository is IRMRKTokenPropertiesRepository { keccak256( abi.encode( DOMAIN_SEPARATOR, - SET_STRING_PROPERTY_TYPEHASH, + SET_STRING_ATTRIBUTE_TYPEHASH, collection, tokenId, key, @@ -1004,20 +1029,20 @@ contract RMRKTokenPropertiesRepository is IRMRKTokenPropertiesRepository { ); address signer = ecrecover(digest, v, r, s); if (signer != setter) { - revert RMRKInvalidSignature(); + revert InvalidSignature(); } _onlyAuthorizedCaller(signer, collection, key, tokenId); _stringValueIds[collection][tokenId][ _getIdForKey(key) ] = _getStringIdForValue(collection, value); - emit StringPropertyUpdated(collection, tokenId, key, value); + emit StringAttributeUpdated(collection, tokenId, key, value); } /** - * @inheritdoc IRMRKTokenPropertiesRepository + * @inheritdoc IERC7508 */ - function presignedSetBoolProperty( + function presignedSetBoolAttribute( address setter, address collection, uint256 tokenId, @@ -1029,7 +1054,7 @@ contract RMRKTokenPropertiesRepository is IRMRKTokenPropertiesRepository { bytes32 s ) external { if (block.timestamp > deadline) { - revert RMRKExpiredDeadline(); + revert ExpiredDeadline(); } bytes32 digest = keccak256( @@ -1038,7 +1063,7 @@ contract RMRKTokenPropertiesRepository is IRMRKTokenPropertiesRepository { keccak256( abi.encode( DOMAIN_SEPARATOR, - SET_BOOL_PROPERTY_TYPEHASH, + SET_BOOL_ATTRIBUTE_TYPEHASH, collection, tokenId, key, @@ -1050,18 +1075,18 @@ contract RMRKTokenPropertiesRepository is IRMRKTokenPropertiesRepository { ); address signer = ecrecover(digest, v, r, s); if (signer != setter) { - revert RMRKInvalidSignature(); + revert InvalidSignature(); } _onlyAuthorizedCaller(signer, collection, key, tokenId); _boolValues[collection][tokenId][_getIdForKey(key)] = value; - emit BoolPropertyUpdated(collection, tokenId, key, value); + emit BoolAttributeUpdated(collection, tokenId, key, value); } /** - * @inheritdoc IRMRKTokenPropertiesRepository + * @inheritdoc IERC7508 */ - function presignedSetBytesProperty( + function presignedSetBytesAttribute( address setter, address collection, uint256 tokenId, @@ -1073,7 +1098,7 @@ contract RMRKTokenPropertiesRepository is IRMRKTokenPropertiesRepository { bytes32 s ) external { if (block.timestamp > deadline) { - revert RMRKExpiredDeadline(); + revert ExpiredDeadline(); } bytes32 digest = keccak256( @@ -1082,7 +1107,7 @@ contract RMRKTokenPropertiesRepository is IRMRKTokenPropertiesRepository { keccak256( abi.encode( DOMAIN_SEPARATOR, - SET_BYTES_PROPERTY_TYPEHASH, + SET_BYTES_ATTRIBUTE_TYPEHASH, collection, tokenId, key, @@ -1094,18 +1119,18 @@ contract RMRKTokenPropertiesRepository is IRMRKTokenPropertiesRepository { ); address signer = ecrecover(digest, v, r, s); if (signer != setter) { - revert RMRKInvalidSignature(); + revert InvalidSignature(); } _onlyAuthorizedCaller(signer, collection, key, tokenId); _bytesValues[collection][tokenId][_getIdForKey(key)] = value; - emit BytesPropertyUpdated(collection, tokenId, key, value); + emit BytesAttributeUpdated(collection, tokenId, key, value); } /** - * @inheritdoc IRMRKTokenPropertiesRepository + * @inheritdoc IERC7508 */ - function presignedSetAddressProperty( + function presignedSetAddressAttribute( address setter, address collection, uint256 tokenId, @@ -1117,7 +1142,7 @@ contract RMRKTokenPropertiesRepository is IRMRKTokenPropertiesRepository { bytes32 s ) external { if (block.timestamp > deadline) { - revert RMRKExpiredDeadline(); + revert ExpiredDeadline(); } bytes32 digest = keccak256( @@ -1126,7 +1151,7 @@ contract RMRKTokenPropertiesRepository is IRMRKTokenPropertiesRepository { keccak256( abi.encode( DOMAIN_SEPARATOR, - SET_ADDRESS_PROPERTY_TYPEHASH, + SET_ADDRESS_ATTRIBUTE_TYPEHASH, collection, tokenId, key, @@ -1138,26 +1163,26 @@ contract RMRKTokenPropertiesRepository is IRMRKTokenPropertiesRepository { ); address signer = ecrecover(digest, v, r, s); if (signer != setter) { - revert RMRKInvalidSignature(); + revert InvalidSignature(); } _onlyAuthorizedCaller(signer, collection, key, tokenId); _addressValues[collection][tokenId][_getIdForKey(key)] = value; - emit AddressPropertyUpdated(collection, tokenId, key, value); + emit AddressAttributeUpdated(collection, tokenId, key, value); } /** * @notice Used to get the Id for a key. If the key does not exist, a new ID is created. * IDs are shared among all tokens and types * @dev The ID of 0 is not used as it represents the default value. - * @param key The property key + * @param key The attribute key * @return The ID of the key */ function _getIdForKey(string memory key) internal returns (uint256) { if (_keysToIds[key] == 0) { - _totalProperties++; - _keysToIds[key] = _totalProperties; - return _totalProperties; + _totalAttributes++; + _keysToIds[key] = _totalAttributes; + return _totalAttributes; } else { return _keysToIds[key]; } @@ -1167,7 +1192,7 @@ contract RMRKTokenPropertiesRepository is IRMRKTokenPropertiesRepository { * @notice Used to get the ID for a string value. If the value does not exist, a new ID is created. * @dev IDs are shared among all tokens and used only for strings. * @param collection Address of the collection being checked for string ID - * @param value The property value + * @param value The attribute value * @return The id for the string value */ function _getStringIdForValue( @@ -1195,7 +1220,7 @@ contract RMRKTokenPropertiesRepository is IRMRKTokenPropertiesRepository { bytes4 interfaceId ) public view virtual returns (bool) { return - interfaceId == type(IRMRKTokenPropertiesRepository).interfaceId || + interfaceId == type(IERC7508).interfaceId || interfaceId == type(IERC165).interfaceId; } } diff --git a/docs/RMRK/extension/tokenProperties/IRMRKTokenPropertiesRepository.md b/docs/RMRK/extension/tokenProperties/IERC7508.md similarity index 51% rename from docs/RMRK/extension/tokenProperties/IRMRKTokenPropertiesRepository.md rename to docs/RMRK/extension/tokenProperties/IERC7508.md index 0cc8c978..8007448f 100644 --- a/docs/RMRK/extension/tokenProperties/IRMRKTokenPropertiesRepository.md +++ b/docs/RMRK/extension/tokenProperties/IERC7508.md @@ -1,8 +1,8 @@ -# IRMRKTokenPropertiesRepository +# IERC7508 *RMRK team* -> IRMRKTokenPropertiesRepository +> IERC7508 Interface smart contract of the RMRK token properties extension. @@ -10,37 +10,61 @@ Interface smart contract of the RMRK token properties extension. ## Methods -### getAddressTokenProperties +### getAddressTokenAttribute ```solidity -function getAddressTokenProperties(address collection, uint256 tokenId, string[] addressKeys) external view returns (struct IRMRKTokenPropertiesRepository.AddressProperty[]) +function getAddressTokenAttribute(address collection, uint256 tokenId, string key) external view returns (address) +``` + +Used to retrieve the address type token attributes. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| collection | address | The collection address | +| tokenId | uint256 | The token ID | +| key | string | The key of the attribute | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | address | The value of the address attribute | + +### getAddressTokenAttributes + +```solidity +function getAddressTokenAttributes(address collection, uint256 tokenId, string[] addressKeys) external view returns (struct IERC7508.AddressAttribute[]) ``` Used to get multiple address parameter values for a token. -*The `AddressProperty` struct contains the following fields: [ string key, address value ]* +*The `AddressAttribute` struct contains the following fields: [ string key, address value ]* #### Parameters | Name | Type | Description | |---|---|---| | collection | address | Address of the collection the token belongs to | -| tokenId | uint256 | ID of the token for which the properties are being retrieved | +| tokenId | uint256 | ID of the token for which the attributes are being retrieved | | addressKeys | string[] | An array of address keys to retrieve | #### Returns | Name | Type | Description | |---|---|---| -| _0 | IRMRKTokenPropertiesRepository.AddressProperty[] | An array of `AddressProperty` structs | +| _0 | IERC7508.AddressAttribute[] | An array of `AddressAttribute` structs | -### getAddressTokenProperty +### getBoolTokenAttribute ```solidity -function getAddressTokenProperty(address collection, uint256 tokenId, string key) external view returns (address) +function getBoolTokenAttribute(address collection, uint256 tokenId, string key) external view returns (bool) ``` -Used to retrieve the address type token properties. +Used to retrieve the bool type token attributes. @@ -50,45 +74,45 @@ Used to retrieve the address type token properties. |---|---|---| | collection | address | The collection address | | tokenId | uint256 | The token ID | -| key | string | The key of the property | +| key | string | The key of the attribute | #### Returns | Name | Type | Description | |---|---|---| -| _0 | address | The value of the address property | +| _0 | bool | The value of the bool attribute | -### getBoolTokenProperties +### getBoolTokenAttributes ```solidity -function getBoolTokenProperties(address collection, uint256 tokenId, string[] boolKeys) external view returns (struct IRMRKTokenPropertiesRepository.BoolProperty[]) +function getBoolTokenAttributes(address collection, uint256 tokenId, string[] boolKeys) external view returns (struct IERC7508.BoolAttribute[]) ``` Used to get multiple bool parameter values for a token. -*The `BoolProperty` struct contains the following fields: [ string key, bool value ]* +*The `BoolAttribute` struct contains the following fields: [ string key, bool value ]* #### Parameters | Name | Type | Description | |---|---|---| | collection | address | Address of the collection the token belongs to | -| tokenId | uint256 | ID of the token for which the properties are being retrieved | +| tokenId | uint256 | ID of the token for which the attributes are being retrieved | | boolKeys | string[] | An array of bool keys to retrieve | #### Returns | Name | Type | Description | |---|---|---| -| _0 | IRMRKTokenPropertiesRepository.BoolProperty[] | An array of `BoolProperty` structs | +| _0 | IERC7508.BoolAttribute[] | An array of `BoolAttribute` structs | -### getBoolTokenProperty +### getBytesTokenAttribute ```solidity -function getBoolTokenProperty(address collection, uint256 tokenId, string key) external view returns (bool) +function getBytesTokenAttribute(address collection, uint256 tokenId, string key) external view returns (bytes) ``` -Used to retrieve the bool type token properties. +Used to retrieve the bytes type token attributes. @@ -98,45 +122,45 @@ Used to retrieve the bool type token properties. |---|---|---| | collection | address | The collection address | | tokenId | uint256 | The token ID | -| key | string | The key of the property | +| key | string | The key of the attribute | #### Returns | Name | Type | Description | |---|---|---| -| _0 | bool | The value of the bool property | +| _0 | bytes | The value of the bytes attribute | -### getBytesTokenProperties +### getBytesTokenAttributes ```solidity -function getBytesTokenProperties(address collection, uint256 tokenId, string[] bytesKeys) external view returns (struct IRMRKTokenPropertiesRepository.BytesProperty[]) +function getBytesTokenAttributes(address collection, uint256 tokenId, string[] bytesKeys) external view returns (struct IERC7508.BytesAttribute[]) ``` Used to get multiple bytes parameter values for a token. -*The `BytesProperty` struct contains the following fields: [ string key, bytes value ]* +*The `BytesAttribute` struct contains the following fields: [ string key, bytes value ]* #### Parameters | Name | Type | Description | |---|---|---| | collection | address | Address of the collection the token belongs to | -| tokenId | uint256 | ID of the token for which the properties are being retrieved | +| tokenId | uint256 | ID of the token for which the attributes are being retrieved | | bytesKeys | string[] | An array of bytes keys to retrieve | #### Returns | Name | Type | Description | |---|---|---| -| _0 | IRMRKTokenPropertiesRepository.BytesProperty[] | An array of `BytesProperty` structs | +| _0 | IERC7508.BytesAttribute[] | An array of `BytesAttribute` structs | -### getBytesTokenProperty +### getStringTokenAttribute ```solidity -function getBytesTokenProperty(address collection, uint256 tokenId, string key) external view returns (bytes) +function getStringTokenAttribute(address collection, uint256 tokenId, string key) external view returns (string) ``` -Used to retrieve the bytes type token properties. +Used to retrieve the string type token attributes. @@ -146,47 +170,47 @@ Used to retrieve the bytes type token properties. |---|---|---| | collection | address | The collection address | | tokenId | uint256 | The token ID | -| key | string | The key of the property | +| key | string | The key of the attribute | #### Returns | Name | Type | Description | |---|---|---| -| _0 | bytes | The value of the bytes property | +| _0 | string | The value of the string attribute | -### getStringTokenProperties +### getStringTokenAttributes ```solidity -function getStringTokenProperties(address collection, uint256 tokenId, string[] stringKeys) external view returns (struct IRMRKTokenPropertiesRepository.StringProperty[]) +function getStringTokenAttributes(address collection, uint256 tokenId, string[] stringKeys) external view returns (struct IERC7508.StringAttribute[]) ``` Used to get multiple sting parameter values for a token. -*The `StringProperty` struct contains the following fields: [ string key, string value ]* +*The `StringAttribute` struct contains the following fields: [ string key, string value ]* #### Parameters | Name | Type | Description | |---|---|---| | collection | address | Address of the collection the token belongs to | -| tokenId | uint256 | ID of the token for which the properties are being retrieved | +| tokenId | uint256 | ID of the token for which the attributes are being retrieved | | stringKeys | string[] | An array of string keys to retrieve | #### Returns | Name | Type | Description | |---|---|---| -| _0 | IRMRKTokenPropertiesRepository.StringProperty[] | An array of `StringProperty` structs | +| _0 | IERC7508.StringAttribute[] | An array of `StringAttribute` structs | -### getStringTokenProperty +### getTokenAttributes ```solidity -function getStringTokenProperty(address collection, uint256 tokenId, string key) external view returns (string) +function getTokenAttributes(address collection, uint256 tokenId, string[] stringKeys, string[] uintKeys, string[] boolKeys, string[] addressKeys, string[] bytesKeys) external view returns (struct IERC7508.StringAttribute[] stringAttributes, struct IERC7508.UintAttribute[] uintAttributes, struct IERC7508.BoolAttribute[] boolAttributes, struct IERC7508.AddressAttribute[] addressAttributes, struct IERC7508.BytesAttribute[] bytesAttributes) ``` -Used to retrieve the string type token properties. - +Used to retrieve multiple token attributes of any type at once. +*The `StringAttribute`, `UintAttribute`, `BoolAttribute`, `AddressAttribute` and `BytesAttribute` structs consists to the following fields (where `value` is of the appropriate type): [ key, value, ]* #### Parameters @@ -194,23 +218,31 @@ Used to retrieve the string type token properties. |---|---|---| | collection | address | The collection address | | tokenId | uint256 | The token ID | -| key | string | The key of the property | +| stringKeys | string[] | An array of string type attribute keys to retrieve | +| uintKeys | string[] | An array of uint type attribute keys to retrieve | +| boolKeys | string[] | An array of bool type attribute keys to retrieve | +| addressKeys | string[] | An array of address type attribute keys to retrieve | +| bytesKeys | string[] | An array of bytes type attribute keys to retrieve | #### Returns | Name | Type | Description | |---|---|---| -| _0 | string | The value of the string property | +| stringAttributes | IERC7508.StringAttribute[] | An array of `StringAttribute` structs containing the string type attributes | +| uintAttributes | IERC7508.UintAttribute[] | An array of `UintAttribute` structs containing the uint type attributes | +| boolAttributes | IERC7508.BoolAttribute[] | An array of `BoolAttribute` structs containing the bool type attributes | +| addressAttributes | IERC7508.AddressAttribute[] | An array of `AddressAttribute` structs containing the address type attributes | +| bytesAttributes | IERC7508.BytesAttribute[] | An array of `BytesAttribute` structs containing the bytes type attributes | -### getTokenProperties +### getUintTokenAttribute ```solidity -function getTokenProperties(address collection, uint256 tokenId, string[] stringKeys, string[] uintKeys, string[] boolKeys, string[] addressKeys, string[] bytesKeys) external view returns (struct IRMRKTokenPropertiesRepository.StringProperty[] stringProperties, struct IRMRKTokenPropertiesRepository.UintProperty[] uintProperties, struct IRMRKTokenPropertiesRepository.BoolProperty[] boolProperties, struct IRMRKTokenPropertiesRepository.AddressProperty[] addressProperties, struct IRMRKTokenPropertiesRepository.BytesProperty[] bytesProperties) +function getUintTokenAttribute(address collection, uint256 tokenId, string key) external view returns (uint256) ``` -Used to retrieve multiple token properties of any type at once. +Used to retrieve the uint type token attributes. + -*The `StringProperty`, `UintProperty`, `BoolProperty`, `AddressProperty` and `BytesProperty` structs consists to the following fields (where `value` is of the appropriate type): [ key, value, ]* #### Parameters @@ -218,69 +250,37 @@ Used to retrieve multiple token properties of any type at once. |---|---|---| | collection | address | The collection address | | tokenId | uint256 | The token ID | -| stringKeys | string[] | An array of string type property keys to retrieve | -| uintKeys | string[] | An array of uint type property keys to retrieve | -| boolKeys | string[] | An array of bool type property keys to retrieve | -| addressKeys | string[] | An array of address type property keys to retrieve | -| bytesKeys | string[] | An array of bytes type property keys to retrieve | +| key | string | The key of the attribute | #### Returns | Name | Type | Description | |---|---|---| -| stringProperties | IRMRKTokenPropertiesRepository.StringProperty[] | An array of `StringProperty` structs containing the string type properties | -| uintProperties | IRMRKTokenPropertiesRepository.UintProperty[] | An array of `UintProperty` structs containing the uint type properties | -| boolProperties | IRMRKTokenPropertiesRepository.BoolProperty[] | An array of `BoolProperty` structs containing the bool type properties | -| addressProperties | IRMRKTokenPropertiesRepository.AddressProperty[] | An array of `AddressProperty` structs containing the address type properties | -| bytesProperties | IRMRKTokenPropertiesRepository.BytesProperty[] | An array of `BytesProperty` structs containing the bytes type properties | +| _0 | uint256 | The value of the uint attribute | -### getUintTokenProperties +### getUintTokenAttributes ```solidity -function getUintTokenProperties(address collection, uint256 tokenId, string[] uintKeys) external view returns (struct IRMRKTokenPropertiesRepository.UintProperty[]) +function getUintTokenAttributes(address collection, uint256 tokenId, string[] uintKeys) external view returns (struct IERC7508.UintAttribute[]) ``` Used to get multiple uint parameter values for a token. -*The `UintProperty` struct contains the following fields: [ string key, uint value ]* +*The `UintAttribute` struct contains the following fields: [ string key, uint value ]* #### Parameters | Name | Type | Description | |---|---|---| | collection | address | Address of the collection the token belongs to | -| tokenId | uint256 | ID of the token for which the properties are being retrieved | +| tokenId | uint256 | ID of the token for which the attributes are being retrieved | | uintKeys | string[] | An array of uint keys to retrieve | #### Returns | Name | Type | Description | |---|---|---| -| _0 | IRMRKTokenPropertiesRepository.UintProperty[] | An array of `UintProperty` structs | - -### getUintTokenProperty - -```solidity -function getUintTokenProperty(address collection, uint256 tokenId, string key) external view returns (uint256) -``` - -Used to retrieve the uint type token properties. - - - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| collection | address | The collection address | -| tokenId | uint256 | The token ID | -| key | string | The key of the property | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | The value of the uint property | +| _0 | IERC7508.UintAttribute[] | An array of `UintAttribute` structs | ### isCollaborator @@ -321,7 +321,7 @@ Used to check if the specified address is listed as a specific address of the gi |---|---|---| | specificAddress | address | Address to be checked. | | collection | address | Address of the collection. | -| key | string | The key of the property | +| key | string | The key of the attribute | #### Returns @@ -332,7 +332,7 @@ Used to check if the specified address is listed as a specific address of the gi ### manageAccessControl ```solidity -function manageAccessControl(address collection, string key, enum IRMRKTokenPropertiesRepository.AccessType accessType, address specificAddress) external nonpayable +function manageAccessControl(address collection, string key, enum IERC7508.AccessType accessType, address specificAddress) external nonpayable ``` Used to manage the access control settings for a specific parameter. @@ -344,8 +344,8 @@ Used to manage the access control settings for a specific parameter. | Name | Type | Description | |---|---|---| | collection | address | The address of the collection being managed. | -| key | string | The key of the property | -| accessType | enum IRMRKTokenPropertiesRepository.AccessType | The type of access control to be applied to the parameter. | +| key | string | The key of the attribute | +| accessType | enum IERC7508.AccessType | The type of access control to be applied to the parameter. | | specificAddress | address | The address to be added as a specific addresses allowed to manage the given parameter. | ### manageCollaborators @@ -366,13 +366,13 @@ Used to manage the collaborators of a collection. | collaboratorAddresses | address[] | The array of collaborator addresses being managed | | collaboratorAddressAccess | bool[] | The array of boolean values indicating if the collaborator address should receive the permission (`true`) or not (`false`). | -### prepareMessageToPresignAddressProperty +### prepareMessageToPresignAddressAttribute ```solidity -function prepareMessageToPresignAddressProperty(address collection, uint256 tokenId, string key, address value, uint256 deadline) external view returns (bytes32) +function prepareMessageToPresignAddressAttribute(address collection, uint256 tokenId, string key, address value, uint256 deadline) external view returns (bytes32) ``` -Used to retrieve the message to be signed for submitting a presigned address property change. +Used to retrieve the message to be signed for submitting a presigned address attribute change. @@ -380,10 +380,10 @@ Used to retrieve the message to be signed for submitting a presigned address pro | Name | Type | Description | |---|---|---| -| collection | address | The address of the collection smart contract of the token receiving the property | -| tokenId | uint256 | The ID of the token receiving the property | -| key | string | The property key | -| value | address | The property value | +| collection | address | The address of the collection smart contract of the token receiving the attribute | +| tokenId | uint256 | The ID of the token receiving the attribute | +| key | string | The attribute key | +| value | address | The attribute value | | deadline | uint256 | The deadline timestamp for the presigned transaction after which the message is invalid | #### Returns @@ -392,13 +392,13 @@ Used to retrieve the message to be signed for submitting a presigned address pro |---|---|---| | _0 | bytes32 | Raw message to be signed by the authorized account | -### prepareMessageToPresignBoolProperty +### prepareMessageToPresignBoolAttribute ```solidity -function prepareMessageToPresignBoolProperty(address collection, uint256 tokenId, string key, bool value, uint256 deadline) external view returns (bytes32) +function prepareMessageToPresignBoolAttribute(address collection, uint256 tokenId, string key, bool value, uint256 deadline) external view returns (bytes32) ``` -Used to retrieve the message to be signed for submitting a presigned bool property change. +Used to retrieve the message to be signed for submitting a presigned bool attribute change. @@ -406,10 +406,10 @@ Used to retrieve the message to be signed for submitting a presigned bool proper | Name | Type | Description | |---|---|---| -| collection | address | The address of the collection smart contract of the token receiving the property | -| tokenId | uint256 | The ID of the token receiving the property | -| key | string | The property key | -| value | bool | The property value | +| collection | address | The address of the collection smart contract of the token receiving the attribute | +| tokenId | uint256 | The ID of the token receiving the attribute | +| key | string | The attribute key | +| value | bool | The attribute value | | deadline | uint256 | The deadline timestamp for the presigned transaction after which the message is invalid | #### Returns @@ -418,13 +418,13 @@ Used to retrieve the message to be signed for submitting a presigned bool proper |---|---|---| | _0 | bytes32 | Raw message to be signed by the authorized account | -### prepareMessageToPresignBytesProperty +### prepareMessageToPresignBytesAttribute ```solidity -function prepareMessageToPresignBytesProperty(address collection, uint256 tokenId, string key, bytes value, uint256 deadline) external view returns (bytes32) +function prepareMessageToPresignBytesAttribute(address collection, uint256 tokenId, string key, bytes value, uint256 deadline) external view returns (bytes32) ``` -Used to retrieve the message to be signed for submitting a presigned bytes property change. +Used to retrieve the message to be signed for submitting a presigned bytes attribute change. @@ -432,10 +432,10 @@ Used to retrieve the message to be signed for submitting a presigned bytes prope | Name | Type | Description | |---|---|---| -| collection | address | The address of the collection smart contract of the token receiving the property | -| tokenId | uint256 | The ID of the token receiving the property | -| key | string | The property key | -| value | bytes | The property value | +| collection | address | The address of the collection smart contract of the token receiving the attribute | +| tokenId | uint256 | The ID of the token receiving the attribute | +| key | string | The attribute key | +| value | bytes | The attribute value | | deadline | uint256 | The deadline timestamp for the presigned transaction after which the message is invalid | #### Returns @@ -444,13 +444,13 @@ Used to retrieve the message to be signed for submitting a presigned bytes prope |---|---|---| | _0 | bytes32 | Raw message to be signed by the authorized account | -### prepareMessageToPresignStringProperty +### prepareMessageToPresignStringAttribute ```solidity -function prepareMessageToPresignStringProperty(address collection, uint256 tokenId, string key, string value, uint256 deadline) external view returns (bytes32) +function prepareMessageToPresignStringAttribute(address collection, uint256 tokenId, string key, string value, uint256 deadline) external view returns (bytes32) ``` -Used to retrieve the message to be signed for submitting a presigned string property change. +Used to retrieve the message to be signed for submitting a presigned string attribute change. @@ -458,10 +458,10 @@ Used to retrieve the message to be signed for submitting a presigned string prop | Name | Type | Description | |---|---|---| -| collection | address | The address of the collection smart contract of the token receiving the property | -| tokenId | uint256 | The ID of the token receiving the property | -| key | string | The property key | -| value | string | The property value | +| collection | address | The address of the collection smart contract of the token receiving the attribute | +| tokenId | uint256 | The ID of the token receiving the attribute | +| key | string | The attribute key | +| value | string | The attribute value | | deadline | uint256 | The deadline timestamp for the presigned transaction after which the message is invalid | #### Returns @@ -470,13 +470,13 @@ Used to retrieve the message to be signed for submitting a presigned string prop |---|---|---| | _0 | bytes32 | Raw message to be signed by the authorized account | -### prepareMessageToPresignUintProperty +### prepareMessageToPresignUintAttribute ```solidity -function prepareMessageToPresignUintProperty(address collection, uint256 tokenId, string key, uint256 value, uint256 deadline) external view returns (bytes32) +function prepareMessageToPresignUintAttribute(address collection, uint256 tokenId, string key, uint256 value, uint256 deadline) external view returns (bytes32) ``` -Used to retrieve the message to be signed for submitting a presigned uint property change. +Used to retrieve the message to be signed for submitting a presigned uint attribute change. @@ -484,10 +484,10 @@ Used to retrieve the message to be signed for submitting a presigned uint proper | Name | Type | Description | |---|---|---| -| collection | address | The address of the collection smart contract of the token receiving the property | -| tokenId | uint256 | The ID of the token receiving the property | -| key | string | The property key | -| value | uint256 | The property value | +| collection | address | The address of the collection smart contract of the token receiving the attribute | +| tokenId | uint256 | The ID of the token receiving the attribute | +| key | string | The attribute key | +| value | uint256 | The attribute value | | deadline | uint256 | The deadline timestamp for the presigned transaction after which the message is invalid | #### Returns @@ -496,121 +496,121 @@ Used to retrieve the message to be signed for submitting a presigned uint proper |---|---|---| | _0 | bytes32 | Raw message to be signed by the authorized account | -### presignedSetAddressProperty +### presignedSetAddressAttribute ```solidity -function presignedSetAddressProperty(address setter, address collection, uint256 tokenId, string key, address value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external nonpayable +function presignedSetAddressAttribute(address setter, address collection, uint256 tokenId, string key, address value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external nonpayable ``` -Used to set the address property on behalf of an authorized account. +Used to set the address attribute on behalf of an authorized account. -*Emits a {AddressPropertyUpdated} event.* +*Emits a {AddressAttributeUpdated} event.* #### Parameters | Name | Type | Description | |---|---|---| -| setter | address | Address of the account that presigned the property change | -| collection | address | Address of the collection receiving the property | -| tokenId | uint256 | The ID of the token receiving the property | -| key | string | The property key | -| value | address | The property value | +| setter | address | Address of the account that presigned the attribute change | +| collection | address | Address of the collection receiving the attribute | +| tokenId | uint256 | The ID of the token receiving the attribute | +| key | string | The attribute key | +| value | address | The attribute value | | deadline | uint256 | The deadline timestamp for the presigned transaction | | v | uint8 | `v` value of an ECDSA signature of the presigned message | | r | bytes32 | `r` value of an ECDSA signature of the presigned message | | s | bytes32 | `s` value of an ECDSA signature of the presigned message | -### presignedSetBoolProperty +### presignedSetBoolAttribute ```solidity -function presignedSetBoolProperty(address setter, address collection, uint256 tokenId, string key, bool value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external nonpayable +function presignedSetBoolAttribute(address setter, address collection, uint256 tokenId, string key, bool value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external nonpayable ``` -Used to set the bool property on behalf of an authorized account. +Used to set the bool attribute on behalf of an authorized account. -*Emits a {BoolPropertyUpdated} event.* +*Emits a {BoolAttributeUpdated} event.* #### Parameters | Name | Type | Description | |---|---|---| -| setter | address | Address of the account that presigned the property change | -| collection | address | Address of the collection receiving the property | -| tokenId | uint256 | The ID of the token receiving the property | -| key | string | The property key | -| value | bool | The property value | +| setter | address | Address of the account that presigned the attribute change | +| collection | address | Address of the collection receiving the attribute | +| tokenId | uint256 | The ID of the token receiving the attribute | +| key | string | The attribute key | +| value | bool | The attribute value | | deadline | uint256 | The deadline timestamp for the presigned transaction | | v | uint8 | `v` value of an ECDSA signature of the presigned message | | r | bytes32 | `r` value of an ECDSA signature of the presigned message | | s | bytes32 | `s` value of an ECDSA signature of the presigned message | -### presignedSetBytesProperty +### presignedSetBytesAttribute ```solidity -function presignedSetBytesProperty(address setter, address collection, uint256 tokenId, string key, bytes value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external nonpayable +function presignedSetBytesAttribute(address setter, address collection, uint256 tokenId, string key, bytes value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external nonpayable ``` -Used to set the bytes property on behalf of an authorized account. +Used to set the bytes attribute on behalf of an authorized account. -*Emits a {BytesPropertyUpdated} event.* +*Emits a {BytesAttributeUpdated} event.* #### Parameters | Name | Type | Description | |---|---|---| -| setter | address | Address of the account that presigned the property change | -| collection | address | Address of the collection receiving the property | -| tokenId | uint256 | The ID of the token receiving the property | -| key | string | The property key | -| value | bytes | The property value | +| setter | address | Address of the account that presigned the attribute change | +| collection | address | Address of the collection receiving the attribute | +| tokenId | uint256 | The ID of the token receiving the attribute | +| key | string | The attribute key | +| value | bytes | The attribute value | | deadline | uint256 | The deadline timestamp for the presigned transaction | | v | uint8 | `v` value of an ECDSA signature of the presigned message | | r | bytes32 | `r` value of an ECDSA signature of the presigned message | | s | bytes32 | `s` value of an ECDSA signature of the presigned message | -### presignedSetStringProperty +### presignedSetStringAttribute ```solidity -function presignedSetStringProperty(address setter, address collection, uint256 tokenId, string key, string value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external nonpayable +function presignedSetStringAttribute(address setter, address collection, uint256 tokenId, string key, string value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external nonpayable ``` -Used to set the string property on behalf of an authorized account. +Used to set the string attribute on behalf of an authorized account. -*Emits a {StringPropertyUpdated} event.* +*Emits a {StringAttributeUpdated} event.* #### Parameters | Name | Type | Description | |---|---|---| -| setter | address | Address of the account that presigned the property change | -| collection | address | Address of the collection receiving the property | -| tokenId | uint256 | The ID of the token receiving the property | -| key | string | The property key | -| value | string | The property value | +| setter | address | Address of the account that presigned the attribute change | +| collection | address | Address of the collection receiving the attribute | +| tokenId | uint256 | The ID of the token receiving the attribute | +| key | string | The attribute key | +| value | string | The attribute value | | deadline | uint256 | The deadline timestamp for the presigned transaction | | v | uint8 | `v` value of an ECDSA signature of the presigned message | | r | bytes32 | `r` value of an ECDSA signature of the presigned message | | s | bytes32 | `s` value of an ECDSA signature of the presigned message | -### presignedSetUintProperty +### presignedSetUintAttribute ```solidity -function presignedSetUintProperty(address setter, address collection, uint256 tokenId, string key, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external nonpayable +function presignedSetUintAttribute(address setter, address collection, uint256 tokenId, string key, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external nonpayable ``` -Used to set the uint property on behalf of an authorized account. +Used to set the uint attribute on behalf of an authorized account. -*Emits a {UintPropertyUpdated} event.* +*Emits a {UintAttributeUpdated} event.* #### Parameters | Name | Type | Description | |---|---|---| -| setter | address | Address of the account that presigned the property change | -| collection | address | Address of the collection receiving the property | -| tokenId | uint256 | The ID of the token receiving the property | -| key | string | The property key | -| value | uint256 | The property value | +| setter | address | Address of the account that presigned the attribute change | +| collection | address | Address of the collection receiving the attribute | +| tokenId | uint256 | The ID of the token receiving the attribute | +| key | string | The attribute key | +| value | uint256 | The attribute value | | deadline | uint256 | The deadline timestamp for the presigned transaction | | v | uint8 | `v` value of an ECDSA signature of the presigned message | | r | bytes32 | `r` value of an ECDSA signature of the presigned message | @@ -622,7 +622,7 @@ Used to set the uint property on behalf of an authorized account. function registerAccessControl(address collection, address issuer, bool useOwnable) external nonpayable ``` -Used to register a collection to use the RMRK token properties repository. +Used to register a collection to use the RMRK token attributes repository. *If the collection does not implement the Ownable interface, the `useOwnable` value must be set to `false`.Emits an {AccessControlRegistration} event.* @@ -630,51 +630,33 @@ Used to register a collection to use the RMRK token properties repository. | Name | Type | Description | |---|---|---| -| collection | address | The address of the collection that will use the RMRK token properties repository. | +| collection | address | The address of the collection that will use the RMRK token attributes repository. | | issuer | address | The address of the issuer of the collection. | | useOwnable | bool | The boolean value to indicate if the collection implements the Ownable interface and whether it should be used to validate that the caller is the issuer (`true`) or to use the manually set issuer address (`false`). | -### setAddressProperties +### setAddressAttribute ```solidity -function setAddressProperties(address collection, uint256 tokenId, IRMRKTokenPropertiesRepository.AddressProperty[] properties) external nonpayable +function setAddressAttribute(address collection, uint256 tokenId, string key, address value) external nonpayable ``` +Used to set an address attribute. - - +*Emits a {AddressAttributeUpdated} event.* #### Parameters | Name | Type | Description | |---|---|---| -| collection | address | undefined | -| tokenId | uint256 | undefined | -| properties | IRMRKTokenPropertiesRepository.AddressProperty[] | undefined | - -### setAddressProperty - -```solidity -function setAddressProperty(address collection, uint256 tokenId, string key, address value) external nonpayable -``` - -Used to set an address property. - -*Emits a {AddressPropertyUpdated} event.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| collection | address | Address of the collection receiving the property | +| collection | address | Address of the collection receiving the attribute | | tokenId | uint256 | The token ID | -| key | string | The property key | -| value | address | The property value | +| key | string | The attribute key | +| value | address | The attribute value | -### setBoolProperties +### setAddressAttributes ```solidity -function setBoolProperties(address collection, uint256 tokenId, IRMRKTokenPropertiesRepository.BoolProperty[] properties) external nonpayable +function setAddressAttributes(address collection, uint256 tokenId, IERC7508.AddressAttribute[] attributes) external nonpayable ``` @@ -687,31 +669,31 @@ function setBoolProperties(address collection, uint256 tokenId, IRMRKTokenProper |---|---|---| | collection | address | undefined | | tokenId | uint256 | undefined | -| properties | IRMRKTokenPropertiesRepository.BoolProperty[] | undefined | +| attributes | IERC7508.AddressAttribute[] | undefined | -### setBoolProperty +### setBoolAttribute ```solidity -function setBoolProperty(address collection, uint256 tokenId, string key, bool value) external nonpayable +function setBoolAttribute(address collection, uint256 tokenId, string key, bool value) external nonpayable ``` -Used to set a boolean property. +Used to set a boolean attribute. -*Emits a {BoolPropertyUpdated} event.* +*Emits a {BoolAttributeUpdated} event.* #### Parameters | Name | Type | Description | |---|---|---| -| collection | address | Address of the collection receiving the property | +| collection | address | Address of the collection receiving the attribute | | tokenId | uint256 | The token ID | -| key | string | The property key | -| value | bool | The property value | +| key | string | The attribute key | +| value | bool | The attribute value | -### setBytesProperties +### setBoolAttributes ```solidity -function setBytesProperties(address collection, uint256 tokenId, IRMRKTokenPropertiesRepository.BytesProperty[] properties) external nonpayable +function setBoolAttributes(address collection, uint256 tokenId, IERC7508.BoolAttribute[] attributes) external nonpayable ``` @@ -724,31 +706,31 @@ function setBytesProperties(address collection, uint256 tokenId, IRMRKTokenPrope |---|---|---| | collection | address | undefined | | tokenId | uint256 | undefined | -| properties | IRMRKTokenPropertiesRepository.BytesProperty[] | undefined | +| attributes | IERC7508.BoolAttribute[] | undefined | -### setBytesProperty +### setBytesAttribute ```solidity -function setBytesProperty(address collection, uint256 tokenId, string key, bytes value) external nonpayable +function setBytesAttribute(address collection, uint256 tokenId, string key, bytes value) external nonpayable ``` -Used to set an bytes property. +Used to set an bytes attribute. -*Emits a {BytesPropertyUpdated} event.* +*Emits a {BytesAttributeUpdated} event.* #### Parameters | Name | Type | Description | |---|---|---| -| collection | address | Address of the collection receiving the property | +| collection | address | Address of the collection receiving the attribute | | tokenId | uint256 | The token ID | -| key | string | The property key | -| value | bytes | The property value | +| key | string | The attribute key | +| value | bytes | The attribute value | -### setStringProperties +### setBytesAttributes ```solidity -function setStringProperties(address collection, uint256 tokenId, IRMRKTokenPropertiesRepository.StringProperty[] properties) external nonpayable +function setBytesAttributes(address collection, uint256 tokenId, IERC7508.BytesAttribute[] attributes) external nonpayable ``` @@ -761,31 +743,31 @@ function setStringProperties(address collection, uint256 tokenId, IRMRKTokenProp |---|---|---| | collection | address | undefined | | tokenId | uint256 | undefined | -| properties | IRMRKTokenPropertiesRepository.StringProperty[] | undefined | +| attributes | IERC7508.BytesAttribute[] | undefined | -### setStringProperty +### setStringAttribute ```solidity -function setStringProperty(address collection, uint256 tokenId, string key, string value) external nonpayable +function setStringAttribute(address collection, uint256 tokenId, string key, string value) external nonpayable ``` -Used to set a string property. +Used to set a string attribute. -*Emits a {StringPropertyUpdated} event.* +*Emits a {StringAttributeUpdated} event.* #### Parameters | Name | Type | Description | |---|---|---| -| collection | address | Address of the collection receiving the property | +| collection | address | Address of the collection receiving the attribute | | tokenId | uint256 | The token ID | -| key | string | The property key | -| value | string | The property value | +| key | string | The attribute key | +| value | string | The attribute value | -### setTokenProperties +### setStringAttributes ```solidity -function setTokenProperties(address collection, uint256 tokenId, IRMRKTokenPropertiesRepository.StringProperty[] stringProperties, IRMRKTokenPropertiesRepository.UintProperty[] uintProperties, IRMRKTokenPropertiesRepository.BoolProperty[] boolProperties, IRMRKTokenPropertiesRepository.AddressProperty[] addressProperties, IRMRKTokenPropertiesRepository.BytesProperty[] bytesProperties) external nonpayable +function setStringAttributes(address collection, uint256 tokenId, IERC7508.StringAttribute[] attributes) external nonpayable ``` @@ -798,16 +780,12 @@ function setTokenProperties(address collection, uint256 tokenId, IRMRKTokenPrope |---|---|---| | collection | address | undefined | | tokenId | uint256 | undefined | -| stringProperties | IRMRKTokenPropertiesRepository.StringProperty[] | undefined | -| uintProperties | IRMRKTokenPropertiesRepository.UintProperty[] | undefined | -| boolProperties | IRMRKTokenPropertiesRepository.BoolProperty[] | undefined | -| addressProperties | IRMRKTokenPropertiesRepository.AddressProperty[] | undefined | -| bytesProperties | IRMRKTokenPropertiesRepository.BytesProperty[] | undefined | +| attributes | IERC7508.StringAttribute[] | undefined | -### setUintProperties +### setTokenAttributes ```solidity -function setUintProperties(address collection, uint256 tokenId, IRMRKTokenPropertiesRepository.UintProperty[] properties) external nonpayable +function setTokenAttributes(address collection, uint256 tokenId, IERC7508.StringAttribute[] stringAttributes, IERC7508.UintAttribute[] uintAttributes, IERC7508.BoolAttribute[] boolAttributes, IERC7508.AddressAttribute[] addressAttributes, IERC7508.BytesAttribute[] bytesAttributes) external nonpayable ``` @@ -820,26 +798,48 @@ function setUintProperties(address collection, uint256 tokenId, IRMRKTokenProper |---|---|---| | collection | address | undefined | | tokenId | uint256 | undefined | -| properties | IRMRKTokenPropertiesRepository.UintProperty[] | undefined | +| stringAttributes | IERC7508.StringAttribute[] | undefined | +| uintAttributes | IERC7508.UintAttribute[] | undefined | +| boolAttributes | IERC7508.BoolAttribute[] | undefined | +| addressAttributes | IERC7508.AddressAttribute[] | undefined | +| bytesAttributes | IERC7508.BytesAttribute[] | undefined | -### setUintProperty +### setUintAttribute ```solidity -function setUintProperty(address collection, uint256 tokenId, string key, uint256 value) external nonpayable +function setUintAttribute(address collection, uint256 tokenId, string key, uint256 value) external nonpayable ``` -Used to set a number property. +Used to set a number attribute. -*Emits a {UintPropertyUpdated} event.* +*Emits a {UintAttributeUpdated} event.* #### Parameters | Name | Type | Description | |---|---|---| -| collection | address | Address of the collection receiving the property | +| collection | address | Address of the collection receiving the attribute | | tokenId | uint256 | The token ID | -| key | string | The property key | -| value | uint256 | The property value | +| key | string | The attribute key | +| value | uint256 | The attribute value | + +### setUintAttributes + +```solidity +function setUintAttributes(address collection, uint256 tokenId, IERC7508.UintAttribute[] attributes) external nonpayable +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| collection | address | undefined | +| tokenId | uint256 | undefined | +| attributes | IERC7508.UintAttribute[] | undefined | ### supportsInterface @@ -889,7 +889,7 @@ Used to notify listeners that a new collection has been registered to use the re ### AccessControlUpdate ```solidity -event AccessControlUpdate(address indexed collection, string key, enum IRMRKTokenPropertiesRepository.AccessType accessType, address specificAddress) +event AccessControlUpdate(address indexed collection, string key, enum IERC7508.AccessType accessType, address specificAddress) ``` Used to notify listeners that the access control settings for a specific parameter have been updated. @@ -902,16 +902,16 @@ Used to notify listeners that the access control settings for a specific paramet |---|---|---| | collection `indexed` | address | Address of the collection | | key | string | The name of the parameter for which the access control settings have been updated | -| accessType | enum IRMRKTokenPropertiesRepository.AccessType | The AccessType of the parameter for which the access control settings have been updated | +| accessType | enum IERC7508.AccessType | The AccessType of the parameter for which the access control settings have been updated | | specificAddress | address | The specific addresses that has been updated | -### AddressPropertyUpdated +### AddressAttributeUpdated ```solidity -event AddressPropertyUpdated(address indexed collection, uint256 indexed tokenId, string key, address value) +event AddressAttributeUpdated(address indexed collection, uint256 indexed tokenId, string key, address value) ``` -Used to notify listeners that an address property has been updated. +Used to notify listeners that an address attribute has been updated. @@ -921,16 +921,16 @@ Used to notify listeners that an address property has been updated. |---|---|---| | collection `indexed` | address | The collection address | | tokenId `indexed` | uint256 | The token ID | -| key | string | The key of the property | -| value | address | The new value of the property | +| key | string | The key of the attribute | +| value | address | The new value of the attribute | -### BoolPropertyUpdated +### BoolAttributeUpdated ```solidity -event BoolPropertyUpdated(address indexed collection, uint256 indexed tokenId, string key, bool value) +event BoolAttributeUpdated(address indexed collection, uint256 indexed tokenId, string key, bool value) ``` -Used to notify listeners that a boolean property has been updated. +Used to notify listeners that a boolean attribute has been updated. @@ -940,16 +940,16 @@ Used to notify listeners that a boolean property has been updated. |---|---|---| | collection `indexed` | address | The collection address | | tokenId `indexed` | uint256 | The token ID | -| key | string | The key of the property | -| value | bool | The new value of the property | +| key | string | The key of the attribute | +| value | bool | The new value of the attribute | -### BytesPropertyUpdated +### BytesAttributeUpdated ```solidity -event BytesPropertyUpdated(address indexed collection, uint256 indexed tokenId, string key, bytes value) +event BytesAttributeUpdated(address indexed collection, uint256 indexed tokenId, string key, bytes value) ``` -Used to notify listeners that a bytes property has been updated. +Used to notify listeners that a bytes attribute has been updated. @@ -959,8 +959,8 @@ Used to notify listeners that a bytes property has been updated. |---|---|---| | collection `indexed` | address | The collection address | | tokenId `indexed` | uint256 | The token ID | -| key | string | The key of the property | -| value | bytes | The new value of the property | +| key | string | The key of the attribute | +| value | bytes | The new value of the attribute | ### CollaboratorUpdate @@ -980,13 +980,13 @@ Used to notify listeners that a new collaborator has been added or removed. | collaborator `indexed` | address | Address of the collaborator | | isCollaborator | bool | A boolean value indicating whether the collaborator has been added (`true`) or removed (`false`) | -### StringPropertyUpdated +### StringAttributeUpdated ```solidity -event StringPropertyUpdated(address indexed collection, uint256 indexed tokenId, string key, string value) +event StringAttributeUpdated(address indexed collection, uint256 indexed tokenId, string key, string value) ``` -Used to notify listeners that a string property has been updated. +Used to notify listeners that a string attribute has been updated. @@ -996,16 +996,16 @@ Used to notify listeners that a string property has been updated. |---|---|---| | collection `indexed` | address | The collection address | | tokenId `indexed` | uint256 | The token ID | -| key | string | The key of the property | -| value | string | The new value of the property | +| key | string | The key of the attribute | +| value | string | The new value of the attribute | -### UintPropertyUpdated +### UintAttributeUpdated ```solidity -event UintPropertyUpdated(address indexed collection, uint256 indexed tokenId, string key, uint256 value) +event UintAttributeUpdated(address indexed collection, uint256 indexed tokenId, string key, uint256 value) ``` -Used to notify listeners that an uint property has been updated. +Used to notify listeners that an uint attribute has been updated. @@ -1015,8 +1015,8 @@ Used to notify listeners that an uint property has been updated. |---|---|---| | collection `indexed` | address | The collection address | | tokenId `indexed` | uint256 | The token ID | -| key | string | The key of the property | -| value | uint256 | The new value of the property | +| key | string | The key of the attribute | +| value | uint256 | The new value of the attribute | diff --git a/docs/RMRK/extension/tokenProperties/RMRKTokenAttributesRepository.md b/docs/RMRK/extension/tokenProperties/RMRKTokenAttributesRepository.md new file mode 100644 index 00000000..9859100e --- /dev/null +++ b/docs/RMRK/extension/tokenProperties/RMRKTokenAttributesRepository.md @@ -0,0 +1,1248 @@ +# RMRKTokenAttributesRepository + +*RMRK team* + +> RMRKTokenAttributesRepository + +Smart contract of the RMRK Token property repository module. + + + +## Methods + +### DOMAIN_SEPARATOR + +```solidity +function DOMAIN_SEPARATOR() external view returns (bytes32) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bytes32 | undefined | + +### SET_ADDRESS_ATTRIBUTE_TYPEHASH + +```solidity +function SET_ADDRESS_ATTRIBUTE_TYPEHASH() external view returns (bytes32) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bytes32 | undefined | + +### SET_BOOL_ATTRIBUTE_TYPEHASH + +```solidity +function SET_BOOL_ATTRIBUTE_TYPEHASH() external view returns (bytes32) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bytes32 | undefined | + +### SET_BYTES_ATTRIBUTE_TYPEHASH + +```solidity +function SET_BYTES_ATTRIBUTE_TYPEHASH() external view returns (bytes32) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bytes32 | undefined | + +### SET_STRING_ATTRIBUTE_TYPEHASH + +```solidity +function SET_STRING_ATTRIBUTE_TYPEHASH() external view returns (bytes32) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bytes32 | undefined | + +### SET_UINT_ATTRIBUTE_TYPEHASH + +```solidity +function SET_UINT_ATTRIBUTE_TYPEHASH() external view returns (bytes32) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bytes32 | undefined | + +### getAddressTokenAttribute + +```solidity +function getAddressTokenAttribute(address collection, uint256 tokenId, string key) external view returns (address) +``` + +Used to retrieve the address type token attributes. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| collection | address | The collection address | +| tokenId | uint256 | The token ID | +| key | string | The key of the attribute | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | address | The value of the address attribute | + +### getAddressTokenAttributes + +```solidity +function getAddressTokenAttributes(address collection, uint256 tokenId, string[] addressKeys) external view returns (struct IERC7508.AddressAttribute[]) +``` + +Used to get multiple address parameter values for a token. + +*The `AddressAttribute` struct contains the following fields: [ string key, address value ]* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| collection | address | Address of the collection the token belongs to | +| tokenId | uint256 | ID of the token for which the attributes are being retrieved | +| addressKeys | string[] | An array of address keys to retrieve | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | IERC7508.AddressAttribute[] | An array of `AddressAttribute` structs | + +### getBoolTokenAttribute + +```solidity +function getBoolTokenAttribute(address collection, uint256 tokenId, string key) external view returns (bool) +``` + +Used to retrieve the bool type token attributes. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| collection | address | The collection address | +| tokenId | uint256 | The token ID | +| key | string | The key of the attribute | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bool | The value of the bool attribute | + +### getBoolTokenAttributes + +```solidity +function getBoolTokenAttributes(address collection, uint256 tokenId, string[] boolKeys) external view returns (struct IERC7508.BoolAttribute[]) +``` + +Used to get multiple bool parameter values for a token. + +*The `BoolAttribute` struct contains the following fields: [ string key, bool value ]* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| collection | address | Address of the collection the token belongs to | +| tokenId | uint256 | ID of the token for which the attributes are being retrieved | +| boolKeys | string[] | An array of bool keys to retrieve | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | IERC7508.BoolAttribute[] | An array of `BoolAttribute` structs | + +### getBytesTokenAttribute + +```solidity +function getBytesTokenAttribute(address collection, uint256 tokenId, string key) external view returns (bytes) +``` + +Used to retrieve the bytes type token attributes. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| collection | address | The collection address | +| tokenId | uint256 | The token ID | +| key | string | The key of the attribute | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bytes | The value of the bytes attribute | + +### getBytesTokenAttributes + +```solidity +function getBytesTokenAttributes(address collection, uint256 tokenId, string[] bytesKeys) external view returns (struct IERC7508.BytesAttribute[]) +``` + +Used to get multiple bytes parameter values for a token. + +*The `BytesAttribute` struct contains the following fields: [ string key, bytes value ]* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| collection | address | Address of the collection the token belongs to | +| tokenId | uint256 | ID of the token for which the attributes are being retrieved | +| bytesKeys | string[] | An array of bytes keys to retrieve | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | IERC7508.BytesAttribute[] | An array of `BytesAttribute` structs | + +### getStringTokenAttribute + +```solidity +function getStringTokenAttribute(address collection, uint256 tokenId, string key) external view returns (string) +``` + +Used to retrieve the string type token attributes. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| collection | address | The collection address | +| tokenId | uint256 | The token ID | +| key | string | The key of the attribute | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | string | The value of the string attribute | + +### getStringTokenAttributes + +```solidity +function getStringTokenAttributes(address collection, uint256 tokenId, string[] stringKeys) external view returns (struct IERC7508.StringAttribute[]) +``` + +Used to get multiple sting parameter values for a token. + +*The `StringAttribute` struct contains the following fields: [ string key, string value ]* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| collection | address | Address of the collection the token belongs to | +| tokenId | uint256 | ID of the token for which the attributes are being retrieved | +| stringKeys | string[] | An array of string keys to retrieve | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | IERC7508.StringAttribute[] | An array of `StringAttribute` structs | + +### getTokenAttributes + +```solidity +function getTokenAttributes(address collection, uint256 tokenId, string[] stringKeys, string[] uintKeys, string[] boolKeys, string[] addressKeys, string[] bytesKeys) external view returns (struct IERC7508.StringAttribute[] stringAttributes, struct IERC7508.UintAttribute[] uintAttributes, struct IERC7508.BoolAttribute[] boolAttributes, struct IERC7508.AddressAttribute[] addressAttributes, struct IERC7508.BytesAttribute[] bytesAttributes) +``` + +Used to retrieve multiple token attributes of any type at once. + +*The `StringAttribute`, `UintAttribute`, `BoolAttribute`, `AddressAttribute` and `BytesAttribute` structs consists to the following fields (where `value` is of the appropriate type): [ key, value, ]* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| collection | address | The collection address | +| tokenId | uint256 | The token ID | +| stringKeys | string[] | An array of string type attribute keys to retrieve | +| uintKeys | string[] | An array of uint type attribute keys to retrieve | +| boolKeys | string[] | An array of bool type attribute keys to retrieve | +| addressKeys | string[] | An array of address type attribute keys to retrieve | +| bytesKeys | string[] | An array of bytes type attribute keys to retrieve | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| stringAttributes | IERC7508.StringAttribute[] | An array of `StringAttribute` structs containing the string type attributes | +| uintAttributes | IERC7508.UintAttribute[] | An array of `UintAttribute` structs containing the uint type attributes | +| boolAttributes | IERC7508.BoolAttribute[] | An array of `BoolAttribute` structs containing the bool type attributes | +| addressAttributes | IERC7508.AddressAttribute[] | An array of `AddressAttribute` structs containing the address type attributes | +| bytesAttributes | IERC7508.BytesAttribute[] | An array of `BytesAttribute` structs containing the bytes type attributes | + +### getUintTokenAttribute + +```solidity +function getUintTokenAttribute(address collection, uint256 tokenId, string key) external view returns (uint256) +``` + +Used to retrieve the uint type token attributes. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| collection | address | The collection address | +| tokenId | uint256 | The token ID | +| key | string | The key of the attribute | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | The value of the uint attribute | + +### getUintTokenAttributes + +```solidity +function getUintTokenAttributes(address collection, uint256 tokenId, string[] uintKeys) external view returns (struct IERC7508.UintAttribute[]) +``` + +Used to get multiple uint parameter values for a token. + +*The `UintAttribute` struct contains the following fields: [ string key, uint value ]* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| collection | address | Address of the collection the token belongs to | +| tokenId | uint256 | ID of the token for which the attributes are being retrieved | +| uintKeys | string[] | An array of uint keys to retrieve | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | IERC7508.UintAttribute[] | An array of `UintAttribute` structs | + +### isCollaborator + +```solidity +function isCollaborator(address collaborator, address collection) external view returns (bool) +``` + +Used to check if the specified address is listed as a collaborator of the given collection's parameter. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| collaborator | address | Address to be checked. | +| collection | address | Address of the collection. | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bool | Boolean value indicating if the address is a collaborator of the given collection's (`true`) or not (`false`). | + +### isSpecificAddress + +```solidity +function isSpecificAddress(address specificAddress, address collection, string key) external view returns (bool) +``` + +Used to check if the specified address is listed as a specific address of the given collection's parameter. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| specificAddress | address | Address to be checked. | +| collection | address | Address of the collection. | +| key | string | The key of the attribute | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bool | Boolean value indicating if the address is a specific address of the given collection's parameter (`true`) or not (`false`). | + +### manageAccessControl + +```solidity +function manageAccessControl(address collection, string key, enum IERC7508.AccessType accessType, address specificAddress) external nonpayable +``` + +Used to manage the access control settings for a specific parameter. + +*Only the `issuer` of the collection can call this function.The possible `accessType` values are: [ Issuer, Collaborator, IssuerOrCollaborator, TokenOwner, SpecificAddress, ]Emits an {AccessControlUpdated} event.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| collection | address | The address of the collection being managed. | +| key | string | The key of the attribute | +| accessType | enum IERC7508.AccessType | The type of access control to be applied to the parameter. | +| specificAddress | address | The address to be added as a specific addresses allowed to manage the given parameter. | + +### manageCollaborators + +```solidity +function manageCollaborators(address collection, address[] collaboratorAddresses, bool[] collaboratorAddressAccess) external nonpayable +``` + +Used to manage the collaborators of a collection. + +*The `collaboratorAddresses` and `collaboratorAddressAccess` arrays must be of the same length.Emits a {CollaboratorUpdate} event.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| collection | address | The address of the collection | +| collaboratorAddresses | address[] | The array of collaborator addresses being managed | +| collaboratorAddressAccess | bool[] | The array of boolean values indicating if the collaborator address should receive the permission (`true`) or not (`false`). | + +### prepareMessageToPresignAddressAttribute + +```solidity +function prepareMessageToPresignAddressAttribute(address collection, uint256 tokenId, string key, address value, uint256 deadline) external view returns (bytes32) +``` + +Used to retrieve the message to be signed for submitting a presigned address attribute change. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| collection | address | The address of the collection smart contract of the token receiving the attribute | +| tokenId | uint256 | The ID of the token receiving the attribute | +| key | string | The attribute key | +| value | address | The attribute value | +| deadline | uint256 | The deadline timestamp for the presigned transaction after which the message is invalid | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bytes32 | Raw message to be signed by the authorized account | + +### prepareMessageToPresignBoolAttribute + +```solidity +function prepareMessageToPresignBoolAttribute(address collection, uint256 tokenId, string key, bool value, uint256 deadline) external view returns (bytes32) +``` + +Used to retrieve the message to be signed for submitting a presigned bool attribute change. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| collection | address | The address of the collection smart contract of the token receiving the attribute | +| tokenId | uint256 | The ID of the token receiving the attribute | +| key | string | The attribute key | +| value | bool | The attribute value | +| deadline | uint256 | The deadline timestamp for the presigned transaction after which the message is invalid | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bytes32 | Raw message to be signed by the authorized account | + +### prepareMessageToPresignBytesAttribute + +```solidity +function prepareMessageToPresignBytesAttribute(address collection, uint256 tokenId, string key, bytes value, uint256 deadline) external view returns (bytes32) +``` + +Used to retrieve the message to be signed for submitting a presigned bytes attribute change. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| collection | address | The address of the collection smart contract of the token receiving the attribute | +| tokenId | uint256 | The ID of the token receiving the attribute | +| key | string | The attribute key | +| value | bytes | The attribute value | +| deadline | uint256 | The deadline timestamp for the presigned transaction after which the message is invalid | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bytes32 | Raw message to be signed by the authorized account | + +### prepareMessageToPresignStringAttribute + +```solidity +function prepareMessageToPresignStringAttribute(address collection, uint256 tokenId, string key, string value, uint256 deadline) external view returns (bytes32) +``` + +Used to retrieve the message to be signed for submitting a presigned string attribute change. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| collection | address | The address of the collection smart contract of the token receiving the attribute | +| tokenId | uint256 | The ID of the token receiving the attribute | +| key | string | The attribute key | +| value | string | The attribute value | +| deadline | uint256 | The deadline timestamp for the presigned transaction after which the message is invalid | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bytes32 | Raw message to be signed by the authorized account | + +### prepareMessageToPresignUintAttribute + +```solidity +function prepareMessageToPresignUintAttribute(address collection, uint256 tokenId, string key, uint256 value, uint256 deadline) external view returns (bytes32) +``` + +Used to retrieve the message to be signed for submitting a presigned uint attribute change. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| collection | address | The address of the collection smart contract of the token receiving the attribute | +| tokenId | uint256 | The ID of the token receiving the attribute | +| key | string | The attribute key | +| value | uint256 | The attribute value | +| deadline | uint256 | The deadline timestamp for the presigned transaction after which the message is invalid | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bytes32 | Raw message to be signed by the authorized account | + +### presignedSetAddressAttribute + +```solidity +function presignedSetAddressAttribute(address setter, address collection, uint256 tokenId, string key, address value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external nonpayable +``` + +Used to set the address attribute on behalf of an authorized account. + +*Emits a {AddressAttributeUpdated} event.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| setter | address | Address of the account that presigned the attribute change | +| collection | address | Address of the collection receiving the attribute | +| tokenId | uint256 | The ID of the token receiving the attribute | +| key | string | The attribute key | +| value | address | The attribute value | +| deadline | uint256 | The deadline timestamp for the presigned transaction | +| v | uint8 | `v` value of an ECDSA signature of the presigned message | +| r | bytes32 | `r` value of an ECDSA signature of the presigned message | +| s | bytes32 | `s` value of an ECDSA signature of the presigned message | + +### presignedSetBoolAttribute + +```solidity +function presignedSetBoolAttribute(address setter, address collection, uint256 tokenId, string key, bool value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external nonpayable +``` + +Used to set the bool attribute on behalf of an authorized account. + +*Emits a {BoolAttributeUpdated} event.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| setter | address | Address of the account that presigned the attribute change | +| collection | address | Address of the collection receiving the attribute | +| tokenId | uint256 | The ID of the token receiving the attribute | +| key | string | The attribute key | +| value | bool | The attribute value | +| deadline | uint256 | The deadline timestamp for the presigned transaction | +| v | uint8 | `v` value of an ECDSA signature of the presigned message | +| r | bytes32 | `r` value of an ECDSA signature of the presigned message | +| s | bytes32 | `s` value of an ECDSA signature of the presigned message | + +### presignedSetBytesAttribute + +```solidity +function presignedSetBytesAttribute(address setter, address collection, uint256 tokenId, string key, bytes value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external nonpayable +``` + +Used to set the bytes attribute on behalf of an authorized account. + +*Emits a {BytesAttributeUpdated} event.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| setter | address | Address of the account that presigned the attribute change | +| collection | address | Address of the collection receiving the attribute | +| tokenId | uint256 | The ID of the token receiving the attribute | +| key | string | The attribute key | +| value | bytes | The attribute value | +| deadline | uint256 | The deadline timestamp for the presigned transaction | +| v | uint8 | `v` value of an ECDSA signature of the presigned message | +| r | bytes32 | `r` value of an ECDSA signature of the presigned message | +| s | bytes32 | `s` value of an ECDSA signature of the presigned message | + +### presignedSetStringAttribute + +```solidity +function presignedSetStringAttribute(address setter, address collection, uint256 tokenId, string key, string value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external nonpayable +``` + +Used to set the string attribute on behalf of an authorized account. + +*Emits a {StringAttributeUpdated} event.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| setter | address | Address of the account that presigned the attribute change | +| collection | address | Address of the collection receiving the attribute | +| tokenId | uint256 | The ID of the token receiving the attribute | +| key | string | The attribute key | +| value | string | The attribute value | +| deadline | uint256 | The deadline timestamp for the presigned transaction | +| v | uint8 | `v` value of an ECDSA signature of the presigned message | +| r | bytes32 | `r` value of an ECDSA signature of the presigned message | +| s | bytes32 | `s` value of an ECDSA signature of the presigned message | + +### presignedSetUintAttribute + +```solidity +function presignedSetUintAttribute(address setter, address collection, uint256 tokenId, string key, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external nonpayable +``` + +Used to set the uint attribute on behalf of an authorized account. + +*Emits a {UintAttributeUpdated} event.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| setter | address | Address of the account that presigned the attribute change | +| collection | address | Address of the collection receiving the attribute | +| tokenId | uint256 | The ID of the token receiving the attribute | +| key | string | The attribute key | +| value | uint256 | The attribute value | +| deadline | uint256 | The deadline timestamp for the presigned transaction | +| v | uint8 | `v` value of an ECDSA signature of the presigned message | +| r | bytes32 | `r` value of an ECDSA signature of the presigned message | +| s | bytes32 | `s` value of an ECDSA signature of the presigned message | + +### registerAccessControl + +```solidity +function registerAccessControl(address collection, address issuer, bool useOwnable) external nonpayable +``` + +Used to register a collection to use the RMRK token attributes repository. + +*If the collection does not implement the Ownable interface, the `useOwnable` value must be set to `false`.Emits an {AccessControlRegistration} event.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| collection | address | The address of the collection that will use the RMRK token attributes repository. | +| issuer | address | The address of the issuer of the collection. | +| useOwnable | bool | The boolean value to indicate if the collection implements the Ownable interface and whether it should be used to validate that the caller is the issuer (`true`) or to use the manually set issuer address (`false`). | + +### setAddressAttribute + +```solidity +function setAddressAttribute(address collection, uint256 tokenId, string key, address value) external nonpayable +``` + +Used to set an address attribute. + +*Emits a {AddressAttributeUpdated} event.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| collection | address | Address of the collection receiving the attribute | +| tokenId | uint256 | The token ID | +| key | string | The attribute key | +| value | address | The attribute value | + +### setAddressAttributes + +```solidity +function setAddressAttributes(address collection, uint256 tokenId, IERC7508.AddressAttribute[] attributes) external nonpayable +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| collection | address | undefined | +| tokenId | uint256 | undefined | +| attributes | IERC7508.AddressAttribute[] | undefined | + +### setBoolAttribute + +```solidity +function setBoolAttribute(address collection, uint256 tokenId, string key, bool value) external nonpayable +``` + +Used to set a boolean attribute. + +*Emits a {BoolAttributeUpdated} event.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| collection | address | Address of the collection receiving the attribute | +| tokenId | uint256 | The token ID | +| key | string | The attribute key | +| value | bool | The attribute value | + +### setBoolAttributes + +```solidity +function setBoolAttributes(address collection, uint256 tokenId, IERC7508.BoolAttribute[] attributes) external nonpayable +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| collection | address | undefined | +| tokenId | uint256 | undefined | +| attributes | IERC7508.BoolAttribute[] | undefined | + +### setBytesAttribute + +```solidity +function setBytesAttribute(address collection, uint256 tokenId, string key, bytes value) external nonpayable +``` + +Used to set an bytes attribute. + +*Emits a {BytesAttributeUpdated} event.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| collection | address | Address of the collection receiving the attribute | +| tokenId | uint256 | The token ID | +| key | string | The attribute key | +| value | bytes | The attribute value | + +### setBytesAttributes + +```solidity +function setBytesAttributes(address collection, uint256 tokenId, IERC7508.BytesAttribute[] attributes) external nonpayable +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| collection | address | undefined | +| tokenId | uint256 | undefined | +| attributes | IERC7508.BytesAttribute[] | undefined | + +### setStringAttribute + +```solidity +function setStringAttribute(address collection, uint256 tokenId, string key, string value) external nonpayable +``` + +Used to set a string attribute. + +*Emits a {StringAttributeUpdated} event.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| collection | address | Address of the collection receiving the attribute | +| tokenId | uint256 | The token ID | +| key | string | The attribute key | +| value | string | The attribute value | + +### setStringAttributes + +```solidity +function setStringAttributes(address collection, uint256 tokenId, IERC7508.StringAttribute[] attributes) external nonpayable +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| collection | address | undefined | +| tokenId | uint256 | undefined | +| attributes | IERC7508.StringAttribute[] | undefined | + +### setTokenAttributes + +```solidity +function setTokenAttributes(address collection, uint256 tokenId, IERC7508.StringAttribute[] stringAttributes, IERC7508.UintAttribute[] uintAttributes, IERC7508.BoolAttribute[] boolAttributes, IERC7508.AddressAttribute[] addressAttributes, IERC7508.BytesAttribute[] bytesAttributes) external nonpayable +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| collection | address | undefined | +| tokenId | uint256 | undefined | +| stringAttributes | IERC7508.StringAttribute[] | undefined | +| uintAttributes | IERC7508.UintAttribute[] | undefined | +| boolAttributes | IERC7508.BoolAttribute[] | undefined | +| addressAttributes | IERC7508.AddressAttribute[] | undefined | +| bytesAttributes | IERC7508.BytesAttribute[] | undefined | + +### setUintAttribute + +```solidity +function setUintAttribute(address collection, uint256 tokenId, string key, uint256 value) external nonpayable +``` + +Used to set a number attribute. + +*Emits a {UintAttributeUpdated} event.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| collection | address | Address of the collection receiving the attribute | +| tokenId | uint256 | The token ID | +| key | string | The attribute key | +| value | uint256 | The attribute value | + +### setUintAttributes + +```solidity +function setUintAttributes(address collection, uint256 tokenId, IERC7508.UintAttribute[] attributes) external nonpayable +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| collection | address | undefined | +| tokenId | uint256 | undefined | +| attributes | IERC7508.UintAttribute[] | undefined | + +### supportsInterface + +```solidity +function supportsInterface(bytes4 interfaceId) external view returns (bool) +``` + + + +*Returns true if this contract implements the interface defined by `interfaceId`. See the corresponding https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] to learn more about how these ids are created. This function call must use less than 30 000 gas.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| interfaceId | bytes4 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bool | undefined | + + + +## Events + +### AccessControlRegistration + +```solidity +event AccessControlRegistration(address indexed collection, address indexed issuer, address indexed registeringAddress, bool useOwnable) +``` + +Used to notify listeners that a new collection has been registered to use the repository. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| collection `indexed` | address | Address of the collection | +| issuer `indexed` | address | Address of the issuer of the collection; the addess authorized to manage the access control | +| registeringAddress `indexed` | address | Address that registered the collection | +| useOwnable | bool | A boolean value indicating whether the collection uses the Ownable extension to verify the issuer (`true`) or not (`false`) | + +### AccessControlUpdate + +```solidity +event AccessControlUpdate(address indexed collection, string key, enum IERC7508.AccessType accessType, address specificAddress) +``` + +Used to notify listeners that the access control settings for a specific parameter have been updated. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| collection `indexed` | address | Address of the collection | +| key | string | The name of the parameter for which the access control settings have been updated | +| accessType | enum IERC7508.AccessType | The AccessType of the parameter for which the access control settings have been updated | +| specificAddress | address | The specific addresses that has been updated | + +### AddressAttributeUpdated + +```solidity +event AddressAttributeUpdated(address indexed collection, uint256 indexed tokenId, string key, address value) +``` + +Used to notify listeners that an address attribute has been updated. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| collection `indexed` | address | The collection address | +| tokenId `indexed` | uint256 | The token ID | +| key | string | The key of the attribute | +| value | address | The new value of the attribute | + +### BoolAttributeUpdated + +```solidity +event BoolAttributeUpdated(address indexed collection, uint256 indexed tokenId, string key, bool value) +``` + +Used to notify listeners that a boolean attribute has been updated. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| collection `indexed` | address | The collection address | +| tokenId `indexed` | uint256 | The token ID | +| key | string | The key of the attribute | +| value | bool | The new value of the attribute | + +### BytesAttributeUpdated + +```solidity +event BytesAttributeUpdated(address indexed collection, uint256 indexed tokenId, string key, bytes value) +``` + +Used to notify listeners that a bytes attribute has been updated. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| collection `indexed` | address | The collection address | +| tokenId `indexed` | uint256 | The token ID | +| key | string | The key of the attribute | +| value | bytes | The new value of the attribute | + +### CollaboratorUpdate + +```solidity +event CollaboratorUpdate(address indexed collection, address indexed collaborator, bool isCollaborator) +``` + +Used to notify listeners that a new collaborator has been added or removed. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| collection `indexed` | address | Address of the collection | +| collaborator `indexed` | address | Address of the collaborator | +| isCollaborator | bool | A boolean value indicating whether the collaborator has been added (`true`) or removed (`false`) | + +### StringAttributeUpdated + +```solidity +event StringAttributeUpdated(address indexed collection, uint256 indexed tokenId, string key, string value) +``` + +Used to notify listeners that a string attribute has been updated. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| collection `indexed` | address | The collection address | +| tokenId `indexed` | uint256 | The token ID | +| key | string | The key of the attribute | +| value | string | The new value of the attribute | + +### UintAttributeUpdated + +```solidity +event UintAttributeUpdated(address indexed collection, uint256 indexed tokenId, string key, uint256 value) +``` + +Used to notify listeners that an uint attribute has been updated. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| collection `indexed` | address | The collection address | +| tokenId `indexed` | uint256 | The token ID | +| key | string | The key of the attribute | +| value | uint256 | The new value of the attribute | + + + +## Errors + +### CollaboratorArraysNotEqualLength + +```solidity +error CollaboratorArraysNotEqualLength() +``` + +Used to signal that the collaborator and collaborator rights array are not of equal length. + + + + +### CollectionAlreadyRegistered + +```solidity +error CollectionAlreadyRegistered() +``` + +Used to signal that the collection is already registered in the repository. + + + + +### CollectionNotRegistered + +```solidity +error CollectionNotRegistered() +``` + +Used to signal that the collection is not registered in the repository yet. + + + + +### ExpiredDeadline + +```solidity +error ExpiredDeadline() +``` + +Used to signal that the presigned message's deadline has expired. + + + + +### InvalidSignature + +```solidity +error InvalidSignature() +``` + +Used to signal that the presigned message's signature is invalid. + + + + +### NotCollectionCollaborator + +```solidity +error NotCollectionCollaborator() +``` + +Used to signal that the caller is not aa collaborator of the collection. + + + + +### NotCollectionIssuer + +```solidity +error NotCollectionIssuer() +``` + +Used to signal that the caller is not the issuer of the collection. + + + + +### NotCollectionIssuerOrCollaborator + +```solidity +error NotCollectionIssuerOrCollaborator() +``` + +Used to signal that the caller is not the issuer or a collaborator of the collection. + + + + +### NotSpecificAddress + +```solidity +error NotSpecificAddress() +``` + +Used to signal that the caller is not the specific address allowed to manage the attribute. + + + + +### NotTokenOwner + +```solidity +error NotTokenOwner() +``` + +Used to signal that the caller is not the owner of the token. + + + + +### OwnableNotImplemented + +```solidity +error OwnableNotImplemented() +``` + +Used to signal that the smart contract interacting with the repository does not implement Ownable pattern. + + + + + diff --git a/docs/RMRK/extension/tokenProperties/RMRKTokenPropertiesRepository.md b/docs/RMRK/extension/tokenProperties/RMRKTokenPropertiesRepository.md deleted file mode 100644 index a028c2db..00000000 --- a/docs/RMRK/extension/tokenProperties/RMRKTokenPropertiesRepository.md +++ /dev/null @@ -1,1248 +0,0 @@ -# RMRKTokenPropertiesRepository - -*RMRK team* - -> RMRKTokenPropertiesRepository - -Smart contract of the RMRK Token property repository module. - - - -## Methods - -### DOMAIN_SEPARATOR - -```solidity -function DOMAIN_SEPARATOR() external view returns (bytes32) -``` - - - - - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bytes32 | undefined | - -### SET_ADDRESS_PROPERTY_TYPEHASH - -```solidity -function SET_ADDRESS_PROPERTY_TYPEHASH() external view returns (bytes32) -``` - - - - - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bytes32 | undefined | - -### SET_BOOL_PROPERTY_TYPEHASH - -```solidity -function SET_BOOL_PROPERTY_TYPEHASH() external view returns (bytes32) -``` - - - - - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bytes32 | undefined | - -### SET_BYTES_PROPERTY_TYPEHASH - -```solidity -function SET_BYTES_PROPERTY_TYPEHASH() external view returns (bytes32) -``` - - - - - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bytes32 | undefined | - -### SET_STRING_PROPERTY_TYPEHASH - -```solidity -function SET_STRING_PROPERTY_TYPEHASH() external view returns (bytes32) -``` - - - - - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bytes32 | undefined | - -### SET_UINT_PROPERTY_TYPEHASH - -```solidity -function SET_UINT_PROPERTY_TYPEHASH() external view returns (bytes32) -``` - - - - - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bytes32 | undefined | - -### getAddressTokenProperties - -```solidity -function getAddressTokenProperties(address collection, uint256 tokenId, string[] addressKeys) external view returns (struct IRMRKTokenPropertiesRepository.AddressProperty[]) -``` - -Used to get multiple address parameter values for a token. - -*The `AddressProperty` struct contains the following fields: [ string key, address value ]* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| collection | address | Address of the collection the token belongs to | -| tokenId | uint256 | ID of the token for which the properties are being retrieved | -| addressKeys | string[] | An array of address keys to retrieve | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | IRMRKTokenPropertiesRepository.AddressProperty[] | An array of `AddressProperty` structs | - -### getAddressTokenProperty - -```solidity -function getAddressTokenProperty(address collection, uint256 tokenId, string key) external view returns (address) -``` - -Used to retrieve the address type token properties. - - - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| collection | address | The collection address | -| tokenId | uint256 | The token ID | -| key | string | The key of the property | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | address | The value of the address property | - -### getBoolTokenProperties - -```solidity -function getBoolTokenProperties(address collection, uint256 tokenId, string[] boolKeys) external view returns (struct IRMRKTokenPropertiesRepository.BoolProperty[]) -``` - -Used to get multiple bool parameter values for a token. - -*The `BoolProperty` struct contains the following fields: [ string key, bool value ]* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| collection | address | Address of the collection the token belongs to | -| tokenId | uint256 | ID of the token for which the properties are being retrieved | -| boolKeys | string[] | An array of bool keys to retrieve | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | IRMRKTokenPropertiesRepository.BoolProperty[] | An array of `BoolProperty` structs | - -### getBoolTokenProperty - -```solidity -function getBoolTokenProperty(address collection, uint256 tokenId, string key) external view returns (bool) -``` - -Used to retrieve the bool type token properties. - - - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| collection | address | The collection address | -| tokenId | uint256 | The token ID | -| key | string | The key of the property | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | The value of the bool property | - -### getBytesTokenProperties - -```solidity -function getBytesTokenProperties(address collection, uint256 tokenId, string[] bytesKeys) external view returns (struct IRMRKTokenPropertiesRepository.BytesProperty[]) -``` - -Used to get multiple bytes parameter values for a token. - -*The `BytesProperty` struct contains the following fields: [ string key, bytes value ]* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| collection | address | Address of the collection the token belongs to | -| tokenId | uint256 | ID of the token for which the properties are being retrieved | -| bytesKeys | string[] | An array of bytes keys to retrieve | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | IRMRKTokenPropertiesRepository.BytesProperty[] | An array of `BytesProperty` structs | - -### getBytesTokenProperty - -```solidity -function getBytesTokenProperty(address collection, uint256 tokenId, string key) external view returns (bytes) -``` - -Used to retrieve the bytes type token properties. - - - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| collection | address | The collection address | -| tokenId | uint256 | The token ID | -| key | string | The key of the property | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bytes | The value of the bytes property | - -### getStringTokenProperties - -```solidity -function getStringTokenProperties(address collection, uint256 tokenId, string[] stringKeys) external view returns (struct IRMRKTokenPropertiesRepository.StringProperty[]) -``` - -Used to get multiple sting parameter values for a token. - -*The `StringProperty` struct contains the following fields: [ string key, string value ]* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| collection | address | Address of the collection the token belongs to | -| tokenId | uint256 | ID of the token for which the properties are being retrieved | -| stringKeys | string[] | An array of string keys to retrieve | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | IRMRKTokenPropertiesRepository.StringProperty[] | An array of `StringProperty` structs | - -### getStringTokenProperty - -```solidity -function getStringTokenProperty(address collection, uint256 tokenId, string key) external view returns (string) -``` - -Used to retrieve the string type token properties. - - - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| collection | address | The collection address | -| tokenId | uint256 | The token ID | -| key | string | The key of the property | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | string | The value of the string property | - -### getTokenProperties - -```solidity -function getTokenProperties(address collection, uint256 tokenId, string[] stringKeys, string[] uintKeys, string[] boolKeys, string[] addressKeys, string[] bytesKeys) external view returns (struct IRMRKTokenPropertiesRepository.StringProperty[] stringProperties, struct IRMRKTokenPropertiesRepository.UintProperty[] uintProperties, struct IRMRKTokenPropertiesRepository.BoolProperty[] boolProperties, struct IRMRKTokenPropertiesRepository.AddressProperty[] addressProperties, struct IRMRKTokenPropertiesRepository.BytesProperty[] bytesProperties) -``` - -Used to retrieve multiple token properties of any type at once. - -*The `StringProperty`, `UintProperty`, `BoolProperty`, `AddressProperty` and `BytesProperty` structs consists to the following fields (where `value` is of the appropriate type): [ key, value, ]* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| collection | address | The collection address | -| tokenId | uint256 | The token ID | -| stringKeys | string[] | An array of string type property keys to retrieve | -| uintKeys | string[] | An array of uint type property keys to retrieve | -| boolKeys | string[] | An array of bool type property keys to retrieve | -| addressKeys | string[] | An array of address type property keys to retrieve | -| bytesKeys | string[] | An array of bytes type property keys to retrieve | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| stringProperties | IRMRKTokenPropertiesRepository.StringProperty[] | An array of `StringProperty` structs containing the string type properties | -| uintProperties | IRMRKTokenPropertiesRepository.UintProperty[] | An array of `UintProperty` structs containing the uint type properties | -| boolProperties | IRMRKTokenPropertiesRepository.BoolProperty[] | An array of `BoolProperty` structs containing the bool type properties | -| addressProperties | IRMRKTokenPropertiesRepository.AddressProperty[] | An array of `AddressProperty` structs containing the address type properties | -| bytesProperties | IRMRKTokenPropertiesRepository.BytesProperty[] | An array of `BytesProperty` structs containing the bytes type properties | - -### getUintTokenProperties - -```solidity -function getUintTokenProperties(address collection, uint256 tokenId, string[] uintKeys) external view returns (struct IRMRKTokenPropertiesRepository.UintProperty[]) -``` - -Used to get multiple uint parameter values for a token. - -*The `UintProperty` struct contains the following fields: [ string key, uint value ]* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| collection | address | Address of the collection the token belongs to | -| tokenId | uint256 | ID of the token for which the properties are being retrieved | -| uintKeys | string[] | An array of uint keys to retrieve | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | IRMRKTokenPropertiesRepository.UintProperty[] | An array of `UintProperty` structs | - -### getUintTokenProperty - -```solidity -function getUintTokenProperty(address collection, uint256 tokenId, string key) external view returns (uint256) -``` - -Used to retrieve the uint type token properties. - - - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| collection | address | The collection address | -| tokenId | uint256 | The token ID | -| key | string | The key of the property | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | The value of the uint property | - -### isCollaborator - -```solidity -function isCollaborator(address collaborator, address collection) external view returns (bool) -``` - -Used to check if the specified address is listed as a collaborator of the given collection's parameter. - - - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| collaborator | address | Address to be checked. | -| collection | address | Address of the collection. | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | Boolean value indicating if the address is a collaborator of the given collection's (`true`) or not (`false`). | - -### isSpecificAddress - -```solidity -function isSpecificAddress(address specificAddress, address collection, string key) external view returns (bool) -``` - -Used to check if the specified address is listed as a specific address of the given collection's parameter. - - - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| specificAddress | address | Address to be checked. | -| collection | address | Address of the collection. | -| key | string | The key of the property | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | Boolean value indicating if the address is a specific address of the given collection's parameter (`true`) or not (`false`). | - -### manageAccessControl - -```solidity -function manageAccessControl(address collection, string key, enum IRMRKTokenPropertiesRepository.AccessType accessType, address specificAddress) external nonpayable -``` - -Used to manage the access control settings for a specific parameter. - -*Only the `issuer` of the collection can call this function.The possible `accessType` values are: [ Issuer, Collaborator, IssuerOrCollaborator, TokenOwner, SpecificAddress, ]Emits an {AccessControlUpdated} event.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| collection | address | The address of the collection being managed. | -| key | string | The key of the property | -| accessType | enum IRMRKTokenPropertiesRepository.AccessType | The type of access control to be applied to the parameter. | -| specificAddress | address | The address to be added as a specific addresses allowed to manage the given parameter. | - -### manageCollaborators - -```solidity -function manageCollaborators(address collection, address[] collaboratorAddresses, bool[] collaboratorAddressAccess) external nonpayable -``` - -Used to manage the collaborators of a collection. - -*The `collaboratorAddresses` and `collaboratorAddressAccess` arrays must be of the same length.Emits a {CollaboratorUpdate} event.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| collection | address | The address of the collection | -| collaboratorAddresses | address[] | The array of collaborator addresses being managed | -| collaboratorAddressAccess | bool[] | The array of boolean values indicating if the collaborator address should receive the permission (`true`) or not (`false`). | - -### prepareMessageToPresignAddressProperty - -```solidity -function prepareMessageToPresignAddressProperty(address collection, uint256 tokenId, string key, address value, uint256 deadline) external view returns (bytes32) -``` - -Used to retrieve the message to be signed for submitting a presigned address property change. - - - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| collection | address | The address of the collection smart contract of the token receiving the property | -| tokenId | uint256 | The ID of the token receiving the property | -| key | string | The property key | -| value | address | The property value | -| deadline | uint256 | The deadline timestamp for the presigned transaction after which the message is invalid | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bytes32 | Raw message to be signed by the authorized account | - -### prepareMessageToPresignBoolProperty - -```solidity -function prepareMessageToPresignBoolProperty(address collection, uint256 tokenId, string key, bool value, uint256 deadline) external view returns (bytes32) -``` - -Used to retrieve the message to be signed for submitting a presigned bool property change. - - - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| collection | address | The address of the collection smart contract of the token receiving the property | -| tokenId | uint256 | The ID of the token receiving the property | -| key | string | The property key | -| value | bool | The property value | -| deadline | uint256 | The deadline timestamp for the presigned transaction after which the message is invalid | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bytes32 | Raw message to be signed by the authorized account | - -### prepareMessageToPresignBytesProperty - -```solidity -function prepareMessageToPresignBytesProperty(address collection, uint256 tokenId, string key, bytes value, uint256 deadline) external view returns (bytes32) -``` - -Used to retrieve the message to be signed for submitting a presigned bytes property change. - - - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| collection | address | The address of the collection smart contract of the token receiving the property | -| tokenId | uint256 | The ID of the token receiving the property | -| key | string | The property key | -| value | bytes | The property value | -| deadline | uint256 | The deadline timestamp for the presigned transaction after which the message is invalid | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bytes32 | Raw message to be signed by the authorized account | - -### prepareMessageToPresignStringProperty - -```solidity -function prepareMessageToPresignStringProperty(address collection, uint256 tokenId, string key, string value, uint256 deadline) external view returns (bytes32) -``` - -Used to retrieve the message to be signed for submitting a presigned string property change. - - - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| collection | address | The address of the collection smart contract of the token receiving the property | -| tokenId | uint256 | The ID of the token receiving the property | -| key | string | The property key | -| value | string | The property value | -| deadline | uint256 | The deadline timestamp for the presigned transaction after which the message is invalid | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bytes32 | Raw message to be signed by the authorized account | - -### prepareMessageToPresignUintProperty - -```solidity -function prepareMessageToPresignUintProperty(address collection, uint256 tokenId, string key, uint256 value, uint256 deadline) external view returns (bytes32) -``` - -Used to retrieve the message to be signed for submitting a presigned uint property change. - - - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| collection | address | The address of the collection smart contract of the token receiving the property | -| tokenId | uint256 | The ID of the token receiving the property | -| key | string | The property key | -| value | uint256 | The property value | -| deadline | uint256 | The deadline timestamp for the presigned transaction after which the message is invalid | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bytes32 | Raw message to be signed by the authorized account | - -### presignedSetAddressProperty - -```solidity -function presignedSetAddressProperty(address setter, address collection, uint256 tokenId, string key, address value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external nonpayable -``` - -Used to set the address property on behalf of an authorized account. - -*Emits a {AddressPropertyUpdated} event.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| setter | address | Address of the account that presigned the property change | -| collection | address | Address of the collection receiving the property | -| tokenId | uint256 | The ID of the token receiving the property | -| key | string | The property key | -| value | address | The property value | -| deadline | uint256 | The deadline timestamp for the presigned transaction | -| v | uint8 | `v` value of an ECDSA signature of the presigned message | -| r | bytes32 | `r` value of an ECDSA signature of the presigned message | -| s | bytes32 | `s` value of an ECDSA signature of the presigned message | - -### presignedSetBoolProperty - -```solidity -function presignedSetBoolProperty(address setter, address collection, uint256 tokenId, string key, bool value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external nonpayable -``` - -Used to set the bool property on behalf of an authorized account. - -*Emits a {BoolPropertyUpdated} event.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| setter | address | Address of the account that presigned the property change | -| collection | address | Address of the collection receiving the property | -| tokenId | uint256 | The ID of the token receiving the property | -| key | string | The property key | -| value | bool | The property value | -| deadline | uint256 | The deadline timestamp for the presigned transaction | -| v | uint8 | `v` value of an ECDSA signature of the presigned message | -| r | bytes32 | `r` value of an ECDSA signature of the presigned message | -| s | bytes32 | `s` value of an ECDSA signature of the presigned message | - -### presignedSetBytesProperty - -```solidity -function presignedSetBytesProperty(address setter, address collection, uint256 tokenId, string key, bytes value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external nonpayable -``` - -Used to set the bytes property on behalf of an authorized account. - -*Emits a {BytesPropertyUpdated} event.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| setter | address | Address of the account that presigned the property change | -| collection | address | Address of the collection receiving the property | -| tokenId | uint256 | The ID of the token receiving the property | -| key | string | The property key | -| value | bytes | The property value | -| deadline | uint256 | The deadline timestamp for the presigned transaction | -| v | uint8 | `v` value of an ECDSA signature of the presigned message | -| r | bytes32 | `r` value of an ECDSA signature of the presigned message | -| s | bytes32 | `s` value of an ECDSA signature of the presigned message | - -### presignedSetStringProperty - -```solidity -function presignedSetStringProperty(address setter, address collection, uint256 tokenId, string key, string value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external nonpayable -``` - -Used to set the string property on behalf of an authorized account. - -*Emits a {StringPropertyUpdated} event.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| setter | address | Address of the account that presigned the property change | -| collection | address | Address of the collection receiving the property | -| tokenId | uint256 | The ID of the token receiving the property | -| key | string | The property key | -| value | string | The property value | -| deadline | uint256 | The deadline timestamp for the presigned transaction | -| v | uint8 | `v` value of an ECDSA signature of the presigned message | -| r | bytes32 | `r` value of an ECDSA signature of the presigned message | -| s | bytes32 | `s` value of an ECDSA signature of the presigned message | - -### presignedSetUintProperty - -```solidity -function presignedSetUintProperty(address setter, address collection, uint256 tokenId, string key, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external nonpayable -``` - -Used to set the uint property on behalf of an authorized account. - -*Emits a {UintPropertyUpdated} event.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| setter | address | Address of the account that presigned the property change | -| collection | address | Address of the collection receiving the property | -| tokenId | uint256 | The ID of the token receiving the property | -| key | string | The property key | -| value | uint256 | The property value | -| deadline | uint256 | The deadline timestamp for the presigned transaction | -| v | uint8 | `v` value of an ECDSA signature of the presigned message | -| r | bytes32 | `r` value of an ECDSA signature of the presigned message | -| s | bytes32 | `s` value of an ECDSA signature of the presigned message | - -### registerAccessControl - -```solidity -function registerAccessControl(address collection, address issuer, bool useOwnable) external nonpayable -``` - -Used to register a collection to use the RMRK token properties repository. - -*If the collection does not implement the Ownable interface, the `useOwnable` value must be set to `false`.Emits an {AccessControlRegistration} event.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| collection | address | The address of the collection that will use the RMRK token properties repository. | -| issuer | address | The address of the issuer of the collection. | -| useOwnable | bool | The boolean value to indicate if the collection implements the Ownable interface and whether it should be used to validate that the caller is the issuer (`true`) or to use the manually set issuer address (`false`). | - -### setAddressProperties - -```solidity -function setAddressProperties(address collection, uint256 tokenId, IRMRKTokenPropertiesRepository.AddressProperty[] properties) external nonpayable -``` - - - - - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| collection | address | undefined | -| tokenId | uint256 | undefined | -| properties | IRMRKTokenPropertiesRepository.AddressProperty[] | undefined | - -### setAddressProperty - -```solidity -function setAddressProperty(address collection, uint256 tokenId, string key, address value) external nonpayable -``` - -Used to set an address property. - -*Emits a {AddressPropertyUpdated} event.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| collection | address | Address of the collection receiving the property | -| tokenId | uint256 | The token ID | -| key | string | The property key | -| value | address | The property value | - -### setBoolProperties - -```solidity -function setBoolProperties(address collection, uint256 tokenId, IRMRKTokenPropertiesRepository.BoolProperty[] properties) external nonpayable -``` - - - - - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| collection | address | undefined | -| tokenId | uint256 | undefined | -| properties | IRMRKTokenPropertiesRepository.BoolProperty[] | undefined | - -### setBoolProperty - -```solidity -function setBoolProperty(address collection, uint256 tokenId, string key, bool value) external nonpayable -``` - -Used to set a boolean property. - -*Emits a {BoolPropertyUpdated} event.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| collection | address | Address of the collection receiving the property | -| tokenId | uint256 | The token ID | -| key | string | The property key | -| value | bool | The property value | - -### setBytesProperties - -```solidity -function setBytesProperties(address collection, uint256 tokenId, IRMRKTokenPropertiesRepository.BytesProperty[] properties) external nonpayable -``` - - - - - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| collection | address | undefined | -| tokenId | uint256 | undefined | -| properties | IRMRKTokenPropertiesRepository.BytesProperty[] | undefined | - -### setBytesProperty - -```solidity -function setBytesProperty(address collection, uint256 tokenId, string key, bytes value) external nonpayable -``` - -Used to set an bytes property. - -*Emits a {BytesPropertyUpdated} event.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| collection | address | Address of the collection receiving the property | -| tokenId | uint256 | The token ID | -| key | string | The property key | -| value | bytes | The property value | - -### setStringProperties - -```solidity -function setStringProperties(address collection, uint256 tokenId, IRMRKTokenPropertiesRepository.StringProperty[] properties) external nonpayable -``` - - - - - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| collection | address | undefined | -| tokenId | uint256 | undefined | -| properties | IRMRKTokenPropertiesRepository.StringProperty[] | undefined | - -### setStringProperty - -```solidity -function setStringProperty(address collection, uint256 tokenId, string key, string value) external nonpayable -``` - -Used to set a string property. - -*Emits a {StringPropertyUpdated} event.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| collection | address | Address of the collection receiving the property | -| tokenId | uint256 | The token ID | -| key | string | The property key | -| value | string | The property value | - -### setTokenProperties - -```solidity -function setTokenProperties(address collection, uint256 tokenId, IRMRKTokenPropertiesRepository.StringProperty[] stringProperties, IRMRKTokenPropertiesRepository.UintProperty[] uintProperties, IRMRKTokenPropertiesRepository.BoolProperty[] boolProperties, IRMRKTokenPropertiesRepository.AddressProperty[] addressProperties, IRMRKTokenPropertiesRepository.BytesProperty[] bytesProperties) external nonpayable -``` - - - - - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| collection | address | undefined | -| tokenId | uint256 | undefined | -| stringProperties | IRMRKTokenPropertiesRepository.StringProperty[] | undefined | -| uintProperties | IRMRKTokenPropertiesRepository.UintProperty[] | undefined | -| boolProperties | IRMRKTokenPropertiesRepository.BoolProperty[] | undefined | -| addressProperties | IRMRKTokenPropertiesRepository.AddressProperty[] | undefined | -| bytesProperties | IRMRKTokenPropertiesRepository.BytesProperty[] | undefined | - -### setUintProperties - -```solidity -function setUintProperties(address collection, uint256 tokenId, IRMRKTokenPropertiesRepository.UintProperty[] properties) external nonpayable -``` - - - - - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| collection | address | undefined | -| tokenId | uint256 | undefined | -| properties | IRMRKTokenPropertiesRepository.UintProperty[] | undefined | - -### setUintProperty - -```solidity -function setUintProperty(address collection, uint256 tokenId, string key, uint256 value) external nonpayable -``` - -Used to set a number property. - -*Emits a {UintPropertyUpdated} event.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| collection | address | Address of the collection receiving the property | -| tokenId | uint256 | The token ID | -| key | string | The property key | -| value | uint256 | The property value | - -### supportsInterface - -```solidity -function supportsInterface(bytes4 interfaceId) external view returns (bool) -``` - - - -*Returns true if this contract implements the interface defined by `interfaceId`. See the corresponding https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] to learn more about how these ids are created. This function call must use less than 30 000 gas.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| interfaceId | bytes4 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - - - -## Events - -### AccessControlRegistration - -```solidity -event AccessControlRegistration(address indexed collection, address indexed issuer, address indexed registeringAddress, bool useOwnable) -``` - -Used to notify listeners that a new collection has been registered to use the repository. - - - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| collection `indexed` | address | Address of the collection | -| issuer `indexed` | address | Address of the issuer of the collection; the addess authorized to manage the access control | -| registeringAddress `indexed` | address | Address that registered the collection | -| useOwnable | bool | A boolean value indicating whether the collection uses the Ownable extension to verify the issuer (`true`) or not (`false`) | - -### AccessControlUpdate - -```solidity -event AccessControlUpdate(address indexed collection, string key, enum IRMRKTokenPropertiesRepository.AccessType accessType, address specificAddress) -``` - -Used to notify listeners that the access control settings for a specific parameter have been updated. - - - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| collection `indexed` | address | Address of the collection | -| key | string | The name of the parameter for which the access control settings have been updated | -| accessType | enum IRMRKTokenPropertiesRepository.AccessType | The AccessType of the parameter for which the access control settings have been updated | -| specificAddress | address | The specific addresses that has been updated | - -### AddressPropertyUpdated - -```solidity -event AddressPropertyUpdated(address indexed collection, uint256 indexed tokenId, string key, address value) -``` - -Used to notify listeners that an address property has been updated. - - - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| collection `indexed` | address | The collection address | -| tokenId `indexed` | uint256 | The token ID | -| key | string | The key of the property | -| value | address | The new value of the property | - -### BoolPropertyUpdated - -```solidity -event BoolPropertyUpdated(address indexed collection, uint256 indexed tokenId, string key, bool value) -``` - -Used to notify listeners that a boolean property has been updated. - - - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| collection `indexed` | address | The collection address | -| tokenId `indexed` | uint256 | The token ID | -| key | string | The key of the property | -| value | bool | The new value of the property | - -### BytesPropertyUpdated - -```solidity -event BytesPropertyUpdated(address indexed collection, uint256 indexed tokenId, string key, bytes value) -``` - -Used to notify listeners that a bytes property has been updated. - - - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| collection `indexed` | address | The collection address | -| tokenId `indexed` | uint256 | The token ID | -| key | string | The key of the property | -| value | bytes | The new value of the property | - -### CollaboratorUpdate - -```solidity -event CollaboratorUpdate(address indexed collection, address indexed collaborator, bool isCollaborator) -``` - -Used to notify listeners that a new collaborator has been added or removed. - - - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| collection `indexed` | address | Address of the collection | -| collaborator `indexed` | address | Address of the collaborator | -| isCollaborator | bool | A boolean value indicating whether the collaborator has been added (`true`) or removed (`false`) | - -### StringPropertyUpdated - -```solidity -event StringPropertyUpdated(address indexed collection, uint256 indexed tokenId, string key, string value) -``` - -Used to notify listeners that a string property has been updated. - - - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| collection `indexed` | address | The collection address | -| tokenId `indexed` | uint256 | The token ID | -| key | string | The key of the property | -| value | string | The new value of the property | - -### UintPropertyUpdated - -```solidity -event UintPropertyUpdated(address indexed collection, uint256 indexed tokenId, string key, uint256 value) -``` - -Used to notify listeners that an uint property has been updated. - - - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| collection `indexed` | address | The collection address | -| tokenId `indexed` | uint256 | The token ID | -| key | string | The key of the property | -| value | uint256 | The new value of the property | - - - -## Errors - -### RMRKCollaboratorArraysNotEqualLength - -```solidity -error RMRKCollaboratorArraysNotEqualLength() -``` - -Attempting to pass collaborator address array and collaborator permission array of different lengths - - - - -### RMRKCollectionAlreadyRegistered - -```solidity -error RMRKCollectionAlreadyRegistered() -``` - -Attempting to register a collection that is already registered - - - - -### RMRKCollectionNotRegistered - -```solidity -error RMRKCollectionNotRegistered() -``` - -Attempting to manage or interact with colleciton that is not registered - - - - -### RMRKExpiredDeadline - -```solidity -error RMRKExpiredDeadline() -``` - -Attempting to pass an epired ECDSA deadline - - - - -### RMRKInvalidSignature - -```solidity -error RMRKInvalidSignature() -``` - -Attempting to use and invalid ECDSA signature - - - - -### RMRKNotCollectionCollaborator - -```solidity -error RMRKNotCollectionCollaborator() -``` - -Attempting to manage a collection without being the collection's collaborator - - - - -### RMRKNotCollectionIssuer - -```solidity -error RMRKNotCollectionIssuer() -``` - -Attemting to manage a collection without being the collection's issuer - - - - -### RMRKNotCollectionIssuerOrCollaborator - -```solidity -error RMRKNotCollectionIssuerOrCollaborator() -``` - -Attempting to manage a collection without being the collection's issuer or collaborator - - - - -### RMRKNotSpecificAddress - -```solidity -error RMRKNotSpecificAddress() -``` - -Attempting to manage a collection without being the specific address - - - - -### RMRKNotTokenOwner - -```solidity -error RMRKNotTokenOwner() -``` - -Attempting to manage a token without being its owner - - - - -### RMRKOwnableNotImplemented - -```solidity -error RMRKOwnableNotImplemented() -``` - -Attemtping to use `Ownable` interface without implementing it - - - - - diff --git a/hardhat.config.ts b/hardhat.config.ts index 257f1395..df28ad66 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -115,22 +115,22 @@ const config: HardhatUserConfig = { }, customChains: [ { - network: "baseGoerli", + network: 'baseGoerli', chainId: 84531, urls: { - apiURL: "https://api-goerli.basescan.org/api", - browserURL: "https://goerli.basescan.org" - } + apiURL: 'https://api-goerli.basescan.org/api', + browserURL: 'https://goerli.basescan.org', + }, }, { - network: "base", + network: 'base', chainId: 8453, urls: { - apiURL: "https://api.basescan.org/api", - browserURL: "https://basescan.org" - } - } - ] + apiURL: 'https://api.basescan.org/api', + browserURL: 'https://basescan.org', + }, + }, + ], }, dodoc: { runOnCompile: false, diff --git a/test/extensions/tokenPropertiesRepository.ts b/test/extensions/tokenAttributesRepository.ts similarity index 66% rename from test/extensions/tokenPropertiesRepository.ts rename to test/extensions/tokenAttributesRepository.ts index 44b423c4..13348497 100644 --- a/test/extensions/tokenPropertiesRepository.ts +++ b/test/extensions/tokenAttributesRepository.ts @@ -2,19 +2,19 @@ import { ethers } from 'hardhat'; import { expect } from 'chai'; import { loadFixture, mine } from '@nomicfoundation/hardhat-network-helpers'; import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; -import { IERC165, IRMRKTokenPropertiesRepository } from '../interfaces'; -import { OwnableMintableERC721Mock, RMRKTokenPropertiesRepository } from '../../typechain-types'; +import { IERC165, IERC7508 } from '../interfaces'; +import { OwnableMintableERC721Mock, RMRKTokenAttributesRepository } from '../../typechain-types'; import { bn } from '../utils'; import { smock, FakeContract } from '@defi-wonderland/smock'; // --------------- FIXTURES ----------------------- -async function tokenPropertiesFixture() { - const factory = await ethers.getContractFactory('RMRKTokenPropertiesRepository'); - const tokenProperties = await factory.deploy(); - await tokenProperties.deployed(); +async function tokenAttributesFixture() { + const factory = await ethers.getContractFactory('RMRKTokenAttributesRepository'); + const tokenAttributes = await factory.deploy(); + await tokenAttributes.deployed(); - return { tokenProperties }; + return { tokenAttributes }; } async function ownedCollectionFixture() { @@ -25,28 +25,28 @@ async function ownedCollectionFixture() { // --------------- TESTS ----------------------- -describe('RMRKTokenPropertiesRepository', async function () { - let tokenProperties: RMRKTokenPropertiesRepository; +describe('RMRKTokenAttributesRepository', async function () { + let tokenAttributes: RMRKTokenAttributesRepository; let ownedCollection: FakeContract; beforeEach(async function () { - ({ tokenProperties } = await loadFixture(tokenPropertiesFixture)); + ({ tokenAttributes } = await loadFixture(tokenAttributesFixture)); ({ ownedCollection } = await loadFixture(ownedCollectionFixture)); - this.tokenProperties = tokenProperties; + this.tokenAttributes = tokenAttributes; this.ownedCollection = ownedCollection; }); - shouldBehaveLikeTokenPropertiesRepositoryInterface(); + shouldBehaveLikeTokenAttributesRepositoryInterface(); - describe('RMRKTokenPropertiesRepository', async function () { + describe('RMRKTokenAttributesRepository', async function () { let issuer: SignerWithAddress; let owner: SignerWithAddress; const tokenId = 1; const tokenId2 = 2; beforeEach(async function () { - ({ tokenProperties } = await loadFixture(tokenPropertiesFixture)); + ({ tokenAttributes } = await loadFixture(tokenAttributesFixture)); ({ ownedCollection } = await loadFixture(ownedCollectionFixture)); const signers = await ethers.getSigners(); @@ -55,107 +55,107 @@ describe('RMRKTokenPropertiesRepository', async function () { ownedCollection.owner.returns(issuer.address); - await tokenProperties.registerAccessControl(ownedCollection.address, issuer.address, false); + await tokenAttributes.registerAccessControl(ownedCollection.address, issuer.address, false); }); - it('can set and get token properties', async function () { + it('can set and get token attributes', async function () { expect( - await tokenProperties.setStringProperty( + await tokenAttributes.setStringAttribute( ownedCollection.address, tokenId, 'description', 'test description', ), ) - .to.emit(tokenProperties, 'StringPropertySet') + .to.emit(tokenAttributes, 'StringAttributeSet') .withArgs(ownedCollection.address, tokenId, 'description', 'test description'); expect( - await tokenProperties.setStringProperty( + await tokenAttributes.setStringAttribute( ownedCollection.address, tokenId, 'description1', 'test description', ), ) - .to.emit(tokenProperties, 'StringPropertySet') + .to.emit(tokenAttributes, 'StringAttributeSet') .withArgs(ownedCollection.address, tokenId, 'description1', 'test description'); - expect(await tokenProperties.setBoolProperty(ownedCollection.address, tokenId, 'rare', true)) - .to.emit(tokenProperties, 'BoolPropertySet') + expect(await tokenAttributes.setBoolAttribute(ownedCollection.address, tokenId, 'rare', true)) + .to.emit(tokenAttributes, 'BoolAttributeSet') .withArgs(ownedCollection.address, tokenId, 'rare', true); expect( - await tokenProperties.setAddressProperty( + await tokenAttributes.setAddressAttribute( ownedCollection.address, tokenId, 'owner', owner.address, ), ) - .to.emit(tokenProperties, 'AddressPropertySet') + .to.emit(tokenAttributes, 'AddressAttributeSet') .withArgs(ownedCollection.address, tokenId, 'owner', owner.address); expect( - await tokenProperties.setUintProperty(ownedCollection.address, tokenId, 'atk', bn(100)), + await tokenAttributes.setUintAttribute(ownedCollection.address, tokenId, 'atk', bn(100)), ) - .to.emit(tokenProperties, 'UintPropertySet') + .to.emit(tokenAttributes, 'UintAttributeSet') .withArgs(ownedCollection.address, tokenId, 'atk', bn(100)); expect( - await tokenProperties.setUintProperty(ownedCollection.address, tokenId, 'health', bn(100)), + await tokenAttributes.setUintAttribute(ownedCollection.address, tokenId, 'health', bn(100)), ) - .to.emit(tokenProperties, 'UintPropertySet') + .to.emit(tokenAttributes, 'UintAttributeSet') .withArgs(ownedCollection.address, tokenId, 'health', bn(100)); expect( - await tokenProperties.setUintProperty(ownedCollection.address, tokenId, 'health', bn(95)), + await tokenAttributes.setUintAttribute(ownedCollection.address, tokenId, 'health', bn(95)), ) - .to.emit(tokenProperties, 'UintPropertySet') + .to.emit(tokenAttributes, 'UintAttributeSet') .withArgs(ownedCollection.address, tokenId, 'health', bn(95)); expect( - await tokenProperties.setUintProperty(ownedCollection.address, tokenId, 'health', bn(80)), + await tokenAttributes.setUintAttribute(ownedCollection.address, tokenId, 'health', bn(80)), ) - .to.emit(tokenProperties, 'UintPropertySet') + .to.emit(tokenAttributes, 'UintAttributeSet') .withArgs(ownedCollection.address, tokenId, 'health', bn(80)); expect( - await tokenProperties.setBytesProperty(ownedCollection.address, tokenId, 'data', '0x1234'), + await tokenAttributes.setBytesAttribute(ownedCollection.address, tokenId, 'data', '0x1234'), ) - .to.emit(tokenProperties, 'BytesPropertySet') + .to.emit(tokenAttributes, 'BytesAttributeSet') .withArgs(ownedCollection.address, tokenId, 'data', '0x1234'); expect( - await tokenProperties.getStringTokenProperty( + await tokenAttributes.getStringTokenAttribute( ownedCollection.address, tokenId, 'description', ), ).to.eql('test description'); expect( - await tokenProperties.getStringTokenProperty( + await tokenAttributes.getStringTokenAttribute( ownedCollection.address, tokenId, 'description1', ), ).to.eql('test description'); expect( - await tokenProperties.getBoolTokenProperty(ownedCollection.address, tokenId, 'rare'), + await tokenAttributes.getBoolTokenAttribute(ownedCollection.address, tokenId, 'rare'), ).to.eql(true); expect( - await tokenProperties.getAddressTokenProperty(ownedCollection.address, tokenId, 'owner'), + await tokenAttributes.getAddressTokenAttribute(ownedCollection.address, tokenId, 'owner'), ).to.eql(owner.address); expect( - await tokenProperties.getUintTokenProperty(ownedCollection.address, tokenId, 'atk'), + await tokenAttributes.getUintTokenAttribute(ownedCollection.address, tokenId, 'atk'), ).to.eql(bn(100)); expect( - await tokenProperties.getUintTokenProperty(ownedCollection.address, tokenId, 'health'), + await tokenAttributes.getUintTokenAttribute(ownedCollection.address, tokenId, 'health'), ).to.eql(bn(80)); expect( - await tokenProperties.getBytesTokenProperty(ownedCollection.address, tokenId, 'data'), + await tokenAttributes.getBytesTokenAttribute(ownedCollection.address, tokenId, 'data'), ).to.eql('0x1234'); - await tokenProperties.setStringProperty( + await tokenAttributes.setStringAttribute( ownedCollection.address, tokenId, 'description', 'test description update', ); expect( - await tokenProperties.getStringTokenProperty( + await tokenAttributes.getStringTokenAttribute( ownedCollection.address, tokenId, 'description', @@ -163,9 +163,9 @@ describe('RMRKTokenPropertiesRepository', async function () { ).to.eql('test description update'); }); - it('can set multiple properties of multiple types at the same time', async function () { + it('can set multiple attributes of multiple types at the same time', async function () { await expect( - tokenProperties.setTokenProperties( + tokenAttributes.setTokenAttributes( ownedCollection.address, tokenId, [ @@ -190,30 +190,30 @@ describe('RMRKTokenPropertiesRepository', async function () { ], ), ) - .to.emit(tokenProperties, 'StringPropertyUpdated') + .to.emit(tokenAttributes, 'StringAttributeUpdated') .withArgs(ownedCollection.address, tokenId, 'string1', 'value1') - .to.emit(tokenProperties, 'StringPropertyUpdated') + .to.emit(tokenAttributes, 'StringAttributeUpdated') .withArgs(ownedCollection.address, tokenId, 'string2', 'value2') - .to.emit(tokenProperties, 'UintPropertyUpdated') + .to.emit(tokenAttributes, 'UintAttributeUpdated') .withArgs(ownedCollection.address, tokenId, 'uint1', bn(1)) - .to.emit(tokenProperties, 'UintPropertyUpdated') + .to.emit(tokenAttributes, 'UintAttributeUpdated') .withArgs(ownedCollection.address, tokenId, 'uint2', bn(2)) - .to.emit(tokenProperties, 'BoolPropertyUpdated') + .to.emit(tokenAttributes, 'BoolAttributeUpdated') .withArgs(ownedCollection.address, tokenId, 'bool1', true) - .to.emit(tokenProperties, 'BoolPropertyUpdated') + .to.emit(tokenAttributes, 'BoolAttributeUpdated') .withArgs(ownedCollection.address, tokenId, 'bool2', false) - .to.emit(tokenProperties, 'AddressPropertyUpdated') + .to.emit(tokenAttributes, 'AddressAttributeUpdated') .withArgs(ownedCollection.address, tokenId, 'address1', owner.address) - .to.emit(tokenProperties, 'AddressPropertyUpdated') + .to.emit(tokenAttributes, 'AddressAttributeUpdated') .withArgs(ownedCollection.address, tokenId, 'address2', issuer.address) - .to.emit(tokenProperties, 'BytesPropertyUpdated') + .to.emit(tokenAttributes, 'BytesAttributeUpdated') .withArgs(ownedCollection.address, tokenId, 'bytes1', '0x1234') - .to.emit(tokenProperties, 'BytesPropertyUpdated') + .to.emit(tokenAttributes, 'BytesAttributeUpdated') .withArgs(ownedCollection.address, tokenId, 'bytes2', '0x5678'); }); - it('can update multiple properties of multiple types at the same time', async function () { - await tokenProperties.setTokenProperties( + it('can update multiple attributes of multiple types at the same time', async function () { + await tokenAttributes.setTokenAttributes( ownedCollection.address, tokenId, [ @@ -239,7 +239,7 @@ describe('RMRKTokenPropertiesRepository', async function () { ); await expect( - tokenProperties.setTokenProperties( + tokenAttributes.setTokenAttributes( ownedCollection.address, tokenId, [ @@ -264,30 +264,30 @@ describe('RMRKTokenPropertiesRepository', async function () { ], ), ) - .to.emit(tokenProperties, 'StringPropertyUpdated') + .to.emit(tokenAttributes, 'StringAttributeUpdated') .withArgs(ownedCollection.address, tokenId, 'string1', 'value1') - .to.emit(tokenProperties, 'StringPropertyUpdated') + .to.emit(tokenAttributes, 'StringAttributeUpdated') .withArgs(ownedCollection.address, tokenId, 'string2', 'value2') - .to.emit(tokenProperties, 'UintPropertyUpdated') + .to.emit(tokenAttributes, 'UintAttributeUpdated') .withArgs(ownedCollection.address, tokenId, 'uint1', bn(1)) - .to.emit(tokenProperties, 'UintPropertyUpdated') + .to.emit(tokenAttributes, 'UintAttributeUpdated') .withArgs(ownedCollection.address, tokenId, 'uint2', bn(2)) - .to.emit(tokenProperties, 'BoolPropertyUpdated') + .to.emit(tokenAttributes, 'BoolAttributeUpdated') .withArgs(ownedCollection.address, tokenId, 'bool1', true) - .to.emit(tokenProperties, 'BoolPropertyUpdated') + .to.emit(tokenAttributes, 'BoolAttributeUpdated') .withArgs(ownedCollection.address, tokenId, 'bool2', false) - .to.emit(tokenProperties, 'AddressPropertyUpdated') + .to.emit(tokenAttributes, 'AddressAttributeUpdated') .withArgs(ownedCollection.address, tokenId, 'address1', owner.address) - .to.emit(tokenProperties, 'AddressPropertyUpdated') + .to.emit(tokenAttributes, 'AddressAttributeUpdated') .withArgs(ownedCollection.address, tokenId, 'address2', issuer.address) - .to.emit(tokenProperties, 'BytesPropertyUpdated') + .to.emit(tokenAttributes, 'BytesAttributeUpdated') .withArgs(ownedCollection.address, tokenId, 'bytes1', '0x1234') - .to.emit(tokenProperties, 'BytesPropertyUpdated') + .to.emit(tokenAttributes, 'BytesAttributeUpdated') .withArgs(ownedCollection.address, tokenId, 'bytes2', '0x5678'); }); - it('can set and update multiple properties of multiple types at the same time even if not all types are updated at the same time', async function () { - await tokenProperties.setTokenProperties( + it('can set and update multiple attributes of multiple types at the same time even if not all types are updated at the same time', async function () { + await tokenAttributes.setTokenAttributes( ownedCollection.address, tokenId, [{ key: 'string1', value: 'value0' }], @@ -307,7 +307,7 @@ describe('RMRKTokenPropertiesRepository', async function () { ); await expect( - tokenProperties.setTokenProperties( + tokenAttributes.setTokenAttributes( ownedCollection.address, tokenId, [], @@ -329,25 +329,25 @@ describe('RMRKTokenPropertiesRepository', async function () { ], ), ) - .to.emit(tokenProperties, 'UintPropertyUpdated') + .to.emit(tokenAttributes, 'UintAttributeUpdated') .withArgs(ownedCollection.address, tokenId, 'uint1', bn(1)) - .to.emit(tokenProperties, 'UintPropertyUpdated') + .to.emit(tokenAttributes, 'UintAttributeUpdated') .withArgs(ownedCollection.address, tokenId, 'uint2', bn(2)) - .to.emit(tokenProperties, 'BoolPropertyUpdated') + .to.emit(tokenAttributes, 'BoolAttributeUpdated') .withArgs(ownedCollection.address, tokenId, 'bool1', true) - .to.emit(tokenProperties, 'BoolPropertyUpdated') + .to.emit(tokenAttributes, 'BoolAttributeUpdated') .withArgs(ownedCollection.address, tokenId, 'bool2', false) - .to.emit(tokenProperties, 'AddressPropertyUpdated') + .to.emit(tokenAttributes, 'AddressAttributeUpdated') .withArgs(ownedCollection.address, tokenId, 'address1', owner.address) - .to.emit(tokenProperties, 'AddressPropertyUpdated') + .to.emit(tokenAttributes, 'AddressAttributeUpdated') .withArgs(ownedCollection.address, tokenId, 'address2', issuer.address) - .to.emit(tokenProperties, 'BytesPropertyUpdated') + .to.emit(tokenAttributes, 'BytesAttributeUpdated') .withArgs(ownedCollection.address, tokenId, 'bytes1', '0x1234') - .to.emit(tokenProperties, 'BytesPropertyUpdated') + .to.emit(tokenAttributes, 'BytesAttributeUpdated') .withArgs(ownedCollection.address, tokenId, 'bytes2', '0x5678'); await expect( - tokenProperties.setTokenProperties( + tokenAttributes.setTokenAttributes( ownedCollection.address, tokenId, [], @@ -360,15 +360,15 @@ describe('RMRKTokenPropertiesRepository', async function () { [], ), ) - .to.emit(tokenProperties, 'BoolPropertyUpdated') + .to.emit(tokenAttributes, 'BoolAttributeUpdated') .withArgs(ownedCollection.address, tokenId, 'bool1', false) - .to.emit(tokenProperties, 'BoolPropertyUpdated') + .to.emit(tokenAttributes, 'BoolAttributeUpdated') .withArgs(ownedCollection.address, tokenId, 'bool2', true); }); - it('can set and update multiple properties of multiple types at the same time', async function () { + it('can set and update multiple attributes of multiple types at the same time', async function () { await expect( - tokenProperties.setTokenProperties( + tokenAttributes.setTokenAttributes( ownedCollection.address, tokenId, [ @@ -393,30 +393,30 @@ describe('RMRKTokenPropertiesRepository', async function () { ], ), ) - .to.emit(tokenProperties, 'StringPropertyUpdated') + .to.emit(tokenAttributes, 'StringAttributeUpdated') .withArgs(ownedCollection.address, tokenId, 'string1', 'value1') - .to.emit(tokenProperties, 'StringPropertyUpdated') + .to.emit(tokenAttributes, 'StringAttributeUpdated') .withArgs(ownedCollection.address, tokenId, 'string2', 'value2') - .to.emit(tokenProperties, 'UintPropertyUpdated') + .to.emit(tokenAttributes, 'UintAttributeUpdated') .withArgs(ownedCollection.address, tokenId, 'uint1', bn(1)) - .to.emit(tokenProperties, 'UintPropertyUpdated') + .to.emit(tokenAttributes, 'UintAttributeUpdated') .withArgs(ownedCollection.address, tokenId, 'uint2', bn(2)) - .to.emit(tokenProperties, 'BoolPropertyUpdated') + .to.emit(tokenAttributes, 'BoolAttributeUpdated') .withArgs(ownedCollection.address, tokenId, 'bool1', true) - .to.emit(tokenProperties, 'BoolPropertyUpdated') + .to.emit(tokenAttributes, 'BoolAttributeUpdated') .withArgs(ownedCollection.address, tokenId, 'bool2', false) - .to.emit(tokenProperties, 'AddressPropertyUpdated') + .to.emit(tokenAttributes, 'AddressAttributeUpdated') .withArgs(ownedCollection.address, tokenId, 'address1', owner.address) - .to.emit(tokenProperties, 'AddressPropertyUpdated') + .to.emit(tokenAttributes, 'AddressAttributeUpdated') .withArgs(ownedCollection.address, tokenId, 'address2', issuer.address) - .to.emit(tokenProperties, 'BytesPropertyUpdated') + .to.emit(tokenAttributes, 'BytesAttributeUpdated') .withArgs(ownedCollection.address, tokenId, 'bytes1', '0x1234') - .to.emit(tokenProperties, 'BytesPropertyUpdated') + .to.emit(tokenAttributes, 'BytesAttributeUpdated') .withArgs(ownedCollection.address, tokenId, 'bytes2', '0x5678'); }); - it('should allow to retrieve multiple properties at once', async function () { - await tokenProperties.setTokenProperties( + it('should allow to retrieve multiple attributes at once', async function () { + await tokenAttributes.setTokenAttributes( ownedCollection.address, tokenId, [ @@ -442,7 +442,7 @@ describe('RMRKTokenPropertiesRepository', async function () { ); expect( - await tokenProperties.getTokenProperties( + await tokenAttributes.getTokenAttributes( ownedCollection.address, tokenId, ['string1', 'string2'], @@ -475,20 +475,20 @@ describe('RMRKTokenPropertiesRepository', async function () { ]); }); - it('can set multiple string properties at the same time', async function () { + it('can set multiple string attributes at the same time', async function () { await expect( - tokenProperties.setStringProperties(ownedCollection.address, tokenId, [ + tokenAttributes.setStringAttributes(ownedCollection.address, tokenId, [ { key: 'string1', value: 'value1' }, { key: 'string2', value: 'value2' }, ]), ) - .to.emit(tokenProperties, 'StringPropertyUpdated') + .to.emit(tokenAttributes, 'StringAttributeUpdated') .withArgs(ownedCollection.address, tokenId, 'string1', 'value1') - .to.emit(tokenProperties, 'StringPropertyUpdated') + .to.emit(tokenAttributes, 'StringAttributeUpdated') .withArgs(ownedCollection.address, tokenId, 'string2', 'value2'); expect( - await tokenProperties.getTokenProperties( + await tokenAttributes.getTokenAttributes( ownedCollection.address, tokenId, ['string1', 'string2'], @@ -509,20 +509,20 @@ describe('RMRKTokenPropertiesRepository', async function () { ]); }); - it('can set multiple uint properties at the same time', async function () { + it('can set multiple uint attributes at the same time', async function () { await expect( - tokenProperties.setUintProperties(ownedCollection.address, tokenId, [ + tokenAttributes.setUintAttributes(ownedCollection.address, tokenId, [ { key: 'uint1', value: bn(1) }, { key: 'uint2', value: bn(2) }, ]), ) - .to.emit(tokenProperties, 'UintPropertyUpdated') + .to.emit(tokenAttributes, 'UintAttributeUpdated') .withArgs(ownedCollection.address, tokenId, 'uint1', bn(1)) - .to.emit(tokenProperties, 'UintPropertyUpdated') + .to.emit(tokenAttributes, 'UintAttributeUpdated') .withArgs(ownedCollection.address, tokenId, 'uint2', bn(2)); expect( - await tokenProperties.getTokenProperties( + await tokenAttributes.getTokenAttributes( ownedCollection.address, tokenId, [], @@ -543,20 +543,20 @@ describe('RMRKTokenPropertiesRepository', async function () { ]); }); - it('can set multiple bool properties at the same time', async function () { + it('can set multiple bool attributes at the same time', async function () { await expect( - tokenProperties.setBoolProperties(ownedCollection.address, tokenId, [ + tokenAttributes.setBoolAttributes(ownedCollection.address, tokenId, [ { key: 'bool1', value: true }, { key: 'bool2', value: false }, ]), ) - .to.emit(tokenProperties, 'BoolPropertyUpdated') + .to.emit(tokenAttributes, 'BoolAttributeUpdated') .withArgs(ownedCollection.address, tokenId, 'bool1', true) - .to.emit(tokenProperties, 'BoolPropertyUpdated') + .to.emit(tokenAttributes, 'BoolAttributeUpdated') .withArgs(ownedCollection.address, tokenId, 'bool2', false); expect( - await tokenProperties.getTokenProperties( + await tokenAttributes.getTokenAttributes( ownedCollection.address, tokenId, [], @@ -577,20 +577,20 @@ describe('RMRKTokenPropertiesRepository', async function () { ]); }); - it('can set multiple address properties at the same time', async function () { + it('can set multiple address attributes at the same time', async function () { await expect( - tokenProperties.setAddressProperties(ownedCollection.address, tokenId, [ + tokenAttributes.setAddressAttributes(ownedCollection.address, tokenId, [ { key: 'address1', value: owner.address }, { key: 'address2', value: issuer.address }, ]), ) - .to.emit(tokenProperties, 'AddressPropertyUpdated') + .to.emit(tokenAttributes, 'AddressAttributeUpdated') .withArgs(ownedCollection.address, tokenId, 'address1', owner.address) - .to.emit(tokenProperties, 'AddressPropertyUpdated') + .to.emit(tokenAttributes, 'AddressAttributeUpdated') .withArgs(ownedCollection.address, tokenId, 'address2', issuer.address); expect( - await tokenProperties.getTokenProperties( + await tokenAttributes.getTokenAttributes( ownedCollection.address, tokenId, [], @@ -611,20 +611,20 @@ describe('RMRKTokenPropertiesRepository', async function () { ]); }); - it('can set multiple bytes properties at the same time', async function () { + it('can set multiple bytes attributes at the same time', async function () { await expect( - tokenProperties.setBytesProperties(ownedCollection.address, tokenId, [ + tokenAttributes.setBytesAttributes(ownedCollection.address, tokenId, [ { key: 'bytes1', value: '0x1234' }, { key: 'bytes2', value: '0x5678' }, ]), ) - .to.emit(tokenProperties, 'BytesPropertyUpdated') + .to.emit(tokenAttributes, 'BytesAttributeUpdated') .withArgs(ownedCollection.address, tokenId, 'bytes1', '0x1234') - .to.emit(tokenProperties, 'BytesPropertyUpdated') + .to.emit(tokenAttributes, 'BytesAttributeUpdated') .withArgs(ownedCollection.address, tokenId, 'bytes2', '0x5678'); expect( - await tokenProperties.getTokenProperties( + await tokenAttributes.getTokenAttributes( ownedCollection.address, tokenId, [], @@ -646,59 +646,59 @@ describe('RMRKTokenPropertiesRepository', async function () { }); it('can reuse keys and values are fine', async function () { - await tokenProperties.setStringProperty(ownedCollection.address, tokenId, 'X', 'X1'); - await tokenProperties.setStringProperty(ownedCollection.address, tokenId2, 'X', 'X2'); + await tokenAttributes.setStringAttribute(ownedCollection.address, tokenId, 'X', 'X1'); + await tokenAttributes.setStringAttribute(ownedCollection.address, tokenId2, 'X', 'X2'); expect( - await tokenProperties.getStringTokenProperty(ownedCollection.address, tokenId, 'X'), + await tokenAttributes.getStringTokenAttribute(ownedCollection.address, tokenId, 'X'), ).to.eql('X1'); expect( - await tokenProperties.getStringTokenProperty(ownedCollection.address, tokenId2, 'X'), + await tokenAttributes.getStringTokenAttribute(ownedCollection.address, tokenId2, 'X'), ).to.eql('X2'); }); - it('can reuse keys among different properties and values are fine', async function () { - await tokenProperties.setStringProperty( + it('can reuse keys among different attributes and values are fine', async function () { + await tokenAttributes.setStringAttribute( ownedCollection.address, tokenId, 'X', 'test description', ); - await tokenProperties.setBoolProperty(ownedCollection.address, tokenId, 'X', true); - await tokenProperties.setAddressProperty( + await tokenAttributes.setBoolAttribute(ownedCollection.address, tokenId, 'X', true); + await tokenAttributes.setAddressAttribute( ownedCollection.address, tokenId, 'X', owner.address, ); - await tokenProperties.setUintProperty(ownedCollection.address, tokenId, 'X', bn(100)); - await tokenProperties.setBytesProperty(ownedCollection.address, tokenId, 'X', '0x1234'); + await tokenAttributes.setUintAttribute(ownedCollection.address, tokenId, 'X', bn(100)); + await tokenAttributes.setBytesAttribute(ownedCollection.address, tokenId, 'X', '0x1234'); expect( - await tokenProperties.getStringTokenProperty(ownedCollection.address, tokenId, 'X'), + await tokenAttributes.getStringTokenAttribute(ownedCollection.address, tokenId, 'X'), ).to.eql('test description'); expect( - await tokenProperties.getBoolTokenProperty(ownedCollection.address, tokenId, 'X'), + await tokenAttributes.getBoolTokenAttribute(ownedCollection.address, tokenId, 'X'), ).to.eql(true); expect( - await tokenProperties.getAddressTokenProperty(ownedCollection.address, tokenId, 'X'), + await tokenAttributes.getAddressTokenAttribute(ownedCollection.address, tokenId, 'X'), ).to.eql(owner.address); expect( - await tokenProperties.getUintTokenProperty(ownedCollection.address, tokenId, 'X'), + await tokenAttributes.getUintTokenAttribute(ownedCollection.address, tokenId, 'X'), ).to.eql(bn(100)); expect( - await tokenProperties.getBytesTokenProperty(ownedCollection.address, tokenId, 'X'), + await tokenAttributes.getBytesTokenAttribute(ownedCollection.address, tokenId, 'X'), ).to.eql('0x1234'); }); it('can reuse string values and values are fine', async function () { - await tokenProperties.setStringProperty( + await tokenAttributes.setStringAttribute( ownedCollection.address, tokenId, 'X', 'common string', ); - await tokenProperties.setStringProperty( + await tokenAttributes.setStringAttribute( ownedCollection.address, tokenId2, 'X', @@ -706,60 +706,62 @@ describe('RMRKTokenPropertiesRepository', async function () { ); expect( - await tokenProperties.getStringTokenProperty(ownedCollection.address, tokenId, 'X'), + await tokenAttributes.getStringTokenAttribute(ownedCollection.address, tokenId, 'X'), ).to.eql('common string'); expect( - await tokenProperties.getStringTokenProperty(ownedCollection.address, tokenId2, 'X'), + await tokenAttributes.getStringTokenAttribute(ownedCollection.address, tokenId2, 'X'), ).to.eql('common string'); }); it('should not allow to set string values to unauthorized caller', async function () { await expect( - tokenProperties + tokenAttributes .connect(owner) - .setStringProperty(ownedCollection.address, tokenId, 'X', 'test description'), - ).to.be.revertedWithCustomError(tokenProperties, 'RMRKNotCollectionIssuer'); + .setStringAttribute(ownedCollection.address, tokenId, 'X', 'test description'), + ).to.be.revertedWithCustomError(tokenAttributes, 'NotCollectionIssuer'); }); it('should not allow to set uint values to unauthorized caller', async function () { await expect( - tokenProperties + tokenAttributes .connect(owner) - .setUintProperty(ownedCollection.address, tokenId, 'X', bn(42)), - ).to.be.revertedWithCustomError(tokenProperties, 'RMRKNotCollectionIssuer'); + .setUintAttribute(ownedCollection.address, tokenId, 'X', bn(42)), + ).to.be.revertedWithCustomError(tokenAttributes, 'NotCollectionIssuer'); }); it('should not allow to set boolean values to unauthorized caller', async function () { await expect( - tokenProperties.connect(owner).setBoolProperty(ownedCollection.address, tokenId, 'X', true), - ).to.be.revertedWithCustomError(tokenProperties, 'RMRKNotCollectionIssuer'); + tokenAttributes + .connect(owner) + .setBoolAttribute(ownedCollection.address, tokenId, 'X', true), + ).to.be.revertedWithCustomError(tokenAttributes, 'NotCollectionIssuer'); }); it('should not allow to set address values to unauthorized caller', async function () { await expect( - tokenProperties + tokenAttributes .connect(owner) - .setAddressProperty(ownedCollection.address, tokenId, 'X', owner.address), - ).to.be.revertedWithCustomError(tokenProperties, 'RMRKNotCollectionIssuer'); + .setAddressAttribute(ownedCollection.address, tokenId, 'X', owner.address), + ).to.be.revertedWithCustomError(tokenAttributes, 'NotCollectionIssuer'); }); it('should not allow to set bytes values to unauthorized caller', async function () { await expect( - tokenProperties + tokenAttributes .connect(owner) - .setBytesProperty(ownedCollection.address, tokenId, 'X', '0x1234'), - ).to.be.revertedWithCustomError(tokenProperties, 'RMRKNotCollectionIssuer'); + .setBytesAttribute(ownedCollection.address, tokenId, 'X', '0x1234'), + ).to.be.revertedWithCustomError(tokenAttributes, 'NotCollectionIssuer'); }); }); - describe('Token properties access control', async function () { + describe('Token attributes access control', async function () { let issuer: SignerWithAddress; let owner: SignerWithAddress; const tokenId = 1; const tokenId2 = 2; beforeEach(async function () { - ({ tokenProperties } = await loadFixture(tokenPropertiesFixture)); + ({ tokenAttributes } = await loadFixture(tokenAttributesFixture)); ({ ownedCollection } = await loadFixture(ownedCollectionFixture)); const signers = await ethers.getSigners(); @@ -770,329 +772,329 @@ describe('RMRKTokenPropertiesRepository', async function () { }); it('should not allow registering an already registered collection', async function () { - await tokenProperties.registerAccessControl(ownedCollection.address, issuer.address, false); + await tokenAttributes.registerAccessControl(ownedCollection.address, issuer.address, false); await expect( - tokenProperties.registerAccessControl(ownedCollection.address, issuer.address, false), - ).to.be.revertedWithCustomError(tokenProperties, 'RMRKCollectionAlreadyRegistered'); + tokenAttributes.registerAccessControl(ownedCollection.address, issuer.address, false), + ).to.be.revertedWithCustomError(tokenAttributes, 'CollectionAlreadyRegistered'); }); it('should not allow to register a collection if caller is not the owner of the collection', async function () { await expect( - tokenProperties + tokenAttributes .connect(owner) .registerAccessControl(ownedCollection.address, issuer.address, true), - ).to.be.revertedWithCustomError(tokenProperties, 'RMRKNotCollectionIssuer'); + ).to.be.revertedWithCustomError(tokenAttributes, 'NotCollectionIssuer'); }); it('should not allow to register a collection without Ownable implemented', async function () { ownedCollection.owner.reset(); await expect( - tokenProperties.registerAccessControl(ownedCollection.address, issuer.address, false), - ).to.be.revertedWithCustomError(tokenProperties, 'RMRKOwnableNotImplemented'); + tokenAttributes.registerAccessControl(ownedCollection.address, issuer.address, false), + ).to.be.revertedWithCustomError(tokenAttributes, 'OwnableNotImplemented'); }); it('should allow to manage access control for registered collections', async function () { - await tokenProperties.registerAccessControl(ownedCollection.address, issuer.address, false); + await tokenAttributes.registerAccessControl(ownedCollection.address, issuer.address, false); expect( - await tokenProperties + await tokenAttributes .connect(issuer) .manageAccessControl(ownedCollection.address, 'X', 2, owner.address), ) - .to.emit(tokenProperties, 'AccessControlUpdate') + .to.emit(tokenAttributes, 'AccessControlUpdate') .withArgs(ownedCollection.address, 'X', 2, owner); }); it('should allow issuer to manage collaborators', async function () { - await tokenProperties.registerAccessControl(ownedCollection.address, issuer.address, false); + await tokenAttributes.registerAccessControl(ownedCollection.address, issuer.address, false); expect( - await tokenProperties + await tokenAttributes .connect(issuer) .manageCollaborators(ownedCollection.address, [owner.address], [true]), ) - .to.emit(tokenProperties, 'CollaboratorUpdate') + .to.emit(tokenAttributes, 'CollaboratorUpdate') .withArgs(ownedCollection.address, [owner.address], [true]); }); it('should not allow to manage collaborators of an unregistered collection', async function () { await expect( - tokenProperties + tokenAttributes .connect(issuer) .manageCollaborators(ownedCollection.address, [owner.address], [true]), - ).to.be.revertedWithCustomError(tokenProperties, 'RMRKCollectionNotRegistered'); + ).to.be.revertedWithCustomError(tokenAttributes, 'CollectionNotRegistered'); }); it('should not allow to manage collaborators if the caller is not the issuer', async function () { - await tokenProperties.registerAccessControl(ownedCollection.address, issuer.address, false); + await tokenAttributes.registerAccessControl(ownedCollection.address, issuer.address, false); await expect( - tokenProperties + tokenAttributes .connect(owner) .manageCollaborators(ownedCollection.address, [owner.address], [true]), - ).to.be.revertedWithCustomError(tokenProperties, 'RMRKNotCollectionIssuer'); + ).to.be.revertedWithCustomError(tokenAttributes, 'NotCollectionIssuer'); }); it('should not allow to manage collaborators for registered collections if collaborator arrays are not of equal length', async function () { - await tokenProperties.registerAccessControl(ownedCollection.address, issuer.address, false); + await tokenAttributes.registerAccessControl(ownedCollection.address, issuer.address, false); await expect( - tokenProperties + tokenAttributes .connect(issuer) .manageCollaborators(ownedCollection.address, [owner.address, issuer.address], [true]), - ).to.be.revertedWithCustomError(tokenProperties, 'RMRKCollaboratorArraysNotEqualLength'); + ).to.be.revertedWithCustomError(tokenAttributes, 'CollaboratorArraysNotEqualLength'); }); it('should not allow to manage access control for unregistered collections', async function () { await expect( - tokenProperties + tokenAttributes .connect(issuer) .manageAccessControl(ownedCollection.address, 'X', 2, owner.address), - ).to.be.revertedWithCustomError(tokenProperties, 'RMRKCollectionNotRegistered'); + ).to.be.revertedWithCustomError(tokenAttributes, 'CollectionNotRegistered'); }); it('should not allow to manage access control if the caller is not issuer', async function () { - await tokenProperties.registerAccessControl(ownedCollection.address, issuer.address, false); + await tokenAttributes.registerAccessControl(ownedCollection.address, issuer.address, false); await expect( - tokenProperties + tokenAttributes .connect(owner) .manageAccessControl(ownedCollection.address, 'X', 2, owner.address), - ).to.be.revertedWithCustomError(tokenProperties, 'RMRKNotCollectionIssuer'); + ).to.be.revertedWithCustomError(tokenAttributes, 'NotCollectionIssuer'); }); it('should not allow to manage access control if the caller is not returned as collection owner when using ownable', async function () { - await tokenProperties.registerAccessControl(ownedCollection.address, issuer.address, true); + await tokenAttributes.registerAccessControl(ownedCollection.address, issuer.address, true); await expect( - tokenProperties + tokenAttributes .connect(owner) .manageAccessControl(ownedCollection.address, 'X', 2, owner.address), - ).to.be.revertedWithCustomError(tokenProperties, 'RMRKNotCollectionIssuer'); + ).to.be.revertedWithCustomError(tokenAttributes, 'NotCollectionIssuer'); }); it('should return the expected value when checking for collaborators', async function () { - await tokenProperties.registerAccessControl(ownedCollection.address, issuer.address, false); + await tokenAttributes.registerAccessControl(ownedCollection.address, issuer.address, false); - expect(await tokenProperties.isCollaborator(owner.address, ownedCollection.address)).to.be + expect(await tokenAttributes.isCollaborator(owner.address, ownedCollection.address)).to.be .false; - await tokenProperties + await tokenAttributes .connect(issuer) .manageCollaborators(ownedCollection.address, [owner.address], [true]); - expect(await tokenProperties.isCollaborator(owner.address, ownedCollection.address)).to.be + expect(await tokenAttributes.isCollaborator(owner.address, ownedCollection.address)).to.be .true; }); it('should return the expected value when checking for specific addresses', async function () { - await tokenProperties.registerAccessControl(ownedCollection.address, issuer.address, false); + await tokenAttributes.registerAccessControl(ownedCollection.address, issuer.address, false); - expect(await tokenProperties.isSpecificAddress(owner.address, ownedCollection.address, 'X')) + expect(await tokenAttributes.isSpecificAddress(owner.address, ownedCollection.address, 'X')) .to.be.false; - await tokenProperties + await tokenAttributes .connect(issuer) .manageAccessControl(ownedCollection.address, 'X', 2, owner.address); - expect(await tokenProperties.isSpecificAddress(owner.address, ownedCollection.address, 'X')) + expect(await tokenAttributes.isSpecificAddress(owner.address, ownedCollection.address, 'X')) .to.be.true; }); it('should use the issuer returned from the collection when using only issuer when only issuer is allowed to manage parameter', async function () { - await tokenProperties + await tokenAttributes .connect(issuer) .registerAccessControl(ownedCollection.address, issuer.address, true); - await tokenProperties + await tokenAttributes .connect(issuer) .manageAccessControl(ownedCollection.address, 'X', 0, ethers.constants.AddressZero); await expect( - tokenProperties + tokenAttributes .connect(owner) - .setAddressProperty(ownedCollection.address, 1, 'X', owner.address), - ).to.be.revertedWithCustomError(tokenProperties, 'RMRKNotCollectionIssuer'); + .setAddressAttribute(ownedCollection.address, 1, 'X', owner.address), + ).to.be.revertedWithCustomError(tokenAttributes, 'NotCollectionIssuer'); ownedCollection.owner.returns(owner.address); await expect( - tokenProperties + tokenAttributes .connect(issuer) - .setAddressProperty(ownedCollection.address, 1, 'X', owner.address), - ).to.be.revertedWithCustomError(tokenProperties, 'RMRKNotCollectionIssuer'); + .setAddressAttribute(ownedCollection.address, 1, 'X', owner.address), + ).to.be.revertedWithCustomError(tokenAttributes, 'NotCollectionIssuer'); }); it('should only allow collaborator to modify the parameters if only collaborator is allowed to modify them', async function () { - await tokenProperties + await tokenAttributes .connect(issuer) .registerAccessControl(ownedCollection.address, issuer.address, false); - await tokenProperties + await tokenAttributes .connect(issuer) .manageAccessControl(ownedCollection.address, 'X', 1, ethers.constants.AddressZero); - await tokenProperties + await tokenAttributes .connect(issuer) .manageCollaborators(ownedCollection.address, [owner.address], [true]); - await tokenProperties + await tokenAttributes .connect(owner) - .setAddressProperty(ownedCollection.address, 1, 'X', owner.address); + .setAddressAttribute(ownedCollection.address, 1, 'X', owner.address); await expect( - tokenProperties + tokenAttributes .connect(issuer) - .setAddressProperty(ownedCollection.address, 1, 'X', owner.address), - ).to.be.revertedWithCustomError(tokenProperties, 'RMRKNotCollectionCollaborator'); + .setAddressAttribute(ownedCollection.address, 1, 'X', owner.address), + ).to.be.revertedWithCustomError(tokenAttributes, 'NotCollectionCollaborator'); }); it('should only allow issuer and collaborator to modify the parameters if only issuer and collaborator is allowed to modify them', async function () { - await tokenProperties + await tokenAttributes .connect(issuer) .registerAccessControl(ownedCollection.address, issuer.address, false); - await tokenProperties + await tokenAttributes .connect(issuer) .manageAccessControl(ownedCollection.address, 'X', 2, ethers.constants.AddressZero); - await tokenProperties + await tokenAttributes .connect(issuer) - .setAddressProperty(ownedCollection.address, 1, 'X', owner.address); + .setAddressAttribute(ownedCollection.address, 1, 'X', owner.address); await expect( - tokenProperties + tokenAttributes .connect(owner) - .setAddressProperty(ownedCollection.address, 1, 'X', owner.address), - ).to.be.revertedWithCustomError(tokenProperties, 'RMRKNotCollectionIssuerOrCollaborator'); + .setAddressAttribute(ownedCollection.address, 1, 'X', owner.address), + ).to.be.revertedWithCustomError(tokenAttributes, 'NotCollectionIssuerOrCollaborator'); - await tokenProperties + await tokenAttributes .connect(issuer) .manageCollaborators(ownedCollection.address, [owner.address], [true]); - await tokenProperties + await tokenAttributes .connect(owner) - .setAddressProperty(ownedCollection.address, 1, 'X', owner.address); + .setAddressAttribute(ownedCollection.address, 1, 'X', owner.address); }); it('should only allow issuer and collaborator to modify the parameters if only issuer and collaborator is allowed to modify them even when using the ownable', async function () { - await tokenProperties + await tokenAttributes .connect(issuer) .registerAccessControl(ownedCollection.address, issuer.address, true); - await tokenProperties + await tokenAttributes .connect(issuer) .manageAccessControl(ownedCollection.address, 'X', 2, ethers.constants.AddressZero); ownedCollection.owner.returns(owner.address); - await tokenProperties + await tokenAttributes .connect(owner) - .setAddressProperty(ownedCollection.address, 1, 'X', owner.address); + .setAddressAttribute(ownedCollection.address, 1, 'X', owner.address); await expect( - tokenProperties + tokenAttributes .connect(issuer) - .setAddressProperty(ownedCollection.address, 1, 'X', owner.address), - ).to.be.revertedWithCustomError(tokenProperties, 'RMRKNotCollectionIssuerOrCollaborator'); + .setAddressAttribute(ownedCollection.address, 1, 'X', owner.address), + ).to.be.revertedWithCustomError(tokenAttributes, 'NotCollectionIssuerOrCollaborator'); - await tokenProperties + await tokenAttributes .connect(owner) .manageCollaborators(ownedCollection.address, [issuer.address], [true]); - await tokenProperties + await tokenAttributes .connect(issuer) - .setAddressProperty(ownedCollection.address, 1, 'X', owner.address); + .setAddressAttribute(ownedCollection.address, 1, 'X', owner.address); }); it('should only allow token owner to modify the parameters if only token owner is allowed to modify them', async function () { - await tokenProperties + await tokenAttributes .connect(issuer) .registerAccessControl(ownedCollection.address, issuer.address, false); - await tokenProperties + await tokenAttributes .connect(issuer) .manageAccessControl(ownedCollection.address, 'X', 3, ethers.constants.AddressZero); await expect( - tokenProperties + tokenAttributes .connect(owner) - .setAddressProperty(ownedCollection.address, 1, 'X', owner.address), - ).to.be.revertedWithCustomError(tokenProperties, 'RMRKNotTokenOwner'); + .setAddressAttribute(ownedCollection.address, 1, 'X', owner.address), + ).to.be.revertedWithCustomError(tokenAttributes, 'NotTokenOwner'); ownedCollection.ownerOf.returns(owner.address); - await tokenProperties + await tokenAttributes .connect(owner) - .setAddressProperty(ownedCollection.address, 1, 'X', owner.address); + .setAddressAttribute(ownedCollection.address, 1, 'X', owner.address); await expect( - tokenProperties + tokenAttributes .connect(issuer) - .setAddressProperty(ownedCollection.address, 1, 'X', owner.address), - ).to.be.revertedWithCustomError(tokenProperties, 'RMRKNotTokenOwner'); + .setAddressAttribute(ownedCollection.address, 1, 'X', owner.address), + ).to.be.revertedWithCustomError(tokenAttributes, 'NotTokenOwner'); }); it('should only allow specific address to modify the parameters if only specific address is allowed to modify them', async function () { - await tokenProperties + await tokenAttributes .connect(issuer) .registerAccessControl(ownedCollection.address, issuer.address, false); - await tokenProperties + await tokenAttributes .connect(issuer) .manageAccessControl(ownedCollection.address, 'X', 4, ethers.constants.AddressZero); await expect( - tokenProperties + tokenAttributes .connect(owner) - .setAddressProperty(ownedCollection.address, 1, 'X', owner.address), - ).to.be.revertedWithCustomError(tokenProperties, 'RMRKNotSpecificAddress'); + .setAddressAttribute(ownedCollection.address, 1, 'X', owner.address), + ).to.be.revertedWithCustomError(tokenAttributes, 'NotSpecificAddress'); - await tokenProperties + await tokenAttributes .connect(issuer) .manageAccessControl(ownedCollection.address, 'X', 4, owner.address); - await tokenProperties + await tokenAttributes .connect(owner) - .setAddressProperty(ownedCollection.address, 1, 'X', owner.address); + .setAddressAttribute(ownedCollection.address, 1, 'X', owner.address); }); it('should allow to use presigned message to modify the parameters', async function () { - await tokenProperties + await tokenAttributes .connect(issuer) .registerAccessControl(ownedCollection.address, issuer.address, false); - const uintMessage = await tokenProperties.prepareMessageToPresignUintProperty( + const uintMessage = await tokenAttributes.prepareMessageToPresignUintAttribute( ownedCollection.address, 1, 'X', 1, bn(9999999999), ); - const stringMessage = await tokenProperties.prepareMessageToPresignStringProperty( + const stringMessage = await tokenAttributes.prepareMessageToPresignStringAttribute( ownedCollection.address, 1, 'X', 'test', bn(9999999999), ); - const boolMessage = await tokenProperties.prepareMessageToPresignBoolProperty( + const boolMessage = await tokenAttributes.prepareMessageToPresignBoolAttribute( ownedCollection.address, 1, 'X', true, bn(9999999999), ); - const bytesMessage = await tokenProperties.prepareMessageToPresignBytesProperty( + const bytesMessage = await tokenAttributes.prepareMessageToPresignBytesAttribute( ownedCollection.address, 1, 'X', '0x1234', bn(9999999999), ); - const addressMessage = await tokenProperties.prepareMessageToPresignAddressProperty( + const addressMessage = await tokenAttributes.prepareMessageToPresignAddressAttribute( ownedCollection.address, 1, 'X', @@ -1127,9 +1129,9 @@ describe('RMRKTokenPropertiesRepository', async function () { const addressV: string = parseInt(addressSignature.substring(130, 132), 16); await expect( - tokenProperties + tokenAttributes .connect(owner) - .presignedSetUintProperty( + .presignedSetUintAttribute( issuer.address, ownedCollection.address, 1, @@ -1141,12 +1143,12 @@ describe('RMRKTokenPropertiesRepository', async function () { uintS, ), ) - .to.emit(tokenProperties, 'UintPropertyUpdated') + .to.emit(tokenAttributes, 'UintAttributeUpdated') .withArgs(ownedCollection.address, 1, 'X', 1); await expect( - tokenProperties + tokenAttributes .connect(owner) - .presignedSetStringProperty( + .presignedSetStringAttribute( issuer.address, ownedCollection.address, 1, @@ -1158,12 +1160,12 @@ describe('RMRKTokenPropertiesRepository', async function () { stringS, ), ) - .to.emit(tokenProperties, 'StringPropertyUpdated') + .to.emit(tokenAttributes, 'StringAttributeUpdated') .withArgs(ownedCollection.address, 1, 'X', 'test'); await expect( - tokenProperties + tokenAttributes .connect(owner) - .presignedSetBoolProperty( + .presignedSetBoolAttribute( issuer.address, ownedCollection.address, 1, @@ -1175,12 +1177,12 @@ describe('RMRKTokenPropertiesRepository', async function () { boolS, ), ) - .to.emit(tokenProperties, 'BoolPropertyUpdated') + .to.emit(tokenAttributes, 'BoolAttributeUpdated') .withArgs(ownedCollection.address, 1, 'X', true); await expect( - tokenProperties + tokenAttributes .connect(owner) - .presignedSetBytesProperty( + .presignedSetBytesAttribute( issuer.address, ownedCollection.address, 1, @@ -1192,12 +1194,12 @@ describe('RMRKTokenPropertiesRepository', async function () { bytesS, ), ) - .to.emit(tokenProperties, 'BytesPropertyUpdated') + .to.emit(tokenAttributes, 'BytesAttributeUpdated') .withArgs(ownedCollection.address, 1, 'X', '0x1234'); await expect( - tokenProperties + tokenAttributes .connect(owner) - .presignedSetAddressProperty( + .presignedSetAddressAttribute( issuer.address, ownedCollection.address, 1, @@ -1209,46 +1211,46 @@ describe('RMRKTokenPropertiesRepository', async function () { addressS, ), ) - .to.emit(tokenProperties, 'AddressPropertyUpdated') + .to.emit(tokenAttributes, 'AddressAttributeUpdated') .withArgs(ownedCollection.address, 1, 'X', owner.address); }); it('should not allow to use presigned message to modify the parameters if the deadline has elapsed', async function () { - await tokenProperties + await tokenAttributes .connect(issuer) .registerAccessControl(ownedCollection.address, issuer.address, false); await mine(1000, { interval: 15 }); - const uintMessage = await tokenProperties.prepareMessageToPresignUintProperty( + const uintMessage = await tokenAttributes.prepareMessageToPresignUintAttribute( ownedCollection.address, 1, 'X', 1, bn(10), ); - const stringMessage = await tokenProperties.prepareMessageToPresignStringProperty( + const stringMessage = await tokenAttributes.prepareMessageToPresignStringAttribute( ownedCollection.address, 1, 'X', 'test', bn(10), ); - const boolMessage = await tokenProperties.prepareMessageToPresignBoolProperty( + const boolMessage = await tokenAttributes.prepareMessageToPresignBoolAttribute( ownedCollection.address, 1, 'X', true, bn(10), ); - const bytesMessage = await tokenProperties.prepareMessageToPresignBytesProperty( + const bytesMessage = await tokenAttributes.prepareMessageToPresignBytesAttribute( ownedCollection.address, 1, 'X', '0x1234', bn(10), ); - const addressMessage = await tokenProperties.prepareMessageToPresignAddressProperty( + const addressMessage = await tokenAttributes.prepareMessageToPresignAddressAttribute( ownedCollection.address, 1, 'X', @@ -1283,9 +1285,9 @@ describe('RMRKTokenPropertiesRepository', async function () { const addressV: string = parseInt(addressSignature.substring(130, 132), 16); await expect( - tokenProperties + tokenAttributes .connect(owner) - .presignedSetUintProperty( + .presignedSetUintAttribute( issuer.address, ownedCollection.address, 1, @@ -1296,11 +1298,11 @@ describe('RMRKTokenPropertiesRepository', async function () { uintR, uintS, ), - ).to.be.revertedWithCustomError(tokenProperties, 'RMRKExpiredDeadline'); + ).to.be.revertedWithCustomError(tokenAttributes, 'ExpiredDeadline'); await expect( - tokenProperties + tokenAttributes .connect(owner) - .presignedSetStringProperty( + .presignedSetStringAttribute( issuer.address, ownedCollection.address, 1, @@ -1311,11 +1313,11 @@ describe('RMRKTokenPropertiesRepository', async function () { stringR, stringS, ), - ).to.be.revertedWithCustomError(tokenProperties, 'RMRKExpiredDeadline'); + ).to.be.revertedWithCustomError(tokenAttributes, 'ExpiredDeadline'); await expect( - tokenProperties + tokenAttributes .connect(owner) - .presignedSetBoolProperty( + .presignedSetBoolAttribute( issuer.address, ownedCollection.address, 1, @@ -1326,11 +1328,11 @@ describe('RMRKTokenPropertiesRepository', async function () { boolR, boolS, ), - ).to.be.revertedWithCustomError(tokenProperties, 'RMRKExpiredDeadline'); + ).to.be.revertedWithCustomError(tokenAttributes, 'ExpiredDeadline'); await expect( - tokenProperties + tokenAttributes .connect(owner) - .presignedSetBytesProperty( + .presignedSetBytesAttribute( issuer.address, ownedCollection.address, 1, @@ -1341,11 +1343,11 @@ describe('RMRKTokenPropertiesRepository', async function () { bytesR, bytesS, ), - ).to.be.revertedWithCustomError(tokenProperties, 'RMRKExpiredDeadline'); + ).to.be.revertedWithCustomError(tokenAttributes, 'ExpiredDeadline'); await expect( - tokenProperties + tokenAttributes .connect(owner) - .presignedSetAddressProperty( + .presignedSetAddressAttribute( issuer.address, ownedCollection.address, 1, @@ -1356,43 +1358,43 @@ describe('RMRKTokenPropertiesRepository', async function () { addressR, addressS, ), - ).to.be.revertedWithCustomError(tokenProperties, 'RMRKExpiredDeadline'); + ).to.be.revertedWithCustomError(tokenAttributes, 'ExpiredDeadline'); }); it('should not allow to use presigned message to modify the parameters if the setter does not match the actual signer', async function () { - await tokenProperties + await tokenAttributes .connect(issuer) .registerAccessControl(ownedCollection.address, issuer.address, false); - const uintMessage = await tokenProperties.prepareMessageToPresignUintProperty( + const uintMessage = await tokenAttributes.prepareMessageToPresignUintAttribute( ownedCollection.address, 1, 'X', 1, bn(9999999999), ); - const stringMessage = await tokenProperties.prepareMessageToPresignStringProperty( + const stringMessage = await tokenAttributes.prepareMessageToPresignStringAttribute( ownedCollection.address, 1, 'X', 'test', bn(9999999999), ); - const boolMessage = await tokenProperties.prepareMessageToPresignBoolProperty( + const boolMessage = await tokenAttributes.prepareMessageToPresignBoolAttribute( ownedCollection.address, 1, 'X', true, bn(9999999999), ); - const bytesMessage = await tokenProperties.prepareMessageToPresignBytesProperty( + const bytesMessage = await tokenAttributes.prepareMessageToPresignBytesAttribute( ownedCollection.address, 1, 'X', '0x1234', bn(9999999999), ); - const addressMessage = await tokenProperties.prepareMessageToPresignAddressProperty( + const addressMessage = await tokenAttributes.prepareMessageToPresignAddressAttribute( ownedCollection.address, 1, 'X', @@ -1427,9 +1429,9 @@ describe('RMRKTokenPropertiesRepository', async function () { const addressV: string = parseInt(addressSignature.substring(130, 132), 16); await expect( - tokenProperties + tokenAttributes .connect(owner) - .presignedSetUintProperty( + .presignedSetUintAttribute( issuer.address, ownedCollection.address, 1, @@ -1440,11 +1442,11 @@ describe('RMRKTokenPropertiesRepository', async function () { uintR, uintS, ), - ).to.be.revertedWithCustomError(tokenProperties, 'RMRKInvalidSignature'); + ).to.be.revertedWithCustomError(tokenAttributes, 'InvalidSignature'); await expect( - tokenProperties + tokenAttributes .connect(owner) - .presignedSetStringProperty( + .presignedSetStringAttribute( issuer.address, ownedCollection.address, 1, @@ -1455,11 +1457,11 @@ describe('RMRKTokenPropertiesRepository', async function () { stringR, stringS, ), - ).to.be.revertedWithCustomError(tokenProperties, 'RMRKInvalidSignature'); + ).to.be.revertedWithCustomError(tokenAttributes, 'InvalidSignature'); await expect( - tokenProperties + tokenAttributes .connect(owner) - .presignedSetBoolProperty( + .presignedSetBoolAttribute( issuer.address, ownedCollection.address, 1, @@ -1470,11 +1472,11 @@ describe('RMRKTokenPropertiesRepository', async function () { boolR, boolS, ), - ).to.be.revertedWithCustomError(tokenProperties, 'RMRKInvalidSignature'); + ).to.be.revertedWithCustomError(tokenAttributes, 'InvalidSignature'); await expect( - tokenProperties + tokenAttributes .connect(owner) - .presignedSetBytesProperty( + .presignedSetBytesAttribute( issuer.address, ownedCollection.address, 1, @@ -1485,11 +1487,11 @@ describe('RMRKTokenPropertiesRepository', async function () { bytesR, bytesS, ), - ).to.be.revertedWithCustomError(tokenProperties, 'RMRKInvalidSignature'); + ).to.be.revertedWithCustomError(tokenAttributes, 'InvalidSignature'); await expect( - tokenProperties + tokenAttributes .connect(owner) - .presignedSetAddressProperty( + .presignedSetAddressAttribute( issuer.address, ownedCollection.address, 1, @@ -1500,39 +1502,39 @@ describe('RMRKTokenPropertiesRepository', async function () { addressR, addressS, ), - ).to.be.revertedWithCustomError(tokenProperties, 'RMRKInvalidSignature'); + ).to.be.revertedWithCustomError(tokenAttributes, 'InvalidSignature'); }); it('should not allow to use presigned message to modify the parameters if the signer is not authorized to modify them', async function () { - const uintMessage = await tokenProperties.prepareMessageToPresignUintProperty( + const uintMessage = await tokenAttributes.prepareMessageToPresignUintAttribute( ownedCollection.address, 1, 'X', 1, bn(9999999999), ); - const stringMessage = await tokenProperties.prepareMessageToPresignStringProperty( + const stringMessage = await tokenAttributes.prepareMessageToPresignStringAttribute( ownedCollection.address, 1, 'X', 'test', bn(9999999999), ); - const boolMessage = await tokenProperties.prepareMessageToPresignBoolProperty( + const boolMessage = await tokenAttributes.prepareMessageToPresignBoolAttribute( ownedCollection.address, 1, 'X', true, bn(9999999999), ); - const bytesMessage = await tokenProperties.prepareMessageToPresignBytesProperty( + const bytesMessage = await tokenAttributes.prepareMessageToPresignBytesAttribute( ownedCollection.address, 1, 'X', '0x1234', bn(9999999999), ); - const addressMessage = await tokenProperties.prepareMessageToPresignAddressProperty( + const addressMessage = await tokenAttributes.prepareMessageToPresignAddressAttribute( ownedCollection.address, 1, 'X', @@ -1567,9 +1569,9 @@ describe('RMRKTokenPropertiesRepository', async function () { const addressV: string = parseInt(addressSignature.substring(130, 132), 16); await expect( - tokenProperties + tokenAttributes .connect(owner) - .presignedSetUintProperty( + .presignedSetUintAttribute( issuer.address, ownedCollection.address, 1, @@ -1580,11 +1582,11 @@ describe('RMRKTokenPropertiesRepository', async function () { uintR, uintS, ), - ).to.be.revertedWithCustomError(tokenProperties, 'RMRKNotCollectionIssuer'); + ).to.be.revertedWithCustomError(tokenAttributes, 'NotCollectionIssuer'); await expect( - tokenProperties + tokenAttributes .connect(owner) - .presignedSetStringProperty( + .presignedSetStringAttribute( issuer.address, ownedCollection.address, 1, @@ -1595,11 +1597,11 @@ describe('RMRKTokenPropertiesRepository', async function () { stringR, stringS, ), - ).to.be.revertedWithCustomError(tokenProperties, 'RMRKNotCollectionIssuer'); + ).to.be.revertedWithCustomError(tokenAttributes, 'NotCollectionIssuer'); await expect( - tokenProperties + tokenAttributes .connect(owner) - .presignedSetBoolProperty( + .presignedSetBoolAttribute( issuer.address, ownedCollection.address, 1, @@ -1610,11 +1612,11 @@ describe('RMRKTokenPropertiesRepository', async function () { boolR, boolS, ), - ).to.be.revertedWithCustomError(tokenProperties, 'RMRKNotCollectionIssuer'); + ).to.be.revertedWithCustomError(tokenAttributes, 'NotCollectionIssuer'); await expect( - tokenProperties + tokenAttributes .connect(owner) - .presignedSetBytesProperty( + .presignedSetBytesAttribute( issuer.address, ownedCollection.address, 1, @@ -1625,11 +1627,11 @@ describe('RMRKTokenPropertiesRepository', async function () { bytesR, bytesS, ), - ).to.be.revertedWithCustomError(tokenProperties, 'RMRKNotCollectionIssuer'); + ).to.be.revertedWithCustomError(tokenAttributes, 'NotCollectionIssuer'); await expect( - tokenProperties + tokenAttributes .connect(owner) - .presignedSetAddressProperty( + .presignedSetAddressAttribute( issuer.address, ownedCollection.address, 1, @@ -1640,19 +1642,17 @@ describe('RMRKTokenPropertiesRepository', async function () { addressR, addressS, ), - ).to.be.revertedWithCustomError(tokenProperties, 'RMRKNotCollectionIssuer'); + ).to.be.revertedWithCustomError(tokenAttributes, 'NotCollectionIssuer'); }); }); }); -async function shouldBehaveLikeTokenPropertiesRepositoryInterface() { +async function shouldBehaveLikeTokenAttributesRepositoryInterface() { it('can support IERC165', async function () { - expect(await this.tokenProperties.supportsInterface(IERC165)).to.equal(true); + expect(await this.tokenAttributes.supportsInterface(IERC165)).to.equal(true); }); - it('can support IRMRKTokenPropertiesRepository', async function () { - expect(await this.tokenProperties.supportsInterface(IRMRKTokenPropertiesRepository)).to.equal( - true, - ); + it('can support IERC7508', async function () { + expect(await this.tokenAttributes.supportsInterface(IERC7508)).to.equal(true); }); } diff --git a/test/interfaces.ts b/test/interfaces.ts index 474883ef..191a645a 100644 --- a/test/interfaces.ts +++ b/test/interfaces.ts @@ -14,7 +14,7 @@ const IRMRKMultiAssetAutoIndex = '0x1cf132fe'; const IRMRKReclaimableChild = '0x2fb59acf'; const IERC6454 = '0x91a6262f'; // ERC6454 const IRMRKTokenProperties = '0x6a49fd01'; -const IRMRKTokenPropertiesRepository = '0x003f5b32'; +const IERC7508 = '0x07cd44c7'; const IRMRKTypedMultiAsset = '0x7f7bb665'; const IRMRKImplementation = '0x524D524B'; // "RMRK" in ASCII hex @@ -35,7 +35,7 @@ export { IRMRKReclaimableChild, IERC6454, IRMRKTypedMultiAsset, - IRMRKTokenPropertiesRepository, + IERC7508, IRMRKTokenProperties, IRMRKImplementation, }; From d341a29eb34d2a6d5262342bafc5c57a2574e246 Mon Sep 17 00:00:00 2001 From: Jan Turk Date: Mon, 11 Sep 2023 13:35:20 +0200 Subject: [PATCH 11/19] Revert unnnecessary changes by prettier --- CHANGELOG.md | 12 ++++++------ contracts/RMRK/emotable/RMRKEmotesRepository.sol | 4 ++-- .../RMRK/extension/tokenHolder/RMRKTokenHolder.sol | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b0eae39..ee622fa9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,12 +46,12 @@ Core implementations updates include breaking changes as well; names and symbols - All contracts now use solidity version 0.8.21. - Upgrades dependencies. - Increases Istanbul code coverage: - | | **Previous** | **Current** | **Change** | - |:--------------: |:------------: |:-----------: |------------ | - | **Statements** | 100.00 % | 100.00 % | + 0.00 % | - | **Branches** | 95.53 % | 96.78 % | + 1.25 % | - | **Functions** | 99.60 % | 99.72 % | + 0.12 % | - | **Lines** | 99.63 % | 99.46 % | - 0.17 % | +| | **Previous** | **Current** | **Change** | +|:--------------: |:------------: |:-----------: |------------ | +| **Statements** | 100.00 % | 100.00 % | + 0.00 % | +| **Branches** | 95.53 % | 96.78 % | + 1.25 % | +| **Functions** | 99.60 % | 99.72 % | + 0.12 % | +| **Lines** | 99.63 % | 99.46 % | - 0.17 % | ### Fixed diff --git a/contracts/RMRK/emotable/RMRKEmotesRepository.sol b/contracts/RMRK/emotable/RMRKEmotesRepository.sol index 7fbe0399..692e6083 100644 --- a/contracts/RMRK/emotable/RMRKEmotesRepository.sol +++ b/contracts/RMRK/emotable/RMRKEmotesRepository.sol @@ -25,9 +25,9 @@ contract RMRKEmotesRepository is IRMRKEmotesRepository { ); // Used to avoid double emoting and control undoing - mapping(address => mapping(address => mapping(uint256 => mapping(string => uint256)))) + mapping(address emoter => mapping(address collection => mapping(uint256 tokenId => mapping(string emoji => uint256 state)))) private _emotesUsedByEmoter; // Cheaper than using a bool - mapping(address => mapping(uint256 => mapping(string => uint256))) + mapping(address collection => mapping(uint256 tokenId => mapping(string emoji => uint256 count))) private _emotesPerToken; /** diff --git a/contracts/RMRK/extension/tokenHolder/RMRKTokenHolder.sol b/contracts/RMRK/extension/tokenHolder/RMRKTokenHolder.sol index 20779b24..e2d3e816 100644 --- a/contracts/RMRK/extension/tokenHolder/RMRKTokenHolder.sol +++ b/contracts/RMRK/extension/tokenHolder/RMRKTokenHolder.sol @@ -20,7 +20,7 @@ error InsufficientBalance(); * @dev The RMRKTokenHolder extension is capable of holding ERC-20, ERC-721, and ERC-1155 tokens. */ abstract contract RMRKTokenHolder is IRMRKTokenHolder { - mapping(uint256 => mapping(address => mapping(TokenType => mapping(uint256 => uint256)))) + mapping(uint256 tokenId => mapping(address tokenAddress => mapping(TokenType tokenType => mapping(uint256 heldTokenId => uint256 balance)))) private _balances; /** From 7028016c87fe7d488160b9d9ed837cc5893725ca Mon Sep 17 00:00:00 2001 From: steven2308 Date: Wed, 13 Sep 2023 07:17:01 -0500 Subject: [PATCH 12/19] Improves hardhat config and .env.example. --- .env.example | 27 ++++++++++++++++++------- hardhat.config.ts | 51 +++++++++++++++++++---------------------------- 2 files changed, 40 insertions(+), 38 deletions(-) diff --git a/.env.example b/.env.example index 0e098988..1def16e7 100644 --- a/.env.example +++ b/.env.example @@ -1,12 +1,25 @@ -ETHERSCAN_API_KEY=ABC123ABC123ABC123ABC123ABC123ABC1 +# Testing networks +MOONBASE_URL=https://moonbase-alpha.blastapi.io/ SEPOLIA_URL=https://eth-sepolia.g.alchemy.com/v2/ +MUMBAI_URL=https://polygon-mumbai.g.alchemy.com/v2/ +BASE_GOERLI_URL=https://base-goerli.g.alchemy.com/v2/ + +# Mainnet networks +MOONRIVER_URL=https://moonriver.blastapi.io/ +MOONBEAM_URL=https://moonbeam.blastapi.io/ ETHEREUM_URL=https://eth-mainnet.g.alchemy.com/v2/ POLYGON_URL=https://polygon-mainnet.g.alchemy.com/v2/ -MUMBAI_URL=https://polygon-mumbai.g.alchemy.com/v2/ BASE_URL=https://base-mainnet.g.alchemy.com/v2/ -BASE_GOERLI_URL=https://base-goerli.g.alchemy.com/v2/ -PRIVATE_KEY=0xabc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc1 -MOONRIVER_MOONSCAN_APIKEY=ABC123 -MOONBEAM_MOONSCAN_APIKEY=ABC123 + +# To verify contracts +ETHERSCAN_API_KEY=ABC123 +MOONSCAN_APIKEY=ABC123 POLYGONSCAN_API_KEY=ABC123 -BASE_API_KEY=ABC123 \ No newline at end of file +BASESCAN_API_KEY=ABC123 + +# To report gas +REPORT_GAS= +COIN_MARKET_CAP_KEY= + +# To deploy contracts and interact with networks +PRIVATE_KEY=0xabc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc1 diff --git a/hardhat.config.ts b/hardhat.config.ts index df28ad66..a0746a11 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -31,35 +31,27 @@ const config: HardhatUserConfig = { evmVersion: 'london', optimizer: { enabled: true, - runs: 100, - }, - outputSelection: { - '*': { - '*': ['storageLayout'], - }, + runs: 200, }, }, }, networks: { - hardhat: { - allowUnlimitedContractSize: true, - }, moonbaseAlpha: { - url: 'https://rpc.testnet.moonbeam.network/', + url: process.env.MOONBASE_URL || 'https://rpc.testnet.moonbeam.network', chainId: 1287, accounts: process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [], gasPrice: 1100000000, }, sepolia: { - url: process.env.SEPOLIA_URL || '', + url: process.env.SEPOLIA_URL || 'https://rpc.sepolia.dev', chainId: 11155111, accounts: process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [], }, polygonMumbai: { - url: process.env.MUMBAI_URL || '', + url: process.env.MUMBAI_URL || 'https://rpc-mumbai.maticvigil.com', chainId: 80001, accounts: process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [], - gasPrice: 135000000000, + gasPrice: 2500000000, }, baseGoerli: { chainId: 84531, @@ -68,30 +60,30 @@ const config: HardhatUserConfig = { gasPrice: 2000000000, }, moonriver: { - url: 'https://rpc.api.moonriver.moonbeam.network', - chainId: 1285, // (hex: 0x505), + url: process.env.MOONRIVER_URL || 'https://rpc.api.moonriver.moonbeam.network', + chainId: 1285, accounts: process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [], }, moonbeam: { - url: 'https://rpc.api.moonbeam.network', - chainId: 1284, // (hex: 0x504), + url: process.env.MOONBEAM_URL || 'https://rpc.api.moonbeam.network', + chainId: 1284, accounts: process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [], }, mainnet: { - url: process.env.ETHEREUM_URL || '', + url: process.env.ETHEREUM_URL || 'https://eth.drpc.org', chainId: 1, accounts: process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [], - gasPrice: 13000000000, + gasPrice: 12000000000, }, polygon: { - url: process.env.POLYGON_URL || '', + url: process.env.POLYGON_URL || 'https://polygon.drpc.org', chainId: 137, accounts: process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [], gasPrice: 120000000000, }, base: { chainId: 8453, - url: process.env.BASE_URL || '', + url: process.env.BASE_URL || 'https://developer-access-mainnet.base.org', accounts: process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [], }, }, @@ -103,15 +95,15 @@ const config: HardhatUserConfig = { }, etherscan: { apiKey: { - moonbaseAlpha: process.env.MOONBEAM_MOONSCAN_APIKEY || '', // Moonbeam Moonscan API Key + moonbaseAlpha: process.env.MOONSCAN_APIKEY || '', // Moonbeam Moonscan API Key sepolia: process.env.ETHERSCAN_API_KEY || '', // Sepolia Etherscan API Key - polygonMumbai: process.env.POLYGON_ETHERSCAN_API_KEY || '', // Polygon Mumbai Etherscan API Key - baseGoerli: process.env.BASE_API_KEY || '', // Base Goerli Etherscan API Key - moonriver: process.env.MOONRIVER_MOONSCAN_APIKEY || '', // Moonriver Moonscan API Key - moonbeam: process.env.MOONBEAM_MOONSCAN_APIKEY || '', // Moonbeam Moonscan API Key + polygonMumbai: process.env.POLYGONSCAN_API_KEY || '', // Polygon Mumbai Etherscan API Key + baseGoerli: process.env.BASESCAN_API_KEY || '', // Base Goerli Etherscan API Key + moonriver: process.env.MOONSCAN_APIKEY || '', // Moonriver Moonscan API Key + moonbeam: process.env.MOONSCAN_APIKEY || '', // Moonbeam Moonscan API Key mainnet: process.env.ETHERSCAN_API_KEY || '', // Ethereum Etherscan API Key - polygon: process.env.POLYGON_ETHERSCAN_API_KEY || '', // Polygon Etherscan API Key - base: process.env.BASE_API_KEY || '', // Base Etherscan API Key + polygon: process.env.POLYGONSCAN_API_KEY || '', // Polygon Etherscan API Key + base: process.env.BASESCAN_API_KEY || '', // Base Etherscan API Key }, customChains: [ { @@ -132,9 +124,6 @@ const config: HardhatUserConfig = { }, ], }, - dodoc: { - runOnCompile: false, - }, }; export default config; From 00b41e669e316691eeba50c51084bd21a567463a Mon Sep 17 00:00:00 2001 From: steven2308 Date: Tue, 19 Sep 2023 11:56:05 -0500 Subject: [PATCH 13/19] Renames 6059 to 7401. --- contracts/RMRK/equippable/RMRKEquippable.sol | 2 +- .../equippable/RMRKMinifiedEquippable.sol | 48 +++++++++---------- .../IRMRKNestableAutoIndex.sol | 4 +- .../RMRKNestableAutoIndex.sol | 2 +- .../reclaimableChild/RMRKReclaimableChild.sol | 2 +- contracts/RMRK/nestable/IERC6059.sol | 4 +- contracts/RMRK/nestable/RMRKNestable.sol | 46 +++++++++--------- .../RMRK/nestable/RMRKNestableMultiAsset.sol | 2 +- contracts/RMRK/utils/RMRKCollectionUtils.sol | 6 +-- contracts/RMRK/utils/RMRKEquipRenderUtils.sol | 4 +- .../RMRK/utils/RMRKNestableRenderUtils.sol | 24 +++++----- contracts/RMRK/utils/RMRKRenderUtils.sol | 2 +- contracts/mocks/RMRKNestableMock.sol | 2 +- contracts/security_mocks/ChildAdder.sol | 4 +- test/behavior/nestable.ts | 8 ++-- test/extensions/nestableAutoIndex.ts | 6 +-- test/extensions/reclaimableChild.ts | 6 +-- test/extensions/typedMultiasset.ts | 4 +- test/implementations/generalBehavior.ts | 8 ++-- test/interfaces.ts | 4 +- test/renderUtils.ts | 4 +- 21 files changed, 96 insertions(+), 96 deletions(-) diff --git a/contracts/RMRK/equippable/RMRKEquippable.sol b/contracts/RMRK/equippable/RMRKEquippable.sol index 2b9ce57e..1a9a30ba 100644 --- a/contracts/RMRK/equippable/RMRKEquippable.sol +++ b/contracts/RMRK/equippable/RMRKEquippable.sol @@ -342,7 +342,7 @@ contract RMRKEquippable is // Check from parent's asset perspective: _checkAssetAcceptsSlot(data.assetId, slotPartId); - IERC6059.Child memory child = childOf(data.tokenId, data.childIndex); + IERC7401.Child memory child = childOf(data.tokenId, data.childIndex); // Check from child perspective intention to be used in part // We add reentrancy guard because of this call, it happens before updating state diff --git a/contracts/RMRK/equippable/RMRKMinifiedEquippable.sol b/contracts/RMRK/equippable/RMRKMinifiedEquippable.sol index fff3c167..02e01cb1 100644 --- a/contracts/RMRK/equippable/RMRKMinifiedEquippable.sol +++ b/contracts/RMRK/equippable/RMRKMinifiedEquippable.sol @@ -13,7 +13,7 @@ import "../core/RMRKCore.sol"; import "../equippable/IERC6220.sol"; import "../library/RMRKErrors.sol"; import "../library/RMRKLib.sol"; -import "../nestable/IERC6059.sol"; +import "../nestable/IERC7401.sol"; import "../security/ReentrancyGuard.sol"; /** @@ -28,7 +28,7 @@ contract RMRKMinifiedEquippable is Context, IERC165, IERC721, - IERC6059, + IERC7401, IERC6220, RMRKCore { @@ -206,7 +206,7 @@ contract RMRKMinifiedEquippable is } /** - * @inheritdoc IERC6059 + * @inheritdoc IERC7401 */ function nestTransferFrom( address from, @@ -224,7 +224,7 @@ contract RMRKMinifiedEquippable is // Destination contract checks: // It seems redundant, but otherwise it would revert with no error if (!to.isContract()) revert RMRKIsNotContract(); - if (!IERC165(to).supportsInterface(type(IERC6059).interfaceId)) + if (!IERC165(to).supportsInterface(type(IERC7401).interfaceId)) revert RMRKNestableTransferToNonRMRKNestableImplementer(); _checkForInheritanceLoop(tokenId, to, destinationId); @@ -302,7 +302,7 @@ contract RMRKMinifiedEquippable is uint256 tokenId, bytes memory data ) private { - IERC6059 destContract = IERC6059(to); + IERC7401 destContract = IERC7401(to); destContract.addChild(destinationId, tokenId, data); emit Transfer(from, to, tokenId); @@ -338,7 +338,7 @@ contract RMRKMinifiedEquippable is address nextOwner, uint256 nextOwnerTokenId, bool isNft - ) = IERC6059(targetContract).directOwnerOf(targetId); + ) = IERC7401(targetContract).directOwnerOf(targetId); // If there's a final address, we're good. There's no loop. if (!isNft) { return; @@ -399,7 +399,7 @@ contract RMRKMinifiedEquippable is ) internal virtual { // It seems redundant, but otherwise it would revert with no error if (!to.isContract()) revert RMRKIsNotContract(); - if (!IERC165(to).supportsInterface(type(IERC6059).interfaceId)) + if (!IERC165(to).supportsInterface(type(IERC7401).interfaceId)) revert RMRKMintToNonRMRKNestableImplementer(); _innerMint(to, tokenId, destinationId, data); @@ -450,22 +450,22 @@ contract RMRKMinifiedEquippable is //////////////////////////////////////// /** - * @inheritdoc IERC6059 + * @inheritdoc IERC7401 */ function ownerOf( uint256 tokenId - ) public view virtual override(IERC6059, IERC721) returns (address) { + ) public view virtual override(IERC7401, IERC721) returns (address) { (address owner, uint256 ownerTokenId, bool isNft) = directOwnerOf( tokenId ); if (isNft) { - owner = IERC6059(owner).ownerOf(ownerTokenId); + owner = IERC7401(owner).ownerOf(ownerTokenId); } return owner; } /** - * @inheritdoc IERC6059 + * @inheritdoc IERC7401 */ function directOwnerOf( uint256 tokenId @@ -490,7 +490,7 @@ contract RMRKMinifiedEquippable is } /** - * @inheritdoc IERC6059 + * @inheritdoc IERC7401 */ function burn( uint256 tokenId, @@ -539,7 +539,7 @@ contract RMRKMinifiedEquippable is // We substract one to the next level to count for the token being burned, then add it again on returns // This is to allow the behavior of 0 recursive burns meaning only the current token is deleted. totalChildBurns += - IERC6059(children[i].contractAddress).burn( + IERC7401(children[i].contractAddress).burn( children[i].tokenId, pendingRecursiveBurns - 1 ) + @@ -745,7 +745,7 @@ contract RMRKMinifiedEquippable is //////////////////////////////////////// /** - * @inheritdoc IERC6059 + * @inheritdoc IERC7401 */ function addChild( uint256 parentId, @@ -779,7 +779,7 @@ contract RMRKMinifiedEquippable is } /** - * @inheritdoc IERC6059 + * @inheritdoc IERC7401 */ function acceptChild( uint256 parentId, @@ -832,7 +832,7 @@ contract RMRKMinifiedEquippable is } /** - * @inheritdoc IERC6059 + * @inheritdoc IERC7401 */ function rejectAllChildren( uint256 tokenId, @@ -848,7 +848,7 @@ contract RMRKMinifiedEquippable is } /** - * @inheritdoc IERC6059 + * @inheritdoc IERC7401 */ function transferChild( uint256 tokenId, @@ -896,7 +896,7 @@ contract RMRKMinifiedEquippable is ); } else { // Destination is an NFT - IERC6059(child.contractAddress).nestTransferFrom( + IERC7401(child.contractAddress).nestTransferFrom( address(this), to, child.tokenId, @@ -951,7 +951,7 @@ contract RMRKMinifiedEquippable is //////////////////////////////////////// /** - * @inheritdoc IERC6059 + * @inheritdoc IERC7401 */ function childrenOf( @@ -962,7 +962,7 @@ contract RMRKMinifiedEquippable is } /** - * @inheritdoc IERC6059 + * @inheritdoc IERC7401 */ function pendingChildrenOf( @@ -973,7 +973,7 @@ contract RMRKMinifiedEquippable is } /** - * @inheritdoc IERC6059 + * @inheritdoc IERC7401 */ function childOf( uint256 parentId, @@ -986,7 +986,7 @@ contract RMRKMinifiedEquippable is } /** - * @inheritdoc IERC6059 + * @inheritdoc IERC7401 */ function pendingChildOf( uint256 parentId, @@ -1630,7 +1630,7 @@ contract RMRKMinifiedEquippable is return interfaceId == type(IERC165).interfaceId || interfaceId == type(IERC721).interfaceId || - interfaceId == type(IERC6059).interfaceId || + interfaceId == type(IERC7401).interfaceId || interfaceId == type(IERC5773).interfaceId || interfaceId == type(IERC6220).interfaceId; } @@ -1886,7 +1886,7 @@ contract RMRKMinifiedEquippable is // Check from parent's asset perspective: _checkAssetAcceptsSlot(data.assetId, slotPartId); - IERC6059.Child memory child = childOf(data.tokenId, data.childIndex); + IERC7401.Child memory child = childOf(data.tokenId, data.childIndex); // Check from child perspective intention to be used in part // We add reentrancy guard because of this call, it happens before updating state diff --git a/contracts/RMRK/extension/nestableAutoIndex/IRMRKNestableAutoIndex.sol b/contracts/RMRK/extension/nestableAutoIndex/IRMRKNestableAutoIndex.sol index 644fe70b..3508d228 100644 --- a/contracts/RMRK/extension/nestableAutoIndex/IRMRKNestableAutoIndex.sol +++ b/contracts/RMRK/extension/nestableAutoIndex/IRMRKNestableAutoIndex.sol @@ -2,14 +2,14 @@ pragma solidity ^0.8.21; -import "../../nestable/IERC6059.sol"; +import "../../nestable/IERC7401.sol"; /** * @title RMRKNestableAutoIndex * @author RMRK team * @notice Interface smart contract of the RMRK Nestable AutoIndex module. */ -interface IRMRKNestableAutoIndex is IERC6059 { +interface IRMRKNestableAutoIndex is IERC7401 { /** * @notice Used to accept a pending child token for a given parent token. * @dev This moves the child token from parent token's pending child tokens array into the active child tokens diff --git a/contracts/RMRK/extension/nestableAutoIndex/RMRKNestableAutoIndex.sol b/contracts/RMRK/extension/nestableAutoIndex/RMRKNestableAutoIndex.sol index e63f3662..e2db1d91 100644 --- a/contracts/RMRK/extension/nestableAutoIndex/RMRKNestableAutoIndex.sol +++ b/contracts/RMRK/extension/nestableAutoIndex/RMRKNestableAutoIndex.sol @@ -163,7 +163,7 @@ contract RMRKNestableAutoIndex is IRMRKNestableAutoIndex, RMRKNestable { function ownerOf( uint256 tokenId - ) public view virtual override(IERC6059, RMRKNestable) returns (address) { + ) public view virtual override(IERC7401, RMRKNestable) returns (address) { return super.ownerOf(tokenId); } } diff --git a/contracts/RMRK/extension/reclaimableChild/RMRKReclaimableChild.sol b/contracts/RMRK/extension/reclaimableChild/RMRKReclaimableChild.sol index 49dca376..55927dce 100644 --- a/contracts/RMRK/extension/reclaimableChild/RMRKReclaimableChild.sol +++ b/contracts/RMRK/extension/reclaimableChild/RMRKReclaimableChild.sol @@ -61,7 +61,7 @@ abstract contract RMRKReclaimableChild is IRMRKReclaimableChild, RMRKNestable { if (_childIsInPending[childAddress][childId] != 0) revert RMRKInvalidChildReclaim(); - (address owner, uint256 ownerTokenId, bool isNft) = IERC6059( + (address owner, uint256 ownerTokenId, bool isNft) = IERC7401( childAddress ).directOwnerOf(childId); if (owner != address(this) || ownerTokenId != tokenId || !isNft) diff --git a/contracts/RMRK/nestable/IERC6059.sol b/contracts/RMRK/nestable/IERC6059.sol index 7da1f1be..c71bb25f 100644 --- a/contracts/RMRK/nestable/IERC6059.sol +++ b/contracts/RMRK/nestable/IERC6059.sol @@ -5,11 +5,11 @@ pragma solidity ^0.8.21; import "@openzeppelin/contracts/utils/introspection/IERC165.sol"; /** - * @title IERC6059 + * @title IERC7401 * @author RMRK team * @notice Interface smart contract of the RMRK nestable module. */ -interface IERC6059 is IERC165 { +interface IERC7401 is IERC165 { /** * @notice The core struct of RMRK ownership. * @dev The `DirectOwner` struct is used to store information of the next immediate owner, be it the parent token or diff --git a/contracts/RMRK/nestable/RMRKNestable.sol b/contracts/RMRK/nestable/RMRKNestable.sol index c44e1a37..cd31f9e4 100644 --- a/contracts/RMRK/nestable/RMRKNestable.sol +++ b/contracts/RMRK/nestable/RMRKNestable.sol @@ -4,7 +4,7 @@ pragma solidity ^0.8.21; -import "./IERC6059.sol"; +import "./IERC7401.sol"; import "../core/RMRKCore.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; @@ -20,7 +20,7 @@ import "../library/RMRKErrors.sol"; * @dev This contract is hierarchy agnostic and can support an arbitrary number of nested levels up and down, as long as * gas limits allow it. */ -contract RMRKNestable is Context, IERC165, IERC721, IERC6059, RMRKCore { +contract RMRKNestable is Context, IERC165, IERC721, IERC7401, RMRKCore { using Address for address; uint256 private constant _MAX_LEVELS_TO_CHECK_FOR_INHERITANCE_LOOP = 100; @@ -106,7 +106,7 @@ contract RMRKNestable is Context, IERC165, IERC721, IERC6059, RMRKCore { return interfaceId == type(IERC165).interfaceId || interfaceId == type(IERC721).interfaceId || - interfaceId == type(IERC6059).interfaceId; + interfaceId == type(IERC7401).interfaceId; } /** @@ -191,7 +191,7 @@ contract RMRKNestable is Context, IERC165, IERC721, IERC6059, RMRKCore { } /** - * @inheritdoc IERC6059 + * @inheritdoc IERC7401 */ function nestTransferFrom( address from, @@ -295,7 +295,7 @@ contract RMRKNestable is Context, IERC165, IERC721, IERC6059, RMRKCore { // Destination contract checks: // It seems redundant, but otherwise it would revert with no error if (!to.isContract()) revert RMRKIsNotContract(); - if (!IERC165(to).supportsInterface(type(IERC6059).interfaceId)) + if (!IERC165(to).supportsInterface(type(IERC7401).interfaceId)) revert RMRKNestableTransferToNonRMRKNestableImplementer(); _checkForInheritanceLoop(tokenId, to, destinationId); @@ -336,7 +336,7 @@ contract RMRKNestable is Context, IERC165, IERC721, IERC6059, RMRKCore { uint256 tokenId, bytes memory data ) private { - IERC6059 destContract = IERC6059(to); + IERC7401 destContract = IERC7401(to); destContract.addChild(destinationId, tokenId, data); emit Transfer(from, to, tokenId); @@ -372,7 +372,7 @@ contract RMRKNestable is Context, IERC165, IERC721, IERC6059, RMRKCore { address nextOwner, uint256 nextOwnerTokenId, bool isNft - ) = IERC6059(targetContract).directOwnerOf(targetId); + ) = IERC7401(targetContract).directOwnerOf(targetId); // If there's a final address, we're good. There's no loop. if (!isNft) { return; @@ -454,7 +454,7 @@ contract RMRKNestable is Context, IERC165, IERC721, IERC6059, RMRKCore { ) internal virtual { // It seems redundant, but otherwise it would revert with no error if (!to.isContract()) revert RMRKIsNotContract(); - if (!IERC165(to).supportsInterface(type(IERC6059).interfaceId)) + if (!IERC165(to).supportsInterface(type(IERC7401).interfaceId)) revert RMRKMintToNonRMRKNestableImplementer(); _innerMint(to, tokenId, destinationId, data); @@ -505,22 +505,22 @@ contract RMRKNestable is Context, IERC165, IERC721, IERC6059, RMRKCore { //////////////////////////////////////// /** - * @inheritdoc IERC6059 + * @inheritdoc IERC7401 */ function ownerOf( uint256 tokenId - ) public view virtual override(IERC6059, IERC721) returns (address) { + ) public view virtual override(IERC7401, IERC721) returns (address) { (address owner, uint256 ownerTokenId, bool isNft) = directOwnerOf( tokenId ); if (isNft) { - owner = IERC6059(owner).ownerOf(ownerTokenId); + owner = IERC7401(owner).ownerOf(ownerTokenId); } return owner; } /** - * @inheritdoc IERC6059 + * @inheritdoc IERC7401 */ function directOwnerOf( uint256 tokenId @@ -545,7 +545,7 @@ contract RMRKNestable is Context, IERC165, IERC721, IERC6059, RMRKCore { } /** - * @inheritdoc IERC6059 + * @inheritdoc IERC7401 */ function burn( uint256 tokenId, @@ -614,7 +614,7 @@ contract RMRKNestable is Context, IERC165, IERC721, IERC6059, RMRKCore { // We substract one to the next level to count for the token being burned, then add it again on returns // This is to allow the behavior of 0 recursive burns meaning only the current token is deleted. totalChildBurns += - IERC6059(children[i].contractAddress).burn( + IERC7401(children[i].contractAddress).burn( children[i].tokenId, pendingRecursiveBurns - 1 ) + @@ -867,7 +867,7 @@ contract RMRKNestable is Context, IERC165, IERC721, IERC6059, RMRKCore { //////////////////////////////////////// /** - * @inheritdoc IERC6059 + * @inheritdoc IERC7401 */ function addChild( uint256 parentId, @@ -901,7 +901,7 @@ contract RMRKNestable is Context, IERC165, IERC721, IERC6059, RMRKCore { } /** - * @inheritdoc IERC6059 + * @inheritdoc IERC7401 */ function acceptChild( uint256 parentId, @@ -954,7 +954,7 @@ contract RMRKNestable is Context, IERC165, IERC721, IERC6059, RMRKCore { } /** - * @inheritdoc IERC6059 + * @inheritdoc IERC7401 */ function rejectAllChildren( uint256 tokenId, @@ -990,7 +990,7 @@ contract RMRKNestable is Context, IERC165, IERC721, IERC6059, RMRKCore { } /** - * @inheritdoc IERC6059 + * @inheritdoc IERC7401 */ function transferChild( uint256 tokenId, @@ -1077,7 +1077,7 @@ contract RMRKNestable is Context, IERC165, IERC721, IERC6059, RMRKCore { ); } else { // Destination is an NFT - IERC6059(child.contractAddress).nestTransferFrom( + IERC7401(child.contractAddress).nestTransferFrom( address(this), to, child.tokenId, @@ -1132,7 +1132,7 @@ contract RMRKNestable is Context, IERC165, IERC721, IERC6059, RMRKCore { //////////////////////////////////////// /** - * @inheritdoc IERC6059 + * @inheritdoc IERC7401 */ function childrenOf( @@ -1143,7 +1143,7 @@ contract RMRKNestable is Context, IERC165, IERC721, IERC6059, RMRKCore { } /** - * @inheritdoc IERC6059 + * @inheritdoc IERC7401 */ function pendingChildrenOf( @@ -1154,7 +1154,7 @@ contract RMRKNestable is Context, IERC165, IERC721, IERC6059, RMRKCore { } /** - * @inheritdoc IERC6059 + * @inheritdoc IERC7401 */ function childOf( uint256 parentId, @@ -1167,7 +1167,7 @@ contract RMRKNestable is Context, IERC165, IERC721, IERC6059, RMRKCore { } /** - * @inheritdoc IERC6059 + * @inheritdoc IERC7401 */ function pendingChildOf( uint256 parentId, diff --git a/contracts/RMRK/nestable/RMRKNestableMultiAsset.sol b/contracts/RMRK/nestable/RMRKNestableMultiAsset.sol index 1d8d50db..48610d60 100644 --- a/contracts/RMRK/nestable/RMRKNestableMultiAsset.sol +++ b/contracts/RMRK/nestable/RMRKNestableMultiAsset.sol @@ -5,7 +5,7 @@ pragma solidity ^0.8.21; import "../multiasset/AbstractMultiAsset.sol"; -import "./IERC6059.sol"; +import "./IERC7401.sol"; import "./RMRKNestable.sol"; import "@openzeppelin/contracts/utils/introspection/IERC165.sol"; diff --git a/contracts/RMRK/utils/RMRKCollectionUtils.sol b/contracts/RMRK/utils/RMRKCollectionUtils.sol index 395d5396..35872d8c 100644 --- a/contracts/RMRK/utils/RMRKCollectionUtils.sol +++ b/contracts/RMRK/utils/RMRKCollectionUtils.sol @@ -6,7 +6,7 @@ import "@openzeppelin/contracts/interfaces/IERC2981.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "../equippable/IERC6220.sol"; -import "../nestable/IERC6059.sol"; +import "../nestable/IERC7401.sol"; import "../extension/soulbound/IERC6454.sol"; import "./IRMRKCollectionData.sol"; @@ -93,7 +93,7 @@ contract RMRKCollectionUtils { * @param collection Address of the collection to get the interface support from * @return supports721 Boolean value signifying whether the collection supports ERC721 interface * @return supportsMultiAsset Boolean value signifying whether the collection supports MultiAsset interface (ERC5773) - * @return supportsNesting Boolean value signifying whether the collection supports Nestable interface (ERC6059) + * @return supportsNesting Boolean value signifying whether the collection supports Nestable interface (ERC7401) * @return supportsEquippable Boolean value signifying whether the collection supports Equippable interface (ERC6220) * @return supportsSoulbound Boolean value signifying whether the collection supports Soulbound interface (ERC6454) * @return supportsRoyalties Boolean value signifying whether the collection supports Royaltiesy interface (ERC2981) @@ -117,7 +117,7 @@ contract RMRKCollectionUtils { supportsMultiAsset = target.supportsInterface( type(IERC5773).interfaceId ); - supportsNesting = target.supportsInterface(type(IERC6059).interfaceId); + supportsNesting = target.supportsInterface(type(IERC7401).interfaceId); supportsEquippable = target.supportsInterface( type(IERC6220).interfaceId ); diff --git a/contracts/RMRK/utils/RMRKEquipRenderUtils.sol b/contracts/RMRK/utils/RMRKEquipRenderUtils.sol index c33ebd15..867ffdfe 100644 --- a/contracts/RMRK/utils/RMRKEquipRenderUtils.sol +++ b/contracts/RMRK/utils/RMRKEquipRenderUtils.sol @@ -7,7 +7,7 @@ import "./RMRKMultiAssetRenderUtils.sol"; import "./RMRKNestableRenderUtils.sol"; import "../catalog/IRMRKCatalog.sol"; import "../equippable/IERC6220.sol"; -import "../nestable/IERC6059.sol"; +import "../nestable/IERC7401.sol"; import "../library/RMRKLib.sol"; import "../library/RMRKErrors.sol"; @@ -1045,7 +1045,7 @@ contract RMRKEquipRenderUtils is address parentAddress, uint256 parentId ) public view returns (ChildWithTopAssetMetadata[] memory) { - IERC6059.Child[] memory children = IERC6059(parentAddress).childrenOf( + IERC7401.Child[] memory children = IERC7401(parentAddress).childrenOf( parentId ); (parentId); diff --git a/contracts/RMRK/utils/RMRKNestableRenderUtils.sol b/contracts/RMRK/utils/RMRKNestableRenderUtils.sol index 82d58b93..77d70485 100644 --- a/contracts/RMRK/utils/RMRKNestableRenderUtils.sol +++ b/contracts/RMRK/utils/RMRKNestableRenderUtils.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.21; -import "../nestable/IERC6059.sol"; +import "../nestable/IERC7401.sol"; import "../library/RMRKErrors.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol"; @@ -26,7 +26,7 @@ contract RMRKNestableRenderUtils { address childAddress, uint256 childId ) public view returns (uint256) { - IERC6059.Child[] memory children = IERC6059(parentAddress).childrenOf( + IERC7401.Child[] memory children = IERC7401(parentAddress).childrenOf( parentId ); (parentId); @@ -57,7 +57,7 @@ contract RMRKNestableRenderUtils { address childAddress, uint256 childId ) public view returns (uint256) { - IERC6059.Child[] memory children = IERC6059(parentAddress) + IERC7401.Child[] memory children = IERC7401(parentAddress) .pendingChildrenOf(parentId); (parentId); uint256 len = children.length; @@ -86,7 +86,7 @@ contract RMRKNestableRenderUtils { uint256 childId ) public view returns (address parentAddress, uint256 parentId) { bool isNFT; - (parentAddress, parentId, isNFT) = IERC6059(childAddress).directOwnerOf( + (parentAddress, parentId, isNFT) = IERC7401(childAddress).directOwnerOf( childId ); if (!isNFT) revert RMRKParentIsNotNFT(); @@ -117,16 +117,16 @@ contract RMRKNestableRenderUtils { bool inParentsPendingChildren ) { - (directOwner, ownerId, isNFT) = IERC6059(collection).directOwnerOf( + (directOwner, ownerId, isNFT) = IERC7401(collection).directOwnerOf( tokenId ); if (!isNFT) { inParentsActiveChildren = false; inParentsPendingChildren = false; } else { - IERC6059.Child[] memory activeChildren = IERC6059(directOwner) + IERC7401.Child[] memory activeChildren = IERC7401(directOwner) .childrenOf(ownerId); - IERC6059.Child[] memory pendingChildren = IERC6059(directOwner) + IERC7401.Child[] memory pendingChildren = IERC7401(directOwner) .pendingChildrenOf(ownerId); uint256 len = activeChildren.length; @@ -222,12 +222,12 @@ contract RMRKNestableRenderUtils { uint256 childId ) public view returns (bool) { if ( - !IERC165(childAddress).supportsInterface(type(IERC6059).interfaceId) + !IERC165(childAddress).supportsInterface(type(IERC7401).interfaceId) ) { return false; } - (address directOwner, uint256 ownerId, ) = IERC6059(childAddress) + (address directOwner, uint256 ownerId, ) = IERC7401(childAddress) .directOwnerOf(childId); return (directOwner == parentAddress && ownerId == parentId); @@ -296,7 +296,7 @@ contract RMRKNestableRenderUtils { view returns (uint256 totalDescendants, bool hasMoreThanOneLevelOfNesting_) { - IERC6059.Child[] memory children = IERC6059(collection).childrenOf( + IERC7401.Child[] memory children = IERC7401(collection).childrenOf( tokenId ); uint256 directChildrenCount = children.length; @@ -325,14 +325,14 @@ contract RMRKNestableRenderUtils { address collection, uint256 tokenId ) public view returns (bool) { - IERC6059.Child[] memory children = IERC6059(collection).childrenOf( + IERC7401.Child[] memory children = IERC7401(collection).childrenOf( tokenId ); uint256 directChildrenCount = children.length; for (uint256 i; i < directChildrenCount; ) { if ( - IERC6059(children[i].contractAddress) + IERC7401(children[i].contractAddress) .childrenOf(children[i].tokenId) .length > 0 ) { diff --git a/contracts/RMRK/utils/RMRKRenderUtils.sol b/contracts/RMRK/utils/RMRKRenderUtils.sol index 7fa0c536..ce429ff1 100644 --- a/contracts/RMRK/utils/RMRKRenderUtils.sol +++ b/contracts/RMRK/utils/RMRKRenderUtils.sol @@ -99,7 +99,7 @@ contract RMRKRenderUtils { type(IERC5773).interfaceId ); data.hasNestingInterface = targetEquippable.supportsInterface( - type(IERC6059).interfaceId + type(IERC7401).interfaceId ); data.hasEquippableInterface = targetEquippable.supportsInterface( type(IERC6220).interfaceId diff --git a/contracts/mocks/RMRKNestableMock.sol b/contracts/mocks/RMRKNestableMock.sol index 084a67bb..862a95f0 100644 --- a/contracts/mocks/RMRKNestableMock.sol +++ b/contracts/mocks/RMRKNestableMock.sol @@ -4,7 +4,7 @@ pragma solidity ^0.8.21; import "../RMRK/nestable/RMRKNestable.sol"; -//Minimal public implementation of IERC6059 for testing. +//Minimal public implementation of IERC7401 for testing. contract RMRKNestableMock is RMRKNestable { // This is used to test the usage of hooks mapping(address => mapping(uint256 => uint256)) private _balancesPerNft; diff --git a/contracts/security_mocks/ChildAdder.sol b/contracts/security_mocks/ChildAdder.sol index f61e701b..7325c72d 100644 --- a/contracts/security_mocks/ChildAdder.sol +++ b/contracts/security_mocks/ChildAdder.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.21; -import "../RMRK/nestable/IERC6059.sol"; +import "../RMRK/nestable/IERC7401.sol"; /** * @title ChildAdder @@ -25,7 +25,7 @@ contract ChildAdder { uint256 numChildren ) external { for (uint256 i; i < numChildren; i++) { - IERC6059(destContract).addChild(parentId, childId, ""); + IERC7401(destContract).addChild(parentId, childId, ""); } } } diff --git a/test/behavior/nestable.ts b/test/behavior/nestable.ts index 4a751e7a..cc041ad0 100644 --- a/test/behavior/nestable.ts +++ b/test/behavior/nestable.ts @@ -3,7 +3,7 @@ import { ethers } from 'hardhat'; import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; import { BigNumber, Contract } from 'ethers'; import { bn, ADDRESS_ZERO } from '../utils'; -import { IERC165, IERC721, IERC6059, IOtherInterface } from '../interfaces'; +import { IERC165, IERC721, IERC7401, IOtherInterface } from '../interfaces'; async function shouldBehaveLikeNestable( mint: (token: Contract, to: string) => Promise, @@ -217,7 +217,7 @@ async function shouldBehaveLikeNestable( }); it('can support INestable', async function () { - expect(await parent.supportsInterface(IERC6059)).to.equal(true); + expect(await parent.supportsInterface(IERC7401)).to.equal(true); }); it('cannot support other interfaceId', async function () { @@ -1047,7 +1047,7 @@ async function shouldBehaveLikeNestable( ).to.be.revertedWithCustomError(child, 'RMRKIsNotContract'); }); - it('cannot nest tranfer to contract if it does implement IERC6059', async function () { + it('cannot nest tranfer to contract if it does implement IERC7401', async function () { const ERC721 = await ethers.getContractFactory('ERC721Mock'); const nonNestable = await ERC721.deploy('Non receiver', 'NR'); await nonNestable.deployed(); @@ -1056,7 +1056,7 @@ async function shouldBehaveLikeNestable( ).to.be.revertedWithCustomError(child, 'RMRKNestableTransferToNonRMRKNestableImplementer'); }); - it('can nest tranfer to IERC6059 contract', async function () { + it('can nest tranfer to IERC7401 contract', async function () { await nestTransfer(child, firstOwner, parent.address, childId, parentId); expect(await child.ownerOf(childId)).to.eql(firstOwner.address); expect(await child.directOwnerOf(childId)).to.eql([parent.address, parentId, true]); diff --git a/test/extensions/nestableAutoIndex.ts b/test/extensions/nestableAutoIndex.ts index b69e054c..49cba1a2 100644 --- a/test/extensions/nestableAutoIndex.ts +++ b/test/extensions/nestableAutoIndex.ts @@ -3,7 +3,7 @@ import { expect } from 'chai'; import { loadFixture } from '@nomicfoundation/hardhat-network-helpers'; import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; import { bn } from '../utils'; -import { IERC165, IERC6059, IRMRKNestableAutoIndex, IOtherInterface } from '../interfaces'; +import { IERC165, IERC7401, IRMRKNestableAutoIndex, IOtherInterface } from '../interfaces'; import { RMRKNestableAutoIndexMock } from '../../typechain-types'; // --------------- FIXTURES ----------------------- @@ -33,8 +33,8 @@ describe('RMRKNestableAutoIndexMock', async function () { expect(await token.supportsInterface(IERC165)).to.equal(true); }); - it('can support IERC6059', async function () { - expect(await token.supportsInterface(IERC6059)).to.equal(true); + it('can support IERC7401', async function () { + expect(await token.supportsInterface(IERC7401)).to.equal(true); }); it('can support IRMRKNestableAutoIndex', async function () { diff --git a/test/extensions/reclaimableChild.ts b/test/extensions/reclaimableChild.ts index f2c0af10..71d4ef1c 100644 --- a/test/extensions/reclaimableChild.ts +++ b/test/extensions/reclaimableChild.ts @@ -3,7 +3,7 @@ import { expect } from 'chai'; import { loadFixture } from '@nomicfoundation/hardhat-network-helpers'; import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; import { ADDRESS_ZERO, bn, mintFromMock, nestMintFromMock } from '../utils'; -import { IERC165, IOtherInterface, IERC6059, IRMRKReclaimableChild } from '../interfaces'; +import { IERC165, IOtherInterface, IERC7401, IRMRKReclaimableChild } from '../interfaces'; import { RMRKNestableClaimableChildMock } from '../../typechain-types'; // --------------- FIXTURES ----------------------- @@ -50,8 +50,8 @@ async function shouldBehaveLikeReclaimableChild() { expect(await this.parent.supportsInterface(IRMRKReclaimableChild)).to.equal(true); }); - it('can support IERC6059', async function () { - expect(await this.parent.supportsInterface(IERC6059)).to.equal(true); + it('can support IERC7401', async function () { + expect(await this.parent.supportsInterface(IERC7401)).to.equal(true); }); it('does not support other interfaces', async function () { diff --git a/test/extensions/typedMultiasset.ts b/test/extensions/typedMultiasset.ts index 7d6f4dbb..3e70465c 100644 --- a/test/extensions/typedMultiasset.ts +++ b/test/extensions/typedMultiasset.ts @@ -8,7 +8,7 @@ import { IERC165, IERC6220, IERC5773, - IERC6059, + IERC7401, IRMRKTypedMultiAsset, IOtherInterface, } from '../interfaces'; @@ -107,7 +107,7 @@ describe('RMRKNestableTypedMultiAssetMock', async function () { }); it('can support INestable', async function () { - expect(await this.assets.supportsInterface(IERC6059)).to.equal(true); + expect(await this.assets.supportsInterface(IERC7401)).to.equal(true); }); shouldBehaveLikeTypedMultiAssetInterface(); diff --git a/test/implementations/generalBehavior.ts b/test/implementations/generalBehavior.ts index 706d285b..b5298394 100644 --- a/test/implementations/generalBehavior.ts +++ b/test/implementations/generalBehavior.ts @@ -37,7 +37,7 @@ import { IERC721Metadata, IERC2981, IERC5773, - IERC6059, + IERC7401, IERC6454, IERC6220, } from '../interfaces'; @@ -641,9 +641,9 @@ async function testInterfaceSupport(legoCombination: LegoCombination, isSoulboun LegoCombination.NestableMultiAsset, ].includes(legoCombination) ) { - expect(await contract.supportsInterface(IERC6059)).to.be.true; + expect(await contract.supportsInterface(IERC7401)).to.be.true; } else { - expect(await contract.supportsInterface(IERC6059)).to.be.false; + expect(await contract.supportsInterface(IERC7401)).to.be.false; } if (legoCombination == LegoCombination.Equippable) { @@ -835,7 +835,7 @@ async function testGeneralBehavior(mintingType: MintingType) { it('cannot burn if not token owner', async function () { await mint(holder.address, contract, owner, rmrkERC20, mintingType); - const expectedError = (await contract.supportsInterface(IERC6059)) + const expectedError = (await contract.supportsInterface(IERC7401)) ? 'RMRKNotApprovedOrDirectOwner' : 'ERC721NotApprovedOrOwner'; await expect(contract.connect(owner)['burn(uint256)'](1)).to.be.revertedWithCustomError( diff --git a/test/interfaces.ts b/test/interfaces.ts index 474883ef..052ba782 100644 --- a/test/interfaces.ts +++ b/test/interfaces.ts @@ -8,7 +8,7 @@ const IRMRKEmotesRepository = '0x1b3327ab'; //ERC6381 const IERC2981 = '0x2a55205a'; // ERC6220 const IERC6220 = '0x28bc9ae4'; // ERC6220 const IERC5773 = '0x06b4329a'; // ERC5773 -const IERC6059 = '0x42b0e56f'; // ERC6059 +const IERC7401 = '0x42b0e56f'; // ERC7401 const IRMRKNestableAutoIndex = '0x1884d52d'; const IRMRKMultiAssetAutoIndex = '0x1cf132fe'; const IRMRKReclaimableChild = '0x2fb59acf'; @@ -29,7 +29,7 @@ export { IERC2981, IERC6220, IERC5773, - IERC6059, + IERC7401, IRMRKNestableAutoIndex, IRMRKMultiAssetAutoIndex, IRMRKReclaimableChild, diff --git a/test/renderUtils.ts b/test/renderUtils.ts index 46bbef84..59ed8f60 100644 --- a/test/renderUtils.ts +++ b/test/renderUtils.ts @@ -1017,7 +1017,7 @@ describe('Extended NFT render utils', function () { ).to.be.true; }); - it('returns false if the child does not implement IERC6059', async function () { + it('returns false if the child does not implement IERC7401', async function () { expect( await renderUtils.validateChildOf( nestableMultiAsset.address, @@ -1061,7 +1061,7 @@ describe('Extended NFT render utils', function () { ).to.be.revertedWithCustomError(renderUtils, 'RMRKMismachedArrayLength'); }); - it('returns false if one of the child tokens does not implement IERC6059', async function () { + it('returns false if one of the child tokens does not implement IERC7401', async function () { expect( await renderUtils.validateChildrenOf( nestableMultiAsset.address, From 5637d8686c2c822c564b132268607fd8efd583eb Mon Sep 17 00:00:00 2001 From: steven2308 Date: Tue, 19 Sep 2023 13:56:48 -0500 Subject: [PATCH 14/19] Updates 6381 to 7409. --- contracts/RMRK/emotable/RMRKEmotesRepository.sol | 2 +- test/interfaces.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/contracts/RMRK/emotable/RMRKEmotesRepository.sol b/contracts/RMRK/emotable/RMRKEmotesRepository.sol index 692e6083..1dd1297e 100644 --- a/contracts/RMRK/emotable/RMRKEmotesRepository.sol +++ b/contracts/RMRK/emotable/RMRKEmotesRepository.sol @@ -17,7 +17,7 @@ contract RMRKEmotesRepository is IRMRKEmotesRepository { bytes32 public immutable DOMAIN_SEPARATOR = keccak256( abi.encode( - "ERC-6381: Public Non-Fungible Token Emote Repository", + "ERC-7409: Public Non-Fungible Token Emote Repository", "1", block.chainid, address(this) diff --git a/test/interfaces.ts b/test/interfaces.ts index 052ba782..a6cd9778 100644 --- a/test/interfaces.ts +++ b/test/interfaces.ts @@ -4,7 +4,7 @@ const IERC721 = '0x80ac58cd'; const IERC721Metadata = '0x5b5e139f'; const IOtherInterface = '0xffffffff'; const IRMRKCatalog = '0xd912401f'; // ERC6220 -const IRMRKEmotesRepository = '0x1b3327ab'; //ERC6381 +const IRMRKEmotesRepository = '0x1b3327ab'; //ERC7409 const IERC2981 = '0x2a55205a'; // ERC6220 const IERC6220 = '0x28bc9ae4'; // ERC6220 const IERC5773 = '0x06b4329a'; // ERC5773 From 4333d9cccd4909811b953ddd7c173b9faa37b1b1 Mon Sep 17 00:00:00 2001 From: steven2308 Date: Tue, 19 Sep 2023 14:07:41 -0500 Subject: [PATCH 15/19] Missing renames on EIP number change. --- ...IRMRKEmotesRepository.sol => IERC7409.sol} | 2 +- .../RMRK/emotable/RMRKEmotesRepository.sol | 26 +++++++++---------- .../nestable/{IERC6059.sol => IERC7401.sol} | 0 3 files changed, 14 insertions(+), 14 deletions(-) rename contracts/RMRK/emotable/{IRMRKEmotesRepository.sol => IERC7409.sol} (99%) rename contracts/RMRK/nestable/{IERC6059.sol => IERC7401.sol} (100%) diff --git a/contracts/RMRK/emotable/IRMRKEmotesRepository.sol b/contracts/RMRK/emotable/IERC7409.sol similarity index 99% rename from contracts/RMRK/emotable/IRMRKEmotesRepository.sol rename to contracts/RMRK/emotable/IERC7409.sol index e5ac9779..21ff69a5 100644 --- a/contracts/RMRK/emotable/IRMRKEmotesRepository.sol +++ b/contracts/RMRK/emotable/IERC7409.sol @@ -4,7 +4,7 @@ pragma solidity ^0.8.21; import "@openzeppelin/contracts/utils/introspection/IERC165.sol"; -interface IRMRKEmotesRepository is IERC165 { +interface IERC7409 is IERC165 { /** * @notice Used to notify listeners that the token with the specified ID has been emoted to or that the reaction has been revoked. * @dev The event MUST only be emitted if the state of the emote is changed. diff --git a/contracts/RMRK/emotable/RMRKEmotesRepository.sol b/contracts/RMRK/emotable/RMRKEmotesRepository.sol index 1dd1297e..62bb54c4 100644 --- a/contracts/RMRK/emotable/RMRKEmotesRepository.sol +++ b/contracts/RMRK/emotable/RMRKEmotesRepository.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.21; -import "./IRMRKEmotesRepository.sol"; +import "./IERC7409.sol"; error BulkParametersOfUnequalLength(); error ExpiredPresignedEmote(); @@ -13,7 +13,7 @@ error InvalidSignature(); * @author RMRK team * @notice Smart contract of the RMRK Emotes repository. */ -contract RMRKEmotesRepository is IRMRKEmotesRepository { +contract RMRKEmotesRepository is IERC7409 { bytes32 public immutable DOMAIN_SEPARATOR = keccak256( abi.encode( @@ -31,7 +31,7 @@ contract RMRKEmotesRepository is IRMRKEmotesRepository { private _emotesPerToken; /** - * @inheritdoc IRMRKEmotesRepository + * @inheritdoc IERC7409 */ function emoteCountOf( address collection, @@ -42,7 +42,7 @@ contract RMRKEmotesRepository is IRMRKEmotesRepository { } /** - * @inheritdoc IRMRKEmotesRepository + * @inheritdoc IERC7409 */ function bulkEmoteCountOf( address[] memory collections, @@ -67,7 +67,7 @@ contract RMRKEmotesRepository is IRMRKEmotesRepository { } /** - * @inheritdoc IRMRKEmotesRepository + * @inheritdoc IERC7409 */ function hasEmoterUsedEmote( address emoter, @@ -79,7 +79,7 @@ contract RMRKEmotesRepository is IRMRKEmotesRepository { } /** - * @inheritdoc IRMRKEmotesRepository + * @inheritdoc IERC7409 */ function haveEmotersUsedEmotes( address[] memory emoters, @@ -110,7 +110,7 @@ contract RMRKEmotesRepository is IRMRKEmotesRepository { } /** - * @inheritdoc IRMRKEmotesRepository + * @inheritdoc IERC7409 */ function emote( address collection, @@ -135,7 +135,7 @@ contract RMRKEmotesRepository is IRMRKEmotesRepository { } /** - * @inheritdoc IRMRKEmotesRepository + * @inheritdoc IERC7409 */ function bulkEmote( address[] memory collections, @@ -186,7 +186,7 @@ contract RMRKEmotesRepository is IRMRKEmotesRepository { } /** - * @inheritdoc IRMRKEmotesRepository + * @inheritdoc IERC7409 */ function prepareMessageToPresignEmote( address collection, @@ -209,7 +209,7 @@ contract RMRKEmotesRepository is IRMRKEmotesRepository { } /** - * @inheritdoc IRMRKEmotesRepository + * @inheritdoc IERC7409 */ function bulkPrepareMessagesToPresignEmote( address[] memory collections, @@ -248,7 +248,7 @@ contract RMRKEmotesRepository is IRMRKEmotesRepository { } /** - * @inheritdoc IRMRKEmotesRepository + * @inheritdoc IERC7409 */ function presignedEmote( address emoter, @@ -301,7 +301,7 @@ contract RMRKEmotesRepository is IRMRKEmotesRepository { } /** - * @inheritdoc IRMRKEmotesRepository + * @inheritdoc IERC7409 */ function bulkPresignedEmote( address[] memory emoters, @@ -393,7 +393,7 @@ contract RMRKEmotesRepository is IRMRKEmotesRepository { bytes4 interfaceId ) public view virtual returns (bool) { return - interfaceId == type(IRMRKEmotesRepository).interfaceId || + interfaceId == type(IERC7409).interfaceId || interfaceId == type(IERC165).interfaceId; } } diff --git a/contracts/RMRK/nestable/IERC6059.sol b/contracts/RMRK/nestable/IERC7401.sol similarity index 100% rename from contracts/RMRK/nestable/IERC6059.sol rename to contracts/RMRK/nestable/IERC7401.sol From b473069b3865720e3b90a32ca7aa261a89f4d760 Mon Sep 17 00:00:00 2001 From: steven2308 Date: Tue, 19 Sep 2023 14:08:03 -0500 Subject: [PATCH 16/19] Updates docs. --- .../{IRMRKEmotesRepository.md => IERC7409.md} | 2 +- docs/RMRK/equippable/RMRKEquippable.md | 16 +++++++-------- .../RMRK/equippable/RMRKMinifiedEquippable.md | 16 +++++++-------- .../IRMRKNestableAutoIndex.md | 16 +++++++-------- .../RMRKNestableAutoIndex.md | 16 +++++++-------- .../reclaimableChild/RMRKReclaimableChild.md | 16 +++++++-------- .../nestable/{IERC6059.md => IERC7401.md} | 20 +++++++++---------- docs/RMRK/nestable/RMRKNestable.md | 16 +++++++-------- docs/RMRK/nestable/RMRKNestableMultiAsset.md | 16 +++++++-------- docs/RMRK/utils/RMRKCollectionUtils.md | 2 +- .../abstract/RMRKAbstractEquippable.md | 16 +++++++-------- .../abstract/RMRKAbstractNestable.md | 16 +++++++-------- .../RMRKAbstractNestableMultiAsset.md | 16 +++++++-------- .../RMRKEquippableLazyMintErc20.md | 16 +++++++-------- .../RMRKEquippableLazyMintErc20Soulbound.md | 16 +++++++-------- .../RMRKNestableLazyMintErc20.md | 16 +++++++-------- .../RMRKNestableLazyMintErc20Soulbound.md | 16 +++++++-------- .../RMRKNestableMultiAssetLazyMintErc20.md | 16 +++++++-------- ...estableMultiAssetLazyMintErc20Soulbound.md | 16 +++++++-------- .../RMRKEquippableLazyMintNative.md | 16 +++++++-------- .../RMRKEquippableLazyMintNativeSoulbound.md | 16 +++++++-------- .../RMRKNestableLazyMintNative.md | 16 +++++++-------- .../RMRKNestableLazyMintNativeSoulbound.md | 16 +++++++-------- .../RMRKNestableMultiAssetLazyMintNative.md | 16 +++++++-------- ...stableMultiAssetLazyMintNativeSoulbound.md | 16 +++++++-------- .../premint/RMRKEquippablePreMint.md | 16 +++++++-------- .../premint/RMRKEquippablePreMintSoulbound.md | 16 +++++++-------- .../premint/RMRKNestableMultiAssetPreMint.md | 16 +++++++-------- .../RMRKNestableMultiAssetPreMintSoulbound.md | 16 +++++++-------- .../premint/RMRKNestablePreMint.md | 16 +++++++-------- .../premint/RMRKNestablePreMintSoulbound.md | 16 +++++++-------- docs/mocks/RMRKEquippableMock.md | 16 +++++++-------- docs/mocks/RMRKMinifiedEquippableMock.md | 16 +++++++-------- docs/mocks/RMRKNestableAutoIndexMock.md | 16 +++++++-------- docs/mocks/RMRKNestableMock.md | 16 +++++++-------- docs/mocks/RMRKNestableMultiAssetMock.md | 16 +++++++-------- .../RMRKNestableClaimableChildMock.md | 16 +++++++-------- .../soulbound/RMRKSoulboundEquippableMock.md | 16 +++++++-------- .../soulbound/RMRKSoulboundNestableMock.md | 16 +++++++-------- .../RMRKSoulboundNestableMultiAssetMock.md | 16 +++++++-------- .../RMRKNestableTypedMultiAssetMock.md | 16 +++++++-------- .../RMRKTypedEquippableMock.md | 16 +++++++-------- 42 files changed, 324 insertions(+), 324 deletions(-) rename docs/RMRK/emotable/{IRMRKEmotesRepository.md => IERC7409.md} (99%) rename docs/RMRK/nestable/{IERC6059.md => IERC7401.md} (97%) diff --git a/docs/RMRK/emotable/IRMRKEmotesRepository.md b/docs/RMRK/emotable/IERC7409.md similarity index 99% rename from docs/RMRK/emotable/IRMRKEmotesRepository.md rename to docs/RMRK/emotable/IERC7409.md index 098006ba..311766cf 100644 --- a/docs/RMRK/emotable/IRMRKEmotesRepository.md +++ b/docs/RMRK/emotable/IERC7409.md @@ -1,4 +1,4 @@ -# IRMRKEmotesRepository +# IERC7409 diff --git a/docs/RMRK/equippable/RMRKEquippable.md b/docs/RMRK/equippable/RMRKEquippable.md index 69b5e264..4a400f18 100644 --- a/docs/RMRK/equippable/RMRKEquippable.md +++ b/docs/RMRK/equippable/RMRKEquippable.md @@ -222,7 +222,7 @@ Used to verify whether a token can be equipped into a given parent's slot. ### childOf ```solidity -function childOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function childOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific active child token for a given parent token. @@ -240,12 +240,12 @@ Used to retrieve a specific active child token for a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containing data about the specified child | +| _0 | IERC7401.Child | A Child struct containing data about the specified child | ### childrenOf ```solidity -function childrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function childrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the active child tokens of a given parent token. @@ -262,7 +262,7 @@ Used to retrieve the active child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's active child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's active child tokens | ### directOwnerOf @@ -625,7 +625,7 @@ Used to retrieve the *root* owner of a given token. ### pendingChildOf ```solidity -function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific pending child token from a given parent token. @@ -643,12 +643,12 @@ Used to retrieve a specific pending child token from a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containting data about the specified child | +| _0 | IERC7401.Child | A Child struct containting data about the specified child | ### pendingChildrenOf ```solidity -function pendingChildrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function pendingChildrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the pending child tokens of a given parent token. @@ -665,7 +665,7 @@ Used to retrieve the pending child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's pending child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's pending child tokens | ### rejectAllAssets diff --git a/docs/RMRK/equippable/RMRKMinifiedEquippable.md b/docs/RMRK/equippable/RMRKMinifiedEquippable.md index bc7a4676..c9f3ae4c 100644 --- a/docs/RMRK/equippable/RMRKMinifiedEquippable.md +++ b/docs/RMRK/equippable/RMRKMinifiedEquippable.md @@ -222,7 +222,7 @@ Used to verify whether a token can be equipped into a given parent's slot. ### childOf ```solidity -function childOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function childOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific active child token for a given parent token. @@ -240,12 +240,12 @@ Used to retrieve a specific active child token for a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containing data about the specified child | +| _0 | IERC7401.Child | A Child struct containing data about the specified child | ### childrenOf ```solidity -function childrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function childrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the active child tokens of a given parent token. @@ -262,7 +262,7 @@ Used to retrieve the active child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's active child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's active child tokens | ### directOwnerOf @@ -625,7 +625,7 @@ Used to retrieve the *root* owner of a given token. ### pendingChildOf ```solidity -function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific pending child token from a given parent token. @@ -643,12 +643,12 @@ Used to retrieve a specific pending child token from a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containting data about the specified child | +| _0 | IERC7401.Child | A Child struct containting data about the specified child | ### pendingChildrenOf ```solidity -function pendingChildrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function pendingChildrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the pending child tokens of a given parent token. @@ -665,7 +665,7 @@ Used to retrieve the pending child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's pending child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's pending child tokens | ### rejectAllAssets diff --git a/docs/RMRK/extension/nestableAutoIndex/IRMRKNestableAutoIndex.md b/docs/RMRK/extension/nestableAutoIndex/IRMRKNestableAutoIndex.md index 0d1da8ba..70d26295 100644 --- a/docs/RMRK/extension/nestableAutoIndex/IRMRKNestableAutoIndex.md +++ b/docs/RMRK/extension/nestableAutoIndex/IRMRKNestableAutoIndex.md @@ -91,7 +91,7 @@ Used to burn a given token. ### childOf ```solidity -function childOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function childOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific active child token for a given parent token. @@ -109,12 +109,12 @@ Used to retrieve a specific active child token for a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containing data about the specified child | +| _0 | IERC7401.Child | A Child struct containing data about the specified child | ### childrenOf ```solidity -function childrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function childrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the active child tokens of a given parent token. @@ -131,7 +131,7 @@ Used to retrieve the active child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's active child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's active child tokens | ### directOwnerOf @@ -202,7 +202,7 @@ Used to retrieve the *root* owner of a given token. ### pendingChildOf ```solidity -function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific pending child token from a given parent token. @@ -220,12 +220,12 @@ Used to retrieve a specific pending child token from a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containting data about the specified child | +| _0 | IERC7401.Child | A Child struct containting data about the specified child | ### pendingChildrenOf ```solidity -function pendingChildrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function pendingChildrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the pending child tokens of a given parent token. @@ -242,7 +242,7 @@ Used to retrieve the pending child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's pending child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's pending child tokens | ### rejectAllChildren diff --git a/docs/RMRK/extension/nestableAutoIndex/RMRKNestableAutoIndex.md b/docs/RMRK/extension/nestableAutoIndex/RMRKNestableAutoIndex.md index e340282b..12df3a4c 100644 --- a/docs/RMRK/extension/nestableAutoIndex/RMRKNestableAutoIndex.md +++ b/docs/RMRK/extension/nestableAutoIndex/RMRKNestableAutoIndex.md @@ -180,7 +180,7 @@ Used to burn a given token. ### childOf ```solidity -function childOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function childOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific active child token for a given parent token. @@ -198,12 +198,12 @@ Used to retrieve a specific active child token for a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containing data about the specified child | +| _0 | IERC7401.Child | A Child struct containing data about the specified child | ### childrenOf ```solidity -function childrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function childrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the active child tokens of a given parent token. @@ -220,7 +220,7 @@ Used to retrieve the active child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's active child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's active child tokens | ### directOwnerOf @@ -336,7 +336,7 @@ function ownerOf(uint256 tokenId) external view returns (address) ### pendingChildOf ```solidity -function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific pending child token from a given parent token. @@ -354,12 +354,12 @@ Used to retrieve a specific pending child token from a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containting data about the specified child | +| _0 | IERC7401.Child | A Child struct containting data about the specified child | ### pendingChildrenOf ```solidity -function pendingChildrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function pendingChildrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the pending child tokens of a given parent token. @@ -376,7 +376,7 @@ Used to retrieve the pending child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's pending child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's pending child tokens | ### rejectAllChildren diff --git a/docs/RMRK/extension/reclaimableChild/RMRKReclaimableChild.md b/docs/RMRK/extension/reclaimableChild/RMRKReclaimableChild.md index a0b52545..c19b72be 100644 --- a/docs/RMRK/extension/reclaimableChild/RMRKReclaimableChild.md +++ b/docs/RMRK/extension/reclaimableChild/RMRKReclaimableChild.md @@ -162,7 +162,7 @@ Used to burn a given token. ### childOf ```solidity -function childOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function childOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific active child token for a given parent token. @@ -180,12 +180,12 @@ Used to retrieve a specific active child token for a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containing data about the specified child | +| _0 | IERC7401.Child | A Child struct containing data about the specified child | ### childrenOf ```solidity -function childrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function childrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the active child tokens of a given parent token. @@ -202,7 +202,7 @@ Used to retrieve the active child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's active child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's active child tokens | ### directOwnerOf @@ -318,7 +318,7 @@ Used to retrieve the *root* owner of a given token. ### pendingChildOf ```solidity -function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific pending child token from a given parent token. @@ -336,12 +336,12 @@ Used to retrieve a specific pending child token from a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containting data about the specified child | +| _0 | IERC7401.Child | A Child struct containting data about the specified child | ### pendingChildrenOf ```solidity -function pendingChildrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function pendingChildrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the pending child tokens of a given parent token. @@ -358,7 +358,7 @@ Used to retrieve the pending child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's pending child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's pending child tokens | ### reclaimChild diff --git a/docs/RMRK/nestable/IERC6059.md b/docs/RMRK/nestable/IERC7401.md similarity index 97% rename from docs/RMRK/nestable/IERC6059.md rename to docs/RMRK/nestable/IERC7401.md index 667cfc56..02266dae 100644 --- a/docs/RMRK/nestable/IERC6059.md +++ b/docs/RMRK/nestable/IERC7401.md @@ -1,8 +1,8 @@ -# IERC6059 +# IERC7401 *RMRK team* -> IERC6059 +> IERC7401 Interface smart contract of the RMRK nestable module. @@ -73,7 +73,7 @@ Used to burn a given token. ### childOf ```solidity -function childOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function childOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific active child token for a given parent token. @@ -91,12 +91,12 @@ Used to retrieve a specific active child token for a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containing data about the specified child | +| _0 | IERC7401.Child | A Child struct containing data about the specified child | ### childrenOf ```solidity -function childrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function childrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the active child tokens of a given parent token. @@ -113,7 +113,7 @@ Used to retrieve the active child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's active child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's active child tokens | ### directOwnerOf @@ -184,7 +184,7 @@ Used to retrieve the *root* owner of a given token. ### pendingChildOf ```solidity -function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific pending child token from a given parent token. @@ -202,12 +202,12 @@ Used to retrieve a specific pending child token from a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containting data about the specified child | +| _0 | IERC7401.Child | A Child struct containting data about the specified child | ### pendingChildrenOf ```solidity -function pendingChildrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function pendingChildrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the pending child tokens of a given parent token. @@ -224,7 +224,7 @@ Used to retrieve the pending child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's pending child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's pending child tokens | ### rejectAllChildren diff --git a/docs/RMRK/nestable/RMRKNestable.md b/docs/RMRK/nestable/RMRKNestable.md index 414187ab..1579f6be 100644 --- a/docs/RMRK/nestable/RMRKNestable.md +++ b/docs/RMRK/nestable/RMRKNestable.md @@ -162,7 +162,7 @@ Used to burn a given token. ### childOf ```solidity -function childOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function childOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific active child token for a given parent token. @@ -180,12 +180,12 @@ Used to retrieve a specific active child token for a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containing data about the specified child | +| _0 | IERC7401.Child | A Child struct containing data about the specified child | ### childrenOf ```solidity -function childrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function childrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the active child tokens of a given parent token. @@ -202,7 +202,7 @@ Used to retrieve the active child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's active child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's active child tokens | ### directOwnerOf @@ -318,7 +318,7 @@ Used to retrieve the *root* owner of a given token. ### pendingChildOf ```solidity -function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific pending child token from a given parent token. @@ -336,12 +336,12 @@ Used to retrieve a specific pending child token from a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containting data about the specified child | +| _0 | IERC7401.Child | A Child struct containting data about the specified child | ### pendingChildrenOf ```solidity -function pendingChildrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function pendingChildrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the pending child tokens of a given parent token. @@ -358,7 +358,7 @@ Used to retrieve the pending child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's pending child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's pending child tokens | ### rejectAllChildren diff --git a/docs/RMRK/nestable/RMRKNestableMultiAsset.md b/docs/RMRK/nestable/RMRKNestableMultiAsset.md index f0242c2d..07d545a1 100644 --- a/docs/RMRK/nestable/RMRKNestableMultiAsset.md +++ b/docs/RMRK/nestable/RMRKNestableMultiAsset.md @@ -197,7 +197,7 @@ Used to burn a given token. ### childOf ```solidity -function childOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function childOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific active child token for a given parent token. @@ -215,12 +215,12 @@ Used to retrieve a specific active child token for a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containing data about the specified child | +| _0 | IERC7401.Child | A Child struct containing data about the specified child | ### childrenOf ```solidity -function childrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function childrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the active child tokens of a given parent token. @@ -237,7 +237,7 @@ Used to retrieve the active child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's active child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's active child tokens | ### directOwnerOf @@ -510,7 +510,7 @@ Used to retrieve the *root* owner of a given token. ### pendingChildOf ```solidity -function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific pending child token from a given parent token. @@ -528,12 +528,12 @@ Used to retrieve a specific pending child token from a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containting data about the specified child | +| _0 | IERC7401.Child | A Child struct containting data about the specified child | ### pendingChildrenOf ```solidity -function pendingChildrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function pendingChildrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the pending child tokens of a given parent token. @@ -550,7 +550,7 @@ Used to retrieve the pending child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's pending child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's pending child tokens | ### rejectAllAssets diff --git a/docs/RMRK/utils/RMRKCollectionUtils.md b/docs/RMRK/utils/RMRKCollectionUtils.md index 664a870c..04db54e8 100644 --- a/docs/RMRK/utils/RMRKCollectionUtils.md +++ b/docs/RMRK/utils/RMRKCollectionUtils.md @@ -54,7 +54,7 @@ Used to get the interface support of a specified collection. |---|---|---| | supports721 | bool | Boolean value signifying whether the collection supports ERC721 interface | | supportsMultiAsset | bool | Boolean value signifying whether the collection supports MultiAsset interface (ERC5773) | -| supportsNesting | bool | Boolean value signifying whether the collection supports Nestable interface (ERC6059) | +| supportsNesting | bool | Boolean value signifying whether the collection supports Nestable interface (ERC7401) | | supportsEquippable | bool | Boolean value signifying whether the collection supports Equippable interface (ERC6220) | | supportsSoulbound | bool | Boolean value signifying whether the collection supports Soulbound interface (ERC6454) | | supportsRoyalties | bool | Boolean value signifying whether the collection supports Royaltiesy interface (ERC2981) | diff --git a/docs/implementations/abstract/RMRKAbstractEquippable.md b/docs/implementations/abstract/RMRKAbstractEquippable.md index cfc51ad5..6be52151 100644 --- a/docs/implementations/abstract/RMRKAbstractEquippable.md +++ b/docs/implementations/abstract/RMRKAbstractEquippable.md @@ -287,7 +287,7 @@ Used to verify whether a token can be equipped into a given parent's slot. ### childOf ```solidity -function childOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function childOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific active child token for a given parent token. @@ -305,12 +305,12 @@ Used to retrieve a specific active child token for a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containing data about the specified child | +| _0 | IERC7401.Child | A Child struct containing data about the specified child | ### childrenOf ```solidity -function childrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function childrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the active child tokens of a given parent token. @@ -327,7 +327,7 @@ Used to retrieve the active child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's active child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's active child tokens | ### collectionMetadata @@ -831,7 +831,7 @@ Used to retrieve the *root* owner of a given token. ### pendingChildOf ```solidity -function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific pending child token from a given parent token. @@ -849,12 +849,12 @@ Used to retrieve a specific pending child token from a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containting data about the specified child | +| _0 | IERC7401.Child | A Child struct containting data about the specified child | ### pendingChildrenOf ```solidity -function pendingChildrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function pendingChildrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the pending child tokens of a given parent token. @@ -871,7 +871,7 @@ Used to retrieve the pending child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's pending child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's pending child tokens | ### rejectAllAssets diff --git a/docs/implementations/abstract/RMRKAbstractNestable.md b/docs/implementations/abstract/RMRKAbstractNestable.md index 759fd641..22bbd7a0 100644 --- a/docs/implementations/abstract/RMRKAbstractNestable.md +++ b/docs/implementations/abstract/RMRKAbstractNestable.md @@ -162,7 +162,7 @@ Used to burn a given token. ### childOf ```solidity -function childOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function childOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific active child token for a given parent token. @@ -180,12 +180,12 @@ Used to retrieve a specific active child token for a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containing data about the specified child | +| _0 | IERC7401.Child | A Child struct containing data about the specified child | ### childrenOf ```solidity -function childrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function childrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the active child tokens of a given parent token. @@ -202,7 +202,7 @@ Used to retrieve the active child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's active child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's active child tokens | ### collectionMetadata @@ -459,7 +459,7 @@ Used to retrieve the *root* owner of a given token. ### pendingChildOf ```solidity -function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific pending child token from a given parent token. @@ -477,12 +477,12 @@ Used to retrieve a specific pending child token from a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containting data about the specified child | +| _0 | IERC7401.Child | A Child struct containting data about the specified child | ### pendingChildrenOf ```solidity -function pendingChildrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function pendingChildrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the pending child tokens of a given parent token. @@ -499,7 +499,7 @@ Used to retrieve the pending child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's pending child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's pending child tokens | ### rejectAllChildren diff --git a/docs/implementations/abstract/RMRKAbstractNestableMultiAsset.md b/docs/implementations/abstract/RMRKAbstractNestableMultiAsset.md index 0c2b7c86..128306da 100644 --- a/docs/implementations/abstract/RMRKAbstractNestableMultiAsset.md +++ b/docs/implementations/abstract/RMRKAbstractNestableMultiAsset.md @@ -237,7 +237,7 @@ Used to burn a given token. ### childOf ```solidity -function childOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function childOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific active child token for a given parent token. @@ -255,12 +255,12 @@ Used to retrieve a specific active child token for a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containing data about the specified child | +| _0 | IERC7401.Child | A Child struct containing data about the specified child | ### childrenOf ```solidity -function childrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function childrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the active child tokens of a given parent token. @@ -277,7 +277,7 @@ Used to retrieve the active child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's active child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's active child tokens | ### collectionMetadata @@ -691,7 +691,7 @@ Used to retrieve the *root* owner of a given token. ### pendingChildOf ```solidity -function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific pending child token from a given parent token. @@ -709,12 +709,12 @@ Used to retrieve a specific pending child token from a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containting data about the specified child | +| _0 | IERC7401.Child | A Child struct containting data about the specified child | ### pendingChildrenOf ```solidity -function pendingChildrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function pendingChildrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the pending child tokens of a given parent token. @@ -731,7 +731,7 @@ Used to retrieve the pending child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's pending child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's pending child tokens | ### rejectAllAssets diff --git a/docs/implementations/lazyMintErc20/RMRKEquippableLazyMintErc20.md b/docs/implementations/lazyMintErc20/RMRKEquippableLazyMintErc20.md index 203d3da9..dd963af3 100644 --- a/docs/implementations/lazyMintErc20/RMRKEquippableLazyMintErc20.md +++ b/docs/implementations/lazyMintErc20/RMRKEquippableLazyMintErc20.md @@ -287,7 +287,7 @@ Used to verify whether a token can be equipped into a given parent's slot. ### childOf ```solidity -function childOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function childOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific active child token for a given parent token. @@ -305,12 +305,12 @@ Used to retrieve a specific active child token for a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containing data about the specified child | +| _0 | IERC7401.Child | A Child struct containing data about the specified child | ### childrenOf ```solidity -function childrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function childrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the active child tokens of a given parent token. @@ -327,7 +327,7 @@ Used to retrieve the active child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's active child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's active child tokens | ### collectionMetadata @@ -895,7 +895,7 @@ Used to retrieve the *root* owner of a given token. ### pendingChildOf ```solidity -function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific pending child token from a given parent token. @@ -913,12 +913,12 @@ Used to retrieve a specific pending child token from a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containting data about the specified child | +| _0 | IERC7401.Child | A Child struct containting data about the specified child | ### pendingChildrenOf ```solidity -function pendingChildrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function pendingChildrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the pending child tokens of a given parent token. @@ -935,7 +935,7 @@ Used to retrieve the pending child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's pending child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's pending child tokens | ### pricePerMint diff --git a/docs/implementations/lazyMintErc20/RMRKEquippableLazyMintErc20Soulbound.md b/docs/implementations/lazyMintErc20/RMRKEquippableLazyMintErc20Soulbound.md index 2f756b8c..b997d039 100644 --- a/docs/implementations/lazyMintErc20/RMRKEquippableLazyMintErc20Soulbound.md +++ b/docs/implementations/lazyMintErc20/RMRKEquippableLazyMintErc20Soulbound.md @@ -287,7 +287,7 @@ Used to verify whether a token can be equipped into a given parent's slot. ### childOf ```solidity -function childOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function childOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific active child token for a given parent token. @@ -305,12 +305,12 @@ Used to retrieve a specific active child token for a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containing data about the specified child | +| _0 | IERC7401.Child | A Child struct containing data about the specified child | ### childrenOf ```solidity -function childrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function childrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the active child tokens of a given parent token. @@ -327,7 +327,7 @@ Used to retrieve the active child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's active child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's active child tokens | ### collectionMetadata @@ -919,7 +919,7 @@ Used to retrieve the *root* owner of a given token. ### pendingChildOf ```solidity -function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific pending child token from a given parent token. @@ -937,12 +937,12 @@ Used to retrieve a specific pending child token from a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containting data about the specified child | +| _0 | IERC7401.Child | A Child struct containting data about the specified child | ### pendingChildrenOf ```solidity -function pendingChildrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function pendingChildrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the pending child tokens of a given parent token. @@ -959,7 +959,7 @@ Used to retrieve the pending child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's pending child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's pending child tokens | ### pricePerMint diff --git a/docs/implementations/lazyMintErc20/RMRKNestableLazyMintErc20.md b/docs/implementations/lazyMintErc20/RMRKNestableLazyMintErc20.md index 972b5c3e..a7c72a21 100644 --- a/docs/implementations/lazyMintErc20/RMRKNestableLazyMintErc20.md +++ b/docs/implementations/lazyMintErc20/RMRKNestableLazyMintErc20.md @@ -162,7 +162,7 @@ Used to burn a given token. ### childOf ```solidity -function childOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function childOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific active child token for a given parent token. @@ -180,12 +180,12 @@ Used to retrieve a specific active child token for a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containing data about the specified child | +| _0 | IERC7401.Child | A Child struct containing data about the specified child | ### childrenOf ```solidity -function childrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function childrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the active child tokens of a given parent token. @@ -202,7 +202,7 @@ Used to retrieve the active child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's active child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's active child tokens | ### collectionMetadata @@ -523,7 +523,7 @@ Used to retrieve the *root* owner of a given token. ### pendingChildOf ```solidity -function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific pending child token from a given parent token. @@ -541,12 +541,12 @@ Used to retrieve a specific pending child token from a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containting data about the specified child | +| _0 | IERC7401.Child | A Child struct containting data about the specified child | ### pendingChildrenOf ```solidity -function pendingChildrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function pendingChildrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the pending child tokens of a given parent token. @@ -563,7 +563,7 @@ Used to retrieve the pending child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's pending child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's pending child tokens | ### pricePerMint diff --git a/docs/implementations/lazyMintErc20/RMRKNestableLazyMintErc20Soulbound.md b/docs/implementations/lazyMintErc20/RMRKNestableLazyMintErc20Soulbound.md index 79160b5c..75d524fc 100644 --- a/docs/implementations/lazyMintErc20/RMRKNestableLazyMintErc20Soulbound.md +++ b/docs/implementations/lazyMintErc20/RMRKNestableLazyMintErc20Soulbound.md @@ -162,7 +162,7 @@ Used to burn a given token. ### childOf ```solidity -function childOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function childOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific active child token for a given parent token. @@ -180,12 +180,12 @@ Used to retrieve a specific active child token for a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containing data about the specified child | +| _0 | IERC7401.Child | A Child struct containing data about the specified child | ### childrenOf ```solidity -function childrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function childrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the active child tokens of a given parent token. @@ -202,7 +202,7 @@ Used to retrieve the active child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's active child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's active child tokens | ### collectionMetadata @@ -547,7 +547,7 @@ Used to retrieve the *root* owner of a given token. ### pendingChildOf ```solidity -function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific pending child token from a given parent token. @@ -565,12 +565,12 @@ Used to retrieve a specific pending child token from a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containting data about the specified child | +| _0 | IERC7401.Child | A Child struct containting data about the specified child | ### pendingChildrenOf ```solidity -function pendingChildrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function pendingChildrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the pending child tokens of a given parent token. @@ -587,7 +587,7 @@ Used to retrieve the pending child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's pending child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's pending child tokens | ### pricePerMint diff --git a/docs/implementations/lazyMintErc20/RMRKNestableMultiAssetLazyMintErc20.md b/docs/implementations/lazyMintErc20/RMRKNestableMultiAssetLazyMintErc20.md index c11715fc..36ef6806 100644 --- a/docs/implementations/lazyMintErc20/RMRKNestableMultiAssetLazyMintErc20.md +++ b/docs/implementations/lazyMintErc20/RMRKNestableMultiAssetLazyMintErc20.md @@ -237,7 +237,7 @@ Used to burn a given token. ### childOf ```solidity -function childOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function childOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific active child token for a given parent token. @@ -255,12 +255,12 @@ Used to retrieve a specific active child token for a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containing data about the specified child | +| _0 | IERC7401.Child | A Child struct containing data about the specified child | ### childrenOf ```solidity -function childrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function childrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the active child tokens of a given parent token. @@ -277,7 +277,7 @@ Used to retrieve the active child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's active child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's active child tokens | ### collectionMetadata @@ -755,7 +755,7 @@ Used to retrieve the *root* owner of a given token. ### pendingChildOf ```solidity -function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific pending child token from a given parent token. @@ -773,12 +773,12 @@ Used to retrieve a specific pending child token from a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containting data about the specified child | +| _0 | IERC7401.Child | A Child struct containting data about the specified child | ### pendingChildrenOf ```solidity -function pendingChildrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function pendingChildrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the pending child tokens of a given parent token. @@ -795,7 +795,7 @@ Used to retrieve the pending child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's pending child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's pending child tokens | ### pricePerMint diff --git a/docs/implementations/lazyMintErc20/RMRKNestableMultiAssetLazyMintErc20Soulbound.md b/docs/implementations/lazyMintErc20/RMRKNestableMultiAssetLazyMintErc20Soulbound.md index b4a5319c..ce46a336 100644 --- a/docs/implementations/lazyMintErc20/RMRKNestableMultiAssetLazyMintErc20Soulbound.md +++ b/docs/implementations/lazyMintErc20/RMRKNestableMultiAssetLazyMintErc20Soulbound.md @@ -237,7 +237,7 @@ Used to burn a given token. ### childOf ```solidity -function childOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function childOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific active child token for a given parent token. @@ -255,12 +255,12 @@ Used to retrieve a specific active child token for a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containing data about the specified child | +| _0 | IERC7401.Child | A Child struct containing data about the specified child | ### childrenOf ```solidity -function childrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function childrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the active child tokens of a given parent token. @@ -277,7 +277,7 @@ Used to retrieve the active child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's active child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's active child tokens | ### collectionMetadata @@ -779,7 +779,7 @@ Used to retrieve the *root* owner of a given token. ### pendingChildOf ```solidity -function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific pending child token from a given parent token. @@ -797,12 +797,12 @@ Used to retrieve a specific pending child token from a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containting data about the specified child | +| _0 | IERC7401.Child | A Child struct containting data about the specified child | ### pendingChildrenOf ```solidity -function pendingChildrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function pendingChildrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the pending child tokens of a given parent token. @@ -819,7 +819,7 @@ Used to retrieve the pending child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's pending child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's pending child tokens | ### pricePerMint diff --git a/docs/implementations/lazyMintNative/RMRKEquippableLazyMintNative.md b/docs/implementations/lazyMintNative/RMRKEquippableLazyMintNative.md index aa5c06d6..f3172f7a 100644 --- a/docs/implementations/lazyMintNative/RMRKEquippableLazyMintNative.md +++ b/docs/implementations/lazyMintNative/RMRKEquippableLazyMintNative.md @@ -287,7 +287,7 @@ Used to verify whether a token can be equipped into a given parent's slot. ### childOf ```solidity -function childOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function childOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific active child token for a given parent token. @@ -305,12 +305,12 @@ Used to retrieve a specific active child token for a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containing data about the specified child | +| _0 | IERC7401.Child | A Child struct containing data about the specified child | ### childrenOf ```solidity -function childrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function childrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the active child tokens of a given parent token. @@ -327,7 +327,7 @@ Used to retrieve the active child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's active child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's active child tokens | ### collectionMetadata @@ -878,7 +878,7 @@ Used to retrieve the *root* owner of a given token. ### pendingChildOf ```solidity -function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific pending child token from a given parent token. @@ -896,12 +896,12 @@ Used to retrieve a specific pending child token from a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containting data about the specified child | +| _0 | IERC7401.Child | A Child struct containting data about the specified child | ### pendingChildrenOf ```solidity -function pendingChildrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function pendingChildrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the pending child tokens of a given parent token. @@ -918,7 +918,7 @@ Used to retrieve the pending child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's pending child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's pending child tokens | ### pricePerMint diff --git a/docs/implementations/lazyMintNative/RMRKEquippableLazyMintNativeSoulbound.md b/docs/implementations/lazyMintNative/RMRKEquippableLazyMintNativeSoulbound.md index 4692823c..93648313 100644 --- a/docs/implementations/lazyMintNative/RMRKEquippableLazyMintNativeSoulbound.md +++ b/docs/implementations/lazyMintNative/RMRKEquippableLazyMintNativeSoulbound.md @@ -287,7 +287,7 @@ Used to verify whether a token can be equipped into a given parent's slot. ### childOf ```solidity -function childOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function childOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific active child token for a given parent token. @@ -305,12 +305,12 @@ Used to retrieve a specific active child token for a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containing data about the specified child | +| _0 | IERC7401.Child | A Child struct containing data about the specified child | ### childrenOf ```solidity -function childrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function childrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the active child tokens of a given parent token. @@ -327,7 +327,7 @@ Used to retrieve the active child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's active child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's active child tokens | ### collectionMetadata @@ -902,7 +902,7 @@ Used to retrieve the *root* owner of a given token. ### pendingChildOf ```solidity -function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific pending child token from a given parent token. @@ -920,12 +920,12 @@ Used to retrieve a specific pending child token from a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containting data about the specified child | +| _0 | IERC7401.Child | A Child struct containting data about the specified child | ### pendingChildrenOf ```solidity -function pendingChildrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function pendingChildrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the pending child tokens of a given parent token. @@ -942,7 +942,7 @@ Used to retrieve the pending child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's pending child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's pending child tokens | ### pricePerMint diff --git a/docs/implementations/lazyMintNative/RMRKNestableLazyMintNative.md b/docs/implementations/lazyMintNative/RMRKNestableLazyMintNative.md index aaff97af..8a47073d 100644 --- a/docs/implementations/lazyMintNative/RMRKNestableLazyMintNative.md +++ b/docs/implementations/lazyMintNative/RMRKNestableLazyMintNative.md @@ -162,7 +162,7 @@ Used to burn a given token. ### childOf ```solidity -function childOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function childOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific active child token for a given parent token. @@ -180,12 +180,12 @@ Used to retrieve a specific active child token for a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containing data about the specified child | +| _0 | IERC7401.Child | A Child struct containing data about the specified child | ### childrenOf ```solidity -function childrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function childrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the active child tokens of a given parent token. @@ -202,7 +202,7 @@ Used to retrieve the active child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's active child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's active child tokens | ### collectionMetadata @@ -506,7 +506,7 @@ Used to retrieve the *root* owner of a given token. ### pendingChildOf ```solidity -function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific pending child token from a given parent token. @@ -524,12 +524,12 @@ Used to retrieve a specific pending child token from a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containting data about the specified child | +| _0 | IERC7401.Child | A Child struct containting data about the specified child | ### pendingChildrenOf ```solidity -function pendingChildrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function pendingChildrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the pending child tokens of a given parent token. @@ -546,7 +546,7 @@ Used to retrieve the pending child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's pending child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's pending child tokens | ### pricePerMint diff --git a/docs/implementations/lazyMintNative/RMRKNestableLazyMintNativeSoulbound.md b/docs/implementations/lazyMintNative/RMRKNestableLazyMintNativeSoulbound.md index ec9dfa4a..a1bfdd61 100644 --- a/docs/implementations/lazyMintNative/RMRKNestableLazyMintNativeSoulbound.md +++ b/docs/implementations/lazyMintNative/RMRKNestableLazyMintNativeSoulbound.md @@ -162,7 +162,7 @@ Used to burn a given token. ### childOf ```solidity -function childOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function childOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific active child token for a given parent token. @@ -180,12 +180,12 @@ Used to retrieve a specific active child token for a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containing data about the specified child | +| _0 | IERC7401.Child | A Child struct containing data about the specified child | ### childrenOf ```solidity -function childrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function childrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the active child tokens of a given parent token. @@ -202,7 +202,7 @@ Used to retrieve the active child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's active child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's active child tokens | ### collectionMetadata @@ -530,7 +530,7 @@ Used to retrieve the *root* owner of a given token. ### pendingChildOf ```solidity -function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific pending child token from a given parent token. @@ -548,12 +548,12 @@ Used to retrieve a specific pending child token from a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containting data about the specified child | +| _0 | IERC7401.Child | A Child struct containting data about the specified child | ### pendingChildrenOf ```solidity -function pendingChildrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function pendingChildrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the pending child tokens of a given parent token. @@ -570,7 +570,7 @@ Used to retrieve the pending child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's pending child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's pending child tokens | ### pricePerMint diff --git a/docs/implementations/lazyMintNative/RMRKNestableMultiAssetLazyMintNative.md b/docs/implementations/lazyMintNative/RMRKNestableMultiAssetLazyMintNative.md index 856d673f..e0a35428 100644 --- a/docs/implementations/lazyMintNative/RMRKNestableMultiAssetLazyMintNative.md +++ b/docs/implementations/lazyMintNative/RMRKNestableMultiAssetLazyMintNative.md @@ -237,7 +237,7 @@ Used to burn a given token. ### childOf ```solidity -function childOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function childOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific active child token for a given parent token. @@ -255,12 +255,12 @@ Used to retrieve a specific active child token for a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containing data about the specified child | +| _0 | IERC7401.Child | A Child struct containing data about the specified child | ### childrenOf ```solidity -function childrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function childrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the active child tokens of a given parent token. @@ -277,7 +277,7 @@ Used to retrieve the active child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's active child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's active child tokens | ### collectionMetadata @@ -738,7 +738,7 @@ Used to retrieve the *root* owner of a given token. ### pendingChildOf ```solidity -function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific pending child token from a given parent token. @@ -756,12 +756,12 @@ Used to retrieve a specific pending child token from a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containting data about the specified child | +| _0 | IERC7401.Child | A Child struct containting data about the specified child | ### pendingChildrenOf ```solidity -function pendingChildrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function pendingChildrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the pending child tokens of a given parent token. @@ -778,7 +778,7 @@ Used to retrieve the pending child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's pending child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's pending child tokens | ### pricePerMint diff --git a/docs/implementations/lazyMintNative/RMRKNestableMultiAssetLazyMintNativeSoulbound.md b/docs/implementations/lazyMintNative/RMRKNestableMultiAssetLazyMintNativeSoulbound.md index f6c695d1..476aa401 100644 --- a/docs/implementations/lazyMintNative/RMRKNestableMultiAssetLazyMintNativeSoulbound.md +++ b/docs/implementations/lazyMintNative/RMRKNestableMultiAssetLazyMintNativeSoulbound.md @@ -237,7 +237,7 @@ Used to burn a given token. ### childOf ```solidity -function childOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function childOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific active child token for a given parent token. @@ -255,12 +255,12 @@ Used to retrieve a specific active child token for a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containing data about the specified child | +| _0 | IERC7401.Child | A Child struct containing data about the specified child | ### childrenOf ```solidity -function childrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function childrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the active child tokens of a given parent token. @@ -277,7 +277,7 @@ Used to retrieve the active child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's active child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's active child tokens | ### collectionMetadata @@ -762,7 +762,7 @@ Used to retrieve the *root* owner of a given token. ### pendingChildOf ```solidity -function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific pending child token from a given parent token. @@ -780,12 +780,12 @@ Used to retrieve a specific pending child token from a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containting data about the specified child | +| _0 | IERC7401.Child | A Child struct containting data about the specified child | ### pendingChildrenOf ```solidity -function pendingChildrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function pendingChildrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the pending child tokens of a given parent token. @@ -802,7 +802,7 @@ Used to retrieve the pending child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's pending child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's pending child tokens | ### pricePerMint diff --git a/docs/implementations/premint/RMRKEquippablePreMint.md b/docs/implementations/premint/RMRKEquippablePreMint.md index b20cac2c..30662636 100644 --- a/docs/implementations/premint/RMRKEquippablePreMint.md +++ b/docs/implementations/premint/RMRKEquippablePreMint.md @@ -287,7 +287,7 @@ Used to verify whether a token can be equipped into a given parent's slot. ### childOf ```solidity -function childOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function childOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific active child token for a given parent token. @@ -305,12 +305,12 @@ Used to retrieve a specific active child token for a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containing data about the specified child | +| _0 | IERC7401.Child | A Child struct containing data about the specified child | ### childrenOf ```solidity -function childrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function childrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the active child tokens of a given parent token. @@ -327,7 +327,7 @@ Used to retrieve the active child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's active child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's active child tokens | ### collectionMetadata @@ -880,7 +880,7 @@ Used to retrieve the *root* owner of a given token. ### pendingChildOf ```solidity -function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific pending child token from a given parent token. @@ -898,12 +898,12 @@ Used to retrieve a specific pending child token from a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containting data about the specified child | +| _0 | IERC7401.Child | A Child struct containting data about the specified child | ### pendingChildrenOf ```solidity -function pendingChildrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function pendingChildrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the pending child tokens of a given parent token. @@ -920,7 +920,7 @@ Used to retrieve the pending child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's pending child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's pending child tokens | ### rejectAllAssets diff --git a/docs/implementations/premint/RMRKEquippablePreMintSoulbound.md b/docs/implementations/premint/RMRKEquippablePreMintSoulbound.md index e3f99c4f..c8f971f4 100644 --- a/docs/implementations/premint/RMRKEquippablePreMintSoulbound.md +++ b/docs/implementations/premint/RMRKEquippablePreMintSoulbound.md @@ -287,7 +287,7 @@ Used to verify whether a token can be equipped into a given parent's slot. ### childOf ```solidity -function childOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function childOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific active child token for a given parent token. @@ -305,12 +305,12 @@ Used to retrieve a specific active child token for a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containing data about the specified child | +| _0 | IERC7401.Child | A Child struct containing data about the specified child | ### childrenOf ```solidity -function childrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function childrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the active child tokens of a given parent token. @@ -327,7 +327,7 @@ Used to retrieve the active child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's active child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's active child tokens | ### collectionMetadata @@ -904,7 +904,7 @@ Used to retrieve the *root* owner of a given token. ### pendingChildOf ```solidity -function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific pending child token from a given parent token. @@ -922,12 +922,12 @@ Used to retrieve a specific pending child token from a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containting data about the specified child | +| _0 | IERC7401.Child | A Child struct containting data about the specified child | ### pendingChildrenOf ```solidity -function pendingChildrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function pendingChildrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the pending child tokens of a given parent token. @@ -944,7 +944,7 @@ Used to retrieve the pending child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's pending child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's pending child tokens | ### rejectAllAssets diff --git a/docs/implementations/premint/RMRKNestableMultiAssetPreMint.md b/docs/implementations/premint/RMRKNestableMultiAssetPreMint.md index 74cc42b6..c6d43b4e 100644 --- a/docs/implementations/premint/RMRKNestableMultiAssetPreMint.md +++ b/docs/implementations/premint/RMRKNestableMultiAssetPreMint.md @@ -237,7 +237,7 @@ Used to burn a given token. ### childOf ```solidity -function childOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function childOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific active child token for a given parent token. @@ -255,12 +255,12 @@ Used to retrieve a specific active child token for a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containing data about the specified child | +| _0 | IERC7401.Child | A Child struct containing data about the specified child | ### childrenOf ```solidity -function childrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function childrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the active child tokens of a given parent token. @@ -277,7 +277,7 @@ Used to retrieve the active child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's active child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's active child tokens | ### collectionMetadata @@ -740,7 +740,7 @@ Used to retrieve the *root* owner of a given token. ### pendingChildOf ```solidity -function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific pending child token from a given parent token. @@ -758,12 +758,12 @@ Used to retrieve a specific pending child token from a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containting data about the specified child | +| _0 | IERC7401.Child | A Child struct containting data about the specified child | ### pendingChildrenOf ```solidity -function pendingChildrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function pendingChildrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the pending child tokens of a given parent token. @@ -780,7 +780,7 @@ Used to retrieve the pending child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's pending child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's pending child tokens | ### rejectAllAssets diff --git a/docs/implementations/premint/RMRKNestableMultiAssetPreMintSoulbound.md b/docs/implementations/premint/RMRKNestableMultiAssetPreMintSoulbound.md index d6e21994..ae4004e3 100644 --- a/docs/implementations/premint/RMRKNestableMultiAssetPreMintSoulbound.md +++ b/docs/implementations/premint/RMRKNestableMultiAssetPreMintSoulbound.md @@ -237,7 +237,7 @@ Used to burn a given token. ### childOf ```solidity -function childOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function childOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific active child token for a given parent token. @@ -255,12 +255,12 @@ Used to retrieve a specific active child token for a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containing data about the specified child | +| _0 | IERC7401.Child | A Child struct containing data about the specified child | ### childrenOf ```solidity -function childrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function childrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the active child tokens of a given parent token. @@ -277,7 +277,7 @@ Used to retrieve the active child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's active child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's active child tokens | ### collectionMetadata @@ -764,7 +764,7 @@ Used to retrieve the *root* owner of a given token. ### pendingChildOf ```solidity -function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific pending child token from a given parent token. @@ -782,12 +782,12 @@ Used to retrieve a specific pending child token from a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containting data about the specified child | +| _0 | IERC7401.Child | A Child struct containting data about the specified child | ### pendingChildrenOf ```solidity -function pendingChildrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function pendingChildrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the pending child tokens of a given parent token. @@ -804,7 +804,7 @@ Used to retrieve the pending child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's pending child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's pending child tokens | ### rejectAllAssets diff --git a/docs/implementations/premint/RMRKNestablePreMint.md b/docs/implementations/premint/RMRKNestablePreMint.md index b9860242..31cc26e4 100644 --- a/docs/implementations/premint/RMRKNestablePreMint.md +++ b/docs/implementations/premint/RMRKNestablePreMint.md @@ -162,7 +162,7 @@ Used to burn a given token. ### childOf ```solidity -function childOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function childOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific active child token for a given parent token. @@ -180,12 +180,12 @@ Used to retrieve a specific active child token for a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containing data about the specified child | +| _0 | IERC7401.Child | A Child struct containing data about the specified child | ### childrenOf ```solidity -function childrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function childrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the active child tokens of a given parent token. @@ -202,7 +202,7 @@ Used to retrieve the active child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's active child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's active child tokens | ### collectionMetadata @@ -508,7 +508,7 @@ Used to retrieve the *root* owner of a given token. ### pendingChildOf ```solidity -function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific pending child token from a given parent token. @@ -526,12 +526,12 @@ Used to retrieve a specific pending child token from a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containting data about the specified child | +| _0 | IERC7401.Child | A Child struct containting data about the specified child | ### pendingChildrenOf ```solidity -function pendingChildrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function pendingChildrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the pending child tokens of a given parent token. @@ -548,7 +548,7 @@ Used to retrieve the pending child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's pending child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's pending child tokens | ### rejectAllChildren diff --git a/docs/implementations/premint/RMRKNestablePreMintSoulbound.md b/docs/implementations/premint/RMRKNestablePreMintSoulbound.md index 09aa3eeb..828e82a8 100644 --- a/docs/implementations/premint/RMRKNestablePreMintSoulbound.md +++ b/docs/implementations/premint/RMRKNestablePreMintSoulbound.md @@ -162,7 +162,7 @@ Used to burn a given token. ### childOf ```solidity -function childOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function childOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific active child token for a given parent token. @@ -180,12 +180,12 @@ Used to retrieve a specific active child token for a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containing data about the specified child | +| _0 | IERC7401.Child | A Child struct containing data about the specified child | ### childrenOf ```solidity -function childrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function childrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the active child tokens of a given parent token. @@ -202,7 +202,7 @@ Used to retrieve the active child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's active child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's active child tokens | ### collectionMetadata @@ -532,7 +532,7 @@ Used to retrieve the *root* owner of a given token. ### pendingChildOf ```solidity -function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific pending child token from a given parent token. @@ -550,12 +550,12 @@ Used to retrieve a specific pending child token from a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containting data about the specified child | +| _0 | IERC7401.Child | A Child struct containting data about the specified child | ### pendingChildrenOf ```solidity -function pendingChildrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function pendingChildrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the pending child tokens of a given parent token. @@ -572,7 +572,7 @@ Used to retrieve the pending child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's pending child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's pending child tokens | ### rejectAllChildren diff --git a/docs/mocks/RMRKEquippableMock.md b/docs/mocks/RMRKEquippableMock.md index 376a6b7e..d8d923d9 100644 --- a/docs/mocks/RMRKEquippableMock.md +++ b/docs/mocks/RMRKEquippableMock.md @@ -260,7 +260,7 @@ Used to verify whether a token can be equipped into a given parent's slot. ### childOf ```solidity -function childOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function childOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific active child token for a given parent token. @@ -278,12 +278,12 @@ Used to retrieve a specific active child token for a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containing data about the specified child | +| _0 | IERC7401.Child | A Child struct containing data about the specified child | ### childrenOf ```solidity -function childrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function childrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the active child tokens of a given parent token. @@ -300,7 +300,7 @@ Used to retrieve the active child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's active child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's active child tokens | ### directOwnerOf @@ -716,7 +716,7 @@ Used to retrieve the *root* owner of a given token. ### pendingChildOf ```solidity -function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific pending child token from a given parent token. @@ -734,12 +734,12 @@ Used to retrieve a specific pending child token from a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containting data about the specified child | +| _0 | IERC7401.Child | A Child struct containting data about the specified child | ### pendingChildrenOf ```solidity -function pendingChildrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function pendingChildrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the pending child tokens of a given parent token. @@ -756,7 +756,7 @@ Used to retrieve the pending child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's pending child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's pending child tokens | ### rejectAllAssets diff --git a/docs/mocks/RMRKMinifiedEquippableMock.md b/docs/mocks/RMRKMinifiedEquippableMock.md index 72e1461b..f608977a 100644 --- a/docs/mocks/RMRKMinifiedEquippableMock.md +++ b/docs/mocks/RMRKMinifiedEquippableMock.md @@ -260,7 +260,7 @@ Used to verify whether a token can be equipped into a given parent's slot. ### childOf ```solidity -function childOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function childOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific active child token for a given parent token. @@ -278,12 +278,12 @@ Used to retrieve a specific active child token for a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containing data about the specified child | +| _0 | IERC7401.Child | A Child struct containing data about the specified child | ### childrenOf ```solidity -function childrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function childrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the active child tokens of a given parent token. @@ -300,7 +300,7 @@ Used to retrieve the active child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's active child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's active child tokens | ### directOwnerOf @@ -698,7 +698,7 @@ Used to retrieve the *root* owner of a given token. ### pendingChildOf ```solidity -function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific pending child token from a given parent token. @@ -716,12 +716,12 @@ Used to retrieve a specific pending child token from a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containting data about the specified child | +| _0 | IERC7401.Child | A Child struct containting data about the specified child | ### pendingChildrenOf ```solidity -function pendingChildrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function pendingChildrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the pending child tokens of a given parent token. @@ -738,7 +738,7 @@ Used to retrieve the pending child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's pending child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's pending child tokens | ### rejectAllAssets diff --git a/docs/mocks/RMRKNestableAutoIndexMock.md b/docs/mocks/RMRKNestableAutoIndexMock.md index b84e2ca5..20ffa04f 100644 --- a/docs/mocks/RMRKNestableAutoIndexMock.md +++ b/docs/mocks/RMRKNestableAutoIndexMock.md @@ -180,7 +180,7 @@ Used to burn a given token. ### childOf ```solidity -function childOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function childOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific active child token for a given parent token. @@ -198,12 +198,12 @@ Used to retrieve a specific active child token for a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containing data about the specified child | +| _0 | IERC7401.Child | A Child struct containing data about the specified child | ### childrenOf ```solidity -function childrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function childrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the active child tokens of a given parent token. @@ -220,7 +220,7 @@ Used to retrieve the active child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's active child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's active child tokens | ### directOwnerOf @@ -371,7 +371,7 @@ function ownerOf(uint256 tokenId) external view returns (address) ### pendingChildOf ```solidity -function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific pending child token from a given parent token. @@ -389,12 +389,12 @@ Used to retrieve a specific pending child token from a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containting data about the specified child | +| _0 | IERC7401.Child | A Child struct containting data about the specified child | ### pendingChildrenOf ```solidity -function pendingChildrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function pendingChildrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the pending child tokens of a given parent token. @@ -411,7 +411,7 @@ Used to retrieve the pending child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's pending child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's pending child tokens | ### rejectAllChildren diff --git a/docs/mocks/RMRKNestableMock.md b/docs/mocks/RMRKNestableMock.md index ae3a0315..085ce143 100644 --- a/docs/mocks/RMRKNestableMock.md +++ b/docs/mocks/RMRKNestableMock.md @@ -185,7 +185,7 @@ Used to burn a given token. ### childOf ```solidity -function childOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function childOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific active child token for a given parent token. @@ -203,12 +203,12 @@ Used to retrieve a specific active child token for a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containing data about the specified child | +| _0 | IERC7401.Child | A Child struct containing data about the specified child | ### childrenOf ```solidity -function childrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function childrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the active child tokens of a given parent token. @@ -225,7 +225,7 @@ Used to retrieve the active child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's active child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's active child tokens | ### directOwnerOf @@ -394,7 +394,7 @@ Used to retrieve the *root* owner of a given token. ### pendingChildOf ```solidity -function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific pending child token from a given parent token. @@ -412,12 +412,12 @@ Used to retrieve a specific pending child token from a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containting data about the specified child | +| _0 | IERC7401.Child | A Child struct containting data about the specified child | ### pendingChildrenOf ```solidity -function pendingChildrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function pendingChildrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the pending child tokens of a given parent token. @@ -434,7 +434,7 @@ Used to retrieve the pending child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's pending child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's pending child tokens | ### rejectAllChildren diff --git a/docs/mocks/RMRKNestableMultiAssetMock.md b/docs/mocks/RMRKNestableMultiAssetMock.md index c736e135..2825e9ef 100644 --- a/docs/mocks/RMRKNestableMultiAssetMock.md +++ b/docs/mocks/RMRKNestableMultiAssetMock.md @@ -232,7 +232,7 @@ Used to burn a given token. ### childOf ```solidity -function childOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function childOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific active child token for a given parent token. @@ -250,12 +250,12 @@ Used to retrieve a specific active child token for a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containing data about the specified child | +| _0 | IERC7401.Child | A Child struct containing data about the specified child | ### childrenOf ```solidity -function childrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function childrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the active child tokens of a given parent token. @@ -272,7 +272,7 @@ Used to retrieve the active child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's active child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's active child tokens | ### directOwnerOf @@ -598,7 +598,7 @@ Used to retrieve the *root* owner of a given token. ### pendingChildOf ```solidity -function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific pending child token from a given parent token. @@ -616,12 +616,12 @@ Used to retrieve a specific pending child token from a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containting data about the specified child | +| _0 | IERC7401.Child | A Child struct containting data about the specified child | ### pendingChildrenOf ```solidity -function pendingChildrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function pendingChildrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the pending child tokens of a given parent token. @@ -638,7 +638,7 @@ Used to retrieve the pending child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's pending child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's pending child tokens | ### rejectAllAssets diff --git a/docs/mocks/extensions/claimableChild/RMRKNestableClaimableChildMock.md b/docs/mocks/extensions/claimableChild/RMRKNestableClaimableChildMock.md index 702f010b..5b921c76 100644 --- a/docs/mocks/extensions/claimableChild/RMRKNestableClaimableChildMock.md +++ b/docs/mocks/extensions/claimableChild/RMRKNestableClaimableChildMock.md @@ -185,7 +185,7 @@ Used to burn a given token. ### childOf ```solidity -function childOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function childOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific active child token for a given parent token. @@ -203,12 +203,12 @@ Used to retrieve a specific active child token for a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containing data about the specified child | +| _0 | IERC7401.Child | A Child struct containing data about the specified child | ### childrenOf ```solidity -function childrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function childrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the active child tokens of a given parent token. @@ -225,7 +225,7 @@ Used to retrieve the active child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's active child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's active child tokens | ### directOwnerOf @@ -394,7 +394,7 @@ Used to retrieve the *root* owner of a given token. ### pendingChildOf ```solidity -function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific pending child token from a given parent token. @@ -412,12 +412,12 @@ Used to retrieve a specific pending child token from a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containting data about the specified child | +| _0 | IERC7401.Child | A Child struct containting data about the specified child | ### pendingChildrenOf ```solidity -function pendingChildrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function pendingChildrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the pending child tokens of a given parent token. @@ -434,7 +434,7 @@ Used to retrieve the pending child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's pending child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's pending child tokens | ### reclaimChild diff --git a/docs/mocks/extensions/soulbound/RMRKSoulboundEquippableMock.md b/docs/mocks/extensions/soulbound/RMRKSoulboundEquippableMock.md index a5683b20..0fc76b7f 100644 --- a/docs/mocks/extensions/soulbound/RMRKSoulboundEquippableMock.md +++ b/docs/mocks/extensions/soulbound/RMRKSoulboundEquippableMock.md @@ -260,7 +260,7 @@ Used to verify whether a token can be equipped into a given parent's slot. ### childOf ```solidity -function childOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function childOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific active child token for a given parent token. @@ -278,12 +278,12 @@ Used to retrieve a specific active child token for a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containing data about the specified child | +| _0 | IERC7401.Child | A Child struct containing data about the specified child | ### childrenOf ```solidity -function childrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function childrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the active child tokens of a given parent token. @@ -300,7 +300,7 @@ Used to retrieve the active child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's active child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's active child tokens | ### directOwnerOf @@ -740,7 +740,7 @@ Used to retrieve the *root* owner of a given token. ### pendingChildOf ```solidity -function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific pending child token from a given parent token. @@ -758,12 +758,12 @@ Used to retrieve a specific pending child token from a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containting data about the specified child | +| _0 | IERC7401.Child | A Child struct containting data about the specified child | ### pendingChildrenOf ```solidity -function pendingChildrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function pendingChildrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the pending child tokens of a given parent token. @@ -780,7 +780,7 @@ Used to retrieve the pending child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's pending child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's pending child tokens | ### rejectAllAssets diff --git a/docs/mocks/extensions/soulbound/RMRKSoulboundNestableMock.md b/docs/mocks/extensions/soulbound/RMRKSoulboundNestableMock.md index eeafbbcb..87332395 100644 --- a/docs/mocks/extensions/soulbound/RMRKSoulboundNestableMock.md +++ b/docs/mocks/extensions/soulbound/RMRKSoulboundNestableMock.md @@ -185,7 +185,7 @@ Used to burn a given token. ### childOf ```solidity -function childOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function childOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific active child token for a given parent token. @@ -203,12 +203,12 @@ Used to retrieve a specific active child token for a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containing data about the specified child | +| _0 | IERC7401.Child | A Child struct containing data about the specified child | ### childrenOf ```solidity -function childrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function childrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the active child tokens of a given parent token. @@ -225,7 +225,7 @@ Used to retrieve the active child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's active child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's active child tokens | ### directOwnerOf @@ -418,7 +418,7 @@ Used to retrieve the *root* owner of a given token. ### pendingChildOf ```solidity -function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific pending child token from a given parent token. @@ -436,12 +436,12 @@ Used to retrieve a specific pending child token from a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containting data about the specified child | +| _0 | IERC7401.Child | A Child struct containting data about the specified child | ### pendingChildrenOf ```solidity -function pendingChildrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function pendingChildrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the pending child tokens of a given parent token. @@ -458,7 +458,7 @@ Used to retrieve the pending child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's pending child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's pending child tokens | ### rejectAllChildren diff --git a/docs/mocks/extensions/soulbound/RMRKSoulboundNestableMultiAssetMock.md b/docs/mocks/extensions/soulbound/RMRKSoulboundNestableMultiAssetMock.md index 0fa09878..54237884 100644 --- a/docs/mocks/extensions/soulbound/RMRKSoulboundNestableMultiAssetMock.md +++ b/docs/mocks/extensions/soulbound/RMRKSoulboundNestableMultiAssetMock.md @@ -232,7 +232,7 @@ Used to burn a given token. ### childOf ```solidity -function childOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function childOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific active child token for a given parent token. @@ -250,12 +250,12 @@ Used to retrieve a specific active child token for a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containing data about the specified child | +| _0 | IERC7401.Child | A Child struct containing data about the specified child | ### childrenOf ```solidity -function childrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function childrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the active child tokens of a given parent token. @@ -272,7 +272,7 @@ Used to retrieve the active child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's active child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's active child tokens | ### directOwnerOf @@ -622,7 +622,7 @@ Used to retrieve the *root* owner of a given token. ### pendingChildOf ```solidity -function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific pending child token from a given parent token. @@ -640,12 +640,12 @@ Used to retrieve a specific pending child token from a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containting data about the specified child | +| _0 | IERC7401.Child | A Child struct containting data about the specified child | ### pendingChildrenOf ```solidity -function pendingChildrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function pendingChildrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the pending child tokens of a given parent token. @@ -662,7 +662,7 @@ Used to retrieve the pending child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's pending child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's pending child tokens | ### rejectAllAssets diff --git a/docs/mocks/extensions/typedMultiAsset/RMRKNestableTypedMultiAssetMock.md b/docs/mocks/extensions/typedMultiAsset/RMRKNestableTypedMultiAssetMock.md index 402ff2c6..c2ffedfb 100644 --- a/docs/mocks/extensions/typedMultiAsset/RMRKNestableTypedMultiAssetMock.md +++ b/docs/mocks/extensions/typedMultiAsset/RMRKNestableTypedMultiAssetMock.md @@ -250,7 +250,7 @@ Used to burn a given token. ### childOf ```solidity -function childOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function childOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific active child token for a given parent token. @@ -268,12 +268,12 @@ Used to retrieve a specific active child token for a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containing data about the specified child | +| _0 | IERC7401.Child | A Child struct containing data about the specified child | ### childrenOf ```solidity -function childrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function childrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the active child tokens of a given parent token. @@ -290,7 +290,7 @@ Used to retrieve the active child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's active child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's active child tokens | ### directOwnerOf @@ -638,7 +638,7 @@ Used to retrieve the *root* owner of a given token. ### pendingChildOf ```solidity -function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific pending child token from a given parent token. @@ -656,12 +656,12 @@ Used to retrieve a specific pending child token from a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containting data about the specified child | +| _0 | IERC7401.Child | A Child struct containting data about the specified child | ### pendingChildrenOf ```solidity -function pendingChildrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function pendingChildrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the pending child tokens of a given parent token. @@ -678,7 +678,7 @@ Used to retrieve the pending child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's pending child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's pending child tokens | ### rejectAllAssets diff --git a/docs/mocks/extensions/typedMultiAsset/RMRKTypedEquippableMock.md b/docs/mocks/extensions/typedMultiAsset/RMRKTypedEquippableMock.md index 8708ac66..9551efbe 100644 --- a/docs/mocks/extensions/typedMultiAsset/RMRKTypedEquippableMock.md +++ b/docs/mocks/extensions/typedMultiAsset/RMRKTypedEquippableMock.md @@ -281,7 +281,7 @@ Used to verify whether a token can be equipped into a given parent's slot. ### childOf ```solidity -function childOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function childOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific active child token for a given parent token. @@ -299,12 +299,12 @@ Used to retrieve a specific active child token for a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containing data about the specified child | +| _0 | IERC7401.Child | A Child struct containing data about the specified child | ### childrenOf ```solidity -function childrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function childrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the active child tokens of a given parent token. @@ -321,7 +321,7 @@ Used to retrieve the active child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's active child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's active child tokens | ### directOwnerOf @@ -759,7 +759,7 @@ Used to retrieve the *root* owner of a given token. ### pendingChildOf ```solidity -function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC6059.Child) +function pendingChildOf(uint256 parentId, uint256 index) external view returns (struct IERC7401.Child) ``` Used to retrieve a specific pending child token from a given parent token. @@ -777,12 +777,12 @@ Used to retrieve a specific pending child token from a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child | A Child struct containting data about the specified child | +| _0 | IERC7401.Child | A Child struct containting data about the specified child | ### pendingChildrenOf ```solidity -function pendingChildrenOf(uint256 parentId) external view returns (struct IERC6059.Child[]) +function pendingChildrenOf(uint256 parentId) external view returns (struct IERC7401.Child[]) ``` Used to retrieve the pending child tokens of a given parent token. @@ -799,7 +799,7 @@ Used to retrieve the pending child tokens of a given parent token. | Name | Type | Description | |---|---|---| -| _0 | IERC6059.Child[] | An array of Child structs containing the parent token's pending child tokens | +| _0 | IERC7401.Child[] | An array of Child structs containing the parent token's pending child tokens | ### rejectAllAssets From 40421e0651340283e56fc15a8541066152c7aa6d Mon Sep 17 00:00:00 2001 From: steven2308 Date: Tue, 19 Sep 2023 14:29:38 -0500 Subject: [PATCH 17/19] Adds section for v2.1.0 on CHANGELOG. --- CHANGELOG.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee622fa9..09427d51 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,23 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [2.1.0] - 2023-09-19 + +This release covers minor improvements and updates the numbers for Nestable and Emotable EIPs. + +The original Nestable EIP (6059) had a missing parameter on a method which was added during the EIP process. Luckily the interfaceId was correct, so all collections deployed using this package actually always used 7401 instead of 6059. For the Emotes EIP, we found before releasing in production that 6381 was not compatible with all current emojis, so we proposed 7409 to fix this and ensure forward compatibility. emotes.app always used 7409. To be extra clear, you do not need to worry about upgrading or fixing previously deployed collections using these EIPs, all Nestable collections deployed using any of RMRK products or libraries has always used 7401, the detection through interfaceId ensures that. + +### Changed +- Equip and Unequip are now gated for owner or approved for assets, permission over transferring is no longer needed to delegate equipping. +- Renames 6059 to 7401. +- Renames emotes repository to 7409. +- Adds base network on testing and production. +- Improves hardhat config and .env.example for network configuration. + +### Fixed +- No longer restricts child catalog to match parent's catalog to consider the child equippable on RMRKEquipRenderUtils. +- Fixes soulbound detection on RenderUtils.getExtendedNFT. + ## [2.0.0] - 2023-08-01 This Release has significant breaking changes in all ready-to-use implementations. The inheritance flow was highly simplified, by merging all extra utilities, which a marketplace would typically expect, into a single abstract contract: `RMRKImplementationBase`. This contract replaces `RMRKCollectionMetadata`, `RMRKMintingUtils` contracts and `name` and `symbol` of all core implementations. From 763fc05b7cb19ef9c3d1e26fe1067325390b8096 Mon Sep 17 00:00:00 2001 From: Steven Pineda Date: Wed, 20 Sep 2023 12:04:33 -0500 Subject: [PATCH 18/19] Apply suggestions from code review Co-authored-by: Jan Turk --- CHANGELOG.md | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 09427d51..7685436a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,19 +7,23 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [2.1.0] - 2023-09-19 -This release covers minor improvements and updates the numbers for Nestable and Emotable EIPs. +This release covers minor improvements and updates the numbers for Nestable and Emotable ERCs. -The original Nestable EIP (6059) had a missing parameter on a method which was added during the EIP process. Luckily the interfaceId was correct, so all collections deployed using this package actually always used 7401 instead of 6059. For the Emotes EIP, we found before releasing in production that 6381 was not compatible with all current emojis, so we proposed 7409 to fix this and ensure forward compatibility. emotes.app always used 7409. To be extra clear, you do not need to worry about upgrading or fixing previously deployed collections using these EIPs, all Nestable collections deployed using any of RMRK products or libraries has always used 7401, the detection through interfaceId ensures that. +The original Nestable standard (ERC-6059) was missing parameter in the specification due to a method modified during the EIP process. The `interfaceId` of the specified interface was correct, so all the collections deployed using this package in the past were using the newly finalized ERC-7401 instead of ERC-6059. + +The need to update the Emotes standard (ERC-6381) was noticed before it was released into production. The implementation was incompatible with the full set of Unicode emojis due to them having additional flags, and their codes extended well over the `bytes4` storage available. The updated standard (ERC-7409) uses `string` type values to store the emoji codes and is now compatible with all existing emojis as well as any of those that will be added in the future. Our emotes.app has used ERC-7409 since its release, so you don't need to worry that some reactions might be lost; they are all there. + +To reiterate: you do not need to worry about upgrading or fixing previously deployed collections using these ERCs, since they are already built based on the latest specification ever since they have been released into the public domain. ### Changed -- Equip and Unequip are now gated for owner or approved for assets, permission over transferring is no longer needed to delegate equipping. -- Renames 6059 to 7401. -- Renames emotes repository to 7409. -- Adds base network on testing and production. +- `equip` and `unequip` methods are now gated to the owner or approved for assets, transfer permission no longer needs to be granted alongside equip/unequip permission. +- Renames ERC-6059 to ERC-7401. +- Renames emotes repository to ERC-7409. +- Adds Base test and mainnet networks - Improves hardhat config and .env.example for network configuration. ### Fixed -- No longer restricts child catalog to match parent's catalog to consider the child equippable on RMRKEquipRenderUtils. +- No longer restricts child catalog from being different than parent's catalog to consider the child equippable in RMRKEquipRenderUtils. - Fixes soulbound detection on RenderUtils.getExtendedNFT. ## [2.0.0] - 2023-08-01 From 58e4ac5a8dbdf7a85ae6f08cb1babf31c5166adc Mon Sep 17 00:00:00 2001 From: steven2308 Date: Thu, 21 Sep 2023 14:27:53 -0500 Subject: [PATCH 19/19] Makes asset and equipping related variables internal instead of public. Bumps version to 2.1.1. --- CHANGELOG.md | 10 +++++++++- contracts/RMRK/core/RMRKCore.sol | 2 +- contracts/RMRK/equippable/RMRKEquippable.sol | 12 ++++++------ .../RMRK/equippable/RMRKMinifiedEquippable.sol | 18 +++++++++--------- .../RMRK/multiasset/AbstractMultiAsset.sol | 6 +++--- package.json | 2 +- 6 files changed, 29 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7685436a..4a7152f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,9 +5,15 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [2.1.1] - 2023-09-21 + +### Changed + +- Most asset and equipping related variables are changed from `private` to `internal` visibility, to allow for more flexibility on implementations. + ## [2.1.0] - 2023-09-19 -This release covers minor improvements and updates the numbers for Nestable and Emotable ERCs. +This release covers minor improvements and updates the numbers for Nestable and Emotable ERCs. The original Nestable standard (ERC-6059) was missing parameter in the specification due to a method modified during the EIP process. The `interfaceId` of the specified interface was correct, so all the collections deployed using this package in the past were using the newly finalized ERC-7401 instead of ERC-6059. @@ -16,6 +22,7 @@ The need to update the Emotes standard (ERC-6381) was noticed before it was rele To reiterate: you do not need to worry about upgrading or fixing previously deployed collections using these ERCs, since they are already built based on the latest specification ever since they have been released into the public domain. ### Changed + - `equip` and `unequip` methods are now gated to the owner or approved for assets, transfer permission no longer needs to be granted alongside equip/unequip permission. - Renames ERC-6059 to ERC-7401. - Renames emotes repository to ERC-7409. @@ -23,6 +30,7 @@ To reiterate: you do not need to worry about upgrading or fixing previously depl - Improves hardhat config and .env.example for network configuration. ### Fixed + - No longer restricts child catalog from being different than parent's catalog to consider the child equippable in RMRKEquipRenderUtils. - Fixes soulbound detection on RenderUtils.getExtendedNFT. diff --git a/contracts/RMRK/core/RMRKCore.sol b/contracts/RMRK/core/RMRKCore.sol index ca305dd5..d6244698 100644 --- a/contracts/RMRK/core/RMRKCore.sol +++ b/contracts/RMRK/core/RMRKCore.sol @@ -13,6 +13,6 @@ contract RMRKCore { * @notice Version of the @rmrk-team/evm-contracts package * @return Version identifier of the smart contract */ - string public constant VERSION = "2.1.0"; + string public constant VERSION = "2.1.1"; bytes4 public constant RMRK_INTERFACE = 0x524D524B; // "RMRK" in ASCII hex } diff --git a/contracts/RMRK/equippable/RMRKEquippable.sol b/contracts/RMRK/equippable/RMRKEquippable.sol index 1a9a30ba..4bf9638e 100644 --- a/contracts/RMRK/equippable/RMRKEquippable.sol +++ b/contracts/RMRK/equippable/RMRKEquippable.sol @@ -38,22 +38,22 @@ contract RMRKEquippable is // ------------------- EQUIPPABLE -------------- /// Mapping of uint64 asset ID to corresponding catalog address. - mapping(uint64 => address) private _catalogAddresses; + mapping(uint64 => address) internal _catalogAddresses; /// Mapping of uint64 ID to asset object. - mapping(uint64 => uint64) private _equippableGroupIds; + mapping(uint64 => uint64) internal _equippableGroupIds; /// Mapping of assetId to catalog parts applicable to this asset, both fixed and slot - mapping(uint64 => uint64[]) private _partIds; + mapping(uint64 => uint64[]) internal _partIds; /// Mapping of token ID to catalog address to slot part ID to equipment information. Used to compose an NFT. mapping(uint256 => mapping(address => mapping(uint64 => Equipment))) - private _equipments; + internal _equipments; /// Mapping of token ID to child (nestable) address to child ID to count of equipped items. Used to check if equipped. mapping(uint256 => mapping(address => mapping(uint256 => uint256))) - private _equipCountPerChild; + internal _equipCountPerChild; /// Mapping of `equippableGroupId` to parent contract address and valid `slotId`. - mapping(uint64 => mapping(address => uint64)) private _validParentSlots; + mapping(uint64 => mapping(address => uint64)) internal _validParentSlots; /** * @notice Used to verify that the caller is either the owner of the given token or approved to manage the token's assets diff --git a/contracts/RMRK/equippable/RMRKMinifiedEquippable.sol b/contracts/RMRK/equippable/RMRKMinifiedEquippable.sol index 02e01cb1..ac23d6ed 100644 --- a/contracts/RMRK/equippable/RMRKMinifiedEquippable.sol +++ b/contracts/RMRK/equippable/RMRKMinifiedEquippable.sol @@ -1251,10 +1251,10 @@ contract RMRKMinifiedEquippable is } /// Mapping of uint64 Ids to asset metadata - mapping(uint64 => string) private _assets; + mapping(uint64 => string) internal _assets; /// Mapping of tokenId to new asset, to asset to be replaced - mapping(uint256 => mapping(uint64 => uint64)) private _assetReplacements; + mapping(uint256 => mapping(uint64 => uint64)) internal _assetReplacements; /// Mapping of tokenId to an array of active assets /// @dev Active recurses is unbounded, getting all would reach gas limit at around 30k items @@ -1268,7 +1268,7 @@ contract RMRKMinifiedEquippable is mapping(uint256 => uint64[]) internal _activeAssetPriorities; /// Mapping of tokenId to assetId to whether the token has this asset assigned - mapping(uint256 => mapping(uint64 => bool)) private _tokenAssets; + mapping(uint256 => mapping(uint64 => bool)) internal _tokenAssets; /// Mapping from owner to operator approvals for assets mapping(address => mapping(address => bool)) @@ -1579,22 +1579,22 @@ contract RMRKMinifiedEquippable is // ------------------- EQUIPPABLE -------------- /// Mapping of uint64 asset ID to corresponding catalog address. - mapping(uint64 => address) private _catalogAddresses; + mapping(uint64 => address) internal _catalogAddresses; /// Mapping of uint64 ID to asset object. - mapping(uint64 => uint64) private _equippableGroupIds; + mapping(uint64 => uint64) internal _equippableGroupIds; /// Mapping of assetId to catalog parts applicable to this asset, both fixed and slot - mapping(uint64 => uint64[]) private _partIds; + mapping(uint64 => uint64[]) internal _partIds; /// Mapping of token ID to catalog address to slot part ID to equipment information. Used to compose an NFT. mapping(uint256 => mapping(address => mapping(uint64 => Equipment))) - private _equipments; + internal _equipments; /// Mapping of token ID to child (nestable) address to child ID to count of equipped items. Used to check if equipped. mapping(uint256 => mapping(address => mapping(uint256 => uint256))) - private _equipCountPerChild; + internal _equipCountPerChild; /// Mapping of `equippableGroupId` to parent contract address and valid `slotId`. - mapping(uint64 => mapping(address => uint64)) private _validParentSlots; + mapping(uint64 => mapping(address => uint64)) internal _validParentSlots; /** * @notice Used to verify that the caller is either the owner of the given token or approved to manage the token's assets diff --git a/contracts/RMRK/multiasset/AbstractMultiAsset.sol b/contracts/RMRK/multiasset/AbstractMultiAsset.sol index 30ed5cdf..4317d81e 100644 --- a/contracts/RMRK/multiasset/AbstractMultiAsset.sol +++ b/contracts/RMRK/multiasset/AbstractMultiAsset.sol @@ -16,10 +16,10 @@ abstract contract AbstractMultiAsset is Context, IERC5773 { using RMRKLib for uint64[]; /// Mapping of uint64 Ids to asset metadata - mapping(uint64 => string) private _assets; + mapping(uint64 => string) internal _assets; /// Mapping of tokenId to new asset, to asset to be replaced - mapping(uint256 => mapping(uint64 => uint64)) private _assetReplacements; + mapping(uint256 => mapping(uint64 => uint64)) internal _assetReplacements; /// Mapping of tokenId to an array of active assets /// @dev Active recurses is unbounded, getting all would reach gas limit at around 30k items @@ -33,7 +33,7 @@ abstract contract AbstractMultiAsset is Context, IERC5773 { mapping(uint256 => uint64[]) internal _activeAssetPriorities; /// Mapping of tokenId to assetId to whether the token has this asset assigned - mapping(uint256 => mapping(uint64 => bool)) private _tokenAssets; + mapping(uint256 => mapping(uint64 => bool)) internal _tokenAssets; /// Mapping from owner to operator approvals for assets mapping(address => mapping(address => bool)) diff --git a/package.json b/package.json index be82d149..537d2710 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@rmrk-team/evm-contracts", - "version": "2.1.0", + "version": "2.1.1", "license": "Apache-2.0", "files": [ "contracts/RMRK/*",