From a8b8ce89893eef4ccb3f92f60fd5ecf86882f88f Mon Sep 17 00:00:00 2001 From: Fabian Vogelsteller Date: Wed, 18 Oct 2023 14:07:41 +0200 Subject: [PATCH 1/2] Update schemas.md --- docs/schemas.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/schemas.md b/docs/schemas.md index 91549769..1d133093 100644 --- a/docs/schemas.md +++ b/docs/schemas.md @@ -45,4 +45,7 @@ import LSP5 from '@erc725/erc725.js/schemas/LSP5ReceivedAssets.json'; // Later use them on instantiation const myErc725Contract = new ERC725js(LSP3, address, web3.currentProvider); + +// You can retrieve the current loaded schema via +myErc725Contract.options.schemas ``` From 3d143f59fb9589019fadbd9a0c2d5e6c9eae68a7 Mon Sep 17 00:00:00 2001 From: CJ42 Date: Wed, 18 Oct 2023 13:59:08 +0100 Subject: [PATCH 2/2] refactor: update LSP interface IDs --- src/constants/interfaces.ts | 17 ++++++++++------- src/index.test.ts | 4 ++-- src/lib/detector.test.ts | 6 +++--- src/lib/detector.ts | 6 +++--- 4 files changed, 18 insertions(+), 15 deletions(-) diff --git a/src/constants/interfaces.ts b/src/constants/interfaces.ts index c2530c88..25e93087 100644 --- a/src/constants/interfaces.ts +++ b/src/constants/interfaces.ts @@ -12,22 +12,25 @@ along with @erc725/erc725.js. If not, see . */ -// from @lukso/lsp-smart-contracts v0.10.2, erc725.js should stay independent -export const INTERFACE_IDS_0_10_2 = { +// from @lukso/lsp-smart-contracts v0.12.0, erc725.js should stay independent +export const INTERFACE_IDS_0_12_0 = { ERC1271: '0x1626ba7e', ERC725X: '0x7545acac', ERC725Y: '0x629aa694', - LSP0ERC725Account: '0x3e89ad98', + LSP0ERC725Account: '0x24871b3d', LSP1UniversalReceiver: '0x6bb56a14', - LSP6KeyManager: '0x38bb3cdb', - LSP7DigitalAsset: '0xda1f85e4', - LSP8IdentifiableDigitalAsset: '0x622e7a01', + LSP1UniversalReceiverDelegate: '0xa245bbda', + LSP6KeyManager: '0x23f34c62', + LSP7DigitalAsset: '0x05519512', + LSP8IdentifiableDigitalAsset: '0x1ae9ba1f', LSP9Vault: '0x28af17e6', + LSP11BasicSocialRecovery: '0x049a28f1', LSP14Ownable2Step: '0x94be5999', LSP17Extendable: '0xa918fa6b', LSP17Extension: '0xcee78b40', LSP20CallVerification: '0x1a0eb6a5', - LSP20CallVerifier: '0x480c0ec2', + LSP20CallVerifier: '0x0d6ecac7', + LSP25ExecuteRelayCall: '0x5ac79908', }; export interface AddressProviderOptions { diff --git a/src/index.test.ts b/src/index.test.ts index 36d077e4..93aef0b0 100644 --- a/src/index.test.ts +++ b/src/index.test.ts @@ -48,7 +48,7 @@ import { SUPPORTED_HASH_FUNCTION_STRINGS, } from './constants/constants'; import { decodeKey } from './lib/decodeData'; -import { INTERFACE_IDS_0_10_2 } from './constants/interfaces'; +import { INTERFACE_IDS_0_12_0 } from './constants/interfaces'; const address = '0x0c03fba782b07bcf810deb3b7f0595024a444f4e'; @@ -1392,7 +1392,7 @@ describe('supportsInterface', () => { chaiAssert.typeOf(erc725Instance.supportsInterface, 'function'); }); - const interfaceId = INTERFACE_IDS_0_10_2.LSP1UniversalReceiver; + const interfaceId = INTERFACE_IDS_0_12_0.LSP1UniversalReceiver; const rpcUrl = 'https://my.test.provider'; const contractAddress = '0xcafecafecafecafecafecafecafecafecafecafe'; diff --git a/src/lib/detector.test.ts b/src/lib/detector.test.ts index 907b6a94..bfde55c0 100644 --- a/src/lib/detector.test.ts +++ b/src/lib/detector.test.ts @@ -22,7 +22,7 @@ import { expect } from 'chai'; import * as sinon from 'sinon'; -import { INTERFACE_IDS_0_10_2 } from '../constants/interfaces'; +import { INTERFACE_IDS_0_12_0 } from '../constants/interfaces'; import { supportsInterface, checkPermissions } from './detector'; @@ -34,7 +34,7 @@ describe('supportsInterface', () => { const providerStub = { supportsInterface: sinon.stub() }; providerStub.supportsInterface - .withArgs(contractAddress, INTERFACE_IDS_0_10_2[interfaceName]) + .withArgs(contractAddress, INTERFACE_IDS_0_12_0[interfaceName]) .returns(Promise.resolve(true)); const doesSupportInterface = await supportsInterface(interfaceName, { @@ -47,7 +47,7 @@ describe('supportsInterface', () => { it('it should return true if the contract supports the interface with interfaceId', async () => { const contractAddress = '0xcafecafecafecafecafecafecafecafecafecafe'; - const interfaceId = INTERFACE_IDS_0_10_2.LSP1UniversalReceiver; + const interfaceId = INTERFACE_IDS_0_12_0.LSP1UniversalReceiver; const providerStub = { supportsInterface: sinon.stub() }; diff --git a/src/lib/detector.ts b/src/lib/detector.ts index e4979117..b60fb638 100644 --- a/src/lib/detector.ts +++ b/src/lib/detector.ts @@ -25,7 +25,7 @@ import { LSP6_DEFAULT_PERMISSIONS } from '../constants/constants'; import { AddressProviderOptions, - INTERFACE_IDS_0_10_2, + INTERFACE_IDS_0_12_0, } from '../constants/interfaces'; /** @@ -41,8 +41,8 @@ export const supportsInterface = async ( options: AddressProviderOptions, ): Promise => { let plainInterfaceId: string; - if (INTERFACE_IDS_0_10_2[interfaceIdOrName]) { - plainInterfaceId = INTERFACE_IDS_0_10_2[interfaceIdOrName]; + if (INTERFACE_IDS_0_12_0[interfaceIdOrName]) { + plainInterfaceId = INTERFACE_IDS_0_12_0[interfaceIdOrName]; } else { plainInterfaceId = interfaceIdOrName; }