Skip to content

Commit 6f97208

Browse files
authored
Eip712 missing types (#26)
* feat: add EIP712 type for changeStatusDelegated * feat: add all other EIP712 types * feat: put eip712 domain name into utils
1 parent 91c5d03 commit 6f97208

File tree

2 files changed

+85
-1
lines changed

2 files changed

+85
-1
lines changed

src/index.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
11
export {
2-
EIP712ChangeStatusType
2+
EIP712DomainName,
3+
EIP712ChangeStatusType,
4+
EIP712ChangeStatusDelegatedType,
5+
EIP712ChangeStatusInListType,
6+
EIP712ChangeStatusesInListDelegatedType,
7+
EIP712ChangeListOwnerType,
8+
EIP712AddListDelegateType,
9+
EIP712RemoveListDelegateType,
10+
EIP712ChangeListStatusType,
311
} from "./util"

src/util.ts

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import {TypedDataField} from "ethers";
22

3+
export const EIP712DomainName = "Revocation Registry"
4+
35
export const EIP712ChangeStatusType = {
46
ChangeStatus: [
57
{name: 'revoked', type: 'bool'} as TypedDataField,
@@ -9,4 +11,78 @@ export const EIP712ChangeStatusType = {
911
{name: 'signer', type: 'address'} as TypedDataField,
1012
{name: 'nonce', type: 'uint'} as TypedDataField,
1113
]
14+
}
15+
16+
export const EIP712ChangeStatusDelegatedType = {
17+
ChangeStatusDelegated: [
18+
{name: 'revoked', type: 'bool'} as TypedDataField,
19+
{name: 'namespace', type: 'address'} as TypedDataField,
20+
{name: 'revocationList', type: 'bytes32'} as TypedDataField,
21+
{name: 'revocationKey', type: 'bytes32'} as TypedDataField,
22+
{name: 'signer', type: 'address'} as TypedDataField,
23+
{name: 'nonce', type: 'uint'} as TypedDataField,
24+
]
25+
}
26+
27+
export const EIP712ChangeStatusInListType = {
28+
ChangeStatusesInList: [
29+
{name: 'revoked', type: 'bool[]'},
30+
{name: 'namespace', type: 'address'},
31+
{name: 'revocationList', type: 'bytes32'},
32+
{name: 'revocationKeys', type: 'bytes32[]'},
33+
{name: 'signer', type: 'address'},
34+
{name: 'nonce', type: 'uint'},
35+
]
36+
}
37+
38+
export const EIP712ChangeStatusesInListDelegatedType = {
39+
ChangeStatusesInListDelegated: [
40+
{name: 'revoked', type: 'bool[]'},
41+
{name: 'namespace', type: 'address'},
42+
{name: 'revocationList', type: 'bytes32'},
43+
{name: 'revocationKeys', type: 'bytes32[]'},
44+
{name: 'signer', type: 'address'},
45+
{name: 'nonce', type: 'uint'},
46+
]
47+
}
48+
49+
export const EIP712ChangeListOwnerType = {
50+
ChangeListOwner: [
51+
{name: 'namespace', type: 'address'},
52+
{name: 'newOwner', type: 'address'},
53+
{name: 'revocationList', type: 'bytes32'},
54+
{name: 'signer', type: 'address'},
55+
{name: 'nonce', type: 'uint'},
56+
]
57+
}
58+
59+
export const EIP712AddListDelegateType = {
60+
AddListDelegate: [
61+
{name: 'namespace', type: 'address'},
62+
{name: 'delegate', type: 'address'},
63+
{name: 'revocationList', type: 'bytes32'},
64+
{name: 'validity', type: 'uint'},
65+
{name: 'signer', type: 'address'},
66+
{name: 'nonce', type: 'uint'},
67+
]
68+
}
69+
70+
export const EIP712RemoveListDelegateType = {
71+
RemoveListDelegate: [
72+
{name: 'namespace', type: 'address'},
73+
{name: 'delegate', type: 'address'},
74+
{name: 'revocationList', type: 'bytes32'},
75+
{name: 'signer', type: 'address'},
76+
{name: 'nonce', type: 'uint'},
77+
]
78+
}
79+
80+
export const EIP712ChangeListStatusType = {
81+
ChangeListStatus: [
82+
{name: 'revoked', type: 'bool'},
83+
{name: 'namespace', type: 'address'},
84+
{name: 'revocationList', type: 'bytes32'},
85+
{name: 'signer', type: 'address'},
86+
{name: 'nonce', type: 'uint'},
87+
]
1288
}

0 commit comments

Comments
 (0)