Skip to content

Commit

Permalink
fix: Repair permissions, some lint and more.
Browse files Browse the repository at this point in the history
  • Loading branch information
richtera committed Apr 5, 2024
1 parent 704cac6 commit 549dfb5
Show file tree
Hide file tree
Showing 29 changed files with 766 additions and 431 deletions.
145 changes: 64 additions & 81 deletions CHANGELOG.md

Large diffs are not rendered by default.

17 changes: 16 additions & 1 deletion biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,23 @@
"noExplicitAny": "off"
},
"style": {
"useImportType": "off"
"useImportType": "off",
"useNodejsImportProtocol": "off"
}
}
},
"formatter": {
"indentWidth": 2,
"indentStyle": "space"
},
"javascript": {
"formatter": {
"semicolons": "always",
"quoteStyle": "single",
"trailingComma": "all"
}
},
"files": {
"ignore": ["node_modules", "build", "coverage", ".vscode"]
}
}
2 changes: 1 addition & 1 deletion examples/src/instantiation.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Web3 from 'web3';
import { ERC725 } from '@erc725/erc725.js';
import Web3 from 'web3';

// this is needed because node does not support `fetch` out of the box
// isomorphic-fetch is not needed in a browser environment
Expand Down
228 changes: 228 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@erc725/erc725.js",
"version": "0.24.0",
"version": "0.24.1-dev.2",
"description": "Library to interact with ERC725 smart contracts",
"main": "build/main/src/index.js",
"typings": "build/main/src/index.d.ts",
Expand All @@ -16,6 +16,8 @@
"build:module": "tsc -p tsconfig.module.json",
"test": "env TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\" }' nyc --reporter=text --reporter=lcov mocha",
"lint": "eslint . --ext .ts",
"format:fix": "prettier --write .",
"format": "prettier .",
"release": "standard-version"
},
"repository": {
Expand Down Expand Up @@ -51,6 +53,7 @@
},
"homepage": "https://github.com/ERC725Alliance/erc725.js#readme",
"devDependencies": {
"@biomejs/biome": "^1.6.4",
"@types/chai": "^4.3.4",
"@types/isomorphic-fetch": "^0.0.36",
"@types/jest": "^27.5.2",
Expand Down
75 changes: 47 additions & 28 deletions src/constants/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
along with @erc725/erc725.js. If not, see <http://www.gnu.org/licenses/>.
*/

/* eslint-disable @typescript-eslint/ban-types */
import { numberToHex, keccak256 } from 'web3-utils';
import { arrToBufArr, bufferToHex } from 'ethereumjs-util';
/* eslint-disable @typescript-eslint/ban-types */
import { keccak256, numberToHex } from 'web3-utils';

import { MethodData, Encoding, Method } from '../types/Method';
import { Encoding, Method, MethodData } from '../types/Method';

// https://github.com/ERC725Alliance/ERC725/blob/develop/docs/ERC-725.md#specification
export const ERC725Y_INTERFACE_IDS = {
Expand Down Expand Up @@ -156,31 +156,50 @@ export const HASH_METHODS: {
// TODO: These values can be imported from lsp-smartcontracts lib after release
// prettier-ignore
export const LSP6_DEFAULT_PERMISSIONS = {
CHANGEOWNER : "0x0000000000000000000000000000000000000000000000000000000000000001",
ADDCONTROLLER : "0x0000000000000000000000000000000000000000000000000000000000000002",
EDITPERMISSIONS : "0x0000000000000000000000000000000000000000000000000000000000000004",
ADDEXTENSIONS : "0x0000000000000000000000000000000000000000000000000000000000000008",
CHANGEEXTENSIONS : "0x0000000000000000000000000000000000000000000000000000000000000010",
ADDUNIVERSALRECEIVERDELEGATE : "0x0000000000000000000000000000000000000000000000000000000000000020",
CHANGEUNIVERSALRECEIVERDELEGATE : "0x0000000000000000000000000000000000000000000000000000000000000040",
REENTRANCY : "0x0000000000000000000000000000000000000000000000000000000000000080",
SUPER_TRANSFERVALUE : "0x0000000000000000000000000000000000000000000000000000000000000100",
TRANSFERVALUE : "0x0000000000000000000000000000000000000000000000000000000000000200",
SUPER_CALL : "0x0000000000000000000000000000000000000000000000000000000000000400",
CALL : "0x0000000000000000000000000000000000000000000000000000000000000800",
SUPER_STATICCALL : "0x0000000000000000000000000000000000000000000000000000000000001000",
STATICCALL : "0x0000000000000000000000000000000000000000000000000000000000002000",
SUPER_DELEGATECALL : "0x0000000000000000000000000000000000000000000000000000000000004000",
DELEGATECALL : "0x0000000000000000000000000000000000000000000000000000000000008000",
DEPLOY : "0x0000000000000000000000000000000000000000000000000000000000010000",
SUPER_SETDATA : "0x0000000000000000000000000000000000000000000000000000000000020000",
SETDATA : "0x0000000000000000000000000000000000000000000000000000000000040000",
ENCRYPT : "0x0000000000000000000000000000000000000000000000000000000000080000",
DECRYPT : "0x0000000000000000000000000000000000000000000000000000000000100000",
SIGN : "0x0000000000000000000000000000000000000000000000000000000000200000",
EXECUTE_RELAY_CALL : "0x0000000000000000000000000000000000000000000000000000000000400000",
ERC4337_PERMISSION : "0x0000000000000000000000000000000000000000000000000000000000800000",
ALL_PERMISSIONS : "0x00000000000000000000000000000000000000000000000000000000007f3f7f" // lsp6 v0.14.0
CHANGEOWNER:
'0x0000000000000000000000000000000000000000000000000000000000000001',
ADDCONTROLLER:
'0x0000000000000000000000000000000000000000000000000000000000000002',
EDITPERMISSIONS:
'0x0000000000000000000000000000000000000000000000000000000000000004',
ADDEXTENSIONS:
'0x0000000000000000000000000000000000000000000000000000000000000008',
CHANGEEXTENSIONS:
'0x0000000000000000000000000000000000000000000000000000000000000010',
ADDUNIVERSALRECEIVERDELEGATE:
'0x0000000000000000000000000000000000000000000000000000000000000020',
CHANGEUNIVERSALRECEIVERDELEGATE:
'0x0000000000000000000000000000000000000000000000000000000000000040',
REENTRANCY:
'0x0000000000000000000000000000000000000000000000000000000000000080',
SUPER_TRANSFERVALUE:
'0x0000000000000000000000000000000000000000000000000000000000000100',
TRANSFERVALUE:
'0x0000000000000000000000000000000000000000000000000000000000000200',
SUPER_CALL:
'0x0000000000000000000000000000000000000000000000000000000000000400',
CALL: '0x0000000000000000000000000000000000000000000000000000000000000800',
SUPER_STATICCALL:
'0x0000000000000000000000000000000000000000000000000000000000001000',
STATICCALL:
'0x0000000000000000000000000000000000000000000000000000000000002000',
SUPER_DELEGATECALL:
'0x0000000000000000000000000000000000000000000000000000000000004000',
DELEGATECALL:
'0x0000000000000000000000000000000000000000000000000000000000008000',
DEPLOY: '0x0000000000000000000000000000000000000000000000000000000000010000',
SUPER_SETDATA:
'0x0000000000000000000000000000000000000000000000000000000000020000',
SETDATA: '0x0000000000000000000000000000000000000000000000000000000000040000',
ENCRYPT: '0x0000000000000000000000000000000000000000000000000000000000080000',
DECRYPT: '0x0000000000000000000000000000000000000000000000000000000000100000',
SIGN: '0x0000000000000000000000000000000000000000000000000000000000200000',
EXECUTE_RELAY_CALL:
'0x0000000000000000000000000000000000000000000000000000000000400000',
ERC4337_PERMISSION:
'0x0000000000000000000000000000000000000000000000000000000000800000',
ALL_PERMISSIONS:
'0x00000000000000000000000000000000000000000000000000000000007f3f7f', // lsp6 v0.14.0
};

export const LSP6_ALL_PERMISSIONS =
Expand Down
Loading

0 comments on commit 549dfb5

Please sign in to comment.