Skip to content

Commit

Permalink
feat: add permission related to 4337
Browse files Browse the repository at this point in the history
  • Loading branch information
CJ42 committed Jan 16, 2024
1 parent 330c604 commit e7fd19b
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/classes/ERC725.md
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,8 @@ ERC725.encodePermissions({
ENCRYPT: false,
DECRYPT: false,
SIGN: false,
EXECUTE_RELAY_CALL: false
EXECUTE_RELAY_CALL: false,
ERC4337_PERMISSION: false
}),
// '0x0000000000000000000000000000000000000000000000000000000000000110'

Expand Down
1 change: 1 addition & 0 deletions src/constants/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ export const LSP6_DEFAULT_PERMISSIONS = {
DECRYPT : "0x0000000000000000000000000000000000000000000000000000000000100000",
SIGN : "0x0000000000000000000000000000000000000000000000000000000000200000",
EXECUTE_RELAY_CALL : "0x0000000000000000000000000000000000000000000000000000000000400000",
ERC4337_PERMISSION : "0x0000000000000000000000000000000000000000000000000000000000800000"
};

export const LSP6_ALL_PERMISSIONS =
Expand Down
8 changes: 8 additions & 0 deletions src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1067,6 +1067,7 @@ describe('Running @erc725/erc725.js tests...', () => {
DECRYPT: true,
SIGN: true,
EXECUTE_RELAY_CALL: false,
ERC4337_PERMISSION: false,
},
hex: '0x00000000000000000000000000000000000000000000000000000000003f3f7f',
},
Expand Down Expand Up @@ -1095,6 +1096,7 @@ describe('Running @erc725/erc725.js tests...', () => {
DECRYPT: false,
SIGN: false,
EXECUTE_RELAY_CALL: false,
ERC4337_PERMISSION: false,
},
hex: '0x0000000000000000000000000000000000000000000000000000000000000000',
},
Expand Down Expand Up @@ -1123,6 +1125,7 @@ describe('Running @erc725/erc725.js tests...', () => {
DECRYPT: false,
SIGN: true,
EXECUTE_RELAY_CALL: false,
ERC4337_PERMISSION: false,
},
hex: '0x0000000000000000000000000000000000000000000000000000000000200a00',
},
Expand Down Expand Up @@ -1151,6 +1154,7 @@ describe('Running @erc725/erc725.js tests...', () => {
DECRYPT: false,
SIGN: false,
EXECUTE_RELAY_CALL: false,
ERC4337_PERMISSION: false,
},
hex: '0x0000000000000000000000000000000000000000000000000000000000040800',
},
Expand Down Expand Up @@ -1179,6 +1183,7 @@ describe('Running @erc725/erc725.js tests...', () => {
DECRYPT: false,
SIGN: false,
EXECUTE_RELAY_CALL: false,
ERC4337_PERMISSION: false,
},
hex: '0x0000000000000000000000000000000000000000000000000000000000040004',
},
Expand Down Expand Up @@ -1207,6 +1212,7 @@ describe('Running @erc725/erc725.js tests...', () => {
DECRYPT: false,
SIGN: false,
EXECUTE_RELAY_CALL: false,
ERC4337_PERMISSION: false,
},
hex: '0x0000000000000000000000000000000000000000000000000000000000000a00',
},
Expand Down Expand Up @@ -1288,6 +1294,7 @@ describe('Running @erc725/erc725.js tests...', () => {
DECRYPT: true,
SIGN: true,
EXECUTE_RELAY_CALL: true,
ERC4337_PERMISSION: true,
},
);
assert.deepStrictEqual(
Expand Down Expand Up @@ -1318,6 +1325,7 @@ describe('Running @erc725/erc725.js tests...', () => {
DECRYPT: true,
SIGN: true,
EXECUTE_RELAY_CALL: true,
ERC4337_PERMISSION: true,
},
);
});
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,7 @@ export class ERC725 {
DECRYPT: false,
SIGN: false,
EXECUTE_RELAY_CALL: false,
ERC4337_PERMISSION: false,
};

const permissionsToTest = Object.keys(LSP6_DEFAULT_PERMISSIONS);
Expand Down
1 change: 1 addition & 0 deletions src/types/Method.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,5 @@ export interface Permissions {
DECRYPT?: boolean;
SIGN?: boolean;
EXECUTE_RELAY_CALL?: boolean;
ERC4337_PERMISSION?: boolean;
}

0 comments on commit e7fd19b

Please sign in to comment.