Skip to content

Commit

Permalink
Merge pull request #374 from ERC725Alliance/permission-4337
Browse files Browse the repository at this point in the history
feat: add permission related to 4337
  • Loading branch information
richtera authored Jan 16, 2024
2 parents 5709e2c + e7fd19b commit afd6885
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 @@ -1079,6 +1079,7 @@ describe('Running @erc725/erc725.js tests...', () => {
DECRYPT: true,
SIGN: true,
EXECUTE_RELAY_CALL: false,
ERC4337_PERMISSION: false,
},
hex: '0x00000000000000000000000000000000000000000000000000000000003f3f7f',
},
Expand Down Expand Up @@ -1107,6 +1108,7 @@ describe('Running @erc725/erc725.js tests...', () => {
DECRYPT: false,
SIGN: false,
EXECUTE_RELAY_CALL: false,
ERC4337_PERMISSION: false,
},
hex: '0x0000000000000000000000000000000000000000000000000000000000000000',
},
Expand Down Expand Up @@ -1135,6 +1137,7 @@ describe('Running @erc725/erc725.js tests...', () => {
DECRYPT: false,
SIGN: true,
EXECUTE_RELAY_CALL: false,
ERC4337_PERMISSION: false,
},
hex: '0x0000000000000000000000000000000000000000000000000000000000200a00',
},
Expand Down Expand Up @@ -1163,6 +1166,7 @@ describe('Running @erc725/erc725.js tests...', () => {
DECRYPT: false,
SIGN: false,
EXECUTE_RELAY_CALL: false,
ERC4337_PERMISSION: false,
},
hex: '0x0000000000000000000000000000000000000000000000000000000000040800',
},
Expand Down Expand Up @@ -1191,6 +1195,7 @@ describe('Running @erc725/erc725.js tests...', () => {
DECRYPT: false,
SIGN: false,
EXECUTE_RELAY_CALL: false,
ERC4337_PERMISSION: false,
},
hex: '0x0000000000000000000000000000000000000000000000000000000000040004',
},
Expand Down Expand Up @@ -1219,6 +1224,7 @@ describe('Running @erc725/erc725.js tests...', () => {
DECRYPT: false,
SIGN: false,
EXECUTE_RELAY_CALL: false,
ERC4337_PERMISSION: false,
},
hex: '0x0000000000000000000000000000000000000000000000000000000000000a00',
},
Expand Down Expand Up @@ -1300,6 +1306,7 @@ describe('Running @erc725/erc725.js tests...', () => {
DECRYPT: true,
SIGN: true,
EXECUTE_RELAY_CALL: true,
ERC4337_PERMISSION: true,
},
);
assert.deepStrictEqual(
Expand Down Expand Up @@ -1330,6 +1337,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 afd6885

Please sign in to comment.