From 230be3cfe8dcbfddc2f220b72490a2638fa3fdfc Mon Sep 17 00:00:00 2001 From: Hugo Masclet Date: Mon, 25 Jul 2022 08:47:15 -0500 Subject: [PATCH 1/5] docs: add isomorphic-fetch --- README.md | 2 ++ docs/getting-started.md | 6 ++++++ docs/writing-data.md | 12 ------------ 3 files changed, 8 insertions(+), 12 deletions(-) delete mode 100644 docs/writing-data.md diff --git a/README.md b/README.md index a3f444a8..f5f81e6d 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,8 @@ import { ERC725 } from '@erc725/erc725.js'; import ERC725 from '@erc725/erc725.js'; ``` +If you install it on the backend side, you may need to also install [`isomorphic-fetch`](https://www.npmjs.com/package/isomorphic-fetch). + ## Example Instantiation ```js diff --git a/docs/getting-started.md b/docs/getting-started.md index 7f82715b..124425c1 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -19,6 +19,12 @@ The `@erc725/erc725.js` package allows you to interact with the ERC-725 schemas npm install @erc725/erc725.js ``` +:::info + +If you install it on the backend side, you may need to also install [`isomorphic-fetch`](https://www.npmjs.com/package/isomorphic-fetch). + +::: + ## Instantiation ```js diff --git a/docs/writing-data.md b/docs/writing-data.md deleted file mode 100644 index 4c0620d6..00000000 --- a/docs/writing-data.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -sidebar_label: Writing Data -sidebar_position: 4 ---- - -# Writing Data - -#### How to write data to the ERC725Account key-value store? - -The `erc725.js` library cannot write or relay data to the blockchain. However, developers can use its utility methods to prepare data for writing to the blockchain. This section will provide an guide for using such functionality. - -TODO From 9118885378a1420b7284960a2686d28e571ec5da Mon Sep 17 00:00:00 2001 From: Mitchell Tucker Date: Wed, 17 Aug 2022 14:11:48 -0600 Subject: [PATCH 2/5] Fix value type for AllowedERC725YKeys Specified in docs https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-6-KeyManager.md#addresspermissionsallowederc725ykeysaddress --- schemas/LSP6KeyManager.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/schemas/LSP6KeyManager.json b/schemas/LSP6KeyManager.json index 6c4f3952..cfdb53eb 100644 --- a/schemas/LSP6KeyManager.json +++ b/schemas/LSP6KeyManager.json @@ -38,7 +38,7 @@ "name": "AddressPermissions:AllowedERC725YKeys:
", "key": "0x4b80742de2bf90b8b4850000
", "keyType": "MappingWithGrouping", - "valueType": "bytes4[]", - "valueContent": "Bytes4" + "valueType": "bytes32[]", + "valueContent": "Bytes32" } ] From 9960ae7e2e8a387bc2abe22d60008538b666a6e6 Mon Sep 17 00:00:00 2001 From: Hugo Masclet Date: Thu, 8 Sep 2022 16:11:52 +0200 Subject: [PATCH 3/5] docs: reorder valueType and valueContent --- docs/getting-started.md | 6 +++--- docs/schemas.md | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/getting-started.md b/docs/getting-started.md index 124425c1..1807e107 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -38,22 +38,22 @@ const schemas = [ name: 'SupportedStandards:LSP3UniversalProfile', key: '0xeafec4d89fa9619884b60000abe425d64acd861a49b8ddf5c0b6962110481f38', keyType: 'Mapping', - valueContent: '0xabe425d6', valueType: 'bytes', + valueContent: '0xabe425d6', }, { name: 'LSP3Profile', key: '0x5ef83ad9559033e6e941db7d7c495acdce616347d28e90c7ce47cbfcfcad3bc5', keyType: 'Singleton', - valueContent: 'JSONURL', valueType: 'bytes', + valueContent: 'JSONURL', }, { name: 'LSP1UniversalReceiverDelegate', key: '0x0cfc51aec37c55a4d0b1a65c6255c4bf2fbdf6277f3cc0730c45b828b6db8b47', keyType: 'Singleton', - valueContent: 'Address', valueType: 'address', + valueContent: 'Address', }, ]; diff --git a/docs/schemas.md b/docs/schemas.md index 5c5bbca3..b8fb1c38 100644 --- a/docs/schemas.md +++ b/docs/schemas.md @@ -15,8 +15,8 @@ _A quick reference for keys used in schema definitions can be seen below_ - `name`: An arbitrary name - `key`: The sha3 hash of the name - `keyType`: One of the supported erc725 keyTypes -- `valueContent`: The described content type for parsing - `valueType`: The type of the content data in store for decoding +- `valueContent`: The described content type for parsing ## Standard LSP Schemas From 279c0b4b3775e60a284a9cee2c8a140a872f72f3 Mon Sep 17 00:00:00 2001 From: Jean Cvllr <31145285+CJ42@users.noreply.github.com> Date: Wed, 14 Sep 2022 12:20:25 +0100 Subject: [PATCH 4/5] feat!: add LSP6 `ENCRYPT` permission in for encrypt/decrypt permissions methods. (#223) * feat!: add `ENCRYPT` permission for `encode/decodePermission` methods * test: update tests with ENCRYPT permission * docs: update docs with ENCRYPT + SUPER permissions --- docs/classes/ERC725.md | 10 ++++++++-- src/index.test.ts | 10 +++++++++- src/index.ts | 1 + src/lib/constants.ts | 11 ++++++----- src/types/Method.ts | 1 + 5 files changed, 25 insertions(+), 8 deletions(-) diff --git a/docs/classes/ERC725.md b/docs/classes/ERC725.md index f3299c14..8a0f6433 100644 --- a/docs/classes/ERC725.md +++ b/docs/classes/ERC725.md @@ -590,6 +590,12 @@ ERC725.encodePermissions({ DEPLOY: false, TRANSFERVALUE: true, SIGN: false, + ENCRYPT: false, + SUPER_SETDATA: false, + SUPER_TRANSFERVALUE: false, + SUPER_CALL: false, + SUPER_STATICCALL: false, + SUPER_DELEGATECALL: false }), // '0x0000000000000000000000000000000000000000000000000000000000000110' @@ -1122,11 +1128,11 @@ Checks if a signature was signed by the `owner` of the ERC725 Account contract, #### Parameters -##### 1. `messageOrHash` - String +##### 1. `messageOrHash` - String Value of a message or hash that needs to be verified. -##### 2. `signature` - String +##### 2. `signature` - String The raw RLP encoded signature. diff --git a/src/index.test.ts b/src/index.test.ts index e7329fdf..27986b17 100644 --- a/src/index.test.ts +++ b/src/index.test.ts @@ -917,13 +917,14 @@ describe('Running @erc725/erc725.js tests...', () => { DEPLOY: true, TRANSFERVALUE: true, SIGN: true, + ENCRYPT: true, SUPER_SETDATA: false, SUPER_TRANSFERVALUE: false, SUPER_CALL: false, SUPER_STATICCALL: false, SUPER_DELEGATECALL: false, }, - hex: '0x00000000000000000000000000000000000000000000000000000000000003ff', + hex: '0x00000000000000000000000000000000000000000000000000000000000007ff', }, { permissions: { @@ -937,6 +938,7 @@ describe('Running @erc725/erc725.js tests...', () => { DEPLOY: false, TRANSFERVALUE: false, SIGN: false, + ENCRYPT: false, SUPER_SETDATA: false, SUPER_TRANSFERVALUE: false, SUPER_CALL: false, @@ -957,6 +959,7 @@ describe('Running @erc725/erc725.js tests...', () => { DEPLOY: false, TRANSFERVALUE: true, SIGN: true, + ENCRYPT: false, SUPER_SETDATA: false, SUPER_TRANSFERVALUE: false, SUPER_CALL: false, @@ -977,6 +980,7 @@ describe('Running @erc725/erc725.js tests...', () => { DEPLOY: false, TRANSFERVALUE: false, SIGN: false, + ENCRYPT: false, SUPER_SETDATA: false, SUPER_TRANSFERVALUE: false, SUPER_CALL: false, @@ -997,6 +1001,7 @@ describe('Running @erc725/erc725.js tests...', () => { DEPLOY: false, TRANSFERVALUE: false, SIGN: false, + ENCRYPT: false, SUPER_SETDATA: false, SUPER_TRANSFERVALUE: false, SUPER_CALL: false, @@ -1017,6 +1022,7 @@ describe('Running @erc725/erc725.js tests...', () => { DEPLOY: false, TRANSFERVALUE: true, SIGN: false, + ENCRYPT: false, SUPER_SETDATA: false, SUPER_TRANSFERVALUE: false, SUPER_CALL: false, @@ -1090,6 +1096,7 @@ describe('Running @erc725/erc725.js tests...', () => { DEPLOY: true, TRANSFERVALUE: true, SIGN: true, + ENCRYPT: true, SUPER_SETDATA: true, SUPER_TRANSFERVALUE: true, SUPER_CALL: true, @@ -1112,6 +1119,7 @@ describe('Running @erc725/erc725.js tests...', () => { DEPLOY: true, TRANSFERVALUE: true, SIGN: true, + ENCRYPT: true, SUPER_SETDATA: true, SUPER_TRANSFERVALUE: true, SUPER_CALL: true, diff --git a/src/index.ts b/src/index.ts index fce66fff..1a364255 100644 --- a/src/index.ts +++ b/src/index.ts @@ -604,6 +604,7 @@ export class ERC725 { DEPLOY: false, TRANSFERVALUE: false, SIGN: false, + ENCRYPT: false, SUPER_SETDATA: false, SUPER_TRANSFERVALUE: false, SUPER_CALL: false, diff --git a/src/lib/constants.ts b/src/lib/constants.ts index 63f05cb4..a9ff1f9d 100644 --- a/src/lib/constants.ts +++ b/src/lib/constants.ts @@ -154,16 +154,17 @@ export const LSP6_DEFAULT_PERMISSIONS = { TRANSFERVALUE: '0x0000000000000000000000000000000000000000000000000000000000000100', SIGN: '0x0000000000000000000000000000000000000000000000000000000000000200', + ENCRYPT: '0x0000000000000000000000000000000000000000000000000000000000000400', SUPER_SETDATA: - '0x0000000000000000000000000000000000000000000000000000000000000400', - SUPER_TRANSFERVALUE: '0x0000000000000000000000000000000000000000000000000000000000000800', - SUPER_CALL: + SUPER_TRANSFERVALUE: '0x0000000000000000000000000000000000000000000000000000000000001000', - SUPER_STATICCALL: + SUPER_CALL: '0x0000000000000000000000000000000000000000000000000000000000002000', - SUPER_DELEGATECALL: + SUPER_STATICCALL: '0x0000000000000000000000000000000000000000000000000000000000004000', + SUPER_DELEGATECALL: + '0x0000000000000000000000000000000000000000000000000000000000008000', }; export const LSP6_ALL_PERMISSIONS = diff --git a/src/types/Method.ts b/src/types/Method.ts index c28fb15d..f6daef40 100644 --- a/src/types/Method.ts +++ b/src/types/Method.ts @@ -35,6 +35,7 @@ export interface Permissions { DEPLOY?: boolean; TRANSFERVALUE?: boolean; SIGN?: boolean; + ENCRYPT?: boolean; SUPER_SETDATA?: boolean; SUPER_TRANSFERVALUE?: boolean; SUPER_CALL?: boolean; From 6551997d61184f8055a37a2f6e59a89be81f562d Mon Sep 17 00:00:00 2001 From: Callum Grindle Date: Wed, 14 Sep 2022 13:49:35 +0200 Subject: [PATCH 5/5] chore(release): 0.15.0 (#225) --- 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 eac7fbc6..4d38a9e4 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. +## [0.15.0](https://github.com/ERC725Alliance/erc725.js/compare/v0.14.4...v0.15.0) (2022-09-14) + + +### ⚠ BREAKING CHANGES + +* add LSP6 `ENCRYPT` permission in for encrypt/decrypt permissions methods. (#223) + ### [0.14.4](https://github.com/ERC725Alliance/erc725.js/compare/v0.14.3...v0.14.4) (2022-07-25) ### Features diff --git a/package-lock.json b/package-lock.json index ed7379d7..0e79a2f9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@erc725/erc725.js", - "version": "0.14.4", + "version": "0.15.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@erc725/erc725.js", - "version": "0.14.4", + "version": "0.15.0", "license": "Apache-2.0", "dependencies": { "ethereumjs-util": "^7.1.4", diff --git a/package.json b/package.json index 15a74eb5..cdfd29aa 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@erc725/erc725.js", - "version": "0.14.4", + "version": "0.15.0", "description": "Library to interact with ERC725 smart contracts", "main": "build/main/src/index.js", "typings": "build/main/src/index.d.ts",