Skip to content

Commit

Permalink
refactor!: change LSP3 to SupportedStandards:LSP3Profile (#664)
Browse files Browse the repository at this point in the history
* refactor!: change LSP3 to SupportedStandards:LSP3Profile

* chore: resolve import issues

---------

Co-authored-by: Jean Cvllr <31145285+CJ42@users.noreply.github.com>
  • Loading branch information
YamenMerhi and CJ42 authored Aug 10, 2023
1 parent c6cc1a4 commit ec87441
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 13 deletions.
8 changes: 4 additions & 4 deletions constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ export type LSPSupportedStandard = { key: string; value: string };
* and contain a set of pre-defined ERC725Y Data Keys.
*/
export const SupportedStandards = {
LSP3UniversalProfile: {
key: '0xeafec4d89fa9619884b60000abe425d64acd861a49b8ddf5c0b6962110481f38',
value: '0xabe425d6',
LSP3Profile: {
key: '0xeafec4d89fa9619884b600005ef83ad9559033e6e941db7d7c495acdce616347',
value: '0x5ef83ad9',
} as LSPSupportedStandard,
LSP4DigitalAsset: {
key: '0xeafec4d89fa9619884b60000a4d96624a38f7ac2d8d9a604ecf07c12c77e480c',
Expand All @@ -123,7 +123,7 @@ export const ERC725YDataKeys = {
'0x0cfc51aec37c55a4d0b1a65c6255c4bf2fbdf6277f3cc0730c45b828b6db8b47',
},
LSP3: {
SupportedStandards_LSP3: SupportedStandards.LSP3UniversalProfile.key,
SupportedStandards_LSP3: SupportedStandards.LSP3Profile.key,

// keccak256('LSP3Profile')
LSP3Profile: '0x5ef83ad9559033e6e941db7d7c495acdce616347d28e90c7ce47cbfcfcad3bc5',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// SPDX-License-Identifier: CC0-1.0
pragma solidity ^0.8.4;

// bytes10(keccak256('SupportedStandards')) + bytes2(0) + bytes20(keccak256('LSP3UniversalProfile'))
bytes32 constant _LSP3_SUPPORTED_STANDARDS_KEY = 0xeafec4d89fa9619884b60000abe425d64acd861a49b8ddf5c0b6962110481f38;
// bytes10(keccak256('SupportedStandards')) + bytes2(0) + bytes20(keccak256('LSP3Profile'))
bytes32 constant _LSP3_SUPPORTED_STANDARDS_KEY = 0xeafec4d89fa9619884b600005ef83ad9559033e6e941db7d7c495acdce616347;

// bytes4(keccak256('LSP3UniversalProfile'))
bytes constant _LSP3_SUPPORTED_STANDARDS_VALUE = hex"abe425d6";
bytes constant _LSP3_SUPPORTED_STANDARDS_VALUE = hex"5ef83ad9";

// bytes32(keccak256("LSP3Profile"))
bytes32 constant _LSP3_PROFILE_KEY = 0x5ef83ad9559033e6e941db7d7c495acdce616347d28e90c7ce47cbfcfcad3bc5;
2 changes: 1 addition & 1 deletion contracts/UniversalProfile.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {LSP0ERC725Account} from "./LSP0ERC725Account/LSP0ERC725Account.sol";
import {
_LSP3_SUPPORTED_STANDARDS_KEY,
_LSP3_SUPPORTED_STANDARDS_VALUE
} from "./LSP3UniversalProfile/LSP3Constants.sol";
} from "./LSP3ProfileMetadata/LSP3Constants.sol";

/**
* @title implementation of a LUKSO's Universal Profile based on LSP3
Expand Down
2 changes: 1 addition & 1 deletion contracts/UniversalProfileInitAbstract.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
import {
_LSP3_SUPPORTED_STANDARDS_KEY,
_LSP3_SUPPORTED_STANDARDS_VALUE
} from "./LSP3UniversalProfile/LSP3Constants.sol";
} from "./LSP3ProfileMetadata/LSP3Constants.sol";

/**
* @title Inheritable Proxy implementation of a LUKSO's Universal Profile based on LSP3
Expand Down
6 changes: 2 additions & 4 deletions tests/UniversalProfile.behaviour.ts
Original file line number Diff line number Diff line change
Expand Up @@ -616,11 +616,9 @@ export const shouldInitializeLikeLSP3 = (buildContext: () => Promise<LSP3TestCon
});

it("should have set key 'SupportedStandards:LSP3UniversalProfile'", async () => {
const result = await context.universalProfile.getData(
SupportedStandards.LSP3UniversalProfile.key,
);
const result = await context.universalProfile.getData(SupportedStandards.LSP3Profile.key);

expect(result).to.equal(SupportedStandards.LSP3UniversalProfile.value);
expect(result).to.equal(SupportedStandards.LSP3Profile.value);
});
});
};

0 comments on commit ec87441

Please sign in to comment.