From acaa377db21a53e9f1803ae121b57da68ad49ee2 Mon Sep 17 00:00:00 2001 From: CallumGrindle Date: Tue, 31 Oct 2023 15:23:02 +0100 Subject: [PATCH 01/17] refactor!: update LSP3 and LSP4 to new verification schema --- README.md | 8 +- docs/classes/lsp4-digital-asset-metadata.md | 128 +++++++++--------- docs/classes/universal-profile.md | 44 +++--- docs/deployment/digital-asset.md | 22 +-- docs/deployment/universal-profile.md | 20 +-- docs/getting-started.md | 8 +- package-lock.json | 14 +- package.json | 2 +- src/lib/classes/lsp7-digtal-asset.spec.ts | 4 +- .../lsp8-identifiable-digital-asset.spec.ts | 6 +- src/lib/classes/universal-profile.spec.ts | 4 +- src/lib/helpers/uploader.helper.spec.ts | 12 +- src/lib/helpers/uploader.helper.ts | 10 +- src/lib/interfaces/lsp3-profile.ts | 4 +- src/lib/interfaces/lsp4-digital-asset.ts | 4 +- src/lib/interfaces/metadata.ts | 8 +- test/lsp3-profile.mock.ts | 40 +++--- test/lsp4-digital-asset.mock.ts | 20 +-- 18 files changed, 179 insertions(+), 179 deletions(-) diff --git a/README.md b/README.md index 99eb8b5d..573ebc99 100644 --- a/README.md +++ b/README.md @@ -41,8 +41,8 @@ const myContracts = await lspFactory.UniversalProfile.deploy({ { width: 500, height: 500, - hashFunction: 'keccak256(bytes)', - hash: '0xfdafad027ecfe57eb4ad047b938805d1dec209d6e9f960fc320d7b9b11cbed14', + verificationFunction: 'keccak256(bytes)', + verificationData: '0xfdafad027ecfe57eb4ad047b938805d1dec209d6e9f960fc320d7b9b11cbed14', url: 'ipfs://QmPLqMFHxiUgYAom3Zg4SiwoxDaFcZpHXpCmiDzxrtjSGp', }, ], @@ -50,8 +50,8 @@ const myContracts = await lspFactory.UniversalProfile.deploy({ { width: 500, height: 500, - hashFunction: 'keccak256(bytes)', - hash: '0xfdafad027ecfe57eb4ad047b938805d1dec209d6e9f960fc320d7b9b11cbed14', + verificationFunction: 'keccak256(bytes)', + verificationData: '0xfdafad027ecfe57eb4ad047b938805d1dec209d6e9f960fc320d7b9b11cbed14', url: 'ipfs://QmPLqMFHxiUgYAom3Zg4SiwoxDaFcZpHXpCmiDzxrtjSGp', }, ], diff --git a/docs/classes/lsp4-digital-asset-metadata.md b/docs/classes/lsp4-digital-asset-metadata.md index 1062a413..f49c715d 100644 --- a/docs/classes/lsp4-digital-asset-metadata.md +++ b/docs/classes/lsp4-digital-asset-metadata.md @@ -69,8 +69,8 @@ await LSP4DigitalAssetMetadata.uploadMetadata( description: 'Digital Asset', assets: [ { - "hashFunction": "keccak256(bytes)", - "hash": "0x5f3dbd89cde4dde36241c501203b67a93b89908063f5516535136bc25f712e11", + "verificationFunction": "keccak256(bytes)", + "verificationData": "0x5f3dbd89cde4dde36241c501203b67a93b89908063f5516535136bc25f712e11", "url": "ipfs://QmWkAki4mLq2cshpbKs4HFCaZdpUX1jLKKfb5y8YMATkwk", "fileType": "image/jpeg" } @@ -80,36 +80,36 @@ await LSP4DigitalAssetMetadata.uploadMetadata( { "width": 1800, "height": 1800, - "hashFunction": "keccak256(bytes)", - "hash": "0x5c6125b5a553337b5ad55610c47114bf58d33c7a21aef14b0ed4c214203c9ca7", + "verificationFunction": "keccak256(bytes)", + "verificationData": "0x5c6125b5a553337b5ad55610c47114bf58d33c7a21aef14b0ed4c214203c9ca7", "url": "ipfs://QmPCQwamReJshNiqSSzf4zMVffNiDx44ykTf1zY95vG6rv" }, { "width": 1024, "height": 1024, - "hashFunction": "keccak256(bytes)", - "hash": "0xc4d1d37a8545012be38a8f33f9a53daceab955a17310bcfffe00f34811506938", + "verificationFunction": "keccak256(bytes)", + "verificationData": "0xc4d1d37a8545012be38a8f33f9a53daceab955a17310bcfffe00f34811506938", "url": "ipfs://Qme8tedX78TaxVwtvacJyS7bcSwe69F4aNnknUzL3gYdFY" }, { "width": 640, "height": 640, - "hashFunction": "keccak256(bytes)", - "hash": "0xa63ebb82e8c428c9a02f1c0a040199748844dccf62e75fcd85454bce4acd4afd", + "verificationFunction": "keccak256(bytes)", + "verificationData": "0xa63ebb82e8c428c9a02f1c0a040199748844dccf62e75fcd85454bce4acd4afd", "url": "ipfs://QmdQRdeeGGmWCPs1iCtxiNzHMZemFpvcsdvweCdnufHdqr" }, { "width": 320, "height": 320, - "hashFunction": "keccak256(bytes)", - "hash": "0x2ab638bb61f4cb686c3ca5ca09285e4507ad2328c0b5f6e10378425ed7c75cd9", + "verificationFunction": "keccak256(bytes)", + "verificationData": "0x2ab638bb61f4cb686c3ca5ca09285e4507ad2328c0b5f6e10378425ed7c75cd9", "url": "ipfs://QmfYYafv6ucuKSm3EbcJxho9Cr2g5Pa3yhv7TaANbP8jbg" }, { "width": 180, "height": 180, - "hashFunction": "keccak256(bytes)", - "hash": "0xefb0b36b3bba2338c18b2b55a0cbc52f04eda03e9b58ca8d04a92fc9b1387853", + "verificationFunction": "keccak256(bytes)", + "verificationData": "0xefb0b36b3bba2338c18b2b55a0cbc52f04eda03e9b58ca8d04a92fc9b1387853", "url": "ipfs://QmU5XJfL1V5tBLfm7xYMGYEi7VLiwDCfsCc8KswRgXNQSr" } ] @@ -118,15 +118,15 @@ await LSP4DigitalAssetMetadata.uploadMetadata( { "width": 256, "height": 256, - "hashFunction": "keccak256(bytes)", - "hash": "0x0b3eb5393a45081071ed39c167d65faef9fd7a4dfada9e513770537f5cf1707b", + "verificationFunction": "keccak256(bytes)", + "verificationData": "0x0b3eb5393a45081071ed39c167d65faef9fd7a4dfada9e513770537f5cf1707b", "url": "ipfs://QmNuLsjDJNKR9xSKXZUB6wJBwChcXLfDnCVEY8XvS3Pxvw" }, { "width": 32, "height": 32, - "hashFunction": "keccak256(bytes)", - "hash": "0x8038199254ab33c9248e09301f01fafb9ca704fce33b484e60153ba6b0e9ce41", + "verificationFunction": "keccak256(bytes)", + "verificationData": "0x8038199254ab33c9248e09301f01fafb9ca704fce33b484e60153ba6b0e9ce41", "url": "ipfs://QmbaNRFxwiCNoKCNyBTPSThwBE6uqA1voD2i2vEGcHKUwy" } ], @@ -166,8 +166,8 @@ await LSP4DigitalAssetMetadata.uploadMetadata( description: 'Digital Asset', assets: [ { - "hashFunction": "keccak256(bytes)", - "hash": "0x5f3dbd89cde4dde36241c501203b67a93b89908063f5516535136bc25f712e11", + "verificationFunction": "keccak256(bytes)", + "verificationData": "0x5f3dbd89cde4dde36241c501203b67a93b89908063f5516535136bc25f712e11", "url": "ipfs://QmWkAki4mLq2cshpbKs4HFCaZdpUX1jLKKfb5y8YMATkwk", "fileType": "image/jpeg" } @@ -177,36 +177,36 @@ await LSP4DigitalAssetMetadata.uploadMetadata( { "width": 1800, "height": 1800, - "hashFunction": "keccak256(bytes)", - "hash": "0x5c6125b5a553337b5ad55610c47114bf58d33c7a21aef14b0ed4c214203c9ca7", + "verificationFunction": "keccak256(bytes)", + "verificationData": "0x5c6125b5a553337b5ad55610c47114bf58d33c7a21aef14b0ed4c214203c9ca7", "url": "ipfs://QmPCQwamReJshNiqSSzf4zMVffNiDx44ykTf1zY95vG6rv" }, { "width": 1024, "height": 1024, - "hashFunction": "keccak256(bytes)", - "hash": "0xc4d1d37a8545012be38a8f33f9a53daceab955a17310bcfffe00f34811506938", + "verificationFunction": "keccak256(bytes)", + "verificationData": "0xc4d1d37a8545012be38a8f33f9a53daceab955a17310bcfffe00f34811506938", "url": "ipfs://Qme8tedX78TaxVwtvacJyS7bcSwe69F4aNnknUzL3gYdFY" }, { "width": 640, "height": 640, - "hashFunction": "keccak256(bytes)", - "hash": "0xa63ebb82e8c428c9a02f1c0a040199748844dccf62e75fcd85454bce4acd4afd", + "verificationFunction": "keccak256(bytes)", + "verificationData": "0xa63ebb82e8c428c9a02f1c0a040199748844dccf62e75fcd85454bce4acd4afd", "url": "ipfs://QmdQRdeeGGmWCPs1iCtxiNzHMZemFpvcsdvweCdnufHdqr" }, { "width": 320, "height": 320, - "hashFunction": "keccak256(bytes)", - "hash": "0x2ab638bb61f4cb686c3ca5ca09285e4507ad2328c0b5f6e10378425ed7c75cd9", + "verificationFunction": "keccak256(bytes)", + "verificationData": "0x2ab638bb61f4cb686c3ca5ca09285e4507ad2328c0b5f6e10378425ed7c75cd9", "url": "ipfs://QmfYYafv6ucuKSm3EbcJxho9Cr2g5Pa3yhv7TaANbP8jbg" }, { "width": 180, "height": 180, - "hashFunction": "keccak256(bytes)", - "hash": "0xefb0b36b3bba2338c18b2b55a0cbc52f04eda03e9b58ca8d04a92fc9b1387853", + "verificationFunction": "keccak256(bytes)", + "verificationData": "0xefb0b36b3bba2338c18b2b55a0cbc52f04eda03e9b58ca8d04a92fc9b1387853", "url": "ipfs://QmU5XJfL1V5tBLfm7xYMGYEi7VLiwDCfsCc8KswRgXNQSr" } ] @@ -215,15 +215,15 @@ await LSP4DigitalAssetMetadata.uploadMetadata( { "width": 256, "height": 256, - "hashFunction": "keccak256(bytes)", - "hash": "0x0b3eb5393a45081071ed39c167d65faef9fd7a4dfada9e513770537f5cf1707b", + "verificationFunction": "keccak256(bytes)", + "verificationData": "0x0b3eb5393a45081071ed39c167d65faef9fd7a4dfada9e513770537f5cf1707b", "url": "ipfs://QmNuLsjDJNKR9xSKXZUB6wJBwChcXLfDnCVEY8XvS3Pxvw" }, { "width": 32, "height": 32, - "hashFunction": "keccak256(bytes)", - "hash": "0x8038199254ab33c9248e09301f01fafb9ca704fce33b484e60153ba6b0e9ce41", + "verificationFunction": "keccak256(bytes)", + "verificationData": "0x8038199254ab33c9248e09301f01fafb9ca704fce33b484e60153ba6b0e9ce41", "url": "ipfs://QmbaNRFxwiCNoKCNyBTPSThwBE6uqA1voD2i2vEGcHKUwy" } ], @@ -266,8 +266,8 @@ await LSP4DigitalAssetMetadata.uploadMetadata( description: 'Digital Asset', assets: [ { - "hashFunction": "keccak256(bytes)", - "hash": "0x5f3dbd89cde4dde36241c501203b67a93b89908063f5516535136bc25f712e11", + "verificationFunction": "keccak256(bytes)", + "verificationData": "0x5f3dbd89cde4dde36241c501203b67a93b89908063f5516535136bc25f712e11", "url": "ipfs://QmWkAki4mLq2cshpbKs4HFCaZdpUX1jLKKfb5y8YMATkwk", "fileType": "image/jpeg" } @@ -277,36 +277,36 @@ await LSP4DigitalAssetMetadata.uploadMetadata( { "width": 1800, "height": 1800, - "hashFunction": "keccak256(bytes)", - "hash": "0x5c6125b5a553337b5ad55610c47114bf58d33c7a21aef14b0ed4c214203c9ca7", + "verificationFunction": "keccak256(bytes)", + "verificationData": "0x5c6125b5a553337b5ad55610c47114bf58d33c7a21aef14b0ed4c214203c9ca7", "url": "ipfs://QmPCQwamReJshNiqSSzf4zMVffNiDx44ykTf1zY95vG6rv" }, { "width": 1024, "height": 1024, - "hashFunction": "keccak256(bytes)", - "hash": "0xc4d1d37a8545012be38a8f33f9a53daceab955a17310bcfffe00f34811506938", + "verificationFunction": "keccak256(bytes)", + "verificationData": "0xc4d1d37a8545012be38a8f33f9a53daceab955a17310bcfffe00f34811506938", "url": "ipfs://Qme8tedX78TaxVwtvacJyS7bcSwe69F4aNnknUzL3gYdFY" }, { "width": 640, "height": 640, - "hashFunction": "keccak256(bytes)", - "hash": "0xa63ebb82e8c428c9a02f1c0a040199748844dccf62e75fcd85454bce4acd4afd", + "verificationFunction": "keccak256(bytes)", + "verificationData": "0xa63ebb82e8c428c9a02f1c0a040199748844dccf62e75fcd85454bce4acd4afd", "url": "ipfs://QmdQRdeeGGmWCPs1iCtxiNzHMZemFpvcsdvweCdnufHdqr" }, { "width": 320, "height": 320, - "hashFunction": "keccak256(bytes)", - "hash": "0x2ab638bb61f4cb686c3ca5ca09285e4507ad2328c0b5f6e10378425ed7c75cd9", + "verificationFunction": "keccak256(bytes)", + "verificationData": "0x2ab638bb61f4cb686c3ca5ca09285e4507ad2328c0b5f6e10378425ed7c75cd9", "url": "ipfs://QmfYYafv6ucuKSm3EbcJxho9Cr2g5Pa3yhv7TaANbP8jbg" }, { "width": 180, "height": 180, - "hashFunction": "keccak256(bytes)", - "hash": "0xefb0b36b3bba2338c18b2b55a0cbc52f04eda03e9b58ca8d04a92fc9b1387853", + "verificationFunction": "keccak256(bytes)", + "verificationData": "0xefb0b36b3bba2338c18b2b55a0cbc52f04eda03e9b58ca8d04a92fc9b1387853", "url": "ipfs://QmU5XJfL1V5tBLfm7xYMGYEi7VLiwDCfsCc8KswRgXNQSr" } ] @@ -315,15 +315,15 @@ await LSP4DigitalAssetMetadata.uploadMetadata( { "width": 256, "height": 256, - "hashFunction": "keccak256(bytes)", - "hash": "0x0b3eb5393a45081071ed39c167d65faef9fd7a4dfada9e513770537f5cf1707b", + "verificationFunction": "keccak256(bytes)", + "verificationData": "0x0b3eb5393a45081071ed39c167d65faef9fd7a4dfada9e513770537f5cf1707b", "url": "ipfs://QmNuLsjDJNKR9xSKXZUB6wJBwChcXLfDnCVEY8XvS3Pxvw" }, { "width": 32, "height": 32, - "hashFunction": "keccak256(bytes)", - "hash": "0x8038199254ab33c9248e09301f01fafb9ca704fce33b484e60153ba6b0e9ce41", + "verificationFunction": "keccak256(bytes)", + "verificationData": "0x8038199254ab33c9248e09301f01fafb9ca704fce33b484e60153ba6b0e9ce41", "url": "ipfs://QmbaNRFxwiCNoKCNyBTPSThwBE6uqA1voD2i2vEGcHKUwy" } ], @@ -365,8 +365,8 @@ await lspFactory.LSP4DigitalAssetMetadata.uploadMetadata({ description: 'Digital Asset', assets: [ { - "hashFunction": "keccak256(bytes)", - "hash": "0x5f3dbd89cde4dde36241c501203b67a93b89908063f5516535136bc25f712e11", + "verificationFunction": "keccak256(bytes)", + "verificationData": "0x5f3dbd89cde4dde36241c501203b67a93b89908063f5516535136bc25f712e11", "url": "ipfs://QmWkAki4mLq2cshpbKs4HFCaZdpUX1jLKKfb5y8YMATkwk", "fileType": "image/jpeg" } @@ -376,36 +376,36 @@ await lspFactory.LSP4DigitalAssetMetadata.uploadMetadata({ { "width": 1800, "height": 1800, - "hashFunction": "keccak256(bytes)", - "hash": "0x5c6125b5a553337b5ad55610c47114bf58d33c7a21aef14b0ed4c214203c9ca7", + "verificationFunction": "keccak256(bytes)", + "verificationData": "0x5c6125b5a553337b5ad55610c47114bf58d33c7a21aef14b0ed4c214203c9ca7", "url": "ipfs://QmPCQwamReJshNiqSSzf4zMVffNiDx44ykTf1zY95vG6rv" }, { "width": 1024, "height": 1024, - "hashFunction": "keccak256(bytes)", - "hash": "0xc4d1d37a8545012be38a8f33f9a53daceab955a17310bcfffe00f34811506938", + "verificationFunction": "keccak256(bytes)", + "verificationData": "0xc4d1d37a8545012be38a8f33f9a53daceab955a17310bcfffe00f34811506938", "url": "ipfs://Qme8tedX78TaxVwtvacJyS7bcSwe69F4aNnknUzL3gYdFY" }, { "width": 640, "height": 640, - "hashFunction": "keccak256(bytes)", - "hash": "0xa63ebb82e8c428c9a02f1c0a040199748844dccf62e75fcd85454bce4acd4afd", + "verificationFunction": "keccak256(bytes)", + "verificationData": "0xa63ebb82e8c428c9a02f1c0a040199748844dccf62e75fcd85454bce4acd4afd", "url": "ipfs://QmdQRdeeGGmWCPs1iCtxiNzHMZemFpvcsdvweCdnufHdqr" }, { "width": 320, "height": 320, - "hashFunction": "keccak256(bytes)", - "hash": "0x2ab638bb61f4cb686c3ca5ca09285e4507ad2328c0b5f6e10378425ed7c75cd9", + "verificationFunction": "keccak256(bytes)", + "verificationData": "0x2ab638bb61f4cb686c3ca5ca09285e4507ad2328c0b5f6e10378425ed7c75cd9", "url": "ipfs://QmfYYafv6ucuKSm3EbcJxho9Cr2g5Pa3yhv7TaANbP8jbg" }, { "width": 180, "height": 180, - "hashFunction": "keccak256(bytes)", - "hash": "0xefb0b36b3bba2338c18b2b55a0cbc52f04eda03e9b58ca8d04a92fc9b1387853", + "verificationFunction": "keccak256(bytes)", + "verificationData": "0xefb0b36b3bba2338c18b2b55a0cbc52f04eda03e9b58ca8d04a92fc9b1387853", "url": "ipfs://QmU5XJfL1V5tBLfm7xYMGYEi7VLiwDCfsCc8KswRgXNQSr" } ] @@ -414,15 +414,15 @@ await lspFactory.LSP4DigitalAssetMetadata.uploadMetadata({ { "width": 256, "height": 256, - "hashFunction": "keccak256(bytes)", - "hash": "0x0b3eb5393a45081071ed39c167d65faef9fd7a4dfada9e513770537f5cf1707b", + "verificationFunction": "keccak256(bytes)", + "verificationData": "0x0b3eb5393a45081071ed39c167d65faef9fd7a4dfada9e513770537f5cf1707b", "url": "ipfs://QmNuLsjDJNKR9xSKXZUB6wJBwChcXLfDnCVEY8XvS3Pxvw" }, { "width": 32, "height": 32, - "hashFunction": "keccak256(bytes)", - "hash": "0x8038199254ab33c9248e09301f01fafb9ca704fce33b484e60153ba6b0e9ce41", + "verificationFunction": "keccak256(bytes)", + "verificationData": "0x8038199254ab33c9248e09301f01fafb9ca704fce33b484e60153ba6b0e9ce41", "url": "ipfs://QmbaNRFxwiCNoKCNyBTPSThwBE6uqA1voD2i2vEGcHKUwy" } ], diff --git a/docs/classes/universal-profile.md b/docs/classes/universal-profile.md index 8fce8a74..c8a762b7 100644 --- a/docs/classes/universal-profile.md +++ b/docs/classes/universal-profile.md @@ -391,36 +391,36 @@ const myLocalAvatar = new File(); { "width": 1800, "height": 1800, - "hashFunction": "keccak256(bytes)", - "hash": "0x5c6125b5a553337b5ad55610c47114bf58d33c7a21aef14b0ed4c214203c9ca7", + "verificationFunction": "keccak256(bytes)", + "verificationData": "0x5c6125b5a553337b5ad55610c47114bf58d33c7a21aef14b0ed4c214203c9ca7", "url": "ipfs://QmPCQwamReJshNiqSSzf4zMVffNiDx44ykTf1zY95vG6rv" }, { "width": 1024, "height": 1024, - "hashFunction": "keccak256(bytes)", - "hash": "0xc4d1d37a8545012be38a8f33f9a53daceab955a17310bcfffe00f34811506938", + "verificationFunction": "keccak256(bytes)", + "verificationData": "0xc4d1d37a8545012be38a8f33f9a53daceab955a17310bcfffe00f34811506938", "url": "ipfs://Qme8tedX78TaxVwtvacJyS7bcSwe69F4aNnknUzL3gYdFY" }, { "width": 640, "height": 640, - "hashFunction": "keccak256(bytes)", - "hash": "0xa63ebb82e8c428c9a02f1c0a040199748844dccf62e75fcd85454bce4acd4afd", + "verificationFunction": "keccak256(bytes)", + "verificationData": "0xa63ebb82e8c428c9a02f1c0a040199748844dccf62e75fcd85454bce4acd4afd", "url": "ipfs://QmdQRdeeGGmWCPs1iCtxiNzHMZemFpvcsdvweCdnufHdqr" }, { "width": 320, "height": 320, - "hashFunction": "keccak256(bytes)", - "hash": "0x2ab638bb61f4cb686c3ca5ca09285e4507ad2328c0b5f6e10378425ed7c75cd9", + "verificationFunction": "keccak256(bytes)", + "verificationData": "0x2ab638bb61f4cb686c3ca5ca09285e4507ad2328c0b5f6e10378425ed7c75cd9", "url": "ipfs://QmfYYafv6ucuKSm3EbcJxho9Cr2g5Pa3yhv7TaANbP8jbg" }, { "width": 180, "height": 180, - "hashFunction": "keccak256(bytes)", - "hash": "0xefb0b36b3bba2338c18b2b55a0cbc52f04eda03e9b58ca8d04a92fc9b1387853", + "verificationFunction": "keccak256(bytes)", + "verificationData": "0xefb0b36b3bba2338c18b2b55a0cbc52f04eda03e9b58ca8d04a92fc9b1387853", "url": "ipfs://QmU5XJfL1V5tBLfm7xYMGYEi7VLiwDCfsCc8KswRgXNQSr" } ], @@ -428,43 +428,43 @@ const myLocalAvatar = new File(); { "width": 1800, "height": 1800, - "hashFunction": "keccak256(bytes)", - "hash": "0x5c6125b5a553337b5ad55610c47114bf58d33c7a21aef14b0ed4c214203c9ca7", + "verificationFunction": "keccak256(bytes)", + "verificationData": "0x5c6125b5a553337b5ad55610c47114bf58d33c7a21aef14b0ed4c214203c9ca7", "url": "ipfs://QmPCQwamReJshNiqSSzf4zMVffNiDx44ykTf1zY95vG6rv" }, { "width": 1024, "height": 1024, - "hashFunction": "keccak256(bytes)", - "hash": "0xc4d1d37a8545012be38a8f33f9a53daceab955a17310bcfffe00f34811506938", + "verificationFunction": "keccak256(bytes)", + "verificationData": "0xc4d1d37a8545012be38a8f33f9a53daceab955a17310bcfffe00f34811506938", "url": "ipfs://Qme8tedX78TaxVwtvacJyS7bcSwe69F4aNnknUzL3gYdFY" }, { "width": 640, "height": 640, - "hashFunction": "keccak256(bytes)", - "hash": "0xa63ebb82e8c428c9a02f1c0a040199748844dccf62e75fcd85454bce4acd4afd", + "verificationFunction": "keccak256(bytes)", + "verificationData": "0xa63ebb82e8c428c9a02f1c0a040199748844dccf62e75fcd85454bce4acd4afd", "url": "ipfs://QmdQRdeeGGmWCPs1iCtxiNzHMZemFpvcsdvweCdnufHdqr" }, { "width": 320, "height": 320, - "hashFunction": "keccak256(bytes)", - "hash": "0x2ab638bb61f4cb686c3ca5ca09285e4507ad2328c0b5f6e10378425ed7c75cd9", + "verificationFunction": "keccak256(bytes)", + "verificationData": "0x2ab638bb61f4cb686c3ca5ca09285e4507ad2328c0b5f6e10378425ed7c75cd9", "url": "ipfs://QmfYYafv6ucuKSm3EbcJxho9Cr2g5Pa3yhv7TaANbP8jbg" }, { "width": 180, "height": 180, - "hashFunction": "keccak256(bytes)", - "hash": "0xefb0b36b3bba2338c18b2b55a0cbc52f04eda03e9b58ca8d04a92fc9b1387853", + "verificationFunction": "keccak256(bytes)", + "verificationData": "0xefb0b36b3bba2338c18b2b55a0cbc52f04eda03e9b58ca8d04a92fc9b1387853", "url": "ipfs://QmU5XJfL1V5tBLfm7xYMGYEi7VLiwDCfsCc8KswRgXNQSr" } ], avatar: [ { - "hashFunction": "keccak256(bytes)", - "hash": "0x5f3dbd89cde4dde36241c501203b67a93b89908063f5516535136bc25f712e11", + "verificationFunction": "keccak256(bytes)", + "verificationData": "0x5f3dbd89cde4dde36241c501203b67a93b89908063f5516535136bc25f712e11", "url": "ipfs://QmWkAki4mLq2cshpbKs4HFCaZdpUX1jLKKfb5y8YMATkwk", "fileType": "image/jpeg" } diff --git a/docs/deployment/digital-asset.md b/docs/deployment/digital-asset.md index 86fb6f5b..8f87527a 100644 --- a/docs/deployment/digital-asset.md +++ b/docs/deployment/digital-asset.md @@ -197,7 +197,7 @@ await lspFactory.LSP8IdentifiableDigitalAsset.deploy({ }); ``` -You can also provide the JSON file yourself to generate the hash value: +You can also provide the JSON file yourself to generate the verificationData value: ```javascript title='Providing a previously uploaded LSP4 metadata URL and JSON file itself' await lspFactory.LSP8IdentifiableDigitalAsset.deploy({ @@ -209,13 +209,13 @@ await lspFactory.LSP8IdentifiableDigitalAsset.deploy({ }); ``` -Or you can provide the hash value and then uploaded file URL: +Or you can provide the verificationData value and then uploaded file URL: -```javascript title='Providing a previously uploaded LSP4 metadata URL and hash values' +```javascript title='Providing a previously uploaded LSP4 metadata URL and verificationData values' await lspFactory.LSP8IdentifiableDigitalAsset.deploy({ digitalAssetMetadata: { - hash: '0xfdafad027ecfe57eb4ad047b938805d1dec209d6e9f960fc320d7b9b11cbed14', - hashFunction: 'keccak256(utf8)', + verificationData: '0xfdafad027ecfe57eb4ad047b938805d1dec209d6e9f960fc320d7b9b11cbed14', + verificationFunction: 'keccak256(utf8)', url: 'https://mycoolserver.com/file.json' }, ... @@ -244,8 +244,8 @@ await lspFactory.LSP8IdentifiableDigitalAsset.deploy({ { width: 500, height: 500, - hashFunction: 'keccak256(bytes)', - hash: '0xfdafad027ecfe57eb4ad044b938805d1dec209d6e9f960fc320d7b9b11cced14', + verificationFunction: 'keccak256(bytes)', + verificationData: '0xfdafad027ecfe57eb4ad044b938805d1dec209d6e9f960fc320d7b9b11cced14', url: 'ipfs://QmPLqMFDxiUgYAom3Zg4SiwoxDaFcZpHXpCmiDzxrajSGp', } ... // Multiple sizes of the image should be included @@ -266,8 +266,8 @@ await lspFactory.LSP8IdentifiableDigitalAsset.deploy({ { width: 256, height: 256, - hashFunction: 'keccak256(bytes)', - hash: '0xfdafad027ecfe57eb4ad044b938805d1dec209d6e9f960fc320d7b9b11cced14', + verificationFunction: 'keccak256(bytes)', + verificationData: '0xfdafad027ecfe57eb4ad044b938805d1dec209d6e9f960fc320d7b9b11cced14', url: 'ipfs://QmPLqMFDxiUgYAom3Zg4SiwoxDaFcZpHXpCmiDzxrajSGp', } ... // Multiple sizes of the icon image should be included @@ -286,8 +286,8 @@ await lspFactory.LSP8IdentifiableDigitalAsset.deploy({ digitalAssetMetadata: { assets: [ { - hashFunction: 'keccak256(bytes)', - hash: '0xfdafad027ecfe57eb4ad044b938805d1dec209d6e9f960fc320d7b9b11cced14', + verificationFunction: 'keccak256(bytes)', + verificationData: '0xfdafad027ecfe57eb4ad044b938805d1dec209d6e9f960fc320d7b9b11cced14', url: 'ipfs://QmPLqMFDxiUgYAom3Zg4SiwoxDaFcZpHXpCmiDzxrajSGp', fileType: 'fbx' } diff --git a/docs/deployment/universal-profile.md b/docs/deployment/universal-profile.md index aeb8f9f1..bdc51e0a 100644 --- a/docs/deployment/universal-profile.md +++ b/docs/deployment/universal-profile.md @@ -147,8 +147,8 @@ Or you can provide the hash value and then uploaded file URL: await lspFactory.UniversalProfile.deploy({ controllerAddresses: ['0x...'], lsp3Profile: { - hash: '0xfdafad027ecfe57eb4ad047b938805d1dec209d6e9f960fc320d7b9b11cbed14', - hashFunction: 'keccak256(utf8)', + verificationData: '0xfdafad027ecfe57eb4ad047b938805d1dec209d6e9f960fc320d7b9b11cbed14', + verificationFunction: 'keccak256(utf8)', url: 'https://mycoolserver.com/file.json', }, }); @@ -176,8 +176,8 @@ const myUniversalProfileData = { { width: 500, height: 500, - hashFunction: 'keccak256(bytes)', - hash: '0xfdafad027ecfe57eb4ad044b938805d1dec209d6e9f960fc320d7b9b11cced14', // bytes32 hex string of the image hash + verificationFunction: 'keccak256(bytes)', + verificationData: '0xfdafad027ecfe57eb4ad044b938805d1dec209d6e9f960fc320d7b9b11cced14', // bytes32 hex string of the image verificationData url: 'ipfs://QmPLqMFDxiUgYAom3Zg4SiwoxDaFcZpHXpCmiDzxrajSGp', }, ... // Multiple image sizes should be included @@ -186,8 +186,8 @@ const myUniversalProfileData = { { width: 500, height: 500, - hashFunction: 'keccak256(bytes)', - hash: '0xfdafad027ecfe57eb4ad047b938805d1dec209d6e9f960fc320d7b9b11cbed14', // bytes32 hex string of the image hash + verificationFunction: 'keccak256(bytes)', + verificationData: '0xfdafad027ecfe57eb4ad047b938805d1dec209d6e9f960fc320d7b9b11cbed14', // bytes32 hex string of the image hash url: 'ipfs://QmPLqMFHxiUDYAom3Zg4SiwoxDaFcZpHXpAmiDzxrtjSGp', }, ... // Multiple image sizes should be included @@ -223,8 +223,8 @@ Avatar files passed as a metadata objects will be set directly on the [LSP3 Prof asset: [ myLocalAvatar, { - hashFunction: 'keccak256(bytes)', - hash: '0x5f3dbd89cde4dde36241c501203b67a93b89908063f5516535136bc25f712e11', + verificationFunction: 'keccak256(bytes)', + verificationData: '0x5f3dbd89cde4dde36241c501203b67a93b89908063f5516535136bc25f712e11', url: 'ipfs://QmWkAki4mLq2c9hsbKs4HFCaZdpUX1jLKKBb5y8YMATkak', fileType: 'image/obj', }, @@ -327,8 +327,8 @@ await myLSPFactory.UniversalProfile.uploadProfileData(myLSP3MetaData); /** { - hash: '0x1234...', - hashFunction: 'keccak256(utf8)', + verificationData: '0x1234...', + verificationFunction: 'keccak256(utf8)', url: 'https://ipfs.lukso.network/ipfs/QmPzUfdKhY6vfcLNDnitwKanpm5GqjYSmw9todNVmi4bqy', json: { LSP3Profile: { diff --git a/docs/getting-started.md b/docs/getting-started.md index 9b19536f..f6126dda 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -61,9 +61,9 @@ const myLSP3MetaData = { { width: 500, height: 500, - hashFunction: 'keccak256(bytes)', + verificationFunction: 'keccak256(bytes)', // bytes32 hex string of the image hash - hash: '0xfdafad027ecfe57eb4ad047b938805d1dec209d6e9f960fc320d7b9b11cbed14', + verificationData: '0xfdafad027ecfe57eb4ad047b938805d1dec209d6e9f960fc320d7b9b11cbed14', url: 'ipfs://QmPLqMFHxiUgYAom3Zg4SiwoxDaFcZpHXpCmiDzxrtjSGp', }, ], @@ -71,9 +71,9 @@ const myLSP3MetaData = { { width: 500, height: 500, - hashFunction: 'keccak256(bytes)', + verificationFunction: 'keccak256(bytes)', // bytes32 hex string of the image hash - hash: '0xfdafad027ecfe57eb4ad047b938805d1dec209d6e9f960fc320d7b9b11cbed14', + verificationData: '0xfdafad027ecfe57eb4ad047b938805d1dec209d6e9f960fc320d7b9b11cbed14', url: 'ipfs://QmPLqMFHxiUgYAom3Zg4SiwoxDaFcZpHXpCmiDzxrtjSGp', }, ], diff --git a/package-lock.json b/package-lock.json index 2e795d9b..d5b1b7b4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "2.5.1", "license": "MIT", "dependencies": { - "@erc725/erc725.js": "^0.18.0", + "@erc725/erc725.js": "^0.21.0", "@ethersproject/abi": "^5.7.0", "@ethersproject/experimental": "^5.7.0", "@lukso/lsp-smart-contracts": "^0.11.1", @@ -1291,9 +1291,9 @@ "dev": true }, "node_modules/@erc725/erc725.js": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/@erc725/erc725.js/-/erc725.js-0.18.0.tgz", - "integrity": "sha512-2LyssXMkBsWjITDMpY2W8wo6+V1B+jC08cdS1k7OY9o0HdX5SbuDJ4a+27rkDGDD4FPg0elAMDw4nn2X3qcdfQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@erc725/erc725.js/-/erc725.js-0.21.0.tgz", + "integrity": "sha512-T3u1FdKJ4hNVIyOkk5siBVagvXDMrlRDTvuASbrXeGI9y8clTwxTDqkQEP6PddA1cqPGzO5i3l2TRS3tKD4VlQ==", "dependencies": { "ethereumjs-util": "^7.1.5", "web3-eth-abi": "^1.10.0", @@ -31676,9 +31676,9 @@ "dev": true }, "@erc725/erc725.js": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/@erc725/erc725.js/-/erc725.js-0.18.0.tgz", - "integrity": "sha512-2LyssXMkBsWjITDMpY2W8wo6+V1B+jC08cdS1k7OY9o0HdX5SbuDJ4a+27rkDGDD4FPg0elAMDw4nn2X3qcdfQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@erc725/erc725.js/-/erc725.js-0.21.0.tgz", + "integrity": "sha512-T3u1FdKJ4hNVIyOkk5siBVagvXDMrlRDTvuASbrXeGI9y8clTwxTDqkQEP6PddA1cqPGzO5i3l2TRS3tKD4VlQ==", "requires": { "ethereumjs-util": "^7.1.5", "web3-eth-abi": "^1.10.0", diff --git a/package.json b/package.json index 99690de8..ef669e64 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "node": ">=10" }, "dependencies": { - "@erc725/erc725.js": "^0.18.0", + "@erc725/erc725.js": "^0.21.0", "@ethersproject/abi": "^5.7.0", "@ethersproject/experimental": "^5.7.0", "@lukso/lsp-smart-contracts": "^0.11.1", diff --git a/src/lib/classes/lsp7-digtal-asset.spec.ts b/src/lib/classes/lsp7-digtal-asset.spec.ts index 54097724..2ab45014 100644 --- a/src/lib/classes/lsp7-digtal-asset.spec.ts +++ b/src/lib/classes/lsp7-digtal-asset.spec.ts @@ -197,12 +197,12 @@ describe('LSP7DigitalAsset', () => { const name = 'TOKEN'; const symbol = 'TKN'; const expectedLSP4Value = - '0x6f357c6a88c86e704ea6cb386d5952122035901f5ea5bb4a695b17d3fccc845d84032b0d697066733a2f2f516d5272714254514c33683256633950454c33643138566e526b6e7a73744547564378685657366a50615a7a5346'; + '0x6f357c6a4d81f92a409b60c056e13102169c07e03f7de2dbcb79775a8b1f66a55b6278a0697066733a2f2f516d61543479786a45464e6d7163595965547832706e5a46426d71395055737763424c446b394b716f7148504b67'; const allowedLSP4Formats = [ lsp4DigitalAsset.LSP4Metadata, lsp4DigitalAsset, - { json: lsp4DigitalAsset, url: 'ipfs://QmRrqBTQL3h2Vc9PEL3d18VnRknzstEGVCxhVW6jPaZzSF' }, + { json: lsp4DigitalAsset, url: 'ipfs://QmaT4yxjEFNmqcYYeTx2pnZFBmq9PUswcBLDk9KqoqHPKg' }, ]; allowedLSP4Formats.forEach((lsp4Metadata) => { diff --git a/src/lib/classes/lsp8-identifiable-digital-asset.spec.ts b/src/lib/classes/lsp8-identifiable-digital-asset.spec.ts index 15226435..fd1ba793 100644 --- a/src/lib/classes/lsp8-identifiable-digital-asset.spec.ts +++ b/src/lib/classes/lsp8-identifiable-digital-asset.spec.ts @@ -244,18 +244,18 @@ describe('LSP8IdentifiableDigitalAsset', () => { expect(actualMintBalance).toEqual(1); }); - describe('lsp8 with passed lsp4Metadata', () => { + fdescribe('lsp8 with passed lsp4Metadata', () => { let digitalAsset: LSP8Mintable; const controllerAddress = '0xaDa25A4424b08F5337DacD619D4bCb21536a9B95'; const name = 'TOKEN'; const symbol = 'TKN'; const expectedLSP4Value = - '0x6f357c6a88c86e704ea6cb386d5952122035901f5ea5bb4a695b17d3fccc845d84032b0d697066733a2f2f516d5272714254514c33683256633950454c33643138566e526b6e7a73744547564378685657366a50615a7a5346'; + '0x6f357c6a4d81f92a409b60c056e13102169c07e03f7de2dbcb79775a8b1f66a55b6278a0697066733a2f2f516d61543479786a45464e6d7163595965547832706e5a46426d71395055737763424c446b394b716f7148504b67'; const allowedLSP4Formats = [ lsp4DigitalAsset.LSP4Metadata, lsp4DigitalAsset, - { json: lsp4DigitalAsset, url: 'ipfs://QmRrqBTQL3h2Vc9PEL3d18VnRknzstEGVCxhVW6jPaZzSF' }, + { json: lsp4DigitalAsset, url: 'ipfs://QmaT4yxjEFNmqcYYeTx2pnZFBmq9PUswcBLDk9KqoqHPKg' }, ]; allowedLSP4Formats.forEach((lsp4Metadata) => { diff --git a/src/lib/classes/universal-profile.spec.ts b/src/lib/classes/universal-profile.spec.ts index 96579d30..8f1137ba 100644 --- a/src/lib/classes/universal-profile.spec.ts +++ b/src/lib/classes/universal-profile.spec.ts @@ -47,12 +47,12 @@ describe('UniversalProfile', () => { let signer: SignerWithAddress; let universalProfile: UniversalProfile; const expectedLSP3Value = - '0x6f357c6a5af8bb903787236579aff8a6518c022fe655646fded5e1ea23ca7aedddb221a4697066733a2f2f516d624b76435645655069444b78756f7579747939624d73574241785a444772326a68786434704c474c78393544'; + '0x6f357c6a55ef1fb1a95f7a6467071879e47a60ad4792dd1707f79cf7e6333bdb09de57cf697066733a2f2f516d635a6a737a314d61565963313167324743456a5258516a34546934765737625a705031653655464c526b434d'; const allowedLSP3Formats = [ lsp3ProfileJson.LSP3Profile, lsp3ProfileJson, - { json: lsp3ProfileJson, url: 'ipfs://QmbKvCVEePiDKxuouyty9bMsWBAxZDGr2jhxd4pLGLx95D' }, + { json: lsp3ProfileJson, url: 'ipfs://QmcZjsz1MaVYc11g2GCEjRXQj4Ti4vW7bZpP1e6UFLRkCM' }, ]; allowedLSP3Formats.forEach((lsp3ProfileMetadata) => { diff --git a/src/lib/helpers/uploader.helper.spec.ts b/src/lib/helpers/uploader.helper.spec.ts index 56b0ec4e..7edd903c 100644 --- a/src/lib/helpers/uploader.helper.spec.ts +++ b/src/lib/helpers/uploader.helper.spec.ts @@ -80,8 +80,8 @@ describe('uploader.helper.spec.ts', () => { // expect(result.length === 5); // expect(result[0]).toHaveProperty('width'); // expect(result[0]).toHaveProperty('height'); - // expect(result[0]).toHaveProperty('hashFunction'); - // expect(result[0]).toHaveProperty('hash'); + // expect(result[0]).toHaveProperty('verificationFunction'); + // expect(result[0]).toHaveProperty('verificationData'); // expect(result[0]).toHaveProperty('url'); // }); }); @@ -103,8 +103,8 @@ describe('uploader.helper.spec.ts', () => { expect(result.length === 5); expect(result[0]).toHaveProperty('width'); expect(result[0]).toHaveProperty('height'); - expect(result[0]).toHaveProperty('hashFunction'); - expect(result[0]).toHaveProperty('hash'); + expect(result[0]).toHaveProperty('verificationFunction'); + expect(result[0]).toHaveProperty('verificationData'); expect(result[0]).toHaveProperty('url'); }); @@ -125,8 +125,8 @@ describe('uploader.helper.spec.ts', () => { expect(result.length === 5); expect(result[0]).toHaveProperty('width'); expect(result[0]).toHaveProperty('height'); - expect(result[0]).toHaveProperty('hashFunction'); - expect(result[0]).toHaveProperty('hash'); + expect(result[0]).toHaveProperty('verificationFunction'); + expect(result[0]).toHaveProperty('verificationData'); expect(result[0]).toHaveProperty('url'); }); diff --git a/src/lib/helpers/uploader.helper.ts b/src/lib/helpers/uploader.helper.ts index ddaeaeec..c8010ac6 100644 --- a/src/lib/helpers/uploader.helper.ts +++ b/src/lib/helpers/uploader.helper.ts @@ -57,8 +57,8 @@ export async function imageUpload( return { width, height, - hashFunction: 'keccak256(bytes)', - hash: keccak256(imgBuffer), + verificationFunction: 'keccak256(bytes)', + verificationData: keccak256(imgBuffer), url: 'ipfs://' + uploadResponse.cid.toString(), }; }) @@ -88,8 +88,8 @@ export async function assetUpload( } return { - hashFunction: 'keccak256(bytes)', - hash: keccak256(fileBuffer), + verificationFunction: 'keccak256(bytes)', + verificationData: keccak256(fileBuffer), url: 'ipfs://' + ipfsResult.cid.toString(), fileType, }; @@ -146,7 +146,7 @@ export async function prepareMetadataAsset( ): Promise { let assetMetadata: AssetMetadata | null; - if ('hashFunction' in asset) { + if ('verificationFunction' in asset) { assetMetadata = asset ?? null; } else if (asset) { assetMetadata = await assetUpload(asset, uploadOptions); diff --git a/src/lib/interfaces/lsp3-profile.ts b/src/lib/interfaces/lsp3-profile.ts index a92d35fd..c2824f60 100644 --- a/src/lib/interfaces/lsp3-profile.ts +++ b/src/lib/interfaces/lsp3-profile.ts @@ -47,8 +47,8 @@ export interface ProfileDataForEncoding { } export interface HashedProfileDataForEncoding { - hashFunction: string; - hash: string; + verificationFunction: string; + verificationData: string; url: string; } diff --git a/src/lib/interfaces/lsp4-digital-asset.ts b/src/lib/interfaces/lsp4-digital-asset.ts index 80d98208..ecd71f35 100644 --- a/src/lib/interfaces/lsp4-digital-asset.ts +++ b/src/lib/interfaces/lsp4-digital-asset.ts @@ -30,8 +30,8 @@ export interface LSP4MetadataUrlForEncoding { } export interface HashedLSP4MetadataForEncoding { - hashFunction: string; - hash: string; + verificationFunction: string; + verificationData: string; url: string; } diff --git a/src/lib/interfaces/metadata.ts b/src/lib/interfaces/metadata.ts index a3d2bc09..65853034 100644 --- a/src/lib/interfaces/metadata.ts +++ b/src/lib/interfaces/metadata.ts @@ -1,8 +1,8 @@ export interface ImageMetadata { width: number; height: number; - hashFunction: string; - hash: string; + verificationFunction: string; + verificationData: string; url: string; } @@ -12,8 +12,8 @@ export interface LinkMetadata { } export interface AssetMetadata { - hashFunction: string; - hash: string; + verificationFunction: string; + verificationData: string; url: string; fileType: string; } diff --git a/test/lsp3-profile.mock.ts b/test/lsp3-profile.mock.ts index a60fe9a3..1c0a076e 100644 --- a/test/lsp3-profile.mock.ts +++ b/test/lsp3-profile.mock.ts @@ -8,36 +8,36 @@ export const lsp3ProfileJson: LSP3ProfileJSON = { { width: 1350, height: 1800, - hashFunction: 'keccak256(bytes)', - hash: '0x229b60ea5b58e1ab8e6f1063300be110bb4fa663ba75d3814d60104ac6b74497', + verificationFunction: 'keccak256(bytes)', + verificationData: '0x229b60ea5b58e1ab8e6f1063300be110bb4fa663ba75d3814d60104ac6b74497', url: 'ipfs://Qmbv9j6iCDDYJ1NXHTZnNHDJ6qaaKkZsf79jhUMFAXcfDR', }, { width: 768, height: 1024, - hashFunction: 'keccak256(bytes)', - hash: '0x320db57770084f114988c8a94bcf219ca66c69421590466a45f382cd84995c2b', + verificationFunction: 'keccak256(bytes)', + verificationData: '0x320db57770084f114988c8a94bcf219ca66c69421590466a45f382cd84995c2b', url: 'ipfs://QmS4m2LmRpay7Jij4DCpvaW5zKZYy43ATZdRxUkUND6nG3', }, { width: 480, height: 640, - hashFunction: 'keccak256(bytes)', - hash: '0x8dff218f989e8c3e86950401438df313e609486eae8ff470f3dccb4bed665631', + verificationFunction: 'keccak256(bytes)', + verificationData: '0x8dff218f989e8c3e86950401438df313e609486eae8ff470f3dccb4bed665631', url: 'ipfs://QmXuzWADWcfLCW6ur9FVpMkuLbKCMpeGJuuJKwQcr4SHWy', }, { width: 240, height: 320, - hashFunction: 'keccak256(bytes)', - hash: '0xe9a2ef4b92b5050092df676e0c2c90eab7dd8750b6457f8add3507d9d4d4b541', + verificationFunction: 'keccak256(bytes)', + verificationData: '0xe9a2ef4b92b5050092df676e0c2c90eab7dd8750b6457f8add3507d9d4d4b541', url: 'ipfs://QmekahsQRQgiHaj12TRrn29Ux7DtdzcpFXP7vr94gKaAHo', }, { width: 135, height: 180, - hashFunction: 'keccak256(bytes)', - hash: '0x42eb23c686b95da5d2e36eaec3d6a3db7e7e50d9ed79c7662f04d7c918e70980', + verificationFunction: 'keccak256(bytes)', + verificationData: '0x42eb23c686b95da5d2e36eaec3d6a3db7e7e50d9ed79c7662f04d7c918e70980', url: 'ipfs://QmRbYFmXDKvea6XHP4yXQu6hmmx9WeZymNkdgarmXu9rVG', }, ], @@ -45,36 +45,36 @@ export const lsp3ProfileJson: LSP3ProfileJSON = { { width: 1024, height: 768, - hashFunction: 'keccak256(bytes)', - hash: '0xbe2d39fe1e0b1911155afc74010db3483528a2b645dea8fcf47bdc34147769be', + verificationFunction: 'keccak256(bytes)', + verificationData: '0xbe2d39fe1e0b1911155afc74010db3483528a2b645dea8fcf47bdc34147769be', url: 'ipfs://QmQ6ujfKSc91F44KtMe6WRTSCXoSdCjomQUy8hCUxHMr28', }, { width: 1024, height: 768, - hashFunction: 'keccak256(bytes)', - hash: '0xbe2d39fe1e0b1911155afc74010db3483528a2b645dea8fcf47bdc34147769be', + verificationFunction: 'keccak256(bytes)', + verificationData: '0xbe2d39fe1e0b1911155afc74010db3483528a2b645dea8fcf47bdc34147769be', url: 'ipfs://QmQ6ujfKSc91F44KtMe6WRTSCXoSdCjomQUy8hCUxHMr28', }, { width: 640, height: 480, - hashFunction: 'keccak256(bytes)', - hash: '0xb115f2bf09994e79726db27a7b8d5a0de41a5b81d11b59b3038fa158718266ff', + verificationFunction: 'keccak256(bytes)', + verificationData: '0xb115f2bf09994e79726db27a7b8d5a0de41a5b81d11b59b3038fa158718266ff', url: 'ipfs://QmakaRZxJMMqwQFJY98J3wjbqYVDnaSZ9sEqBF9iMv3GNX', }, { width: 320, height: 240, - hashFunction: 'keccak256(bytes)', - hash: '0x7bb445a253370e6e99787cfdd51f39e1c72e78519232bbbc73f5628e212391d2', + verificationFunction: 'keccak256(bytes)', + verificationData: '0x7bb445a253370e6e99787cfdd51f39e1c72e78519232bbbc73f5628e212391d2', url: 'ipfs://QmQWnRTrv5AmWLnJXH7LrJddnMALiWU28AZKW4s7EGozBE', }, { width: 180, height: 135, - hashFunction: 'keccak256(bytes)', - hash: '0x22833de71837428db3f2f0f4d5237c5aa7b99a1069f545abd6505a8d2c4a61a3', + verificationFunction: 'keccak256(bytes)', + verificationData: '0x22833de71837428db3f2f0f4d5237c5aa7b99a1069f545abd6505a8d2c4a61a3', url: 'ipfs://QmSUyD96J4VFg9QoQGXBBiPrBdJddzmDUKETnHAdyqmDQQ', }, ], diff --git a/test/lsp4-digital-asset.mock.ts b/test/lsp4-digital-asset.mock.ts index 0e0af834..19673620 100644 --- a/test/lsp4-digital-asset.mock.ts +++ b/test/lsp4-digital-asset.mock.ts @@ -8,36 +8,36 @@ export const lsp4DigitalAsset: LSP4DigitalAssetJSON = { { width: 668, height: 1800, - hashFunction: 'keccak256(bytes)', - hash: '0x8914e70f13ed41e47bdf66364ec71f70a46382630734a18e4e8116ae6bc0a550', + verificationFunction: 'keccak256(bytes)', + verificationData: '0x8914e70f13ed41e47bdf66364ec71f70a46382630734a18e4e8116ae6bc0a550', url: 'ipfs://QmTexfzZo1DqWoNmHxAWXmEQZxF9wvzYQyhyAFV1i1hVov', }, { width: 380, height: 1024, - hashFunction: 'keccak256(bytes)', - hash: '0x2cd6b5caa6bfa187076aa272153da7066cde17734fc294c30633f806d1cc1115', + verificationFunction: 'keccak256(bytes)', + verificationData: '0x2cd6b5caa6bfa187076aa272153da7066cde17734fc294c30633f806d1cc1115', url: 'ipfs://QmZsV83mjphpmht3iNRVrGLuXYuNTUtQSRnFKwGT4ExuTT', }, { width: 237, height: 640, - hashFunction: 'keccak256(bytes)', - hash: '0x7cfd48ed15e0f9d036349f8417510a40c1022f2f1159e03be8592af3f65fc53d', + verificationFunction: 'keccak256(bytes)', + verificationData: '0x7cfd48ed15e0f9d036349f8417510a40c1022f2f1159e03be8592af3f65fc53d', url: 'ipfs://QmThDy6sZsxF5sQdoW2V9HQbERuHTAuiSUr4RC7QegMtEr', }, { width: 119, height: 320, - hashFunction: 'keccak256(bytes)', - hash: '0x5de55e95f44f0e51b709d6186951414ad096c9a20f471deb6b99f13928549957', + verificationFunction: 'keccak256(bytes)', + verificationData: '0x5de55e95f44f0e51b709d6186951414ad096c9a20f471deb6b99f13928549957', url: 'ipfs://QmQ9iEqZ1dUTxDRK8aD71EqAx2tBYNwiC6YxrhDCpG111P', }, { width: 67, height: 180, - hashFunction: 'keccak256(bytes)', - hash: '0x64bdbca238f2368c8ecb700a9df7522c3f3753e2a31e97550aa9a8ba63e6768b', + verificationFunction: 'keccak256(bytes)', + verificationData: '0x64bdbca238f2368c8ecb700a9df7522c3f3753e2a31e97550aa9a8ba63e6768b', url: 'ipfs://QmfALFP7dysQLTpcGFvzy4FpGkjkmQmHg68RNUkxNnGArM', }, ], From b779d754e1bda91ab5223f0ac29e18dc19fe98c1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 17 Aug 2023 12:56:23 +0000 Subject: [PATCH 02/17] chore(main): release 3.0.0 --- CHANGELOG.md | 10 ++++++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f0752970..72cb9202 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,16 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [3.0.0](https://github.com/lukso-network/tools-lsp-factory/compare/v2.5.1...v3.0.0) (2023-08-17) + +### ⚠ BREAKING CHANGES + +- upgrade smart contracts to v0.10.3 ([#204](https://github.com/lukso-network/tools-lsp-factory/issues/204)) + +### Features + +- upgrade smart contracts to v0.10.3 ([#204](https://github.com/lukso-network/tools-lsp-factory/issues/204)) ([db9d147](https://github.com/lukso-network/tools-lsp-factory/commit/db9d147df5b11dcb95c7a8249c683db49db2cce0)) + ### [2.5.1](https://github.com/lukso-network/tools-lsp-factory/compare/v2.5.0...v2.5.1) (2023-03-30) ### Bug Fixes diff --git a/package-lock.json b/package-lock.json index d5b1b7b4..a1556d6b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@lukso/lsp-factory.js", - "version": "2.5.1", + "version": "3.0.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@lukso/lsp-factory.js", - "version": "2.5.1", + "version": "3.0.0", "license": "MIT", "dependencies": { "@erc725/erc725.js": "^0.21.0", diff --git a/package.json b/package.json index ef669e64..019752ab 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@lukso/lsp-factory.js", - "version": "2.5.1", + "version": "3.0.0", "description": "Helper Library to allow simple deployments of UniversalProfiles and LSP7 and LSP8 Digital Assets.", "main": "build/main/src/index.js", "typings": "build/main/src/index.d.ts", From 8eae89aa03dbbc26467fb570357be5dfcafb29bb Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 8 Sep 2023 08:14:29 +0000 Subject: [PATCH 03/17] chore(main): release 3.1.0 --- CHANGELOG.md | 21 +++++++++++++++++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 72cb9202..8ce8c47f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,27 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [3.1.0](https://github.com/lukso-network/tools-lsp-factory/compare/v3.0.0...v3.1.0) (2023-09-08) + + +### ⚠ BREAKING CHANGES + +* upgrade lsp to v0.11.1 + +### Features + +* upgrade lsp to v0.11.1 ([ccc61f8](https://github.com/lukso-network/tools-lsp-factory/commit/ccc61f855028c617767f726e317298ee65ee358a)) + + +### Bug Fixes + +* enable source map ([e3c60b3](https://github.com/lukso-network/tools-lsp-factory/commit/e3c60b331c213ce5ce6dec8479b577471345d76e)) + + +### Miscellaneous Chores + +* release 3.1.0 ([6955282](https://github.com/lukso-network/tools-lsp-factory/commit/6955282cd707d10493dda0acd3d02d91dc607bcc)) + ## [3.0.0](https://github.com/lukso-network/tools-lsp-factory/compare/v2.5.1...v3.0.0) (2023-08-17) ### ⚠ BREAKING CHANGES diff --git a/package-lock.json b/package-lock.json index a1556d6b..633a181b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@lukso/lsp-factory.js", - "version": "3.0.0", + "version": "3.1.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@lukso/lsp-factory.js", - "version": "3.0.0", + "version": "3.1.0", "license": "MIT", "dependencies": { "@erc725/erc725.js": "^0.21.0", diff --git a/package.json b/package.json index 019752ab..30f14ae3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@lukso/lsp-factory.js", - "version": "3.0.0", + "version": "3.1.0", "description": "Helper Library to allow simple deployments of UniversalProfiles and LSP7 and LSP8 Digital Assets.", "main": "build/main/src/index.js", "typings": "build/main/src/index.d.ts", From ce4b70db4c3e0c0881ede05df8d00256cd29d89c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 12 Sep 2023 09:00:36 +0000 Subject: [PATCH 04/17] chore(main): release 3.1.1 --- CHANGELOG.md | 7 +++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ce8c47f..f5fa421d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [3.1.1](https://github.com/lukso-network/tools-lsp-factory/compare/v3.1.0...v3.1.1) (2023-09-12) + + +### Bug Fixes + +* use default SC version ([ed4a1a2](https://github.com/lukso-network/tools-lsp-factory/commit/ed4a1a2b85a0e1283ceb2142af64a1d74080d940)) + ## [3.1.0](https://github.com/lukso-network/tools-lsp-factory/compare/v3.0.0...v3.1.0) (2023-09-08) diff --git a/package-lock.json b/package-lock.json index 633a181b..926b4450 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@lukso/lsp-factory.js", - "version": "3.1.0", + "version": "3.1.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@lukso/lsp-factory.js", - "version": "3.1.0", + "version": "3.1.1", "license": "MIT", "dependencies": { "@erc725/erc725.js": "^0.21.0", diff --git a/package.json b/package.json index 30f14ae3..5336356c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@lukso/lsp-factory.js", - "version": "3.1.0", + "version": "3.1.1", "description": "Helper Library to allow simple deployments of UniversalProfiles and LSP7 and LSP8 Digital Assets.", "main": "build/main/src/index.js", "typings": "build/main/src/index.d.ts", From c02e0c8b722f710b264c4b32b7dbbdea4cc7b40c Mon Sep 17 00:00:00 2001 From: CJ42 Date: Wed, 18 Oct 2023 18:55:25 +0100 Subject: [PATCH 05/17] build: upgrade erc725.js + lsp-smart-contracts --- package-lock.json | 307 ++++++++++++++++++++++++---------------------- package.json | 2 +- 2 files changed, 163 insertions(+), 146 deletions(-) diff --git a/package-lock.json b/package-lock.json index 926b4450..abb7e406 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "@erc725/erc725.js": "^0.21.0", "@ethersproject/abi": "^5.7.0", "@ethersproject/experimental": "^5.7.0", - "@lukso/lsp-smart-contracts": "^0.11.1", + "@lukso/lsp-smart-contracts": "^0.12.0-rc.0", "axios": "^0.23.0", "browser-image-compression": "^2.0.0", "ethers": "^5.7.0", @@ -54,6 +54,11 @@ "node": ">=10" } }, + "node_modules/@account-abstraction/contracts": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/@account-abstraction/contracts/-/contracts-0.6.0.tgz", + "integrity": "sha512-8ooRJuR7XzohMDM4MV34I12Ci2bmxfE9+cixakRL7lA4BAwJKQ3ahvd8FbJa9kiwkUPCUNtj+/zxDQWYYalLMQ==" + }, "node_modules/@babel/code-frame": { "version": "7.16.0", "license": "MIT", @@ -159,9 +164,9 @@ "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" }, "node_modules/@babel/helper-define-polyfill-provider": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.4.2.tgz", - "integrity": "sha512-k0qnnOqHn5dK9pZpfD5XXZ9SojAITdCKRn2Lp6rnDGzIbaP0rHyMPk/4wsSxVBVz4RfN0q6VpXWP2pDGIoQ7hw==", + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.4.3.tgz", + "integrity": "sha512-WBrLmuPP47n7PNwsZ57pqam6G/RGo1vw/87b0Blc53tZNGZ4x7YvZ6HgQe2vo1W/FR20OgjeZuGXzudPiXHFug==", "dependencies": { "@babel/helper-compilation-targets": "^7.22.6", "@babel/helper-plugin-utils": "^7.22.5", @@ -519,15 +524,15 @@ } }, "node_modules/@babel/plugin-transform-runtime": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.22.15.tgz", - "integrity": "sha512-tEVLhk8NRZSmwQ0DJtxxhTrCht1HVo8VaMzYT4w6lwyKBuHsgoioAUA7/6eT2fRfc5/23fuGdlwIxXhRVgWr4g==", + "version": "7.23.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.23.2.tgz", + "integrity": "sha512-XOntj6icgzMS58jPVtQpiuF6ZFWxQiJavISGx5KGjRj+3gqZr8+N6Kx+N9BApWzgS+DOjIZfXXj0ZesenOWDyA==", "dependencies": { "@babel/helper-module-imports": "^7.22.15", "@babel/helper-plugin-utils": "^7.22.5", - "babel-plugin-polyfill-corejs2": "^0.4.5", - "babel-plugin-polyfill-corejs3": "^0.8.3", - "babel-plugin-polyfill-regenerator": "^0.5.2", + "babel-plugin-polyfill-corejs2": "^0.4.6", + "babel-plugin-polyfill-corejs3": "^0.8.5", + "babel-plugin-polyfill-regenerator": "^0.5.3", "semver": "^6.3.1" }, "engines": { @@ -546,9 +551,9 @@ } }, "node_modules/@babel/runtime": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.15.tgz", - "integrity": "sha512-T0O+aa+4w0u06iNmapipJXMV4HoUir03hpx3/YqXXhu9xim3w+dVphjFWl1OH8NbZHw5Lbm9k45drDkgq2VNNA==", + "version": "7.23.2", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.23.2.tgz", + "integrity": "sha512-mM8eg4yl5D6i3lu2QKPuPH4FArvJ8KhTofbE7jwMUv9KX5mBvwPAqnV3MlyBNqdp9RyRKP6Yck8TrfYrPvX3bg==", "dependencies": { "regenerator-runtime": "^0.14.0" }, @@ -1302,9 +1307,9 @@ } }, "node_modules/@erc725/smart-contracts": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/@erc725/smart-contracts/-/smart-contracts-5.2.0.tgz", - "integrity": "sha512-ML7eXO2l6GO847CKGTbSO7MxpfVpmZvVPA/4KutYwVkaZmPxB05WC2flPxUilUz7ws0S7xgyt50sPHLA1ffojA==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@erc725/smart-contracts/-/smart-contracts-6.0.0.tgz", + "integrity": "sha512-6okutGGL9xbg/MSgAof2FU1UcSNE/z3p9TORlROVGaM3gi1A6FQQ7fDqtBYkPtvHureX8yS9gP7xPt3PRbP43Q==", "dependencies": { "@openzeppelin/contracts": "^4.9.3", "@openzeppelin/contracts-upgradeable": "^4.9.3", @@ -3805,11 +3810,12 @@ } }, "node_modules/@lukso/lsp-smart-contracts": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/@lukso/lsp-smart-contracts/-/lsp-smart-contracts-0.11.1.tgz", - "integrity": "sha512-qGmTVjGR6tA+h7o4AAJBuGphcJTfXcVdCpx7yeHvLWW3+3a+KYsCORKKnutAfMwdbIL0W944PVhzq7xx+vVLPg==", + "version": "0.12.0-rc.0", + "resolved": "https://registry.npmjs.org/@lukso/lsp-smart-contracts/-/lsp-smart-contracts-0.12.0-rc.0.tgz", + "integrity": "sha512-yyX5AbsPCfOwH/tVUQp4Arf3ysKviqoPI9UBbAkImWjxQCocI6K1PBKCH77kCeuOFzpPBGcHo4LqlSkhbqvYNw==", "dependencies": { - "@erc725/smart-contracts": "^5.2.0", + "@account-abstraction/contracts": "^0.6.0", + "@erc725/smart-contracts": "^6.0.0", "@openzeppelin/contracts": "^4.9.2", "@openzeppelin/contracts-upgradeable": "^4.9.2", "solidity-bytes-utils": "0.8.0" @@ -4801,9 +4807,9 @@ } }, "node_modules/@types/ethereum-protocol": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@types/ethereum-protocol/-/ethereum-protocol-1.0.2.tgz", - "integrity": "sha512-Ri/hwt4UckZlF7eqhhAQcXsNvcgQmSJOKZteLco1/5NsRcneW/cJuQcrQNILN2Ohs9WUQjeGW3ZRRNqkEVMzuQ==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@types/ethereum-protocol/-/ethereum-protocol-1.0.4.tgz", + "integrity": "sha512-qzqIdFigCLH4ZoTjDAAz3kv6+dGXx8UVP9a5RHrJzbnaqSKEMSI/zAMgMH2HPRJrMKKYBOydYgblzS+WZG27+Q==", "dependencies": { "bignumber.js": "7.2.1" } @@ -4825,9 +4831,9 @@ } }, "node_modules/@types/http-cache-semantics": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.1.tgz", - "integrity": "sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ==" + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.3.tgz", + "integrity": "sha512-V46MYLFp08Wf2mmaBhvgjStM3tPa+2GAdy/iqoX+noX1//zje2x4XmrIU0cAwyClATsTmahbtoQ2EwP7I5WSiA==" }, "node_modules/@types/istanbul-lib-coverage": { "version": "2.0.3", @@ -5072,9 +5078,9 @@ "license": "MIT" }, "node_modules/@types/responselike": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.0.tgz", - "integrity": "sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.2.tgz", + "integrity": "sha512-/4YQT5Kp6HxUDb4yhRkm0bJ7TbjvTddqX7PZ5hz6qV3pxSo72f/6YPRo+Mu2DU307tm9IioO69l7uAwn5XNcFA==", "dependencies": { "@types/node": "*" } @@ -5098,9 +5104,9 @@ "license": "MIT" }, "node_modules/@types/underscore": { - "version": "1.11.9", - "resolved": "https://registry.npmjs.org/@types/underscore/-/underscore-1.11.9.tgz", - "integrity": "sha512-M63wKUdsjDFUfyFt1TCUZHGFk9KDAa5JP0adNUErbm0U45Lr06HtANdYRP+GyleEopEoZ4UyBcdAC5TnW4Uz2w==" + "version": "1.11.12", + "resolved": "https://registry.npmjs.org/@types/underscore/-/underscore-1.11.12.tgz", + "integrity": "sha512-beX81q12OQo809WJ/UYCvUDvJR3YQ4wtehYYQ6eNw5VLyd+KUNBRV4FgzZCHBmACbdPulH9F9ifhxzFFU9TWvQ==" }, "node_modules/@types/web3": { "version": "1.0.20", @@ -5112,9 +5118,9 @@ } }, "node_modules/@types/web3-provider-engine": { - "version": "14.0.1", - "resolved": "https://registry.npmjs.org/@types/web3-provider-engine/-/web3-provider-engine-14.0.1.tgz", - "integrity": "sha512-SaAfLJY/40wKFDsNFwaNfwqFSL6kVhTx9JD18qM+Gaw1qdAXLYF/6E7TIqWEdoG4so6fki/zxURP5NsoCePYJw==", + "version": "14.0.2", + "resolved": "https://registry.npmjs.org/@types/web3-provider-engine/-/web3-provider-engine-14.0.2.tgz", + "integrity": "sha512-i+vgIh873kDu6MnYZkIqrho4JCan1c8TcPnYY6te2lq1ODD4SPA8JxFCyQjK+vwbLMr5F3N/I37AfK/wxiyuEA==", "dependencies": { "@types/ethereum-protocol": "*" } @@ -6060,12 +6066,12 @@ } }, "node_modules/babel-plugin-polyfill-corejs2": { - "version": "0.4.5", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.5.tgz", - "integrity": "sha512-19hwUH5FKl49JEsvyTcoHakh6BE0wgXLLptIyKZ3PijHc/Ci521wygORCUCCred+E/twuqRyAkE02BAWPmsHOg==", + "version": "0.4.6", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.6.tgz", + "integrity": "sha512-jhHiWVZIlnPbEUKSSNb9YoWcQGdlTLq7z1GHL4AjFxaoOUMuuEVJ+Y4pAaQUGOGk93YsVCKPbqbfw3m0SM6H8Q==", "dependencies": { "@babel/compat-data": "^7.22.6", - "@babel/helper-define-polyfill-provider": "^0.4.2", + "@babel/helper-define-polyfill-provider": "^0.4.3", "semver": "^6.3.1" }, "peerDependencies": { @@ -6081,23 +6087,23 @@ } }, "node_modules/babel-plugin-polyfill-corejs3": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.8.3.tgz", - "integrity": "sha512-z41XaniZL26WLrvjy7soabMXrfPWARN25PZoriDEiLMxAp50AUW3t35BGQUMg5xK3UrpVTtagIDklxYa+MhiNA==", + "version": "0.8.5", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.8.5.tgz", + "integrity": "sha512-Q6CdATeAvbScWPNLB8lzSO7fgUVBkQt6zLgNlfyeCr/EQaEQR+bWiBYYPYAFyE528BMjRhL+1QBMOI4jc/c5TA==", "dependencies": { - "@babel/helper-define-polyfill-provider": "^0.4.2", - "core-js-compat": "^3.31.0" + "@babel/helper-define-polyfill-provider": "^0.4.3", + "core-js-compat": "^3.32.2" }, "peerDependencies": { "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" } }, "node_modules/babel-plugin-polyfill-regenerator": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.5.2.tgz", - "integrity": "sha512-tAlOptU0Xj34V1Y2PNTL4Y0FOJMDB6bZmoW39FeCQIhigGLkqu3Fj6uiXpxIf6Ij274ENdYx64y6Au+ZKlb1IA==", + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.5.3.tgz", + "integrity": "sha512-8sHeDOmXC8csczMrYEOf0UTNa4yE2SxV5JGeT/LP1n0OYVDUUFPxG9vdk2AlDlIit4t+Kf0xCtpgXPBwnn/9pw==", "dependencies": { - "@babel/helper-define-polyfill-provider": "^0.4.2" + "@babel/helper-define-polyfill-provider": "^0.4.3" }, "peerDependencies": { "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" @@ -6505,9 +6511,9 @@ "optional": true }, "node_modules/browserslist": { - "version": "4.21.10", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.10.tgz", - "integrity": "sha512-bipEBdZfVH5/pwrvqc+Ub0kUPVfGUhlKxbvfD+z1BDnPEO/X98ruXGA1WP5ASpAFKan7Qr6j736IacbZQuAlKQ==", + "version": "4.22.1", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.22.1.tgz", + "integrity": "sha512-FEVc202+2iuClEhZhrWy6ZiAcRLvNMyYcxZ8raemul1DYVOVdFsbqckWLdsixQZCpJlwe77Z3UTalE7jsjnKfQ==", "funding": [ { "type": "opencollective", @@ -6523,10 +6529,10 @@ } ], "dependencies": { - "caniuse-lite": "^1.0.30001517", - "electron-to-chromium": "^1.4.477", + "caniuse-lite": "^1.0.30001541", + "electron-to-chromium": "^1.4.535", "node-releases": "^2.0.13", - "update-browserslist-db": "^1.0.11" + "update-browserslist-db": "^1.0.13" }, "bin": { "browserslist": "cli.js" @@ -6796,9 +6802,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001517", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001517.tgz", - "integrity": "sha512-Vdhm5S11DaFVLlyiKu4hiUTkpZu+y1KA/rZZqVQfOD5YdDT/eQKlkt7NaE0WGOFgX32diqt9MiP9CAiFeRklaA==", + "version": "1.0.30001550", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001550.tgz", + "integrity": "sha512-p82WjBYIypO0ukTsd/FG3Xxs+4tFeaY9pfT4amQL8KWtYH7H9nYwReGAbMTJ0hsmRO8IfDtsS6p3ZWj8+1c2RQ==", "funding": [ { "type": "opencollective", @@ -8810,11 +8816,11 @@ } }, "node_modules/core-js-compat": { - "version": "3.32.2", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.32.2.tgz", - "integrity": "sha512-+GjlguTDINOijtVRUxrQOv3kfu9rl+qPNdX2LTbJ/ZyVTuxK+ksVSAGX1nHstu4hrv1En/uPTtWgq2gI5wt4AQ==", + "version": "3.33.0", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.33.0.tgz", + "integrity": "sha512-0w4LcLXsVEuNkIqwjjf9rjCoPhK8uqA4tMRh4Ge26vfLtUutshn+aRJU21I9LCJlh2QQHfisNToLjw1XEJLTWw==", "dependencies": { - "browserslist": "^4.21.10" + "browserslist": "^4.22.1" }, "funding": { "type": "opencollective", @@ -9986,9 +9992,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.512", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.512.tgz", - "integrity": "sha512-1W8wRbYlQE4ph7eoj3TJ+uqwO6+xvAE/L+KGU7WTQQvX3tnSIGZAb90MTsMoJqzntamiwJhBAj4WZmygXhsOUg==" + "version": "1.4.557", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.557.tgz", + "integrity": "sha512-6x0zsxyMXpnMJnHrondrD3SuAeKcwij9S+83j2qHAQPXbGTDDfgImzzwgGlzrIcXbHQ42tkG4qA6U860cImNhw==" }, "node_modules/elliptic": { "version": "6.5.4", @@ -11316,6 +11322,7 @@ "version": "5.1.0", "resolved": "https://registry.npmjs.org/eth-json-rpc-infura/-/eth-json-rpc-infura-5.1.0.tgz", "integrity": "sha512-THzLye3PHUSGn1EXMhg6WTLW9uim7LQZKeKaeYsS9+wOBcamRiCQVGHa6D2/4P0oS0vSaxsBnU/J6qvn0MPdow==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", "dependencies": { "eth-json-rpc-middleware": "^6.0.0", "eth-rpc-errors": "^3.0.0", @@ -29370,9 +29377,9 @@ } }, "node_modules/update-browserslist-db": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz", - "integrity": "sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==", + "version": "1.0.13", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz", + "integrity": "sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==", "funding": [ { "type": "opencollective", @@ -29828,9 +29835,9 @@ "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==" }, "node_modules/web3-bzz/node_modules/keyv": { - "version": "4.5.3", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.3.tgz", - "integrity": "sha512-QCiSav9WaX1PgETJ+SpNnx2PRRapJ/oRSXM4VO5OGYGSjrxbKPVFVhB3l2OCbLCk329N8qyAtsJjSjvVBWzEug==", + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", "dependencies": { "json-buffer": "3.0.1" } @@ -30065,9 +30072,13 @@ } }, "node_modules/web3-eth-accounts/node_modules/uuid": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", - "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], "bin": { "uuid": "dist/bin/uuid" } @@ -30715,6 +30726,11 @@ } }, "dependencies": { + "@account-abstraction/contracts": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/@account-abstraction/contracts/-/contracts-0.6.0.tgz", + "integrity": "sha512-8ooRJuR7XzohMDM4MV34I12Ci2bmxfE9+cixakRL7lA4BAwJKQ3ahvd8FbJa9kiwkUPCUNtj+/zxDQWYYalLMQ==" + }, "@babel/code-frame": { "version": "7.16.0", "requires": { @@ -30792,9 +30808,9 @@ } }, "@babel/helper-define-polyfill-provider": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.4.2.tgz", - "integrity": "sha512-k0qnnOqHn5dK9pZpfD5XXZ9SojAITdCKRn2Lp6rnDGzIbaP0rHyMPk/4wsSxVBVz4RfN0q6VpXWP2pDGIoQ7hw==", + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.4.3.tgz", + "integrity": "sha512-WBrLmuPP47n7PNwsZ57pqam6G/RGo1vw/87b0Blc53tZNGZ4x7YvZ6HgQe2vo1W/FR20OgjeZuGXzudPiXHFug==", "requires": { "@babel/helper-compilation-targets": "^7.22.6", "@babel/helper-plugin-utils": "^7.22.5", @@ -31018,15 +31034,15 @@ } }, "@babel/plugin-transform-runtime": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.22.15.tgz", - "integrity": "sha512-tEVLhk8NRZSmwQ0DJtxxhTrCht1HVo8VaMzYT4w6lwyKBuHsgoioAUA7/6eT2fRfc5/23fuGdlwIxXhRVgWr4g==", + "version": "7.23.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.23.2.tgz", + "integrity": "sha512-XOntj6icgzMS58jPVtQpiuF6ZFWxQiJavISGx5KGjRj+3gqZr8+N6Kx+N9BApWzgS+DOjIZfXXj0ZesenOWDyA==", "requires": { "@babel/helper-module-imports": "^7.22.15", "@babel/helper-plugin-utils": "^7.22.5", - "babel-plugin-polyfill-corejs2": "^0.4.5", - "babel-plugin-polyfill-corejs3": "^0.8.3", - "babel-plugin-polyfill-regenerator": "^0.5.2", + "babel-plugin-polyfill-corejs2": "^0.4.6", + "babel-plugin-polyfill-corejs3": "^0.8.5", + "babel-plugin-polyfill-regenerator": "^0.5.3", "semver": "^6.3.1" }, "dependencies": { @@ -31038,9 +31054,9 @@ } }, "@babel/runtime": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.15.tgz", - "integrity": "sha512-T0O+aa+4w0u06iNmapipJXMV4HoUir03hpx3/YqXXhu9xim3w+dVphjFWl1OH8NbZHw5Lbm9k45drDkgq2VNNA==", + "version": "7.23.2", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.23.2.tgz", + "integrity": "sha512-mM8eg4yl5D6i3lu2QKPuPH4FArvJ8KhTofbE7jwMUv9KX5mBvwPAqnV3MlyBNqdp9RyRKP6Yck8TrfYrPvX3bg==", "requires": { "regenerator-runtime": "^0.14.0" } @@ -31687,9 +31703,9 @@ } }, "@erc725/smart-contracts": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/@erc725/smart-contracts/-/smart-contracts-5.2.0.tgz", - "integrity": "sha512-ML7eXO2l6GO847CKGTbSO7MxpfVpmZvVPA/4KutYwVkaZmPxB05WC2flPxUilUz7ws0S7xgyt50sPHLA1ffojA==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@erc725/smart-contracts/-/smart-contracts-6.0.0.tgz", + "integrity": "sha512-6okutGGL9xbg/MSgAof2FU1UcSNE/z3p9TORlROVGaM3gi1A6FQQ7fDqtBYkPtvHureX8yS9gP7xPt3PRbP43Q==", "requires": { "@openzeppelin/contracts": "^4.9.3", "@openzeppelin/contracts-upgradeable": "^4.9.3", @@ -33238,11 +33254,12 @@ } }, "@lukso/lsp-smart-contracts": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/@lukso/lsp-smart-contracts/-/lsp-smart-contracts-0.11.1.tgz", - "integrity": "sha512-qGmTVjGR6tA+h7o4AAJBuGphcJTfXcVdCpx7yeHvLWW3+3a+KYsCORKKnutAfMwdbIL0W944PVhzq7xx+vVLPg==", + "version": "0.12.0-rc.0", + "resolved": "https://registry.npmjs.org/@lukso/lsp-smart-contracts/-/lsp-smart-contracts-0.12.0-rc.0.tgz", + "integrity": "sha512-yyX5AbsPCfOwH/tVUQp4Arf3ysKviqoPI9UBbAkImWjxQCocI6K1PBKCH77kCeuOFzpPBGcHo4LqlSkhbqvYNw==", "requires": { - "@erc725/smart-contracts": "^5.2.0", + "@account-abstraction/contracts": "^0.6.0", + "@erc725/smart-contracts": "^6.0.0", "@openzeppelin/contracts": "^4.9.2", "@openzeppelin/contracts-upgradeable": "^4.9.2", "solidity-bytes-utils": "0.8.0" @@ -34002,9 +34019,9 @@ } }, "@types/ethereum-protocol": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@types/ethereum-protocol/-/ethereum-protocol-1.0.2.tgz", - "integrity": "sha512-Ri/hwt4UckZlF7eqhhAQcXsNvcgQmSJOKZteLco1/5NsRcneW/cJuQcrQNILN2Ohs9WUQjeGW3ZRRNqkEVMzuQ==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@types/ethereum-protocol/-/ethereum-protocol-1.0.4.tgz", + "integrity": "sha512-qzqIdFigCLH4ZoTjDAAz3kv6+dGXx8UVP9a5RHrJzbnaqSKEMSI/zAMgMH2HPRJrMKKYBOydYgblzS+WZG27+Q==", "requires": { "bignumber.js": "7.2.1" }, @@ -34024,9 +34041,9 @@ } }, "@types/http-cache-semantics": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.1.tgz", - "integrity": "sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ==" + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.3.tgz", + "integrity": "sha512-V46MYLFp08Wf2mmaBhvgjStM3tPa+2GAdy/iqoX+noX1//zje2x4XmrIU0cAwyClATsTmahbtoQ2EwP7I5WSiA==" }, "@types/istanbul-lib-coverage": { "version": "2.0.3", @@ -34207,9 +34224,9 @@ "dev": true }, "@types/responselike": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.0.tgz", - "integrity": "sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.2.tgz", + "integrity": "sha512-/4YQT5Kp6HxUDb4yhRkm0bJ7TbjvTddqX7PZ5hz6qV3pxSo72f/6YPRo+Mu2DU307tm9IioO69l7uAwn5XNcFA==", "requires": { "@types/node": "*" } @@ -34231,9 +34248,9 @@ "dev": true }, "@types/underscore": { - "version": "1.11.9", - "resolved": "https://registry.npmjs.org/@types/underscore/-/underscore-1.11.9.tgz", - "integrity": "sha512-M63wKUdsjDFUfyFt1TCUZHGFk9KDAa5JP0adNUErbm0U45Lr06HtANdYRP+GyleEopEoZ4UyBcdAC5TnW4Uz2w==" + "version": "1.11.12", + "resolved": "https://registry.npmjs.org/@types/underscore/-/underscore-1.11.12.tgz", + "integrity": "sha512-beX81q12OQo809WJ/UYCvUDvJR3YQ4wtehYYQ6eNw5VLyd+KUNBRV4FgzZCHBmACbdPulH9F9ifhxzFFU9TWvQ==" }, "@types/web3": { "version": "1.0.20", @@ -34245,9 +34262,9 @@ } }, "@types/web3-provider-engine": { - "version": "14.0.1", - "resolved": "https://registry.npmjs.org/@types/web3-provider-engine/-/web3-provider-engine-14.0.1.tgz", - "integrity": "sha512-SaAfLJY/40wKFDsNFwaNfwqFSL6kVhTx9JD18qM+Gaw1qdAXLYF/6E7TIqWEdoG4so6fki/zxURP5NsoCePYJw==", + "version": "14.0.2", + "resolved": "https://registry.npmjs.org/@types/web3-provider-engine/-/web3-provider-engine-14.0.2.tgz", + "integrity": "sha512-i+vgIh873kDu6MnYZkIqrho4JCan1c8TcPnYY6te2lq1ODD4SPA8JxFCyQjK+vwbLMr5F3N/I37AfK/wxiyuEA==", "requires": { "@types/ethereum-protocol": "*" } @@ -34876,12 +34893,12 @@ } }, "babel-plugin-polyfill-corejs2": { - "version": "0.4.5", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.5.tgz", - "integrity": "sha512-19hwUH5FKl49JEsvyTcoHakh6BE0wgXLLptIyKZ3PijHc/Ci521wygORCUCCred+E/twuqRyAkE02BAWPmsHOg==", + "version": "0.4.6", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.6.tgz", + "integrity": "sha512-jhHiWVZIlnPbEUKSSNb9YoWcQGdlTLq7z1GHL4AjFxaoOUMuuEVJ+Y4pAaQUGOGk93YsVCKPbqbfw3m0SM6H8Q==", "requires": { "@babel/compat-data": "^7.22.6", - "@babel/helper-define-polyfill-provider": "^0.4.2", + "@babel/helper-define-polyfill-provider": "^0.4.3", "semver": "^6.3.1" }, "dependencies": { @@ -34893,20 +34910,20 @@ } }, "babel-plugin-polyfill-corejs3": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.8.3.tgz", - "integrity": "sha512-z41XaniZL26WLrvjy7soabMXrfPWARN25PZoriDEiLMxAp50AUW3t35BGQUMg5xK3UrpVTtagIDklxYa+MhiNA==", + "version": "0.8.5", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.8.5.tgz", + "integrity": "sha512-Q6CdATeAvbScWPNLB8lzSO7fgUVBkQt6zLgNlfyeCr/EQaEQR+bWiBYYPYAFyE528BMjRhL+1QBMOI4jc/c5TA==", "requires": { - "@babel/helper-define-polyfill-provider": "^0.4.2", - "core-js-compat": "^3.31.0" + "@babel/helper-define-polyfill-provider": "^0.4.3", + "core-js-compat": "^3.32.2" } }, "babel-plugin-polyfill-regenerator": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.5.2.tgz", - "integrity": "sha512-tAlOptU0Xj34V1Y2PNTL4Y0FOJMDB6bZmoW39FeCQIhigGLkqu3Fj6uiXpxIf6Ij274ENdYx64y6Au+ZKlb1IA==", + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.5.3.tgz", + "integrity": "sha512-8sHeDOmXC8csczMrYEOf0UTNa4yE2SxV5JGeT/LP1n0OYVDUUFPxG9vdk2AlDlIit4t+Kf0xCtpgXPBwnn/9pw==", "requires": { - "@babel/helper-define-polyfill-provider": "^0.4.2" + "@babel/helper-define-polyfill-provider": "^0.4.3" } }, "babel-preset-current-node-syntax": { @@ -35222,14 +35239,14 @@ } }, "browserslist": { - "version": "4.21.10", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.10.tgz", - "integrity": "sha512-bipEBdZfVH5/pwrvqc+Ub0kUPVfGUhlKxbvfD+z1BDnPEO/X98ruXGA1WP5ASpAFKan7Qr6j736IacbZQuAlKQ==", + "version": "4.22.1", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.22.1.tgz", + "integrity": "sha512-FEVc202+2iuClEhZhrWy6ZiAcRLvNMyYcxZ8raemul1DYVOVdFsbqckWLdsixQZCpJlwe77Z3UTalE7jsjnKfQ==", "requires": { - "caniuse-lite": "^1.0.30001517", - "electron-to-chromium": "^1.4.477", + "caniuse-lite": "^1.0.30001541", + "electron-to-chromium": "^1.4.535", "node-releases": "^2.0.13", - "update-browserslist-db": "^1.0.11" + "update-browserslist-db": "^1.0.13" } }, "bs-logger": { @@ -35401,9 +35418,9 @@ } }, "caniuse-lite": { - "version": "1.0.30001517", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001517.tgz", - "integrity": "sha512-Vdhm5S11DaFVLlyiKu4hiUTkpZu+y1KA/rZZqVQfOD5YdDT/eQKlkt7NaE0WGOFgX32diqt9MiP9CAiFeRklaA==" + "version": "1.0.30001550", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001550.tgz", + "integrity": "sha512-p82WjBYIypO0ukTsd/FG3Xxs+4tFeaY9pfT4amQL8KWtYH7H9nYwReGAbMTJ0hsmRO8IfDtsS6p3ZWj8+1c2RQ==" }, "capture-exit": { "version": "2.0.0", @@ -36828,11 +36845,11 @@ "dev": true }, "core-js-compat": { - "version": "3.32.2", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.32.2.tgz", - "integrity": "sha512-+GjlguTDINOijtVRUxrQOv3kfu9rl+qPNdX2LTbJ/ZyVTuxK+ksVSAGX1nHstu4hrv1En/uPTtWgq2gI5wt4AQ==", + "version": "3.33.0", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.33.0.tgz", + "integrity": "sha512-0w4LcLXsVEuNkIqwjjf9rjCoPhK8uqA4tMRh4Ge26vfLtUutshn+aRJU21I9LCJlh2QQHfisNToLjw1XEJLTWw==", "requires": { - "browserslist": "^4.21.10" + "browserslist": "^4.22.1" } }, "core-js-pure": { @@ -37646,9 +37663,9 @@ } }, "electron-to-chromium": { - "version": "1.4.512", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.512.tgz", - "integrity": "sha512-1W8wRbYlQE4ph7eoj3TJ+uqwO6+xvAE/L+KGU7WTQQvX3tnSIGZAb90MTsMoJqzntamiwJhBAj4WZmygXhsOUg==" + "version": "1.4.557", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.557.tgz", + "integrity": "sha512-6x0zsxyMXpnMJnHrondrD3SuAeKcwij9S+83j2qHAQPXbGTDDfgImzzwgGlzrIcXbHQ42tkG4qA6U860cImNhw==" }, "elliptic": { "version": "6.5.4", @@ -51810,9 +51827,9 @@ } }, "update-browserslist-db": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz", - "integrity": "sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==", + "version": "1.0.13", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz", + "integrity": "sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==", "requires": { "escalade": "^3.1.1", "picocolors": "^1.0.0" @@ -52139,9 +52156,9 @@ "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==" }, "keyv": { - "version": "4.5.3", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.3.tgz", - "integrity": "sha512-QCiSav9WaX1PgETJ+SpNnx2PRRapJ/oRSXM4VO5OGYGSjrxbKPVFVhB3l2OCbLCk329N8qyAtsJjSjvVBWzEug==", + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", "requires": { "json-buffer": "3.0.1" } @@ -52328,9 +52345,9 @@ } }, "uuid": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", - "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==" + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==" } } }, diff --git a/package.json b/package.json index 5336356c..3c49d2c9 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "@erc725/erc725.js": "^0.21.0", "@ethersproject/abi": "^5.7.0", "@ethersproject/experimental": "^5.7.0", - "@lukso/lsp-smart-contracts": "^0.11.1", + "@lukso/lsp-smart-contracts": "^0.12.0-rc.0", "axios": "^0.23.0", "browser-image-compression": "^2.0.0", "ethers": "^5.7.0", From 425e23fea89723cbf7784f500171d1d57109c537 Mon Sep 17 00:00:00 2001 From: CJ42 Date: Wed, 18 Oct 2023 18:58:20 +0100 Subject: [PATCH 06/17] refactor!: add tokenIdType to LSP8 deployment --- .../lsp8-identifiable-digital-asset.spec.ts | 12 ++++ .../lsp8-identifiable-digital-asset.ts | 4 +- .../interfaces/digital-asset-deployment.ts | 5 ++ src/lib/services/base-contract.service.ts | 2 +- src/lib/services/digital-asset.service.ts | 56 +++++++++---------- .../services/universal-receiver.service.ts | 2 +- test/digital-asset.utils.ts | 8 +-- 7 files changed, 50 insertions(+), 39 deletions(-) diff --git a/src/lib/classes/lsp8-identifiable-digital-asset.spec.ts b/src/lib/classes/lsp8-identifiable-digital-asset.spec.ts index fd1ba793..be9d19e7 100644 --- a/src/lib/classes/lsp8-identifiable-digital-asset.spec.ts +++ b/src/lib/classes/lsp8-identifiable-digital-asset.spec.ts @@ -1,3 +1,4 @@ +import { LSP8_TOKEN_ID_TYPES } from '@lukso/lsp-smart-contracts'; import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; import { providers } from 'ethers'; import { ethers } from 'hardhat'; @@ -37,6 +38,7 @@ describe('LSP8IdentifiableDigitalAsset', () => { controllerAddress: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266', name: 'TOKEN', symbol: 'TKN', + tokenIdType: LSP8_TOKEN_ID_TYPES.UNIQUE_ID, }); expect(lsp8IdentifiableDigitalAsset.LSP8IdentifiableDigitalAsset.address).toBeDefined(); @@ -59,6 +61,7 @@ describe('LSP8IdentifiableDigitalAsset', () => { controllerAddress: signer.address, name: 'TOKEN', symbol: 'TKN', + tokenIdType: LSP8_TOKEN_ID_TYPES.UNIQUE_ID, }, { LSP8IdentifiableDigitalAsset: { @@ -88,6 +91,7 @@ describe('LSP8IdentifiableDigitalAsset', () => { controllerAddress: signer.address, name: 'TOKEN', symbol: 'TKN', + tokenIdType: LSP8_TOKEN_ID_TYPES.UNIQUE_ID, }, { LSP8IdentifiableDigitalAsset: { version: baseContract.address }, @@ -157,6 +161,7 @@ describe('LSP8IdentifiableDigitalAsset', () => { controllerAddress: signer.address, name: 'TOKEN', symbol: 'TKN', + tokenIdType: LSP8_TOKEN_ID_TYPES.UNIQUE_ID, }, { LSP8IdentifiableDigitalAsset: { version: baseContract.address }, @@ -176,6 +181,7 @@ describe('LSP8IdentifiableDigitalAsset', () => { controllerAddress: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266', name: 'TOKEN', symbol: 'TKN', + tokenIdType: LSP8_TOKEN_ID_TYPES.UNIQUE_ID, }, { LSP8IdentifiableDigitalAsset: { @@ -206,6 +212,7 @@ describe('LSP8IdentifiableDigitalAsset', () => { controllerAddress: signer.address, name: 'TOKEN', symbol: 'TKN', + tokenIdType: LSP8_TOKEN_ID_TYPES.UNIQUE_ID, }, { LSP8IdentifiableDigitalAsset: { @@ -249,6 +256,8 @@ describe('LSP8IdentifiableDigitalAsset', () => { const controllerAddress = '0xaDa25A4424b08F5337DacD619D4bCb21536a9B95'; const name = 'TOKEN'; const symbol = 'TKN'; + const tokenIdType = LSP8_TOKEN_ID_TYPES.UNIQUE_ID; + const expectedLSP4Value = '0x6f357c6a4d81f92a409b60c056e13102169c07e03f7de2dbcb79775a8b1f66a55b6278a0697066733a2f2f516d61543479786a45464e6d7163595965547832706e5a46426d71395055737763424c446b394b716f7148504b67'; @@ -266,6 +275,7 @@ describe('LSP8IdentifiableDigitalAsset', () => { name, symbol, digitalAssetMetadata: lsp4Metadata, + tokenIdType, }); expect(lsp8DigitalAsset.LSP8IdentifiableDigitalAsset.address).toBeDefined(); @@ -307,6 +317,7 @@ describe('LSP8IdentifiableDigitalAsset', () => { '0xFCA72D5763b8cFc686C2285099D5F35a2F094E9f', '0x591c236982b089Ad4B60758C075fA50Ec53CD674', ]; + const tokenIdType = LSP8_TOKEN_ID_TYPES.UNIQUE_ID; let lspFactory: LSPFactory; @@ -326,6 +337,7 @@ describe('LSP8IdentifiableDigitalAsset', () => { name, symbol, creators, + tokenIdType, }); digitalAsset = LSP8Mintable__factory.connect( diff --git a/src/lib/classes/lsp8-identifiable-digital-asset.ts b/src/lib/classes/lsp8-identifiable-digital-asset.ts index 3733114f..62f83614 100644 --- a/src/lib/classes/lsp8-identifiable-digital-asset.ts +++ b/src/lib/classes/lsp8-identifiable-digital-asset.ts @@ -8,8 +8,8 @@ import { LSPFactoryOptions } from '../interfaces'; import { ContractNames, DeployedLSP8IdentifiableDigitalAsset, - DigitalAssetDeploymentOptions, LSP8ContractDeploymentOptions, + LSP8IdentifiableDigitalAssetDeploymentOptions, } from '../interfaces/digital-asset-deployment'; import { lsp8BaseContractDeployment$, @@ -59,7 +59,7 @@ export class LSP8IdentifiableDigitalAsset { *``` */ async deploy( - digitalAssetDeploymentOptions: DigitalAssetDeploymentOptions, + digitalAssetDeploymentOptions: LSP8IdentifiableDigitalAssetDeploymentOptions, contractDeploymentOptions?: LSP8ContractDeploymentOptions ): Promise { const digitalAssetConfiguration = contractDeploymentOptions diff --git a/src/lib/interfaces/digital-asset-deployment.ts b/src/lib/interfaces/digital-asset-deployment.ts index 1de31008..d41c6b25 100644 --- a/src/lib/interfaces/digital-asset-deployment.ts +++ b/src/lib/interfaces/digital-asset-deployment.ts @@ -28,6 +28,11 @@ export interface LSP7DigitalAssetDeploymentOptions extends DigitalAssetDeploymen isNFT: boolean; } +export interface LSP8IdentifiableDigitalAssetDeploymentOptions + extends DigitalAssetDeploymentOptions { + tokenIdType: number | string; +} + export interface DeployedLSP8IdentifiableDigitalAsset { LSP8IdentifiableDigitalAsset: DeployedContract; } diff --git a/src/lib/services/base-contract.service.ts b/src/lib/services/base-contract.service.ts index c824bfaf..30707571 100644 --- a/src/lib/services/base-contract.service.ts +++ b/src/lib/services/base-contract.service.ts @@ -1,5 +1,5 @@ import { Signer } from '@ethersproject/abstract-signer'; -import { providers } from 'ethers'; +import { constants as ethersConstants, providers } from 'ethers'; import { defer, EMPTY, forkJoin, from, merge, Observable, of } from 'rxjs'; import { defaultIfEmpty, last, shareReplay, switchMap, tap } from 'rxjs/operators'; diff --git a/src/lib/services/digital-asset.service.ts b/src/lib/services/digital-asset.service.ts index 87b5c80e..308557b9 100644 --- a/src/lib/services/digital-asset.service.ts +++ b/src/lib/services/digital-asset.service.ts @@ -47,6 +47,7 @@ import { DigitalAssetContractDeploymentOptions, DigitalAssetDeploymentOptions, LSP7DigitalAssetDeploymentOptions, + LSP8IdentifiableDigitalAssetDeploymentOptions, } from '../interfaces/digital-asset-deployment'; import { LSP4DigitalAssetJSON, @@ -167,23 +168,17 @@ function initializeLSP7Proxy( const controllerAddress = await signer.getAddress(); - const gasEstimate = await contract.estimateGas[`initialize(string,string,address,bool)`]( + const gasEstimate = await contract.estimateGas.initialize( name, symbol, controllerAddress, isNFT ); - const transaction = await contract[`initialize(string,string,address,bool)`]( - name, - symbol, - controllerAddress, - isNFT, - { - gasLimit: gasEstimate.add(GAS_BUFFER), - gasPrice: GAS_PRICE, - } - ); + const transaction = await contract.initialize(name, symbol, controllerAddress, isNFT, { + gasLimit: gasEstimate.add(GAS_BUFFER), + gasPrice: GAS_PRICE, + }); return { type: DeploymentType.TRANSACTION, @@ -203,7 +198,7 @@ function initializeLSP7Proxy( export function lsp8IdentifiableDigitalAssetDeployment$( signer: Signer, - digitalAssetDeploymentOptions: DigitalAssetDeploymentOptions, + digitalAssetDeploymentOptions: LSP8IdentifiableDigitalAssetDeploymentOptions, baseContractAddress$: Observable, byteCode?: string ) { @@ -222,7 +217,7 @@ export function lsp8IdentifiableDigitalAssetDeployment$( export function lsp8IdentifiableDigitalAssetDeploymentWithBaseContractAddress$( signer: Signer, - digitalAssetDeploymentOptions: DigitalAssetDeploymentOptions, + digitalAssetDeploymentOptions: LSP8IdentifiableDigitalAssetDeploymentOptions, baseContractAddress: string, byteCode?: string ) { @@ -254,7 +249,7 @@ export function lsp8IdentifiableDigitalAssetDeploymentWithBaseContractAddress$( async function deployLSP8IdentifiableDigitalAsset( signer: Signer, - digitalAssetDeploymentOptions: DigitalAssetDeploymentOptions, + digitalAssetDeploymentOptions: LSP8IdentifiableDigitalAssetDeploymentOptions, baseContractAddress: string, byteCode?: string ) { @@ -269,14 +264,16 @@ async function deployLSP8IdentifiableDigitalAsset( return new ContractFactory(LSP8Mintable__factory.abi, byteCode, signer).deploy( digitalAssetDeploymentOptions.name, digitalAssetDeploymentOptions.symbol, - controllerAddress + controllerAddress, + digitalAssetDeploymentOptions.tokenIdType ); } return new LSP8Mintable__factory(signer).deploy( digitalAssetDeploymentOptions.name, digitalAssetDeploymentOptions.symbol, - controllerAddress + controllerAddress, + digitalAssetDeploymentOptions.tokenIdType ); }; @@ -293,9 +290,9 @@ async function deployLSP8IdentifiableDigitalAsset( function initializeLSP8Proxy( signer: Signer, digitalAssetDeploymentReceipt$: Observable, - digitalAssetDeploymentOptions: DigitalAssetDeploymentOptions + digitalAssetDeploymentOptions: LSP8IdentifiableDigitalAssetDeploymentOptions ) { - const { name, symbol } = digitalAssetDeploymentOptions; + const { name, symbol, tokenIdType } = digitalAssetDeploymentOptions; const initialize$ = digitalAssetDeploymentReceipt$.pipe( takeLast(1), @@ -306,25 +303,22 @@ function initializeLSP8Proxy( const controllerAddress = await signer.getAddress(); - const gasEstimate = await contract.estimateGas[`initialize(string,string,address)`]( - name, - symbol, - controllerAddress - ); - - const transaction = await contract[`initialize(string,string,address)`]( + const gasEstimate = await contract.estimateGas.initialize( name, symbol, controllerAddress, - { - gasLimit: gasEstimate.add(GAS_BUFFER), - gasPrice: GAS_PRICE, - } + tokenIdType ); + + const transaction = await contract.initialize(name, symbol, controllerAddress, tokenIdType, { + gasLimit: gasEstimate.add(GAS_BUFFER), + gasPrice: GAS_PRICE, + }); + return { type: DeploymentType.TRANSACTION, contractName: result.contractName, - functionName: 'initialize(string,string,address)', + functionName: 'initialize(string,string,address,uint256)', status: DeploymentStatus.PENDING, transaction, }; @@ -612,7 +606,7 @@ async function prepareSetDataTransaction( keysToSet.push(...creatorArrayIndexKeys); keysToSet.push(...creatorsMapKeys); - valuesToSet.push(ethers.utils.hexZeroPad(ethers.utils.hexlify([creators.length]), 32)); + valuesToSet.push(ethers.utils.hexZeroPad(ethers.utils.hexlify(creators.length), 16)); valuesToSet.push(...creatorArrayIndexValues); valuesToSet.push(...creatorsMapValues); } diff --git a/src/lib/services/universal-receiver.service.ts b/src/lib/services/universal-receiver.service.ts index 027bac86..543bb35f 100644 --- a/src/lib/services/universal-receiver.service.ts +++ b/src/lib/services/universal-receiver.service.ts @@ -1,4 +1,4 @@ -import { ContractFactory, providers, Signer } from 'ethers'; +import { ContractFactory, constants as ethersConstants, providers, Signer } from 'ethers'; import { concat, EMPTY, forkJoin, from, Observable } from 'rxjs'; import { shareReplay, switchMap } from 'rxjs/operators'; diff --git a/test/digital-asset.utils.ts b/test/digital-asset.utils.ts index 0b9096dc..8570249c 100644 --- a/test/digital-asset.utils.ts +++ b/test/digital-asset.utils.ts @@ -7,12 +7,12 @@ export async function testDeployWithSpecifiedCreators( digitalAsset: LSP7Mintable | LSP8Mintable, creators: string[] ) { - const [creatorArrayLength] = await digitalAsset.getDataBatch([LSP4_KEYS.LSP4_CREATORS_ARRAY]); - - expect(creatorArrayLength).toEqual( - '0x0000000000000000000000000000000000000000000000000000000000000003' + const creatorArrayLength = await digitalAsset.getData( + ERC725YDataKeys.LSP4['LSP4Creators[]'].length ); + expect(creatorArrayLength).toEqual('0x00000000000000000000000000000003'); + const [creator1, creator2, creator3] = await digitalAsset.getDataBatch([ LSP4_KEYS.LSP4_CREATORS_ARRAY.slice(0, 34) + ethers.utils.hexZeroPad(ethers.utils.hexlify([0]), 16).substring(2), From b0848d25b123508401f7062605f70a51974d912f Mon Sep 17 00:00:00 2001 From: CJ42 Date: Wed, 18 Oct 2023 23:56:18 +0100 Subject: [PATCH 07/17] refactor: use constants from lsp-smart-contracts and ethers packages --- src/lib/classes/lsp7-digtal-asset.spec.ts | 10 +-- .../lsp8-identifiable-digital-asset.spec.ts | 11 ++-- src/lib/classes/proxy-deployer.spec.ts | 15 ++--- src/lib/classes/universal-profile.spec.ts | 61 ++++++++++--------- src/lib/helpers/config.helper.spec.ts | 18 ------ src/lib/helpers/config.helper.ts | 47 -------------- src/lib/helpers/erc725.helper.ts | 7 ++- src/lib/services/base-contract.service.ts | 6 +- src/lib/services/digital-asset.service.ts | 12 ++-- .../universal-profile.service.spec.ts | 32 +++++----- src/lib/services/universal-profile.service.ts | 46 +++++++------- .../services/universal-receiver.service.ts | 5 +- test/digital-asset.utils.ts | 13 ++-- test/test.utils.ts | 3 +- 14 files changed, 111 insertions(+), 175 deletions(-) delete mode 100644 src/lib/helpers/config.helper.spec.ts diff --git a/src/lib/classes/lsp7-digtal-asset.spec.ts b/src/lib/classes/lsp7-digtal-asset.spec.ts index 2ab45014..4db731e0 100644 --- a/src/lib/classes/lsp7-digtal-asset.spec.ts +++ b/src/lib/classes/lsp7-digtal-asset.spec.ts @@ -1,3 +1,4 @@ +import { ERC725YDataKeys } from '@lukso/lsp-smart-contracts'; import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; import { providers } from 'ethers'; import { ethers } from 'hardhat'; @@ -9,6 +10,7 @@ import { LSPFactory, } from '../../../build/main/src/index'; import { testDeployWithSpecifiedCreators } from '../../../test/digital-asset.utils'; +import { JSONURL_KNOWN_HASH_FUNCTIONS } from '../helpers/config.helper'; import { lsp4DigitalAsset } from './../../../test/lsp4-digital-asset.mock'; import { ProxyDeployer } from './proxy-deployer'; @@ -228,12 +230,10 @@ describe('LSP7DigitalAsset', () => { const ownerAddress = await digitalAsset.owner(); expect(ownerAddress).toEqual(controllerAddress); - const data = await digitalAsset.getDataBatch([ - '0x9afb95cacc9f95858ec44aa8c3b685511002e30ae54415823f406128b85b238e', - ]); + const data = await digitalAsset.getData(ERC725YDataKeys.LSP4.LSP4Metadata); - expect(data[0].startsWith('0x6f357c6a')).toBe(true); - expect(data[0]).toEqual(expectedLSP4Value); + expect(data.startsWith(JSONURL_KNOWN_HASH_FUNCTIONS['keccak256(utf8)'])).toBe(true); + expect(data).toEqual(expectedLSP4Value); }); it('should have correct name and symbol set', async () => { const [retrievedName, retrievedSymbol] = await digitalAsset.getDataBatch([ diff --git a/src/lib/classes/lsp8-identifiable-digital-asset.spec.ts b/src/lib/classes/lsp8-identifiable-digital-asset.spec.ts index be9d19e7..a01d3220 100644 --- a/src/lib/classes/lsp8-identifiable-digital-asset.spec.ts +++ b/src/lib/classes/lsp8-identifiable-digital-asset.spec.ts @@ -1,4 +1,4 @@ -import { LSP8_TOKEN_ID_TYPES } from '@lukso/lsp-smart-contracts'; +import { ERC725YDataKeys, LSP8_TOKEN_ID_TYPES } from '@lukso/lsp-smart-contracts'; import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; import { providers } from 'ethers'; import { ethers } from 'hardhat'; @@ -12,6 +12,7 @@ import { } from '../../../build/main/src/index'; import { testDeployWithSpecifiedCreators } from '../../../test/digital-asset.utils'; import { lsp4DigitalAsset } from '../../../test/lsp4-digital-asset.mock'; +import { JSONURL_KNOWN_HASH_FUNCTIONS } from '../helpers/config.helper'; import { ProxyDeployer } from './proxy-deployer'; @@ -290,12 +291,10 @@ describe('LSP8IdentifiableDigitalAsset', () => { const ownerAddress = await digitalAsset.owner(); expect(ownerAddress).toEqual(controllerAddress); - const data = await digitalAsset.getDataBatch([ - '0x9afb95cacc9f95858ec44aa8c3b685511002e30ae54415823f406128b85b238e', - ]); + const data = await digitalAsset.getData(ERC725YDataKeys.LSP4.LSP4Metadata); - expect(data[0].startsWith('0x6f357c6a')).toBe(true); - expect(data[0]).toEqual(expectedLSP4Value); + expect(data.startsWith(JSONURL_KNOWN_HASH_FUNCTIONS['keccak256(utf8)'])).toBe(true); + expect(data).toEqual(expectedLSP4Value); }); it('should have correct name and symbol set', async () => { const [retrievedName, retrievedSymbol] = await digitalAsset.getDataBatch([ diff --git a/src/lib/classes/proxy-deployer.spec.ts b/src/lib/classes/proxy-deployer.spec.ts index abf21deb..fbfeff30 100644 --- a/src/lib/classes/proxy-deployer.spec.ts +++ b/src/lib/classes/proxy-deployer.spec.ts @@ -1,3 +1,4 @@ +import { ERC725YDataKeys } from '@lukso/lsp-smart-contracts'; import { ethers, SignerWithAddress } from 'hardhat'; import { ProxyDeployer } from './proxy-deployer'; @@ -23,16 +24,10 @@ describe('UniversalProfile', () => { ); await erc725AccountProxy.initialize(await signer.getAddress()); - await erc725AccountProxy.setData( - '0x5ef83ad9559033e6e941db7d7c495acdce616347d28e90c7ce47cbfcfcad3bc5', - '0xbeefbeef', - { - from: await signer.getAddress(), - } - ); - const data = await erc725AccountProxy.getData( - '0x5ef83ad9559033e6e941db7d7c495acdce616347d28e90c7ce47cbfcfcad3bc5' - ); + await erc725AccountProxy.setData(ERC725YDataKeys.LSP3.LSP3Profile, '0xbeefbeef', { + from: await signer.getAddress(), + }); + const data = await erc725AccountProxy.getData(ERC725YDataKeys.LSP3.LSP3Profile); expect(data).toEqual('0xbeefbeef'); }); diff --git a/src/lib/classes/universal-profile.spec.ts b/src/lib/classes/universal-profile.spec.ts index 8f1137ba..fda34b3a 100644 --- a/src/lib/classes/universal-profile.spec.ts +++ b/src/lib/classes/universal-profile.spec.ts @@ -1,4 +1,5 @@ import { ERC725 } from '@erc725/erc725.js'; +import { ALL_PERMISSIONS, ERC725YDataKeys } from '@lukso/lsp-smart-contracts'; import KeyManagerContract from '@lukso/lsp-smart-contracts/artifacts/LSP6KeyManager.json'; import UniversalProfileContract from '@lukso/lsp-smart-contracts/artifacts/UniversalProfile.json'; import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; @@ -18,12 +19,7 @@ import { testUPDeployment, } from '../../../test/test.utils'; import { UniversalProfile } from '../../../types/ethers-v5'; -import { - ADDRESS_PERMISSIONS_ARRAY_KEY, - DEFAULT_PERMISSIONS, - LSP3_UP_KEYS, - PREFIX_PERMISSIONS, -} from '../helpers/config.helper'; +import { JSONURL_KNOWN_HASH_FUNCTIONS } from '../helpers/config.helper'; import { getDeployedByteCode } from '../helpers/deployment.helper'; import { ContractNames, DeployedUniversalProfileContracts, DeploymentEvent } from '../interfaces'; @@ -69,12 +65,10 @@ describe('UniversalProfile', () => { universalProfile = UniversalProfile__factory.connect(LSP0ERC725Account.address, signer); - const lsp3Data = await universalProfile.getDataBatch([ - '0x5ef83ad9559033e6e941db7d7c495acdce616347d28e90c7ce47cbfcfcad3bc5', - ]); + const lsp3Data = await universalProfile.getData(ERC725YDataKeys.LSP3.LSP3Profile); - expect(lsp3Data[0].startsWith('0x6f357c6a')).toBe(true); - expect(lsp3Data[0]).toEqual(expectedLSP3Value); + expect(lsp3Data.startsWith(JSONURL_KNOWN_HASH_FUNCTIONS['keccak256(utf8)'])).toBe(true); + expect(lsp3Data).toEqual(expectedLSP3Value); }); }); }); @@ -99,18 +93,19 @@ describe('UniversalProfile', () => { ); }); - it('controller address should have DEFAULT_PERMISSIONS set', async () => { + it('controller address should have ALL_PERMISSIONS set', async () => { const [signerPermissions] = await universalProfile.getDataBatch([ - PREFIX_PERMISSIONS + uniqueController.address.substring(2), + ERC725YDataKeys.LSP6['AddressPermissions:Permissions'] + + uniqueController.address.substring(2), ]); - expect(signerPermissions).toEqual(ERC725.encodePermissions(DEFAULT_PERMISSIONS)); + expect(signerPermissions).toEqual(ALL_PERMISSIONS); }); it('controller address should be registered in AddressPermissions[0] array', async () => { const hexIndex = ethers.utils.hexlify([0]); const key = - ADDRESS_PERMISSIONS_ARRAY_KEY.slice(0, 34) + + ERC725YDataKeys.LSP6['AddressPermissions[]'].index + ethers.utils.hexZeroPad(hexIndex, 16).substring(2); const [result] = await universalProfile.getDataBatch([key]); @@ -135,17 +130,17 @@ describe('UniversalProfile', () => { universalProfile = UniversalProfile__factory.connect(LSP0ERC725Account.address, controller); }); - it('controller address should have DEFAULT_PERMISSIONS set', async () => { + it('controller address should have ALL_PERMISSIONS set', async () => { const [signerPermissions] = await universalProfile.getDataBatch([ - PREFIX_PERMISSIONS + controller.address.substring(2), + ERC725YDataKeys.LSP6['AddressPermissions:Permissions'] + controller.address.substring(2), ]); - expect(signerPermissions).toEqual(ERC725.encodePermissions(DEFAULT_PERMISSIONS)); + expect(signerPermissions).toEqual(ALL_PERMISSIONS); }); it('signer address should have no permissions set', async () => { const [signerPermissions] = await universalProfile.getDataBatch([ - PREFIX_PERMISSIONS + signers[0].address.substring(2), + ERC725YDataKeys.LSP6['AddressPermissions:Permissions'] + signers[0].address.substring(2), ]); expect(signerPermissions).toEqual(ERC725.encodePermissions({})); @@ -173,7 +168,7 @@ describe('UniversalProfile', () => { it('controller address should have custom permissions set', async () => { const [signerPermissions] = await universalProfile.getDataBatch([ - PREFIX_PERMISSIONS + controller.address.substring(2), + ERC725YDataKeys.LSP6['AddressPermissions:Permissions'] + controller.address.substring(2), ]); expect(signerPermissions).toEqual(customPermissions); @@ -214,18 +209,21 @@ describe('UniversalProfile', () => { keyManager = new ethers.Contract(LSP6KeyManager.address, KeyManagerContract.abi, provider); }); - it('1st address should have DEFAULT_PERMISSIONS set', async () => { + it('1st address should have ALL_PERMISSIONS set', async () => { const [signerPermissions] = await universalProfile .connect(signers[0]) - .callStatic.getDataBatch([PREFIX_PERMISSIONS + firstControllerAddress.substring(2)]); + .callStatic.getDataBatch([ + ERC725YDataKeys.LSP6['AddressPermissions:Permissions'] + + firstControllerAddress.substring(2), + ]); - expect(signerPermissions).toEqual(ERC725.encodePermissions(DEFAULT_PERMISSIONS)); + expect(signerPermissions).toEqual(ALL_PERMISSIONS); }); it('1st address should be registered in AddressPermissions[0] array', async () => { const hexIndex = ethers.utils.hexlify([0]); const key = - ADDRESS_PERMISSIONS_ARRAY_KEY.slice(0, 34) + + ERC725YDataKeys.LSP6['AddressPermissions[]'].index + ethers.utils.hexZeroPad(hexIndex, 16).substring(2); const [result] = await universalProfile.connect(signers[0]).callStatic.getDataBatch([key]); @@ -233,10 +231,13 @@ describe('UniversalProfile', () => { expect(checkedsumResult).toEqual(firstControllerAddress); }); - it('2nd address should have DEFAULT_PERMISSIONS set', async () => { + it('2nd address should have ALL_PERMISSIONS set', async () => { const [signerPermissions] = await universalProfile .connect(signers[1]) - .callStatic.getDataBatch([PREFIX_PERMISSIONS + secondControllerAddress.substring(2)]); + .callStatic.getDataBatch([ + ERC725YDataKeys.LSP6['AddressPermissions:Permissions'] + + secondControllerAddress.substring(2), + ]); expect(signerPermissions).toEqual(customPermissions); }); @@ -244,7 +245,7 @@ describe('UniversalProfile', () => { it('2nd address should be registered in AddressPermissions[1] array', async () => { const hexIndex = ethers.utils.hexlify([1]); const key = - ADDRESS_PERMISSIONS_ARRAY_KEY.slice(0, 34) + + ERC725YDataKeys.LSP6['AddressPermissions[]'].index + ethers.utils.hexZeroPad(hexIndex, 16).substring(2); const [result] = await universalProfile.connect(signers[0]).callStatic.getDataBatch([key]); @@ -325,6 +326,7 @@ describe('UniversalProfile', () => { describe('Deployment with only ERC725 baseContract set to true', () => { let deployedContracts: DeployedUniversalProfileContracts; + it('Should deploy only ERC725 Base contract', async () => { deployedContracts = await testUPDeployment( { @@ -337,6 +339,7 @@ describe('UniversalProfile', () => { [signers[0].address] ); }); + it('UP contract bytecode should contain base contract address', async () => { if (!deployedContracts.LSP0ERC725Account) fail(); if (!deployedContracts.LSP0ERC725AccountBaseContract) fail(); @@ -620,7 +623,7 @@ describe('UniversalProfile', () => { ); const data = await universalProfile.getDataBatch([ - LSP3_UP_KEYS.UNIVERSAL_RECEIVER_DELEGATE_KEY, + ERC725YDataKeys.LSP1.LSP1UniversalReceiverDelegate, ]); const checkedsumResult = ethers.utils.getAddress(data[0]); @@ -650,7 +653,7 @@ describe('UniversalProfile', () => { ); const univeralReceiverDelegate = await universalProfile.getDataBatch([ - LSP3_UP_KEYS.UNIVERSAL_RECEIVER_DELEGATE_KEY, + ERC725YDataKeys.LSP1.LSP1UniversalReceiverDelegate, ]); const checkedsumResult = ethers.utils.getAddress(univeralReceiverDelegate[0]); diff --git a/src/lib/helpers/config.helper.spec.ts b/src/lib/helpers/config.helper.spec.ts deleted file mode 100644 index ea1f9d3a..00000000 --- a/src/lib/helpers/config.helper.spec.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { LSP3_UP_KEYS, LSP4_KEYS } from './config.helper'; - -describe('Config Helpper', () => { - it('should use the correct keys', () => { - expect(LSP3_UP_KEYS.LSP3_PROFILE).toEqual( - '0x5ef83ad9559033e6e941db7d7c495acdce616347d28e90c7ce47cbfcfcad3bc5' - ); - expect(LSP3_UP_KEYS.UNIVERSAL_RECEIVER_DELEGATE_KEY).toEqual( - '0x0cfc51aec37c55a4d0b1a65c6255c4bf2fbdf6277f3cc0730c45b828b6db8b47' - ); - expect(LSP4_KEYS.LSP4_CREATORS_ARRAY).toEqual( - '0x114bd03b3a46d48759680d81ebb2b414fda7d030a7105a851867accf1c2352e7' - ); - expect(LSP4_KEYS.LSP4_METADATA).toEqual( - '0x9afb95cacc9f95858ec44aa8c3b685511002e30ae54415823f406128b85b238e' - ); - }); -}); diff --git a/src/lib/helpers/config.helper.ts b/src/lib/helpers/config.helper.ts index 55f852dd..8eb90b54 100644 --- a/src/lib/helpers/config.helper.ts +++ b/src/lib/helpers/config.helper.ts @@ -1,6 +1,3 @@ -import { Permissions } from '@erc725/erc725.js/build/main/src/types/Method'; -import { keccak256 } from '@ethersproject/keccak256'; -import { toUtf8Bytes } from '@ethersproject/strings'; import { version as lspSmartContractsVersion } from '@lukso/lsp-smart-contracts/package.json'; import { Options } from 'ipfs-http-client'; @@ -16,50 +13,6 @@ export const defaultUploadOptions: UploadOptions = { ipfsGateway: defaultIpfsGateway, }; -export const LSP3_UP_KEYS = { - UNIVERSAL_RECEIVER_DELEGATE_KEY: keccak256(toUtf8Bytes('LSP1UniversalReceiverDelegate')), - LSP3_PROFILE: keccak256(toUtf8Bytes('LSP3Profile')), -}; - -export const LSP4_KEYS = { - LSP4_METADATA: keccak256(toUtf8Bytes('LSP4Metadata')), - LSP4_CREATORS_ARRAY: keccak256(toUtf8Bytes('LSP4Creators[]')), - LSP4_CREATORS_MAP_PREFIX: '0x6de85eaf5d982b4e5da00000', -}; - -export const NULL_ADDRESS = '0x0000000000000000000000000000000000000000'; - -export const ADDRESS_PERMISSIONS_ARRAY_KEY = - '0xdf30dba06db6a30e65354d9a64c609861f089545ca58c6b4dbe31a5f338cb0e3'; - -export const PREFIX_PERMISSIONS = '0x4b80742de2bf82acb3630000'; - -// exclude DELEGATECALL for safety -export const DEFAULT_PERMISSIONS: Permissions = { - CHANGEOWNER: true, - EDITPERMISSIONS: true, - ADDCONTROLLER: true, - SETDATA: true, - CALL: true, - STATICCALL: true, - DELEGATECALL: false, - DEPLOY: true, - TRANSFERVALUE: true, - SIGN: true, - SUPER_CALL: true, - SUPER_DELEGATECALL: false, - SUPER_SETDATA: true, - SUPER_STATICCALL: true, - SUPER_TRANSFERVALUE: true, - ENCRYPT: true, - ADDEXTENSIONS: true, - ADDUNIVERSALRECEIVERDELEGATE: true, - CHANGEEXTENSIONS: true, - CHANGEUNIVERSALRECEIVERDELEGATE: true, - DECRYPT: true, - REENTRANCY: true, -}; - export const DEFAULT_CONTRACT_VERSION = lspSmartContractsVersion; export const GAS_PRICE = 10_000_000_000; diff --git a/src/lib/helpers/erc725.helper.ts b/src/lib/helpers/erc725.helper.ts index 3a9e87d0..36b13036 100644 --- a/src/lib/helpers/erc725.helper.ts +++ b/src/lib/helpers/erc725.helper.ts @@ -1,4 +1,5 @@ import { ERC725, ERC725JSONSchema } from '@erc725/erc725.js'; +import { ERC725YDataKeys } from '@lukso/lsp-smart-contracts'; import { providers } from 'ethers'; import { LSP3ProfileDataForEncoding } from '../interfaces/lsp3-profile'; @@ -7,14 +8,14 @@ import { LSP4MetadataForEncoding } from '../interfaces/lsp4-digital-asset'; export const schema: ERC725JSONSchema[] = [ { name: 'LSP3Profile', - key: '0x5ef83ad9559033e6e941db7d7c495acdce616347d28e90c7ce47cbfcfcad3bc5', + key: ERC725YDataKeys.LSP3.LSP3Profile, keyType: 'Singleton', - valueContent: 'JSONURL', valueType: 'bytes', + valueContent: 'JSONURL', }, { name: 'LSP4Metadata', - key: '0x9afb95cacc9f95858ec44aa8c3b685511002e30ae54415823f406128b85b238e', + key: ERC725YDataKeys.LSP4.LSP4Metadata, keyType: 'Singleton', valueType: 'bytes', valueContent: 'JSONURL', diff --git a/src/lib/services/base-contract.service.ts b/src/lib/services/base-contract.service.ts index 30707571..5140656a 100644 --- a/src/lib/services/base-contract.service.ts +++ b/src/lib/services/base-contract.service.ts @@ -15,7 +15,7 @@ import { UniversalProfileInit__factory, } from '../..'; import contractVersions from '../../versions.json'; -import { GAS_PRICE, NULL_ADDRESS } from '../helpers/config.helper'; +import { GAS_PRICE } from '../helpers/config.helper'; import { deployBaseContract, getDeployedByteCode, @@ -23,6 +23,8 @@ import { } from '../helpers/deployment.helper'; import { ContractNames as DigitalAssetContractNames } from '../interfaces/digital-asset-deployment'; +const { AddressZero } = ethersConstants; + export function universalProfileBaseContractsDeployment$( signer: Signer, baseContractsToDeploy$: Observable<[boolean, boolean, boolean]> @@ -124,7 +126,7 @@ export function shouldDeployBaseContract$( providedByteCode?: string ) { const defaultBaseContractBytecode$ = from( - getDeployedByteCode(defaultBaseContractAddress ?? NULL_ADDRESS, provider) + getDeployedByteCode(defaultBaseContractAddress ?? AddressZero, provider) ); const deployProxy = diff --git a/src/lib/services/digital-asset.service.ts b/src/lib/services/digital-asset.service.ts index 308557b9..a479dff8 100644 --- a/src/lib/services/digital-asset.service.ts +++ b/src/lib/services/digital-asset.service.ts @@ -1,5 +1,5 @@ import { Signer } from '@ethersproject/abstract-signer'; -import { INTERFACE_IDS } from '@lukso/lsp-smart-contracts'; +import { ERC725YDataKeys, INTERFACE_IDS } from '@lukso/lsp-smart-contracts'; import axios from 'axios'; import { ContractFactory, ethers } from 'ethers'; import { @@ -23,7 +23,7 @@ import { LSP8MintableInit__factory, } from '../../'; import { LSP4DigitalAssetMetadata } from '../classes/lsp4-digital-asset-metadata'; -import { GAS_BUFFER, GAS_PRICE, LSP4_KEYS } from '../helpers/config.helper'; +import { GAS_BUFFER, GAS_PRICE } from '../helpers/config.helper'; import { convertContractDeploymentOptionsVersion, deployContract, @@ -584,7 +584,7 @@ async function prepareSetDataTransaction( for (let i = 0; i < creators.length; i++) { creatorArrayIndexKeys.push( - LSP4_KEYS.LSP4_CREATORS_ARRAY.slice(0, 34) + + ERC725YDataKeys.LSP4['LSP4Creators[]'].index + ethers.utils.hexZeroPad(ethers.utils.hexlify([i]), 16).substring(2) ); @@ -593,7 +593,7 @@ async function prepareSetDataTransaction( const isUniversalProfile = await addressIsUniversalProfile(creators[i], signer); const creatorInterface = isUniversalProfile ? INTERFACE_IDS.LSP0ERC725Account : '0xffffffff'; - creatorsMapKeys.push(LSP4_KEYS.LSP4_CREATORS_MAP_PREFIX + creators[i].slice(2)); + creatorsMapKeys.push(ERC725YDataKeys.LSP4.LSP4CreatorsMap + creators[i].slice(2)); creatorsMapValues.push( creatorInterface.slice(0, 10) + ethers.utils.hexZeroPad(ethers.utils.hexlify([i]), 8).slice(2) ); @@ -602,7 +602,7 @@ async function prepareSetDataTransaction( const valuesToSet: string[] = []; if (creators.length) { - keysToSet.push(LSP4_KEYS.LSP4_CREATORS_ARRAY); + keysToSet.push(ERC725YDataKeys.LSP4['LSP4Creators[]'].length); keysToSet.push(...creatorArrayIndexKeys); keysToSet.push(...creatorsMapKeys); @@ -612,7 +612,7 @@ async function prepareSetDataTransaction( } if (lsp4Metadata) { - keysToSet.push(LSP4_KEYS.LSP4_METADATA); + keysToSet.push(ERC725YDataKeys.LSP4.LSP4Metadata); valuesToSet.push(lsp4Metadata); } diff --git a/src/lib/services/universal-profile.service.spec.ts b/src/lib/services/universal-profile.service.spec.ts index 1dd06f33..4fbb286b 100644 --- a/src/lib/services/universal-profile.service.spec.ts +++ b/src/lib/services/universal-profile.service.spec.ts @@ -1,13 +1,9 @@ import ERC725 from '@erc725/erc725.js'; +import { ALL_PERMISSIONS, ERC725YDataKeys } from '@lukso/lsp-smart-contracts'; import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; import { ethers } from 'hardhat'; import { deployUniversalProfileContracts } from '../../../test/test.utils'; -import { - ADDRESS_PERMISSIONS_ARRAY_KEY, - DEFAULT_PERMISSIONS, - PREFIX_PERMISSIONS, -} from '../helpers/config.helper'; import { prepareSetDataParameters } from './universal-profile.service'; @@ -44,12 +40,14 @@ describe('LSP3Account Service', () => { expect(universalProfile.address).toEqual(erc725AccountAddress); // AddressPermissions[] array length should be 1 - const totalPermissionsSet = valuesToSet[keysToSet.indexOf(ADDRESS_PERMISSIONS_ARRAY_KEY)]; + const totalPermissionsSet = + valuesToSet[keysToSet.indexOf(ERC725YDataKeys.LSP6['AddressPermissions[]'].length)]; const expectedLength = abiCoder.encode(['uint256'], [2]); expect(totalPermissionsSet).toEqual(expectedLength); // controller address should have default permissions set - const controllerPermissionsKey = PREFIX_PERMISSIONS + signers[0].address.substring(2); + const controllerPermissionsKey = + ERC725YDataKeys.LSP6['AddressPermissions:Permissions'] + signers[0].address.substring(2); const controllerPermissionsValue = valuesToSet[keysToSet.indexOf(controllerPermissionsKey)]; const expectedPermissions = ERC725.encodePermissions({ CHANGEOWNER: true, @@ -61,7 +59,7 @@ describe('LSP3Account Service', () => { const hexIndex = ethers.utils.hexlify([0]); const addressPermissionArrayIndexKey = - ADDRESS_PERMISSIONS_ARRAY_KEY.slice(0, 34) + + ERC725YDataKeys.LSP6['AddressPermissions[]'].index + ethers.utils.hexZeroPad(hexIndex, 16).substring(2); const result = valuesToSet[keysToSet.indexOf(addressPermissionArrayIndexKey)]; @@ -80,7 +78,8 @@ describe('LSP3Account Service', () => { ); // AddressPermissions[] array length should be 2 - const totalPermissionsSet = valuesToSet[keysToSet.indexOf(ADDRESS_PERMISSIONS_ARRAY_KEY)]; + const totalPermissionsSet = + valuesToSet[keysToSet.indexOf(ERC725YDataKeys.LSP6['AddressPermissions[]'].length)]; const expectedLength = abiCoder.encode(['uint256'], [controllerAddresses.length + 1]); expect(totalPermissionsSet).toEqual(expectedLength); @@ -88,7 +87,8 @@ describe('LSP3Account Service', () => { const controllerAddress = controllerAddresses[index]; // controller address should have default permissions set - const controllerPermissionsKey = PREFIX_PERMISSIONS + controllerAddress.substring(2); + const controllerPermissionsKey = + ERC725YDataKeys.LSP6['AddressPermissions:Permissions'] + controllerAddress.substring(2); const controllerPermissionsValue = valuesToSet[keysToSet.indexOf(controllerPermissionsKey)]; const expectedPermissions = ERC725.encodePermissions({ @@ -99,7 +99,7 @@ describe('LSP3Account Service', () => { // controller address in the array at AddressPermissions[index] const hexIndex = ethers.utils.hexlify([index]); - const leftSideKey = ADDRESS_PERMISSIONS_ARRAY_KEY.slice(0, 34); + const leftSideKey = ERC725YDataKeys.LSP6['AddressPermissions[]'].index; const rightSideKey = ethers.utils.hexZeroPad(hexIndex, 16); const addressPermissionArrayIndexKey = leftSideKey + rightSideKey.substring(2); @@ -119,7 +119,8 @@ describe('LSP3Account Service', () => { ); // AddressPermissions[] array length should be 11 (including Universal Receiver Delegate address) - const totalPermissionsSet = valuesToSet[keysToSet.indexOf(ADDRESS_PERMISSIONS_ARRAY_KEY)]; + const totalPermissionsSet = + valuesToSet[keysToSet.indexOf(ERC725YDataKeys.LSP6['AddressPermissions[]'].length)]; const expectedLength = abiCoder.encode(['uint256'], [controllerAddresses.length + 1]); expect(totalPermissionsSet).toEqual(expectedLength); @@ -127,7 +128,8 @@ describe('LSP3Account Service', () => { const controllerAddress = controllerAddresses[index]; // controller address should have default permissions set - const controllerPermissionsKey = PREFIX_PERMISSIONS + controllerAddress.substring(2); + const controllerPermissionsKey = + ERC725YDataKeys.LSP6['AddressPermissions:Permissions'] + controllerAddress.substring(2); const controllerPermissionsValue = valuesToSet[keysToSet.indexOf(controllerPermissionsKey)]; const expectedPermissions = @@ -136,13 +138,13 @@ describe('LSP3Account Service', () => { CHANGEOWNER: true, EDITPERMISSIONS: true, }) - : ERC725.encodePermissions(DEFAULT_PERMISSIONS); + : ALL_PERMISSIONS; expect(controllerPermissionsValue).toEqual(expectedPermissions); // controller address in the array at AddressPermissions[index] const hexIndex = ethers.utils.hexlify([index]); - const leftSideKey = ADDRESS_PERMISSIONS_ARRAY_KEY.slice(0, 34); + const leftSideKey = ERC725YDataKeys.LSP6['AddressPermissions[]'].index; const rightSideKey = ethers.utils.hexZeroPad(hexIndex, 16); const addressPermissionArrayIndexKey = leftSideKey + rightSideKey.substring(2); diff --git a/src/lib/services/universal-profile.service.ts b/src/lib/services/universal-profile.service.ts index 493c5e46..3fdea990 100644 --- a/src/lib/services/universal-profile.service.ts +++ b/src/lib/services/universal-profile.service.ts @@ -1,5 +1,5 @@ import { ERC725 } from '@erc725/erc725.js'; -import { INTERFACE_IDS } from '@lukso/lsp-smart-contracts'; +import { ALL_PERMISSIONS, ERC725YDataKeys, INTERFACE_IDS } from '@lukso/lsp-smart-contracts'; import axios from 'axios'; import { BytesLike, Contract, ContractFactory, ethers, Signer } from 'ethers'; import { concat, defer, EMPTY, forkJoin, from, Observable, of } from 'rxjs'; @@ -11,14 +11,7 @@ import { UniversalProfile__factory, UniversalProfileInit__factory, } from '../..'; -import { - ADDRESS_PERMISSIONS_ARRAY_KEY, - DEFAULT_PERMISSIONS, - GAS_BUFFER, - GAS_PRICE, - LSP3_UP_KEYS, - PREFIX_PERMISSIONS, -} from '../helpers/config.helper'; +import { GAS_BUFFER, GAS_PRICE } from '../helpers/config.helper'; import { convertContractDeploymentOptionsVersion, deployContract, @@ -407,7 +400,7 @@ export async function prepareSetDataParameters( controllers.map((controller, index) => { if (typeof controller === 'string') { controllerAddresses[index] = controller; - controllerPermissions[index] = ERC725.encodePermissions(DEFAULT_PERMISSIONS); + controllerPermissions[index] = ALL_PERMISSIONS; } else { controllerAddresses[index] = controller.address; controllerPermissions[index] = controller.permissions; @@ -416,7 +409,7 @@ export async function prepareSetDataParameters( // see: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-6-KeyManager.md#addresspermissionspermissionsaddress const addressPermissionsKeys = controllerAddresses.map( - (address) => PREFIX_PERMISSIONS + address.substring(2) + (address) => ERC725YDataKeys.LSP6['AddressPermissions:Permissions'] + address.substring(2) ); // see: https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-6-KeyManager.md#addresspermissions @@ -424,7 +417,7 @@ export async function prepareSetDataParameters( const hexIndex = ethers.utils.hexlify([index]); return ( - ADDRESS_PERMISSIONS_ARRAY_KEY.slice(0, 34) + + ERC725YDataKeys.LSP6['AddressPermissions[]'].index + ethers.utils.hexZeroPad(hexIndex, 16).substring(2) ); }); @@ -432,12 +425,14 @@ export async function prepareSetDataParameters( const hexIndex = ethers.utils.hexlify([controllerAddresses.length]); const universalReceiverPermissionIndex = - ADDRESS_PERMISSIONS_ARRAY_KEY.slice(0, 34) + ethers.utils.hexZeroPad(hexIndex, 16).substring(2); + ERC725YDataKeys.LSP6['AddressPermissions[]'].index + + ethers.utils.hexZeroPad(hexIndex, 16).substring(2); const keysToSet = [ - LSP3_UP_KEYS.UNIVERSAL_RECEIVER_DELEGATE_KEY, - PREFIX_PERMISSIONS + universalReceiverDelegateAddress.substring(2), - ADDRESS_PERMISSIONS_ARRAY_KEY, + ERC725YDataKeys.LSP1.LSP1UniversalReceiverDelegate, + ERC725YDataKeys.LSP6['AddressPermissions:Permissions'] + + universalReceiverDelegateAddress.substring(2), + ERC725YDataKeys.LSP6['AddressPermissions[]'].length, ...addressPermissionsArrayElements, // AddressPermission[index] = controllerAddress ...addressPermissionsKeys, // AddressPermissions:Permissions:
= controllerPermission, universalReceiverPermissionIndex, @@ -456,15 +451,20 @@ export async function prepareSetDataParameters( const signerAddress = await signer.getAddress(); if (!controllerAddresses.includes(signerAddress)) { - keysToSet.push(PREFIX_PERMISSIONS + signerAddress.substring(2)); + keysToSet.push( + ERC725YDataKeys.LSP6['AddressPermissions:Permissions'] + signerAddress.substring(2) + ); valuesToSet.push(ERC725.encodePermissions({ CHANGEOWNER: true, EDITPERMISSIONS: true })); } else { - valuesToSet[keysToSet.indexOf(PREFIX_PERMISSIONS + signerAddress.substring(2))] = - ERC725.encodePermissions({ CHANGEOWNER: true, EDITPERMISSIONS: true }); + valuesToSet[ + keysToSet.indexOf( + ERC725YDataKeys.LSP6['AddressPermissions:Permissions'] + signerAddress.substring(2) + ) + ] = ERC725.encodePermissions({ CHANGEOWNER: true, EDITPERMISSIONS: true }); } if (encodedLSP3Profile) { - keysToSet.push(LSP3_UP_KEYS.LSP3_PROFILE); + keysToSet.push(ERC725YDataKeys.LSP3.LSP3Profile); valuesToSet.push(encodedLSP3Profile); } @@ -580,15 +580,13 @@ export async function revokeSignerPermissions( if (controllerAddress.includes(signerAddress)) { const controller = controllers[controllerAddress.indexOf(signerAddress)]; signerPermission = - typeof controller === 'string' - ? ERC725.encodePermissions(DEFAULT_PERMISSIONS) - : controller.permissions ?? ERC725.encodePermissions(DEFAULT_PERMISSIONS); + typeof controller === 'string' ? ALL_PERMISSIONS : controller.permissions ?? ALL_PERMISSIONS; } else { signerPermission = ERC725.encodePermissions({}); } const revokeSignerPermissionsPayload = erc725Account.interface.encodeFunctionData('setData', [ - PREFIX_PERMISSIONS + signerAddress.substring(2), + ERC725YDataKeys.LSP6['AddressPermissions:Permissions'] + signerAddress.substring(2), signerPermission, ]); diff --git a/src/lib/services/universal-receiver.service.ts b/src/lib/services/universal-receiver.service.ts index 543bb35f..eff94fa7 100644 --- a/src/lib/services/universal-receiver.service.ts +++ b/src/lib/services/universal-receiver.service.ts @@ -7,7 +7,6 @@ import { DeploymentEventProxyContract, LSP1UniversalReceiverDelegateUP__factory, } from '../..'; -import { NULL_ADDRESS } from '../helpers/config.helper'; import { deployContract, deployProxyContract, @@ -16,6 +15,8 @@ import { } from '../helpers/deployment.helper'; import { BaseContractAddresses, ContractNames } from '../interfaces'; +const { AddressZero } = ethersConstants; + export type UniversalReceiverDeploymentEvent = | DeploymentEventContract | DeploymentEventProxyContract; @@ -29,7 +30,7 @@ export function universalReceiverDelegateDeployment$( byteCode?: string ) { const defaultURDBytecode$ = from( - getDeployedByteCode(defaultUniversalReceiverAddress ?? NULL_ADDRESS, provider) + getDeployedByteCode(defaultUniversalReceiverAddress ?? AddressZero, provider) ); return forkJoin([defaultURDBytecode$, baseContractAddresses$]).pipe( diff --git a/test/digital-asset.utils.ts b/test/digital-asset.utils.ts index 8570249c..8aa53b4a 100644 --- a/test/digital-asset.utils.ts +++ b/test/digital-asset.utils.ts @@ -1,24 +1,23 @@ import { ethers } from 'ethers'; import { LSP7Mintable, LSP8Mintable } from '../build/main/src'; -import { LSP4_KEYS } from '../src/lib/helpers/config.helper'; -import { INTERFACE_IDS } from '@lukso/lsp-smart-contracts'; +import { ERC725YDataKeys, INTERFACE_IDS } from '@lukso/lsp-smart-contracts'; export async function testDeployWithSpecifiedCreators( digitalAsset: LSP7Mintable | LSP8Mintable, creators: string[] ) { - const creatorArrayLength = await digitalAsset.getData( + const [creatorArrayLength] = await digitalAsset.getData( ERC725YDataKeys.LSP4['LSP4Creators[]'].length ); expect(creatorArrayLength).toEqual('0x00000000000000000000000000000003'); const [creator1, creator2, creator3] = await digitalAsset.getDataBatch([ - LSP4_KEYS.LSP4_CREATORS_ARRAY.slice(0, 34) + + ERC725YDataKeys.LSP4['LSP4Creators[]'].index + ethers.utils.hexZeroPad(ethers.utils.hexlify([0]), 16).substring(2), - LSP4_KEYS.LSP4_CREATORS_ARRAY.slice(0, 34) + + ERC725YDataKeys.LSP4['LSP4Creators[]'].index + ethers.utils.hexZeroPad(ethers.utils.hexlify([1]), 16).substring(2), - LSP4_KEYS.LSP4_CREATORS_ARRAY.slice(0, 34) + + ERC725YDataKeys.LSP4['LSP4Creators[]'].index + ethers.utils.hexZeroPad(ethers.utils.hexlify([2]), 16).substring(2), ]); @@ -27,7 +26,7 @@ export async function testDeployWithSpecifiedCreators( expect(ethers.utils.getAddress(creator3)).toEqual(creators[2]); const creatorKeys = creators.map((creatorAddress) => { - return LSP4_KEYS.LSP4_CREATORS_MAP_PREFIX + creatorAddress.slice(2); + return ERC725YDataKeys.LSP4.LSP4CreatorsMap + creatorAddress.slice(2); }); const creatorValues = await digitalAsset.getDataBatch(creatorKeys); diff --git a/test/test.utils.ts b/test/test.utils.ts index 76f9b346..96d94115 100644 --- a/test/test.utils.ts +++ b/test/test.utils.ts @@ -2,6 +2,7 @@ import crypto from 'crypto'; import { Signer } from '@ethersproject/abstract-signer'; import { NonceManager } from '@ethersproject/experimental'; +import { ERC725YDataKeys } from '@lukso/lsp-smart-contracts'; import { UniversalProfile__factory } from '../types/ethers-v5/factories/UniversalProfile__factory'; import { LSP6KeyManager__factory } from '../types/ethers-v5/factories/LSP6KeyManager__factory'; @@ -79,7 +80,7 @@ function isAddress(address: string) { } export async function testSetData(upAddress: string, keyManagerAddress: string, signer: Signer) { - const key = '0x5ef83ad9559033e6e941db7d7c495acdce616347d28e90c7ce47cbfcfcad3bc5'; + const key = ERC725YDataKeys.LSP3.LSP3Profile; const value = '0x' + crypto.randomBytes(32).toString('hex'); const universalProfile = UniversalProfile__factory.connect(upAddress, signer); From eed59e7b1aec3bd0d16e5832ee319e253a51743d Mon Sep 17 00:00:00 2001 From: CJ42 Date: Thu, 19 Oct 2023 00:02:19 +0100 Subject: [PATCH 08/17] test: simplify tests with `getData` --- .../lsp8-identifiable-digital-asset.spec.ts | 19 ++++-- src/lib/classes/proxy-deployer.spec.ts | 13 ++-- src/lib/classes/universal-profile.spec.ts | 66 +++++++++---------- test/test.utils.ts | 4 +- 4 files changed, 55 insertions(+), 47 deletions(-) diff --git a/src/lib/classes/lsp8-identifiable-digital-asset.spec.ts b/src/lib/classes/lsp8-identifiable-digital-asset.spec.ts index a01d3220..70d2f3ab 100644 --- a/src/lib/classes/lsp8-identifiable-digital-asset.spec.ts +++ b/src/lib/classes/lsp8-identifiable-digital-asset.spec.ts @@ -15,6 +15,7 @@ import { lsp4DigitalAsset } from '../../../test/lsp4-digital-asset.mock'; import { JSONURL_KNOWN_HASH_FUNCTIONS } from '../helpers/config.helper'; import { ProxyDeployer } from './proxy-deployer'; +import ERC725 from '@erc725/erc725.js'; jest.setTimeout(30000); jest.useRealTimers(); @@ -120,6 +121,7 @@ describe('LSP8IdentifiableDigitalAsset', () => { } ); }); + it('Should be compatible with RxJS', (done) => { const myLSPFactory = new LSPFactory(provider, signer); let lsp8Address: string; @@ -287,6 +289,7 @@ describe('LSP8IdentifiableDigitalAsset', () => { signer ); }); + it('should deploy and set LSP4DigitalAsset data', async () => { const ownerAddress = await digitalAsset.owner(); expect(ownerAddress).toEqual(controllerAddress); @@ -296,14 +299,20 @@ describe('LSP8IdentifiableDigitalAsset', () => { expect(data.startsWith(JSONURL_KNOWN_HASH_FUNCTIONS['keccak256(utf8)'])).toBe(true); expect(data).toEqual(expectedLSP4Value); }); - it('should have correct name and symbol set', async () => { - const [retrievedName, retrievedSymbol] = await digitalAsset.getDataBatch([ - '0xdeba1e292f8ba88238e10ab3c7f88bd4be4fac56cad5194b6ecceaf653468af1', - '0x2f0a68ab07768e01943a599e73362a0e17a63a72e94dd2e384d2c1d4db932756', - ]); + + it('should have correct name, symbol and token ID type set', async () => { + const [retrievedName, retrievedSymbol, retrievedTokenIdType] = + await digitalAsset.getDataBatch([ + ERC725YDataKeys.LSP4.LSP4TokenName, + ERC725YDataKeys.LSP4.LSP4TokenSymbol, + ERC725YDataKeys.LSP8.LSP8TokenIdType, + ]); + + const tokenIdTypeDecoded = ethers.BigNumber.from(retrievedTokenIdType).toNumber(); expect(ethers.utils.toUtf8String(retrievedName)).toEqual(name); expect(ethers.utils.toUtf8String(retrievedSymbol)).toEqual(symbol); + expect(tokenIdTypeDecoded).toEqual(tokenIdType); }); }); diff --git a/src/lib/classes/proxy-deployer.spec.ts b/src/lib/classes/proxy-deployer.spec.ts index fbfeff30..acc9dd9a 100644 --- a/src/lib/classes/proxy-deployer.spec.ts +++ b/src/lib/classes/proxy-deployer.spec.ts @@ -1,5 +1,5 @@ -import { ERC725YDataKeys } from '@lukso/lsp-smart-contracts'; import { ethers, SignerWithAddress } from 'hardhat'; +import { hexlify, randomBytes } from 'ethers/lib/utils'; import { ProxyDeployer } from './proxy-deployer'; @@ -17,18 +17,19 @@ describe('UniversalProfile', () => { baseContracts = await proxyDeployer.deployUniversalProfileBaseContracts(); }); - it('should deploy the ERC725Account proxy and setData', async () => { + it('should deploy the ERC725Account proxy and be able to set any data key/value pair', async () => { // LSPAccount const erc725AccountProxy = await proxyDeployer.deployProxyContract( baseContracts.universalProfile ); await erc725AccountProxy.initialize(await signer.getAddress()); - await erc725AccountProxy.setData(ERC725YDataKeys.LSP3.LSP3Profile, '0xbeefbeef', { + const randomDataKey = hexlify(randomBytes(32)); + const randomDataValueExpected = hexlify(randomBytes(4)); + + await erc725AccountProxy.setData(randomDataKey, randomDataValueExpected, { from: await signer.getAddress(), }); - const data = await erc725AccountProxy.getData(ERC725YDataKeys.LSP3.LSP3Profile); - - expect(data).toEqual('0xbeefbeef'); + expect(await erc725AccountProxy.getData(randomDataKey)).toEqual(randomDataValueExpected); }); }); diff --git a/src/lib/classes/universal-profile.spec.ts b/src/lib/classes/universal-profile.spec.ts index fda34b3a..de18837f 100644 --- a/src/lib/classes/universal-profile.spec.ts +++ b/src/lib/classes/universal-profile.spec.ts @@ -94,10 +94,10 @@ describe('UniversalProfile', () => { }); it('controller address should have ALL_PERMISSIONS set', async () => { - const [signerPermissions] = await universalProfile.getDataBatch([ + const signerPermissions = await universalProfile.getData( ERC725YDataKeys.LSP6['AddressPermissions:Permissions'] + - uniqueController.address.substring(2), - ]); + uniqueController.address.substring(2) + ); expect(signerPermissions).toEqual(ALL_PERMISSIONS); }); @@ -108,7 +108,7 @@ describe('UniversalProfile', () => { ERC725YDataKeys.LSP6['AddressPermissions[]'].index + ethers.utils.hexZeroPad(hexIndex, 16).substring(2); - const [result] = await universalProfile.getDataBatch([key]); + const result = await universalProfile.getData(key); const checkedsumResult = ethers.utils.getAddress(result); expect(checkedsumResult).toEqual(uniqueController.address); }); @@ -131,17 +131,17 @@ describe('UniversalProfile', () => { }); it('controller address should have ALL_PERMISSIONS set', async () => { - const [signerPermissions] = await universalProfile.getDataBatch([ - ERC725YDataKeys.LSP6['AddressPermissions:Permissions'] + controller.address.substring(2), - ]); + const signerPermissions = await universalProfile.getData( + ERC725YDataKeys.LSP6['AddressPermissions:Permissions'] + controller.address.substring(2) + ); expect(signerPermissions).toEqual(ALL_PERMISSIONS); }); - it('signer address should have no permissions set', async () => { - const [signerPermissions] = await universalProfile.getDataBatch([ - ERC725YDataKeys.LSP6['AddressPermissions:Permissions'] + signers[0].address.substring(2), - ]); + it('random signer address should have no permissions set', async () => { + const signerPermissions = await universalProfile.getData( + ERC725YDataKeys.LSP6['AddressPermissions:Permissions'] + signers[0].address.substring(2) + ); expect(signerPermissions).toEqual(ERC725.encodePermissions({})); }); @@ -167,9 +167,9 @@ describe('UniversalProfile', () => { }); it('controller address should have custom permissions set', async () => { - const [signerPermissions] = await universalProfile.getDataBatch([ - ERC725YDataKeys.LSP6['AddressPermissions:Permissions'] + controller.address.substring(2), - ]); + const signerPermissions = await universalProfile.getData( + ERC725YDataKeys.LSP6['AddressPermissions:Permissions'] + controller.address.substring(2) + ); expect(signerPermissions).toEqual(customPermissions); }); @@ -180,6 +180,7 @@ describe('UniversalProfile', () => { let keyManager; let firstControllerAddress: string; let secondControllerAddress: string; + const customPermissions = ERC725.encodePermissions({ DELEGATECALL: true, CALL: true, @@ -210,12 +211,9 @@ describe('UniversalProfile', () => { }); it('1st address should have ALL_PERMISSIONS set', async () => { - const [signerPermissions] = await universalProfile - .connect(signers[0]) - .callStatic.getDataBatch([ - ERC725YDataKeys.LSP6['AddressPermissions:Permissions'] + - firstControllerAddress.substring(2), - ]); + const signerPermissions = await universalProfile.getData( + ERC725YDataKeys.LSP6['AddressPermissions:Permissions'] + firstControllerAddress.substring(2) + ); expect(signerPermissions).toEqual(ALL_PERMISSIONS); }); @@ -226,18 +224,18 @@ describe('UniversalProfile', () => { ERC725YDataKeys.LSP6['AddressPermissions[]'].index + ethers.utils.hexZeroPad(hexIndex, 16).substring(2); - const [result] = await universalProfile.connect(signers[0]).callStatic.getDataBatch([key]); + const result = await universalProfile.getData(key); const checkedsumResult = ethers.utils.getAddress(result); expect(checkedsumResult).toEqual(firstControllerAddress); }); it('2nd address should have ALL_PERMISSIONS set', async () => { - const [signerPermissions] = await universalProfile + const signerPermissions = await universalProfile .connect(signers[1]) - .callStatic.getDataBatch([ + .getData( ERC725YDataKeys.LSP6['AddressPermissions:Permissions'] + - secondControllerAddress.substring(2), - ]); + secondControllerAddress.substring(2) + ); expect(signerPermissions).toEqual(customPermissions); }); @@ -248,7 +246,7 @@ describe('UniversalProfile', () => { ERC725YDataKeys.LSP6['AddressPermissions[]'].index + ethers.utils.hexZeroPad(hexIndex, 16).substring(2); - const [result] = await universalProfile.connect(signers[0]).callStatic.getDataBatch([key]); + const result = await universalProfile.getData(key); const checkedsumResult = ethers.utils.getAddress(result); expect(checkedsumResult).toEqual(secondControllerAddress); }); @@ -622,11 +620,11 @@ describe('UniversalProfile', () => { signers[0] ); - const data = await universalProfile.getDataBatch([ - ERC725YDataKeys.LSP1.LSP1UniversalReceiverDelegate, - ]); + const universalReceiverDelegateAddress = await universalProfile.getData( + ERC725YDataKeys.LSP1.LSP1UniversalReceiverDelegate + ); - const checkedsumResult = ethers.utils.getAddress(data[0]); + const checkedsumResult = ethers.utils.getAddress(universalReceiverDelegateAddress); expect(checkedsumResult).toEqual(baseContracts.universalReceiverDelegate.address); }); @@ -652,11 +650,11 @@ describe('UniversalProfile', () => { signers[0] ); - const univeralReceiverDelegate = await universalProfile.getDataBatch([ - ERC725YDataKeys.LSP1.LSP1UniversalReceiverDelegate, - ]); + const universalReceiverDelegateAddress = await universalProfile.getData( + ERC725YDataKeys.LSP1.LSP1UniversalReceiverDelegate + ); - const checkedsumResult = ethers.utils.getAddress(univeralReceiverDelegate[0]); + const checkedsumResult = ethers.utils.getAddress(universalReceiverDelegateAddress); expect(checkedsumResult).toEqual(deployedContracts.LSP1UniversalReceiverDelegate.address); }); diff --git a/test/test.utils.ts b/test/test.utils.ts index 96d94115..617a4747 100644 --- a/test/test.utils.ts +++ b/test/test.utils.ts @@ -93,8 +93,8 @@ export async function testSetData(upAddress: string, keyManagerAddress: string, expect(result).toBeTruthy(); - const data = await universalProfile.getDataBatch([key]); - expect(data).toEqual([value]); + const data = await universalProfile.getData(key); + expect(data).toEqual(value); } export async function testProxyBytecodeContainsAddress( From a1c56363e2c6068e03655f14d38b8f637cec7e1c Mon Sep 17 00:00:00 2001 From: CJ42 Date: Thu, 19 Oct 2023 00:32:48 +0100 Subject: [PATCH 09/17] build: add `.prettierrc` --- .prettierrc | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .prettierrc diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 00000000..6a8af5e9 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,5 @@ +{ + "tabWidth": 2, + "semi": true, + "singleQuote": true +} From 16b66ca6189c4c9cbc200df32203b9382538d7cd Mon Sep 17 00:00:00 2001 From: CJ42 Date: Thu, 19 Oct 2023 00:49:35 +0100 Subject: [PATCH 10/17] feat: add `keccak256(utf8)` constant in helpers --- src/lib/helpers/config.helper.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lib/helpers/config.helper.ts b/src/lib/helpers/config.helper.ts index 8eb90b54..2f7b98c6 100644 --- a/src/lib/helpers/config.helper.ts +++ b/src/lib/helpers/config.helper.ts @@ -15,5 +15,10 @@ export const defaultUploadOptions: UploadOptions = { export const DEFAULT_CONTRACT_VERSION = lspSmartContractsVersion; +// TODO: add this constant inside the `@lukso/lsp-smart-contracts` package +export const JSONURL_KNOWN_HASH_FUNCTIONS = { + 'keccak256(utf8)': '0x6f357c6a', +}; + export const GAS_PRICE = 10_000_000_000; export const GAS_BUFFER = 100_000; From bb2540024b9b5ba6dd2a1cc3e49c81ca0b1eac7d Mon Sep 17 00:00:00 2001 From: CJ42 Date: Thu, 19 Oct 2023 00:58:56 +0100 Subject: [PATCH 11/17] chore: fix incorrect file name --- .../{lsp7-digtal-asset.spec.ts => lsp7-digital-asset.spec.ts} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename src/lib/classes/{lsp7-digtal-asset.spec.ts => lsp7-digital-asset.spec.ts} (99%) diff --git a/src/lib/classes/lsp7-digtal-asset.spec.ts b/src/lib/classes/lsp7-digital-asset.spec.ts similarity index 99% rename from src/lib/classes/lsp7-digtal-asset.spec.ts rename to src/lib/classes/lsp7-digital-asset.spec.ts index 4db731e0..21b9be67 100644 --- a/src/lib/classes/lsp7-digtal-asset.spec.ts +++ b/src/lib/classes/lsp7-digital-asset.spec.ts @@ -10,9 +10,9 @@ import { LSPFactory, } from '../../../build/main/src/index'; import { testDeployWithSpecifiedCreators } from '../../../test/digital-asset.utils'; +import { lsp4DigitalAsset } from '../../../test/lsp4-digital-asset.mock'; import { JSONURL_KNOWN_HASH_FUNCTIONS } from '../helpers/config.helper'; -import { lsp4DigitalAsset } from './../../../test/lsp4-digital-asset.mock'; import { ProxyDeployer } from './proxy-deployer'; jest.setTimeout(30000); From 82ec98de815e1d1b4e06a5a04dfe67b04a118c18 Mon Sep 17 00:00:00 2001 From: CJ42 Date: Thu, 19 Oct 2023 11:50:13 +0100 Subject: [PATCH 12/17] build: add address of deployed contracts versions --- src/versions.json | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/versions.json b/src/versions.json index a27b71f7..2aea2b89 100644 --- a/src/versions.json +++ b/src/versions.json @@ -7,35 +7,40 @@ "ERC725Account": { "versions": { "0.10.3": "0x40114F4f71C3551f79CBfdaa63F41741fA7eC86D", - "0.11.1": "0xc1716883d30069f26743acc63722de2a52a258b4" + "0.11.1": "0xc1716883d30069f26743acc63722de2a52a258b4", + "0.12.0-rc.0": "0x6ce5A2a09a12e1782BF7E0183f727f7d02508ED3" }, "baseContract": true }, "KeyManager": { "versions": { "0.10.3": "0xDDF7D4650007Bb117c9e3ec29C7263e7D8344211", - "0.11.1": "0x8ed15cca37cff8d3bf80d0fb96cfba5608b8610a" + "0.11.1": "0x8ed15cca37cff8d3bf80d0fb96cfba5608b8610a", + "0.12.0-rc.0": "0xC386092DC6727C2A440F53F9A05Ace85FC5F64D4" }, "baseContract": true }, "UniversalReceiverDelegate": { "versions": { "0.10.3": "0x3a181401d642ff76eacc13db4fecf4761de135d2", - "0.11.1": "0x9b1eF52DdEc3b8414FbE359ed7826334729ab97E" + "0.11.1": "0x9b1eF52DdEc3b8414FbE359ed7826334729ab97E", + "0.12.0-rc.0": "0xA20454137b47440C71fE4DD203D25D69F0b34535" }, "baseContract": false }, "LSP7Mintable": { "versions": { "0.10.3": "0xaf45071fcf03564108f0cf82ba34932fe257565e", - "0.11.1": "0xd684F8642268484e22E64d86fDc8F6D8D9e930d5" + "0.11.1": "0xd684F8642268484e22E64d86fDc8F6D8D9e930d5", + "0.12.0-rc.0": "0x5Db67F2dCa10ac8DF1c7FB6EA7ed4DCdBCEdb853" }, "baseContract": true }, "LSP8Mintable": { "versions": { "0.10.3": "0xB8e8a2Db3Dcbc8384B62F28165998BB78Db209F3", - "0.11.1": "0x5453551C4256F0ccE92DF7D3dcaeCd90E80b0a2f" + "0.11.1": "0x5453551C4256F0ccE92DF7D3dcaeCd90E80b0a2f", + "0.12.0-rc.0": "0xB7d1d9d8C388D1F5A77A204823A0fb22aeaC22e3" }, "baseContract": true } From 919c5a4078169a4a5e60735b6a7d313a8b2ea106 Mon Sep 17 00:00:00 2001 From: CJ42 Date: Thu, 19 Oct 2023 11:55:39 +0100 Subject: [PATCH 13/17] fix: encode LSP2 array length as 16 bytes long --- src/lib/classes/lsp8-identifiable-digital-asset.spec.ts | 1 - src/lib/classes/proxy-deployer.spec.ts | 2 +- src/lib/services/universal-profile.service.spec.ts | 7 +++---- src/lib/services/universal-profile.service.ts | 2 +- test/digital-asset.utils.ts | 2 +- 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/lib/classes/lsp8-identifiable-digital-asset.spec.ts b/src/lib/classes/lsp8-identifiable-digital-asset.spec.ts index 70d2f3ab..f0e83a4d 100644 --- a/src/lib/classes/lsp8-identifiable-digital-asset.spec.ts +++ b/src/lib/classes/lsp8-identifiable-digital-asset.spec.ts @@ -15,7 +15,6 @@ import { lsp4DigitalAsset } from '../../../test/lsp4-digital-asset.mock'; import { JSONURL_KNOWN_HASH_FUNCTIONS } from '../helpers/config.helper'; import { ProxyDeployer } from './proxy-deployer'; -import ERC725 from '@erc725/erc725.js'; jest.setTimeout(30000); jest.useRealTimers(); diff --git a/src/lib/classes/proxy-deployer.spec.ts b/src/lib/classes/proxy-deployer.spec.ts index acc9dd9a..196a70cb 100644 --- a/src/lib/classes/proxy-deployer.spec.ts +++ b/src/lib/classes/proxy-deployer.spec.ts @@ -1,5 +1,5 @@ -import { ethers, SignerWithAddress } from 'hardhat'; import { hexlify, randomBytes } from 'ethers/lib/utils'; +import { ethers, SignerWithAddress } from 'hardhat'; import { ProxyDeployer } from './proxy-deployer'; diff --git a/src/lib/services/universal-profile.service.spec.ts b/src/lib/services/universal-profile.service.spec.ts index 4fbb286b..7cdebdc0 100644 --- a/src/lib/services/universal-profile.service.spec.ts +++ b/src/lib/services/universal-profile.service.spec.ts @@ -17,7 +17,6 @@ describe('LSP3Account Service', () => { }); describe('prepareSetDataParameters', () => { - let abiCoder; let universalProfile, universalReceiverDelegate; beforeAll(async () => { @@ -42,7 +41,7 @@ describe('LSP3Account Service', () => { // AddressPermissions[] array length should be 1 const totalPermissionsSet = valuesToSet[keysToSet.indexOf(ERC725YDataKeys.LSP6['AddressPermissions[]'].length)]; - const expectedLength = abiCoder.encode(['uint256'], [2]); + const expectedLength = ethers.utils.hexZeroPad(2, 16); expect(totalPermissionsSet).toEqual(expectedLength); // controller address should have default permissions set @@ -80,7 +79,7 @@ describe('LSP3Account Service', () => { // AddressPermissions[] array length should be 2 const totalPermissionsSet = valuesToSet[keysToSet.indexOf(ERC725YDataKeys.LSP6['AddressPermissions[]'].length)]; - const expectedLength = abiCoder.encode(['uint256'], [controllerAddresses.length + 1]); + const expectedLength = ethers.utils.hexZeroPad(controllerAddresses.length + 1, 16); expect(totalPermissionsSet).toEqual(expectedLength); for (let index = 0; index < controllerAddresses.length; index++) { @@ -121,7 +120,7 @@ describe('LSP3Account Service', () => { // AddressPermissions[] array length should be 11 (including Universal Receiver Delegate address) const totalPermissionsSet = valuesToSet[keysToSet.indexOf(ERC725YDataKeys.LSP6['AddressPermissions[]'].length)]; - const expectedLength = abiCoder.encode(['uint256'], [controllerAddresses.length + 1]); + const expectedLength = ethers.utils.hexZeroPad(controllerAddresses.length + 1, 16); expect(totalPermissionsSet).toEqual(expectedLength); for (let index = 0; index < controllerAddresses.length; index++) { diff --git a/src/lib/services/universal-profile.service.ts b/src/lib/services/universal-profile.service.ts index 3fdea990..6160084f 100644 --- a/src/lib/services/universal-profile.service.ts +++ b/src/lib/services/universal-profile.service.ts @@ -441,7 +441,7 @@ export async function prepareSetDataParameters( const valuesToSet = [ universalReceiverDelegateAddress, ERC725.encodePermissions({ SUPER_SETDATA: true, REENTRANCY: true }), - ethers.utils.defaultAbiCoder.encode(['uint256'], [controllerPermissions.length + 1]), + ethers.utils.hexZeroPad(ethers.utils.hexlify(controllerAddresses.length + 1), 16), ...controllerAddresses, ...controllerPermissions, universalReceiverDelegateAddress, diff --git a/test/digital-asset.utils.ts b/test/digital-asset.utils.ts index 8aa53b4a..dc094366 100644 --- a/test/digital-asset.utils.ts +++ b/test/digital-asset.utils.ts @@ -6,7 +6,7 @@ export async function testDeployWithSpecifiedCreators( digitalAsset: LSP7Mintable | LSP8Mintable, creators: string[] ) { - const [creatorArrayLength] = await digitalAsset.getData( + const creatorArrayLength = await digitalAsset.getData( ERC725YDataKeys.LSP4['LSP4Creators[]'].length ); From 4f98ecf601f5dfd1e933ac4fcb3be10b98b72d9e Mon Sep 17 00:00:00 2001 From: CJ42 Date: Mon, 23 Oct 2023 15:09:29 +0100 Subject: [PATCH 14/17] refactor: use type from erc725.js --- src/lib/classes/lsp7-digital-asset.spec.ts | 4 ++-- src/lib/classes/lsp8-identifiable-digital-asset.spec.ts | 4 ++-- src/lib/classes/universal-profile.spec.ts | 6 ++++-- src/lib/helpers/config.helper.ts | 5 ----- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/lib/classes/lsp7-digital-asset.spec.ts b/src/lib/classes/lsp7-digital-asset.spec.ts index 21b9be67..d6a95fac 100644 --- a/src/lib/classes/lsp7-digital-asset.spec.ts +++ b/src/lib/classes/lsp7-digital-asset.spec.ts @@ -1,3 +1,4 @@ +import { SUPPORTED_HASH_FUNCTION_HASHES } from '@erc725/erc725.js/build/main/src/constants/constants'; import { ERC725YDataKeys } from '@lukso/lsp-smart-contracts'; import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; import { providers } from 'ethers'; @@ -11,7 +12,6 @@ import { } from '../../../build/main/src/index'; import { testDeployWithSpecifiedCreators } from '../../../test/digital-asset.utils'; import { lsp4DigitalAsset } from '../../../test/lsp4-digital-asset.mock'; -import { JSONURL_KNOWN_HASH_FUNCTIONS } from '../helpers/config.helper'; import { ProxyDeployer } from './proxy-deployer'; @@ -232,7 +232,7 @@ describe('LSP7DigitalAsset', () => { const data = await digitalAsset.getData(ERC725YDataKeys.LSP4.LSP4Metadata); - expect(data.startsWith(JSONURL_KNOWN_HASH_FUNCTIONS['keccak256(utf8)'])).toBe(true); + expect(data.startsWith(SUPPORTED_HASH_FUNCTION_HASHES.HASH_KECCAK256_UTF8)).toBe(true); expect(data).toEqual(expectedLSP4Value); }); it('should have correct name and symbol set', async () => { diff --git a/src/lib/classes/lsp8-identifiable-digital-asset.spec.ts b/src/lib/classes/lsp8-identifiable-digital-asset.spec.ts index f0e83a4d..0e7d8bf0 100644 --- a/src/lib/classes/lsp8-identifiable-digital-asset.spec.ts +++ b/src/lib/classes/lsp8-identifiable-digital-asset.spec.ts @@ -1,3 +1,4 @@ +import { SUPPORTED_HASH_FUNCTION_HASHES } from '@erc725/erc725.js/build/main/src/constants/constants'; import { ERC725YDataKeys, LSP8_TOKEN_ID_TYPES } from '@lukso/lsp-smart-contracts'; import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; import { providers } from 'ethers'; @@ -12,7 +13,6 @@ import { } from '../../../build/main/src/index'; import { testDeployWithSpecifiedCreators } from '../../../test/digital-asset.utils'; import { lsp4DigitalAsset } from '../../../test/lsp4-digital-asset.mock'; -import { JSONURL_KNOWN_HASH_FUNCTIONS } from '../helpers/config.helper'; import { ProxyDeployer } from './proxy-deployer'; @@ -295,7 +295,7 @@ describe('LSP8IdentifiableDigitalAsset', () => { const data = await digitalAsset.getData(ERC725YDataKeys.LSP4.LSP4Metadata); - expect(data.startsWith(JSONURL_KNOWN_HASH_FUNCTIONS['keccak256(utf8)'])).toBe(true); + expect(data.startsWith(SUPPORTED_HASH_FUNCTION_HASHES.HASH_KECCAK256_UTF8)).toBe(true); expect(data).toEqual(expectedLSP4Value); }); diff --git a/src/lib/classes/universal-profile.spec.ts b/src/lib/classes/universal-profile.spec.ts index de18837f..05e8c219 100644 --- a/src/lib/classes/universal-profile.spec.ts +++ b/src/lib/classes/universal-profile.spec.ts @@ -1,4 +1,5 @@ import { ERC725 } from '@erc725/erc725.js'; +import { SUPPORTED_HASH_FUNCTION_HASHES } from '@erc725/erc725.js/build/main/src/constants/constants'; import { ALL_PERMISSIONS, ERC725YDataKeys } from '@lukso/lsp-smart-contracts'; import KeyManagerContract from '@lukso/lsp-smart-contracts/artifacts/LSP6KeyManager.json'; import UniversalProfileContract from '@lukso/lsp-smart-contracts/artifacts/UniversalProfile.json'; @@ -19,7 +20,6 @@ import { testUPDeployment, } from '../../../test/test.utils'; import { UniversalProfile } from '../../../types/ethers-v5'; -import { JSONURL_KNOWN_HASH_FUNCTIONS } from '../helpers/config.helper'; import { getDeployedByteCode } from '../helpers/deployment.helper'; import { ContractNames, DeployedUniversalProfileContracts, DeploymentEvent } from '../interfaces'; @@ -67,7 +67,9 @@ describe('UniversalProfile', () => { const lsp3Data = await universalProfile.getData(ERC725YDataKeys.LSP3.LSP3Profile); - expect(lsp3Data.startsWith(JSONURL_KNOWN_HASH_FUNCTIONS['keccak256(utf8)'])).toBe(true); + expect(lsp3Data.startsWith(SUPPORTED_HASH_FUNCTION_HASHES.HASH_KECCAK256_UTF8)).toBe( + true + ); expect(lsp3Data).toEqual(expectedLSP3Value); }); }); diff --git a/src/lib/helpers/config.helper.ts b/src/lib/helpers/config.helper.ts index 2f7b98c6..8eb90b54 100644 --- a/src/lib/helpers/config.helper.ts +++ b/src/lib/helpers/config.helper.ts @@ -15,10 +15,5 @@ export const defaultUploadOptions: UploadOptions = { export const DEFAULT_CONTRACT_VERSION = lspSmartContractsVersion; -// TODO: add this constant inside the `@lukso/lsp-smart-contracts` package -export const JSONURL_KNOWN_HASH_FUNCTIONS = { - 'keccak256(utf8)': '0x6f357c6a', -}; - export const GAS_PRICE = 10_000_000_000; export const GAS_BUFFER = 100_000; From bb44150c1c045a0d3a756bb5d09adffc1df8226a Mon Sep 17 00:00:00 2001 From: CJ42 Date: Tue, 31 Oct 2023 08:44:46 +0000 Subject: [PATCH 15/17] build: upgrade erc725.js + lsp-smart-contracts --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index abb7e406..0bc9066e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "@erc725/erc725.js": "^0.21.0", "@ethersproject/abi": "^5.7.0", "@ethersproject/experimental": "^5.7.0", - "@lukso/lsp-smart-contracts": "^0.12.0-rc.0", + "@lukso/lsp-smart-contracts": "^0.12.0", "axios": "^0.23.0", "browser-image-compression": "^2.0.0", "ethers": "^5.7.0", @@ -3810,9 +3810,9 @@ } }, "node_modules/@lukso/lsp-smart-contracts": { - "version": "0.12.0-rc.0", - "resolved": "https://registry.npmjs.org/@lukso/lsp-smart-contracts/-/lsp-smart-contracts-0.12.0-rc.0.tgz", - "integrity": "sha512-yyX5AbsPCfOwH/tVUQp4Arf3ysKviqoPI9UBbAkImWjxQCocI6K1PBKCH77kCeuOFzpPBGcHo4LqlSkhbqvYNw==", + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/@lukso/lsp-smart-contracts/-/lsp-smart-contracts-0.12.0.tgz", + "integrity": "sha512-isF4Ts5VScJqZJkTxNc4T9U60jbVGj6OCxfXijXUGP+ZsOFHuWf9EOFRljA+m5yeVa47XC7vZPuMptMUQS/FNA==", "dependencies": { "@account-abstraction/contracts": "^0.6.0", "@erc725/smart-contracts": "^6.0.0", @@ -33254,9 +33254,9 @@ } }, "@lukso/lsp-smart-contracts": { - "version": "0.12.0-rc.0", - "resolved": "https://registry.npmjs.org/@lukso/lsp-smart-contracts/-/lsp-smart-contracts-0.12.0-rc.0.tgz", - "integrity": "sha512-yyX5AbsPCfOwH/tVUQp4Arf3ysKviqoPI9UBbAkImWjxQCocI6K1PBKCH77kCeuOFzpPBGcHo4LqlSkhbqvYNw==", + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/@lukso/lsp-smart-contracts/-/lsp-smart-contracts-0.12.0.tgz", + "integrity": "sha512-isF4Ts5VScJqZJkTxNc4T9U60jbVGj6OCxfXijXUGP+ZsOFHuWf9EOFRljA+m5yeVa47XC7vZPuMptMUQS/FNA==", "requires": { "@account-abstraction/contracts": "^0.6.0", "@erc725/smart-contracts": "^6.0.0", diff --git a/package.json b/package.json index 3c49d2c9..5163a194 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "@erc725/erc725.js": "^0.21.0", "@ethersproject/abi": "^5.7.0", "@ethersproject/experimental": "^5.7.0", - "@lukso/lsp-smart-contracts": "^0.12.0-rc.0", + "@lukso/lsp-smart-contracts": "^0.12.0", "axios": "^0.23.0", "browser-image-compression": "^2.0.0", "ethers": "^5.7.0", From adbaadcb2e68a7b0e1e171055165875ebee2e30d Mon Sep 17 00:00:00 2001 From: CallumGrindle Date: Fri, 3 Nov 2023 09:42:29 +0100 Subject: [PATCH 16/17] fix: add v12 base contract versions --- src/versions.json | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/versions.json b/src/versions.json index 2aea2b89..5643ce58 100644 --- a/src/versions.json +++ b/src/versions.json @@ -8,7 +8,8 @@ "versions": { "0.10.3": "0x40114F4f71C3551f79CBfdaa63F41741fA7eC86D", "0.11.1": "0xc1716883d30069f26743acc63722de2a52a258b4", - "0.12.0-rc.0": "0x6ce5A2a09a12e1782BF7E0183f727f7d02508ED3" + "0.12.0-rc.0": "0x6ce5A2a09a12e1782BF7E0183f727f7d02508ED3", + "0.12.0": "0xF95ae7ABD05D5aB39fBf8Cc128c1b5C6C8171e7f" }, "baseContract": true }, @@ -16,7 +17,8 @@ "versions": { "0.10.3": "0xDDF7D4650007Bb117c9e3ec29C7263e7D8344211", "0.11.1": "0x8ed15cca37cff8d3bf80d0fb96cfba5608b8610a", - "0.12.0-rc.0": "0xC386092DC6727C2A440F53F9A05Ace85FC5F64D4" + "0.12.0-rc.0": "0xC386092DC6727C2A440F53F9A05Ace85FC5F64D4", + "0.12.0": "0xb228510D275b86ffF65829dD5be51bAD96b536D0" }, "baseContract": true }, @@ -24,7 +26,8 @@ "versions": { "0.10.3": "0x3a181401d642ff76eacc13db4fecf4761de135d2", "0.11.1": "0x9b1eF52DdEc3b8414FbE359ed7826334729ab97E", - "0.12.0-rc.0": "0xA20454137b47440C71fE4DD203D25D69F0b34535" + "0.12.0-rc.0": "0xA20454137b47440C71fE4DD203D25D69F0b34535", + "0.12.0": "0x4555ed733f58Da8Cc6A2Fd6A050874192Ac97985" }, "baseContract": false }, @@ -32,7 +35,8 @@ "versions": { "0.10.3": "0xaf45071fcf03564108f0cf82ba34932fe257565e", "0.11.1": "0xd684F8642268484e22E64d86fDc8F6D8D9e930d5", - "0.12.0-rc.0": "0x5Db67F2dCa10ac8DF1c7FB6EA7ed4DCdBCEdb853" + "0.12.0-rc.0": "0x5Db67F2dCa10ac8DF1c7FB6EA7ed4DCdBCEdb853", + "0.12.0": "0x75d56CE25DdFa3760f7cC216B939519Bc9Da079B" }, "baseContract": true }, @@ -40,7 +44,8 @@ "versions": { "0.10.3": "0xB8e8a2Db3Dcbc8384B62F28165998BB78Db209F3", "0.11.1": "0x5453551C4256F0ccE92DF7D3dcaeCd90E80b0a2f", - "0.12.0-rc.0": "0xB7d1d9d8C388D1F5A77A204823A0fb22aeaC22e3" + "0.12.0-rc.0": "0xB7d1d9d8C388D1F5A77A204823A0fb22aeaC22e3", + "0.12.0": "0x1B7799CB9bEDF8CcB6e8C3F992F35d35c9AC9823" }, "baseContract": true } From 1a4e2108cf81ad646e7f0cfc0571924d863fc889 Mon Sep 17 00:00:00 2001 From: CallumGrindle Date: Fri, 3 Nov 2023 09:55:20 +0100 Subject: [PATCH 17/17] fix: erc725.js imports --- src/lib/classes/lsp7-digital-asset.spec.ts | 6 ++++-- src/lib/classes/lsp8-identifiable-digital-asset.spec.ts | 6 ++++-- src/lib/classes/universal-profile.spec.ts | 8 ++++---- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/lib/classes/lsp7-digital-asset.spec.ts b/src/lib/classes/lsp7-digital-asset.spec.ts index d6a95fac..bd1b3e88 100644 --- a/src/lib/classes/lsp7-digital-asset.spec.ts +++ b/src/lib/classes/lsp7-digital-asset.spec.ts @@ -1,4 +1,4 @@ -import { SUPPORTED_HASH_FUNCTION_HASHES } from '@erc725/erc725.js/build/main/src/constants/constants'; +import { SUPPORTED_VERIFICATION_FUNCTION_HASHES } from '@erc725/erc725.js/build/main/src/constants/constants'; import { ERC725YDataKeys } from '@lukso/lsp-smart-contracts'; import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; import { providers } from 'ethers'; @@ -232,7 +232,9 @@ describe('LSP7DigitalAsset', () => { const data = await digitalAsset.getData(ERC725YDataKeys.LSP4.LSP4Metadata); - expect(data.startsWith(SUPPORTED_HASH_FUNCTION_HASHES.HASH_KECCAK256_UTF8)).toBe(true); + expect(data.startsWith(SUPPORTED_VERIFICATION_FUNCTION_HASHES.HASH_KECCAK256_UTF8)).toBe( + true + ); expect(data).toEqual(expectedLSP4Value); }); it('should have correct name and symbol set', async () => { diff --git a/src/lib/classes/lsp8-identifiable-digital-asset.spec.ts b/src/lib/classes/lsp8-identifiable-digital-asset.spec.ts index 0e7d8bf0..75c32bc4 100644 --- a/src/lib/classes/lsp8-identifiable-digital-asset.spec.ts +++ b/src/lib/classes/lsp8-identifiable-digital-asset.spec.ts @@ -1,4 +1,4 @@ -import { SUPPORTED_HASH_FUNCTION_HASHES } from '@erc725/erc725.js/build/main/src/constants/constants'; +import { SUPPORTED_VERIFICATION_FUNCTION_HASHES } from '@erc725/erc725.js/build/main/src/constants/constants'; import { ERC725YDataKeys, LSP8_TOKEN_ID_TYPES } from '@lukso/lsp-smart-contracts'; import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; import { providers } from 'ethers'; @@ -295,7 +295,9 @@ describe('LSP8IdentifiableDigitalAsset', () => { const data = await digitalAsset.getData(ERC725YDataKeys.LSP4.LSP4Metadata); - expect(data.startsWith(SUPPORTED_HASH_FUNCTION_HASHES.HASH_KECCAK256_UTF8)).toBe(true); + expect(data.startsWith(SUPPORTED_VERIFICATION_FUNCTION_HASHES.HASH_KECCAK256_UTF8)).toBe( + true + ); expect(data).toEqual(expectedLSP4Value); }); diff --git a/src/lib/classes/universal-profile.spec.ts b/src/lib/classes/universal-profile.spec.ts index 05e8c219..86f8d168 100644 --- a/src/lib/classes/universal-profile.spec.ts +++ b/src/lib/classes/universal-profile.spec.ts @@ -1,5 +1,5 @@ import { ERC725 } from '@erc725/erc725.js'; -import { SUPPORTED_HASH_FUNCTION_HASHES } from '@erc725/erc725.js/build/main/src/constants/constants'; +import { SUPPORTED_VERIFICATION_FUNCTION_HASHES } from '@erc725/erc725.js/build/main/src/constants/constants'; import { ALL_PERMISSIONS, ERC725YDataKeys } from '@lukso/lsp-smart-contracts'; import KeyManagerContract from '@lukso/lsp-smart-contracts/artifacts/LSP6KeyManager.json'; import UniversalProfileContract from '@lukso/lsp-smart-contracts/artifacts/UniversalProfile.json'; @@ -67,9 +67,9 @@ describe('UniversalProfile', () => { const lsp3Data = await universalProfile.getData(ERC725YDataKeys.LSP3.LSP3Profile); - expect(lsp3Data.startsWith(SUPPORTED_HASH_FUNCTION_HASHES.HASH_KECCAK256_UTF8)).toBe( - true - ); + expect( + lsp3Data.startsWith(SUPPORTED_VERIFICATION_FUNCTION_HASHES.HASH_KECCAK256_UTF8) + ).toBe(true); expect(lsp3Data).toEqual(expectedLSP3Value); }); });