From 0b7a93be46146de18785118b757a4a5de0bffd85 Mon Sep 17 00:00:00 2001 From: Fabian Vogelsteller Date: Wed, 30 Mar 2022 14:10:45 +0500 Subject: [PATCH 01/13] improved example titles encodeData --- docs/classes/ERC725.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/classes/ERC725.md b/docs/classes/ERC725.md index 3bfc2895..e02357c5 100644 --- a/docs/classes/ERC725.md +++ b/docs/classes/ERC725.md @@ -104,7 +104,7 @@ An object with the same keys as the object that was passed in as a parameter con #### Example -```javascript title="Encoding object with one key" +```javascript title="Encode a JSONURL with json and uploaded URL" const encodedDataOneKey = erc725.encodeData({ LSP3Profile: { json: profileJson, // check instantiation.js to see the actual JSON @@ -121,7 +121,7 @@ const encodedDataOneKey = erc725.encodeData({ */ ``` -```javascript title="Encoding object with one key" +```javascript title="Encode a JSONURL with json, hash function, hash and uploaded URL" const encodedDataOneKeyV2 = erc725.encodeData({ LSP3Profile: { hashFunction: 'keccak256(utf8)', @@ -140,7 +140,7 @@ const encodedDataOneKeyV2 = erc725.encodeData({ */ ``` -```javascript title="Encoding object with multiple keys" +```javascript title="Encode multiple keys at once" const encodedDataManyKeys = erc725.encodeData({ LSP3Profile: { hashFunction: 'keccak256(utf8)', From 866ba2cdc231a111c4fdd54884e8bd04fb11646c Mon Sep 17 00:00:00 2001 From: Hugo Masclet Date: Thu, 3 Aug 2023 12:22:31 +0200 Subject: [PATCH 02/13] chore(release): 0.18.0 --- CHANGELOG.md | 23 ++++++++++++++++++++++- package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 09d380e1..1f5c284d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,28 @@ 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.18.0](https://github.com/ERC725Alliance/erc725.js/compare/v0.17.2...v0.18.0) (2023-08-03) + +### ⚠ BREAKING CHANGES + +- new encoding for static value types (not arrays `[]`) (#288) +- change `ArrayLength` value from `uint256` to `uint128` (#287) + +### Features + +- add checkPermissions function ([17d2258](https://github.com/ERC725Alliance/erc725.js/commit/17d225843c236951ef1515a0ff91095b5ef27cd3)) +- Add new feature "Decode Mapping Key" ([8c1f1fc](https://github.com/ERC725Alliance/erc725.js/commit/8c1f1fcfb15fa43d1d3934b0b15f09d47902bb41)) + +### Bug Fixes + +- decode any uint256 as number not string ([#289](https://github.com/ERC725Alliance/erc725.js/issues/289)) ([37203f1](https://github.com/ERC725Alliance/erc725.js/commit/37203f14d313a0caff75724dc74175c741c1b540)) +- variable naming ([44b4785](https://github.com/ERC725Alliance/erc725.js/commit/44b47851ed63b817edc21c63655d67bac13a7e7f)) + +### improvement + +- change `ArrayLength` value from `uint256` to `uint128` ([#287](https://github.com/ERC725Alliance/erc725.js/issues/287)) ([c95ee8a](https://github.com/ERC725Alliance/erc725.js/commit/c95ee8a53bf25bcf47777054af27cae1fbad8b2f)) +- new encoding for static value types (not arrays `[]`) ([#288](https://github.com/ERC725Alliance/erc725.js/issues/288)) ([f0b04da](https://github.com/ERC725Alliance/erc725.js/commit/f0b04daa57a281c537a8f28594439573188f0dce)) + ### [0.17.2](https://github.com/ERC725Alliance/erc725.js/compare/v0.17.1...v0.17.2) (2023-03-14) - removed ERC725JSONSchemaKeyType duplicate value ([060ee6c](https://github.com/ERC725Alliance/erc725.js/commit/060ee6ce23bda328f727140419de7590f48fc394)) @@ -103,7 +125,6 @@ Minor update to update the LSP-2 schemas. ### improvement -- change fetchData output to non object ([1d4d570](https://github.com/ERC725Alliance/erc725.js/commit/1d4d57077a7766b3490477efb20f194fc4e00da4)) - fetchData as same output as decodeData ([59c3a87](https://github.com/ERC725Alliance/erc725.js/commit/59c3a879fefb2b9bfe46b9bea91ff6bd2a528df1)) - getData as same output as decodeData ([0f3b149](https://github.com/ERC725Alliance/erc725.js/commit/0f3b149f2280e6025a05e8e9ed306facfa63601a)) - use array for decodeData ([261d100](https://github.com/ERC725Alliance/erc725.js/commit/261d1007f4ff63abd9d794f4e64e5b408ce7c1a3)) diff --git a/package-lock.json b/package-lock.json index 01181bfa..d068a9f6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@erc725/erc725.js", - "version": "0.17.2", + "version": "0.18.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@erc725/erc725.js", - "version": "0.17.2", + "version": "0.18.0", "license": "Apache-2.0", "dependencies": { "ethereumjs-util": "^7.1.5", diff --git a/package.json b/package.json index 217f6c87..25e73534 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@erc725/erc725.js", - "version": "0.17.2", + "version": "0.18.0", "description": "Library to interact with ERC725 smart contracts", "main": "build/main/src/index.js", "typings": "build/main/src/index.d.ts", From 100d42becf2478d98d8e9f40356089edb8012a08 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 5 Oct 2023 09:56:42 +0000 Subject: [PATCH 03/13] chore(main): release 0.19.0 --- CHANGELOG.md | 30 ++++++++++++++++++++++++++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 33 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1f5c284d..71b2249f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,36 @@ 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.19.0](https://github.com/ERC725Alliance/erc725.js/compare/v0.18.0...v0.19.0) (2023-10-05) + + +### ⚠ BREAKING CHANGES + +* change LSP3 to SupportedStandards:LSP3Profile ([#307](https://github.com/ERC725Alliance/erc725.js/issues/307)) +* new encoding for static value types (not arrays `[]`) ([#288](https://github.com/ERC725Alliance/erc725.js/issues/288)) +* change `ArrayLength` value from `uint256` to `uint128` ([#287](https://github.com/ERC725Alliance/erc725.js/issues/287)) + +### Features + +* add checkPermissions function ([17d2258](https://github.com/ERC725Alliance/erc725.js/commit/17d225843c236951ef1515a0ff91095b5ef27cd3)) +* add schemas for LSP8 + LSP17 ([#311](https://github.com/ERC725Alliance/erc725.js/issues/311)) ([1e8dbf7](https://github.com/ERC725Alliance/erc725.js/commit/1e8dbf765c6c5e250539b402e9bd5a395966a8c2)) + + +### Bug Fixes + +* decode any uint256 as number not string ([#289](https://github.com/ERC725Alliance/erc725.js/issues/289)) ([37203f1](https://github.com/ERC725Alliance/erc725.js/commit/37203f14d313a0caff75724dc74175c741c1b540)) +* dependencies & example ([#302](https://github.com/ERC725Alliance/erc725.js/issues/302)) ([9979e89](https://github.com/ERC725Alliance/erc725.js/commit/9979e89e438cd9f7cc586d7dc271de969f13b125)) +* incorrect value in schema for array length in `...Map` ([#310](https://github.com/ERC725Alliance/erc725.js/issues/310)) ([0d28b13](https://github.com/ERC725Alliance/erc725.js/commit/0d28b1317dc085078090a8babacf4db517d91a87)) +* Remove hardcoded require ([5279278](https://github.com/ERC725Alliance/erc725.js/commit/527927812b1a05b13f8dc6b14aecaa6d24e98d61)) +* variable naming ([44b4785](https://github.com/ERC725Alliance/erc725.js/commit/44b47851ed63b817edc21c63655d67bac13a7e7f)) + + +### Code Refactoring + +* change `ArrayLength` value from `uint256` to `uint128` ([#287](https://github.com/ERC725Alliance/erc725.js/issues/287)) ([c95ee8a](https://github.com/ERC725Alliance/erc725.js/commit/c95ee8a53bf25bcf47777054af27cae1fbad8b2f)) +* change LSP3 to SupportedStandards:LSP3Profile ([#307](https://github.com/ERC725Alliance/erc725.js/issues/307)) ([73f3481](https://github.com/ERC725Alliance/erc725.js/commit/73f34818fe152c3ab5299177adc0eddfed6886c5)) +* new encoding for static value types (not arrays `[]`) ([#288](https://github.com/ERC725Alliance/erc725.js/issues/288)) ([f0b04da](https://github.com/ERC725Alliance/erc725.js/commit/f0b04daa57a281c537a8f28594439573188f0dce)) + ## [0.18.0](https://github.com/ERC725Alliance/erc725.js/compare/v0.17.2...v0.18.0) (2023-08-03) ### ⚠ BREAKING CHANGES diff --git a/package-lock.json b/package-lock.json index d068a9f6..7029f5ea 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@erc725/erc725.js", - "version": "0.18.0", + "version": "0.19.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@erc725/erc725.js", - "version": "0.18.0", + "version": "0.19.0", "license": "Apache-2.0", "dependencies": { "ethereumjs-util": "^7.1.5", diff --git a/package.json b/package.json index 25e73534..0e326f26 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@erc725/erc725.js", - "version": "0.18.0", + "version": "0.19.0", "description": "Library to interact with ERC725 smart contracts", "main": "build/main/src/index.js", "typings": "build/main/src/index.d.ts", From 2aaeeb17125f069b691b81ba6c24f603cdaae4ed Mon Sep 17 00:00:00 2001 From: Fabian Vogelsteller Date: Wed, 18 Oct 2023 14:07:41 +0200 Subject: [PATCH 04/13] 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 4c5860d32a7f59e8dc8766dcd6525ae036ed9dec Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 18 Oct 2023 12:47:44 +0000 Subject: [PATCH 05/13] chore(main): release 0.20.0 --- 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 71b2249f..93c639e1 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.20.0](https://github.com/ERC725Alliance/erc725.js/compare/v0.19.0...v0.20.0) (2023-10-18) + + +### Features + +* add permission `EXECUTE_RELAY_CALL` ([6db8835](https://github.com/ERC725Alliance/erc725.js/commit/6db8835ccd9d1082d9e8184bb2f14972760bea69)) + ## [0.19.0](https://github.com/ERC725Alliance/erc725.js/compare/v0.18.0...v0.19.0) (2023-10-05) diff --git a/package-lock.json b/package-lock.json index 7029f5ea..14c78fbf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@erc725/erc725.js", - "version": "0.19.0", + "version": "0.20.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@erc725/erc725.js", - "version": "0.19.0", + "version": "0.20.0", "license": "Apache-2.0", "dependencies": { "ethereumjs-util": "^7.1.5", diff --git a/package.json b/package.json index 0e326f26..69ded2bd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@erc725/erc725.js", - "version": "0.19.0", + "version": "0.20.0", "description": "Library to interact with ERC725 smart contracts", "main": "build/main/src/index.js", "typings": "build/main/src/index.d.ts", From 4635125888c37c24d3215a3eed615fe27c112a36 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 30 Oct 2023 09:47:58 +0000 Subject: [PATCH 06/13] chore(main): release 0.20.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 93c639e1..51882859 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.20.1](https://github.com/ERC725Alliance/erc725.js/compare/v0.20.0...v0.20.1) (2023-10-30) + + +### Bug Fixes + +* incorrect permission value for `EXECUTE_RELAY_CALL` ([55b8f5e](https://github.com/ERC725Alliance/erc725.js/commit/55b8f5e64c29c5a85d872f605667c88c1546f6b3)) + ## [0.20.0](https://github.com/ERC725Alliance/erc725.js/compare/v0.19.0...v0.20.0) (2023-10-18) diff --git a/package-lock.json b/package-lock.json index 196959bf..c7997238 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@erc725/erc725.js", - "version": "0.20.0", + "version": "0.20.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@erc725/erc725.js", - "version": "0.20.0", + "version": "0.20.1", "license": "Apache-2.0", "dependencies": { "ethereumjs-util": "^7.1.5", diff --git a/package.json b/package.json index 69ded2bd..625e93ab 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@erc725/erc725.js", - "version": "0.20.0", + "version": "0.20.1", "description": "Library to interact with ERC725 smart contracts", "main": "build/main/src/index.js", "typings": "build/main/src/index.d.ts", From 3a2d725dd2b17f42d6f6251b2de2958f1d03fe74 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 2 Nov 2023 16:06:31 +0000 Subject: [PATCH 07/13] chore(main): release 0.21.0 --- CHANGELOG.md | 16 ++++++++++++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 51882859..04dbd3b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,22 @@ 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.21.0](https://github.com/ERC725Alliance/erc725.js/compare/v0.20.1...v0.21.0) (2023-11-02) + + +### ⚠ BREAKING CHANGES + +* update lsp3/lsp4 verificationData + +### Features + +* new gas parameter ([82e3833](https://github.com/ERC725Alliance/erc725.js/commit/82e383345a712619b5c6a1030b124d2625115fc1)) + + +### Code Refactoring + +* update lsp3/lsp4 verificationData ([9640d9f](https://github.com/ERC725Alliance/erc725.js/commit/9640d9fbf88c7cf694b9e82cc3a711350334b097)) + ## [0.20.1](https://github.com/ERC725Alliance/erc725.js/compare/v0.20.0...v0.20.1) (2023-10-30) diff --git a/package-lock.json b/package-lock.json index c7997238..914a5f6f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@erc725/erc725.js", - "version": "0.20.1", + "version": "0.21.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@erc725/erc725.js", - "version": "0.20.1", + "version": "0.21.0", "license": "Apache-2.0", "dependencies": { "ethereumjs-util": "^7.1.5", diff --git a/package.json b/package.json index 625e93ab..06313535 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@erc725/erc725.js", - "version": "0.20.1", + "version": "0.21.0", "description": "Library to interact with ERC725 smart contracts", "main": "build/main/src/index.js", "typings": "build/main/src/index.d.ts", From 636d4c9bfccd684a08610d71644c535bb70c4007 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 6 Nov 2023 10:06:09 +0000 Subject: [PATCH 08/13] chore(main): release 0.21.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 04dbd3b8..117e38d1 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.21.1](https://github.com/ERC725Alliance/erc725.js/compare/v0.21.0...v0.21.1) (2023-11-06) + + +### Bug Fixes + +* incorrect hex for `LSP8MetadataTokenURI` ([0500a75](https://github.com/ERC725Alliance/erc725.js/commit/0500a752e3117c5c7e9df8cfed22cb5d6fee20c5)) + ## [0.21.0](https://github.com/ERC725Alliance/erc725.js/compare/v0.20.1...v0.21.0) (2023-11-02) diff --git a/package-lock.json b/package-lock.json index 914a5f6f..68a531e6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@erc725/erc725.js", - "version": "0.21.0", + "version": "0.21.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@erc725/erc725.js", - "version": "0.21.0", + "version": "0.21.1", "license": "Apache-2.0", "dependencies": { "ethereumjs-util": "^7.1.5", diff --git a/package.json b/package.json index 06313535..101fe003 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@erc725/erc725.js", - "version": "0.21.0", + "version": "0.21.1", "description": "Library to interact with ERC725 smart contracts", "main": "build/main/src/index.js", "typings": "build/main/src/index.d.ts", From 9d08111779db2c0170f20c9ea9893b4254b65d3f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 7 Nov 2023 11:41:06 +0000 Subject: [PATCH 09/13] chore(main): release 0.21.2 --- CHANGELOG.md | 11 +++++++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 117e38d1..e714a5f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,17 @@ 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.21.2](https://github.com/ERC725Alliance/erc725.js/compare/v0.21.1...v0.21.2) (2023-11-07) + + +### Bug Fixes + +* Add for unknown verification method to allow for null verification data in LSP2 ([f205818](https://github.com/ERC725Alliance/erc725.js/commit/f205818af348471bde8f88af2008497b8c13e258)) +* Add more fixes per PR comments ([e7302e4](https://github.com/ERC725Alliance/erc725.js/commit/e7302e4504408e2f4f6304badd2024bfe05fcf47)) +* Change to verification object ([ddd2ab2](https://github.com/ERC725Alliance/erc725.js/commit/ddd2ab23d1c5181745827f338d9abaea48c772f7)) +* More renames _FUNCTIONS to _METHODS ([1a96be1](https://github.com/ERC725Alliance/erc725.js/commit/1a96be1dd15942d2a844bc26b9ab73e053e3b766)) +* Move @types/jest and jest ([852918c](https://github.com/ERC725Alliance/erc725.js/commit/852918c72228b3839ba60730dadef66837008f5a)) + ## [0.21.1](https://github.com/ERC725Alliance/erc725.js/compare/v0.21.0...v0.21.1) (2023-11-06) diff --git a/package-lock.json b/package-lock.json index 6b9f66d7..cb2c3a5d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@erc725/erc725.js", - "version": "0.21.1", + "version": "0.21.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@erc725/erc725.js", - "version": "0.21.1", + "version": "0.21.2", "license": "Apache-2.0", "dependencies": { "@types/jest": "^27.5.2", diff --git a/package.json b/package.json index eed40fdf..c417bb41 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@erc725/erc725.js", - "version": "0.21.1", + "version": "0.21.2", "description": "Library to interact with ERC725 smart contracts", "main": "build/main/src/index.js", "typings": "build/main/src/index.d.ts", From 86301caa7364e3116c9e9efba6d016ce9090cfaf Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 29 Nov 2023 11:46:57 +0000 Subject: [PATCH 10/13] chore(main): release 0.21.3 --- CHANGELOG.md | 16 ++++++++++++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e714a5f8..1e7fc7a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,22 @@ 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.21.3](https://github.com/ERC725Alliance/erc725.js/compare/v0.21.2...v0.21.3) (2023-11-29) + + +### Features + +* add `encode/decodeValueType` as public callable methods ([#325](https://github.com/ERC725Alliance/erc725.js/issues/325)) ([a6fe7c8](https://github.com/ERC725Alliance/erc725.js/commit/a6fe7c8470688f573426b59fc2023a08da0cbd36)) +* add more schemas available to parse via `getSchema` ([#351](https://github.com/ERC725Alliance/erc725.js/issues/351)) ([b882379](https://github.com/ERC725Alliance/erc725.js/commit/b8823796c5f99d89d56954c894dfb6964adc552a)) +* add support for multi types in mappings ([#357](https://github.com/ERC725Alliance/erc725.js/issues/357)) ([ba92903](https://github.com/ERC725Alliance/erc725.js/commit/ba9290326efad0aab3855ad3f0ed2722180980ed)) +* add support to encode / decode any `uint8` to `uint256` types ([#355](https://github.com/ERC725Alliance/erc725.js/issues/355)) ([417a4e8](https://github.com/ERC725Alliance/erc725.js/commit/417a4e8ff2c74f3f9e35d0018a4973c97c6ac997)) +* allow to encode LSP2 Array length only ([#326](https://github.com/ERC725Alliance/erc725.js/issues/326)) ([3a6be55](https://github.com/ERC725Alliance/erc725.js/commit/3a6be551d889904b7d95e2630ab637f2a31feb50)) + + +### Bug Fixes + +* update lsp6 schema ([75c4044](https://github.com/ERC725Alliance/erc725.js/commit/75c40444e407d93076cc1e49ad706cc0055f383b)) + ## [0.21.2](https://github.com/ERC725Alliance/erc725.js/compare/v0.21.1...v0.21.2) (2023-11-07) diff --git a/package-lock.json b/package-lock.json index 46eea1b4..d734fda1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@erc725/erc725.js", - "version": "0.21.2", + "version": "0.21.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@erc725/erc725.js", - "version": "0.21.2", + "version": "0.21.3", "license": "Apache-2.0", "dependencies": { "add": "^2.0.6", diff --git a/package.json b/package.json index c417bb41..f42d3c0e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@erc725/erc725.js", - "version": "0.21.2", + "version": "0.21.3", "description": "Library to interact with ERC725 smart contracts", "main": "build/main/src/index.js", "typings": "build/main/src/index.d.ts", From 330cb7d0c6581a51a2962882b865b61d00e38006 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 15 Dec 2023 12:11:21 +0000 Subject: [PATCH 11/13] chore(main): release 0.22.0 --- CHANGELOG.md | 12 ++++++++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e7fc7a7..719bc838 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,18 @@ 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.22.0](https://github.com/ERC725Alliance/erc725.js/compare/v0.21.3...v0.22.0) (2023-12-15) + + +### ⚠ BREAKING CHANGES + +* update new LSP7/8 interface IDs ([#367](https://github.com/ERC725Alliance/erc725.js/issues/367)) +* `JSONURL` and `AssetURL` are now deprecated and have been replaced by `VerifiableURI`. The decoding is backward compatible but if you try to encode `JSONURL` and `AssetURL` value, they will be encoded as [`VerifiableURI`](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-2-ERC725YJSONSchema.md#verifiableuri). ([9aa87e5](https://github.com/ERC725Alliance/erc725.js/commit/9aa87e5ccc0fb1caac1f3291387370b3a980324b)) + +### Bug Fixes + +* Rename JSONURLDataToEncode ([808f1b3](https://github.com/ERC725Alliance/erc725.js/commit/808f1b362bd2275424cf93ac6333049cde90216e)) + ## [0.21.3](https://github.com/ERC725Alliance/erc725.js/compare/v0.21.2...v0.21.3) (2023-11-29) diff --git a/package-lock.json b/package-lock.json index d734fda1..3cb8b8bb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@erc725/erc725.js", - "version": "0.21.3", + "version": "0.22.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@erc725/erc725.js", - "version": "0.21.3", + "version": "0.22.0", "license": "Apache-2.0", "dependencies": { "add": "^2.0.6", diff --git a/package.json b/package.json index f42d3c0e..70a04fe7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@erc725/erc725.js", - "version": "0.21.3", + "version": "0.22.0", "description": "Library to interact with ERC725 smart contracts", "main": "build/main/src/index.js", "typings": "build/main/src/index.d.ts", From 9cda8808c505e24e96a1384d24d260f4e5d9bf8d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 22 Jan 2024 17:34:17 +0000 Subject: [PATCH 12/13] chore(main): release 0.23.0 --- CHANGELOG.md | 34 ++++++++++++++++++++++++++++++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 37 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 719bc838..478cc92e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,40 @@ 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.23.0](https://github.com/ERC725Alliance/erc725.js/compare/v0.22.0...v0.23.0) (2024-01-22) + + +### Features + +* add permission related to 4337 ([e7fd19b](https://github.com/ERC725Alliance/erc725.js/commit/e7fd19bc27aa89fae410b9633ef5ccdf13f33f0e)) +* allow to load typed schemas from `schemas/` folder ([c54a370](https://github.com/ERC725Alliance/erc725.js/commit/c54a370c1e4f8d71ba6bb7e62122b89069f521e6)) + + +### Bug Fixes + +* Add workaround to read (bytes4,URI), repair none vs unknown signature. ([204409d](https://github.com/ERC725Alliance/erc725.js/commit/204409df544825041a586865cfb6bb124288e48f)) +* Additional PR repair ([2a18f2b](https://github.com/ERC725Alliance/erc725.js/commit/2a18f2bf1a24547e71cad6953f5144761aa2cc9a)) +* BodyInit should be just string or buffer and not already Uint8Array ([08e0177](https://github.com/ERC725Alliance/erc725.js/commit/08e017778fa42ade5386b8d9e85255225a7f3195)) +* Cleanup ([038d975](https://github.com/ERC725Alliance/erc725.js/commit/038d97584075c89f93f51227666074cf11973a29)) +* Cleanup a bit with comments. ([3d6a5a6](https://github.com/ERC725Alliance/erc725.js/commit/3d6a5a65db5049b678d0d54149e9b11ea2479999)) +* Cleanup and handle situation where one of many keys fails. Return null. ([cdf4583](https://github.com/ERC725Alliance/erc725.js/commit/cdf4583c159d8c8e52a832bfe5af6b650d8945fa)) +* Cleanup error handler inside of getDataFromExternalSources ([fde2e0f](https://github.com/ERC725Alliance/erc725.js/commit/fde2e0f41df3ecee90a4dfd8248dd9c2a7a72965)) +* Debug and repair test scripts. Implement detecting of JSON inside of Uint8Array ([74c0526](https://github.com/ERC725Alliance/erc725.js/commit/74c0526e3f544400ced78f02ff4fed64bd048bfa)) +* Missing commit ([a3dd604](https://github.com/ERC725Alliance/erc725.js/commit/a3dd604964c9c9221ff421fe668faa8fd363101a)) +* More fixes ([620b606](https://github.com/ERC725Alliance/erc725.js/commit/620b60632e50ca59abedae9935f8b75d188278e0)) +* Remove .only call for testing. ([d5ef3c9](https://github.com/ERC725Alliance/erc725.js/commit/d5ef3c9965e2c5ad343f88a9c30a6281e9fa169b)) +* Remove console debugging. ([e349d57](https://github.com/ERC725Alliance/erc725.js/commit/e349d5715c7779c1eeb8d6e08c3ae3bf17eedd9e)) +* Remove unnecessary special case for 0x00000000 ([cd6152a](https://github.com/ERC725Alliance/erc725.js/commit/cd6152a88ca7a1c98184799b6fdc6982ff8a1cd6)) +* Repair and enhance test scripts ([224eb9e](https://github.com/ERC725Alliance/erc725.js/commit/224eb9ecb1b16f373f2ad17ee9d3efab08dda53b)) +* Repair as per PR review ([0a52452](https://github.com/ERC725Alliance/erc725.js/commit/0a5245230455324e9911e4e14992c50e6f645ba2)) +* Repair console.log and expand types of URLs (ar://, ipfs://, https\?://, data:) ([5c8f228](https://github.com/ERC725Alliance/erc725.js/commit/5c8f2285d2d23c59ef9707a54e419b55d25e4136)) +* Repair problems with IPFS, fetch and VerifiableURI ([44834b8](https://github.com/ERC725Alliance/erc725.js/commit/44834b8ed517e869ad99920b2853e30213a8d7b5)) +* Repair to not throw errors when data is not authentica or not accessible withing getDataFromExternalSources. ([25756d0](https://github.com/ERC725Alliance/erc725.js/commit/25756d09cecfec5d13d6e4fb6ed842c4e3d77734)) +* Repair tuples containing numeric types uintX/intX, add Number to output data type. ([01cceea](https://github.com/ERC725Alliance/erc725.js/commit/01cceeac03f719df6eb8be8c238aca4483e7a3e8)) +* Simplify buffer to string conversion. ([0bd1349](https://github.com/ERC725Alliance/erc725.js/commit/0bd1349f863283cf16cc6808bef48990ec118361)) +* Simplify creation of key to detect JSON. ([df2580d](https://github.com/ERC725Alliance/erc725.js/commit/df2580d9434dc386480f7eec2cd6e94a5b4ca7c1)) +* Use a single keccak function since ethereumjs converts it to a Buffer no matter what. ([cdc6c0a](https://github.com/ERC725Alliance/erc725.js/commit/cdc6c0a0f749209352d620db6d60865a276e072c)) + ## [0.22.0](https://github.com/ERC725Alliance/erc725.js/compare/v0.21.3...v0.22.0) (2023-12-15) diff --git a/package-lock.json b/package-lock.json index 3cb8b8bb..cc3762fb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@erc725/erc725.js", - "version": "0.22.0", + "version": "0.23.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@erc725/erc725.js", - "version": "0.22.0", + "version": "0.23.0", "license": "Apache-2.0", "dependencies": { "add": "^2.0.6", diff --git a/package.json b/package.json index 70a04fe7..a0422020 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@erc725/erc725.js", - "version": "0.22.0", + "version": "0.23.0", "description": "Library to interact with ERC725 smart contracts", "main": "build/main/src/index.js", "typings": "build/main/src/index.d.ts", From 8adad51093239f4852d1bb2ed3ba0489bf8a978c Mon Sep 17 00:00:00 2001 From: Maxime Date: Thu, 22 Feb 2024 13:20:43 +0000 Subject: [PATCH 13/13] feat: add ALL_PERMISSIONS flag to encoding --- package-lock.json | 4 +- src/constants/constants.ts | 3 +- src/index.test.ts | 116 +++++++++++++++++++++++++++++++++++++ src/index.ts | 53 +++++++++++++++-- src/types/Method.ts | 1 + test/testHelpers.ts | 18 ++++++ 6 files changed, 186 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index ae367a79..d734fda1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@erc725/erc725.js", - "version": "0.17.2", + "version": "0.21.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@erc725/erc725.js", - "version": "0.17.2", + "version": "0.21.3", "license": "Apache-2.0", "dependencies": { "add": "^2.0.6", diff --git a/src/constants/constants.ts b/src/constants/constants.ts index 85e19aea..f28a6852 100644 --- a/src/constants/constants.ts +++ b/src/constants/constants.ts @@ -179,7 +179,8 @@ export const LSP6_DEFAULT_PERMISSIONS = { DECRYPT : "0x0000000000000000000000000000000000000000000000000000000000100000", SIGN : "0x0000000000000000000000000000000000000000000000000000000000200000", EXECUTE_RELAY_CALL : "0x0000000000000000000000000000000000000000000000000000000000400000", - ERC4337_PERMISSION : "0x0000000000000000000000000000000000000000000000000000000000800000" + ERC4337_PERMISSION : "0x0000000000000000000000000000000000000000000000000000000000800000", + ALL_PERMISSIONS : "0x00000000000000000000000000000000000000000000000000000000007f3f7f" // lsp6 v0.14.0 }; export const LSP6_ALL_PERMISSIONS = diff --git a/src/index.test.ts b/src/index.test.ts index c498e50f..561480b2 100644 --- a/src/index.test.ts +++ b/src/index.test.ts @@ -47,6 +47,7 @@ import 'isomorphic-fetch'; import { ERC725Y_INTERFACE_IDS, + LSP6_DEFAULT_PERMISSIONS, SUPPORTED_VERIFICATION_METHOD_STRINGS, } from './constants/constants'; import { decodeKey } from './lib/decodeData'; @@ -1192,6 +1193,7 @@ describe('Running @erc725/erc725.js tests...', () => { SIGN: true, EXECUTE_RELAY_CALL: false, ERC4337_PERMISSION: false, + ALL_PERMISSIONS: false, }, hex: '0x00000000000000000000000000000000000000000000000000000000003f3f7f', }, @@ -1221,6 +1223,7 @@ describe('Running @erc725/erc725.js tests...', () => { SIGN: false, EXECUTE_RELAY_CALL: false, ERC4337_PERMISSION: false, + ALL_PERMISSIONS: false, }, hex: '0x0000000000000000000000000000000000000000000000000000000000000000', }, @@ -1250,6 +1253,7 @@ describe('Running @erc725/erc725.js tests...', () => { SIGN: true, EXECUTE_RELAY_CALL: false, ERC4337_PERMISSION: false, + ALL_PERMISSIONS: false, }, hex: '0x0000000000000000000000000000000000000000000000000000000000200a00', }, @@ -1279,6 +1283,7 @@ describe('Running @erc725/erc725.js tests...', () => { SIGN: false, EXECUTE_RELAY_CALL: false, ERC4337_PERMISSION: false, + ALL_PERMISSIONS: false, }, hex: '0x0000000000000000000000000000000000000000000000000000000000040800', }, @@ -1308,6 +1313,7 @@ describe('Running @erc725/erc725.js tests...', () => { SIGN: false, EXECUTE_RELAY_CALL: false, ERC4337_PERMISSION: false, + ALL_PERMISSIONS: false, }, hex: '0x0000000000000000000000000000000000000000000000000000000000040004', }, @@ -1337,6 +1343,7 @@ describe('Running @erc725/erc725.js tests...', () => { SIGN: false, EXECUTE_RELAY_CALL: false, ERC4337_PERMISSION: false, + ALL_PERMISSIONS: false, }, hex: '0x0000000000000000000000000000000000000000000000000000000000000a00', }, @@ -1376,6 +1383,112 @@ describe('Running @erc725/erc725.js tests...', () => { }); }); + describe('Randomized Permissions Encoding', () => { + function convertToPermissionBits(permissions: { [key: string]: string }) { + const permissionBits = {}; + Object.entries(permissions).forEach(([key, hexValue]) => { + // Convert hex to binary, then find the position of the '1' bit + const bitPosition = BigInt(hexValue).toString(2).length - 1; + permissionBits[key] = bitPosition; + }); + return permissionBits; + } + + // remove LSP6_DEFAULT_PERMISSIONS.ALL_PERMISSIONS from LSP6_DEFAULT_PERMISSIONS + const ALL_PERMISSIONS_WITHOUT_ALL_PERMISSIONS = Object.keys( + LSP6_DEFAULT_PERMISSIONS, + ).reduce((acc, key) => { + if (key !== 'ALL_PERMISSIONS') { + acc[key] = LSP6_DEFAULT_PERMISSIONS[key]; + } + return acc; + }, {}); + + // Use the function to generate permissionBits + const permissionBits = convertToPermissionBits( + ALL_PERMISSIONS_WITHOUT_ALL_PERMISSIONS, + ); + + // Function to generate a random permissions object + const generateRandomPermissions = () => { + return Object.keys(permissionBits).reduce((acc, key) => { + // Randomly assign true or false + acc[key] = Math.random() < 0.5; + return acc; + }, {}); + }; + + // Function to calculate expected hex based on permissions + const calculateExpectedHex = (permissions) => { + let basePermissions = BigInt(0); + Object.entries(permissions).forEach(([key, value]) => { + if (value) { + const bitPosition = permissionBits[key]; + basePermissions |= BigInt(1) << BigInt(bitPosition); + } + }); + // Convert to hex string, properly padded + return `0x${basePermissions.toString(16).padStart(64, '0')}`; + }; + + // Run the randomized test multiple times + const numberOfTests = 100; // Number of random tests + for (let i = 0; i < numberOfTests; i++) { + it(`Randomized test #${i + 1}`, () => { + const randomPermissions = generateRandomPermissions(); + const encoded = ERC725.encodePermissions(randomPermissions); + const expectedHex = calculateExpectedHex(randomPermissions); + assert.strictEqual( + encoded, + expectedHex, + `Failed at randomized test #${i + 1}`, + ); + }); + } + }); + + describe('all permissions', () => { + it('should encode ALL_PERMISSIONS correctly', () => { + const permissions = { ALL_PERMISSIONS: true }; + const encoded = ERC725.encodePermissions(permissions); + + assert.strictEqual( + encoded, + LSP6_DEFAULT_PERMISSIONS.ALL_PERMISSIONS, + 'Encoded permissions do not match expected value for ALL_PERMISSIONS', + ); + }); + + it('should ignore individual permissions when ALL_PERMISSIONS is set', () => { + const permissions = { + ALL_PERMISSIONS: true, + CHANGEOWNER: true, + }; + const encoded = ERC725.encodePermissions(permissions); + assert.strictEqual( + encoded, + LSP6_DEFAULT_PERMISSIONS.ALL_PERMISSIONS, + 'ALL_PERMISSIONS did not correctly encode with additional permissions', + ); + }); + it('should be able to disable permissions that are part of ALL_PERMISSIONS', () => { + const permissions = { + ALL_PERMISSIONS: true, + CHANGEOWNER: false, // Explicitly disable CHANGEOWNER + }; + + const encoded = ERC725.encodePermissions(permissions); + const decodedPermissions = ERC725.decodePermissions(encoded); + + // check that the permission is disabled + assert.strictEqual( + decodedPermissions.CHANGEOWNER, + false, + 'CHANGEOWNER permission was not correctly disabled', + ); + }); + }); + describe('decodePermissions', () => { testCases.forEach((testCase) => { it(`Decodes ${testCase.hex} permission correctly`, () => { @@ -1383,6 +1496,7 @@ describe('Running @erc725/erc725.js tests...', () => { ERC725.decodePermissions(testCase.hex), testCase.permissions, ); + assert.deepStrictEqual( erc725Instance.decodePermissions(testCase.hex), testCase.permissions, @@ -1419,6 +1533,7 @@ describe('Running @erc725/erc725.js tests...', () => { SIGN: true, EXECUTE_RELAY_CALL: true, ERC4337_PERMISSION: true, + ALL_PERMISSIONS: true, }, ); assert.deepStrictEqual( @@ -1450,6 +1565,7 @@ describe('Running @erc725/erc725.js tests...', () => { SIGN: true, EXECUTE_RELAY_CALL: true, ERC4337_PERMISSION: true, + ALL_PERMISSIONS: true, }, ); }); diff --git a/src/index.ts b/src/index.ts index d797aa50..0f38da8e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -450,13 +450,53 @@ export class ERC725 { * @returns {*} The permissions encoded as a hexadecimal string as defined by the LSP6 Standard. */ static encodePermissions(permissions: Permissions): string { - const result = Object.keys(permissions).reduce((previous, key) => { - return permissions[key] - ? previous | Number(hexToNumber(LSP6_DEFAULT_PERMISSIONS[key])) - : previous; - }, 0); + let basePermissions = BigInt(0); - return leftPad(toHex(result), 64); + // If ALL_PERMISSIONS is requested, start with that as the base + if (permissions.ALL_PERMISSIONS) { + basePermissions = BigInt( + hexToNumber(LSP6_DEFAULT_PERMISSIONS.ALL_PERMISSIONS), + ); + } + + // Explicitly add REENTRANCY, DELEGATECALL, and SUPER_DELEGATECALL if requested (they are not included in ALL_PERMISSIONS) + const additionalPermissions = [ + LSP6_DEFAULT_PERMISSIONS.REENTRANCY, + LSP6_DEFAULT_PERMISSIONS.DELEGATECALL, + LSP6_DEFAULT_PERMISSIONS.SUPER_DELEGATECALL, + ]; + additionalPermissions.forEach((permission) => { + if (permissions[permission]) { + basePermissions |= BigInt( + hexToNumber(LSP6_DEFAULT_PERMISSIONS[permission]), + ); + } + }); + + // Process each permission to potentially switch off permissions included in ALL_PERMISSIONS + Object.keys(permissions).forEach((key) => { + const permissionValue = BigInt( + hexToNumber(LSP6_DEFAULT_PERMISSIONS[key]), + ); + + if (permissions[key]) { + // If not dealing with ALL_PERMISSIONS or additional permissions, ensure they are added + if ( + !additionalPermissions.includes(key) && + key !== LSP6_DEFAULT_PERMISSIONS.ALL_PERMISSIONS + ) { + basePermissions |= permissionValue; + } + } else if ( + LSP6_DEFAULT_PERMISSIONS[key] !== + LSP6_DEFAULT_PERMISSIONS.ALL_PERMISSIONS + ) { + // If permission is set to false, remove it from the basePermissions + basePermissions &= ~permissionValue; + } + }); + // Convert the final BigInt permission value back to a hex string, properly padded + return leftPad(toHex(basePermissions.toString()), 64); } /** @@ -503,6 +543,7 @@ export class ERC725 { SIGN: false, EXECUTE_RELAY_CALL: false, ERC4337_PERMISSION: false, + ALL_PERMISSIONS: false, }; const permissionsToTest = Object.keys(LSP6_DEFAULT_PERMISSIONS); diff --git a/src/types/Method.ts b/src/types/Method.ts index 681aee85..6eb49bb9 100644 --- a/src/types/Method.ts +++ b/src/types/Method.ts @@ -48,4 +48,5 @@ export interface Permissions { SIGN?: boolean; EXECUTE_RELAY_CALL?: boolean; ERC4337_PERMISSION?: boolean; + ALL_PERMISSIONS?: boolean; } diff --git a/test/testHelpers.ts b/test/testHelpers.ts index c51c3cdd..b1547472 100644 --- a/test/testHelpers.ts +++ b/test/testHelpers.ts @@ -111,3 +111,21 @@ export function generateAllResults(schemas) { }; }); } + +export function hexToBitPositions(hexString) { + const binaryString = BigInt(hexString).toString(2); + + const bitPositions: number[] = []; + + for (let i = binaryString.length - 1; i >= 0; i--) { + // The current bit is set to 1 + if (binaryString[i] === '1') { + // Calculate the bit position. We subtract from the string's length to start counting from 0 + const bitPosition = binaryString.length - 1 - i; + bitPositions.push(bitPosition); + } + } + + // Return the array of bit positions + return bitPositions; +}