Skip to content

Commit ab252c5

Browse files
committed
fix: eip712 data type for nonce
1 parent da27159 commit ab252c5

File tree

3 files changed

+26
-26
lines changed

3 files changed

+26
-26
lines changed

contracts/RevocationRegistry.sol

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ contract RevocationRegistry is Initializable, EIP712Upgradeable, PausableUpgrade
8585
_changeStatus(revoked, namespace, revocationList, revocationKey);
8686
}
8787

88-
function _hashChangeStatus(bool revoked, address namespace, bytes32 revocationList, bytes32 revocationKey, address signer, uint nonce) internal view returns (bytes32) {
88+
function _hashChangeStatus(bool revoked, address namespace, bytes32 revocationList, bytes32 revocationKey, address signer, uint256 nonce) internal view returns (bytes32) {
8989
return _hashTypedDataV4(keccak256(abi.encode(
90-
keccak256("ChangeStatus(bool revoked,address namespace,bytes32 revocationList,bytes32 revocationKey,address signer,uint nonce)"),
90+
keccak256("ChangeStatus(bool revoked,address namespace,bytes32 revocationList,bytes32 revocationKey,address signer,uint256 nonce)"),
9191
revoked,
9292
namespace,
9393
revocationList,
@@ -110,9 +110,9 @@ contract RevocationRegistry is Initializable, EIP712Upgradeable, PausableUpgrade
110110
_changeStatus(revoked, namespace, revocationList, revocationKey);
111111
}
112112

113-
function _hashChangeStatusDelegated(bool revoked, address namespace, bytes32 revocationList, bytes32 revocationKey, address signer, uint nonce) internal view returns (bytes32) {
113+
function _hashChangeStatusDelegated(bool revoked, address namespace, bytes32 revocationList, bytes32 revocationKey, address signer, uint256 nonce) internal view returns (bytes32) {
114114
return _hashTypedDataV4(keccak256(abi.encode(
115-
keccak256("ChangeStatusDelegated(bool revoked,address namespace,bytes32 revocationList,bytes32 revocationKey,address signer,uint nonce)"),
115+
keccak256("ChangeStatusDelegated(bool revoked,address namespace,bytes32 revocationList,bytes32 revocationKey,address signer,uint256 nonce)"),
116116
revoked,
117117
namespace,
118118
revocationList,
@@ -142,9 +142,9 @@ contract RevocationRegistry is Initializable, EIP712Upgradeable, PausableUpgrade
142142
_changeStatusesInList(revoked, namespace, revocationList, revocationKeys);
143143
}
144144

145-
function _hashChangeStatusesInList(bool[] memory revoked, address namespace, bytes32 revocationList, bytes32[] memory revocationKeys, address signer, uint nonce) internal view returns (bytes32) {
145+
function _hashChangeStatusesInList(bool[] memory revoked, address namespace, bytes32 revocationList, bytes32[] memory revocationKeys, address signer, uint256 nonce) internal view returns (bytes32) {
146146
return _hashTypedDataV4(keccak256(abi.encode(
147-
keccak256("ChangeStatusesInList(bool[] revoked,address namespace,bytes32 revocationList,bytes32[] revocationKeys,address signer,uint nonce)"),
147+
keccak256("ChangeStatusesInList(bool[] revoked,address namespace,bytes32 revocationList,bytes32[] revocationKeys,address signer,uint256 nonce)"),
148148
keccak256(abi.encodePacked(revoked)),
149149
namespace,
150150
revocationList,
@@ -167,9 +167,9 @@ contract RevocationRegistry is Initializable, EIP712Upgradeable, PausableUpgrade
167167
_changeStatusesInList(revoked, namespace, revocationList, revocationKeys);
168168
}
169169

170-
function _hashChangeStatusesInListDelegated(bool[] memory revoked, address namespace, bytes32 revocationList, bytes32[] memory revocationKeys, address signer, uint nonce) internal view returns (bytes32) {
170+
function _hashChangeStatusesInListDelegated(bool[] memory revoked, address namespace, bytes32 revocationList, bytes32[] memory revocationKeys, address signer, uint256 nonce) internal view returns (bytes32) {
171171
return _hashTypedDataV4(keccak256(abi.encode(
172-
keccak256("ChangeStatusesInListDelegated(bool[] revoked,address namespace,bytes32 revocationList,bytes32[] revocationKeys,address signer,uint nonce)"),
172+
keccak256("ChangeStatusesInListDelegated(bool[] revoked,address namespace,bytes32 revocationList,bytes32[] revocationKeys,address signer,uint256 nonce)"),
173173
keccak256(abi.encodePacked(revoked)),
174174
namespace,
175175
revocationList,
@@ -198,9 +198,9 @@ contract RevocationRegistry is Initializable, EIP712Upgradeable, PausableUpgrade
198198
_changeListOwner(namespace, newOwner, revocationList);
199199
}
200200

201-
function _hashChangeListOwner(address namespace, address newOwner, bytes32 revocationList, address signer, uint nonce) internal view returns (bytes32) {
201+
function _hashChangeListOwner(address namespace, address newOwner, bytes32 revocationList, address signer, uint256 nonce) internal view returns (bytes32) {
202202
return _hashTypedDataV4(keccak256(abi.encode(
203-
keccak256("ChangeListOwner(address namespace,address newOwner,bytes32 revocationList,address signer,uint nonce)"),
203+
keccak256("ChangeListOwner(address namespace,address newOwner,bytes32 revocationList,address signer,uint256 nonce)"),
204204
namespace,
205205
newOwner,
206206
revocationList,
@@ -227,9 +227,9 @@ contract RevocationRegistry is Initializable, EIP712Upgradeable, PausableUpgrade
227227
_changeListStatus(revoked, namespace, revocationList);
228228
}
229229

230-
function _hashChangeListStatus(bool revoked, address namespace, bytes32 revocationList, address signer, uint nonce) internal view returns (bytes32) {
230+
function _hashChangeListStatus(bool revoked, address namespace, bytes32 revocationList, address signer, uint256 nonce) internal view returns (bytes32) {
231231
return _hashTypedDataV4(keccak256(abi.encode(
232-
keccak256("ChangeListStatus(bool revoked,address namespace,bytes32 revocationList,address signer,uint nonce)"),
232+
keccak256("ChangeListStatus(bool revoked,address namespace,bytes32 revocationList,address signer,uint256 nonce)"),
233233
revoked,
234234
namespace,
235235
revocationList,
@@ -258,9 +258,9 @@ contract RevocationRegistry is Initializable, EIP712Upgradeable, PausableUpgrade
258258
_addListDelegate(namespace, delegate, revocationList, validity);
259259
}
260260

261-
function _hashAddListDelegate(address namespace, address delegate, bytes32 revocationList, uint validity, address signer, uint nonce) internal view returns (bytes32) {
261+
function _hashAddListDelegate(address namespace, address delegate, bytes32 revocationList, uint validity, address signer, uint256 nonce) internal view returns (bytes32) {
262262
return _hashTypedDataV4(keccak256(abi.encode(
263-
keccak256("AddListDelegate(address namespace,address delegate,bytes32 revocationList,uint validity,address signer,uint nonce)"),
263+
keccak256("AddListDelegate(address namespace,address delegate,bytes32 revocationList,uint validity,address signer,uint256 nonce)"),
264264
namespace,
265265
delegate,
266266
revocationList,
@@ -289,9 +289,9 @@ contract RevocationRegistry is Initializable, EIP712Upgradeable, PausableUpgrade
289289
_removeListDelegate(namespace, delegate, revocationList);
290290
}
291291

292-
function _hashRemoveListDelegate(address namespace, address delegate, bytes32 revocationList, address signer, uint nonce) internal view returns (bytes32) {
292+
function _hashRemoveListDelegate(address namespace, address delegate, bytes32 revocationList, address signer, uint256 nonce) internal view returns (bytes32) {
293293
return _hashTypedDataV4(keccak256(abi.encode(
294-
keccak256("RemoveListDelegate(address namespace,address delegate,bytes32 revocationList,address signer,uint nonce)"),
294+
keccak256("RemoveListDelegate(address namespace,address delegate,bytes32 revocationList,address signer,uint256 nonce)"),
295295
namespace,
296296
delegate,
297297
revocationList,

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@spherity/ethr-revocation-registry",
3-
"version": "1.0.13",
3+
"version": "1.1.0",
44
"description": "The Ethereum Revocation List types for smart contract interaction.",
55
"main": "dist/index.js",
66
"typings": "dist/index.d.ts",

src/util.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export const EIP712ChangeStatusType = {
99
{name: 'revocationList', type: 'bytes32'} as TypedDataField,
1010
{name: 'revocationKey', type: 'bytes32'} as TypedDataField,
1111
{name: 'signer', type: 'address'} as TypedDataField,
12-
{name: 'nonce', type: 'uint'} as TypedDataField,
12+
{name: 'nonce', type: 'uint256'} as TypedDataField,
1313
]
1414
}
1515

@@ -20,7 +20,7 @@ export const EIP712ChangeStatusDelegatedType = {
2020
{name: 'revocationList', type: 'bytes32'} as TypedDataField,
2121
{name: 'revocationKey', type: 'bytes32'} as TypedDataField,
2222
{name: 'signer', type: 'address'} as TypedDataField,
23-
{name: 'nonce', type: 'uint'} as TypedDataField,
23+
{name: 'nonce', type: 'uint256'} as TypedDataField,
2424
]
2525
}
2626

@@ -31,7 +31,7 @@ export const EIP712ChangeStatusesInListType = {
3131
{name: 'revocationList', type: 'bytes32'},
3232
{name: 'revocationKeys', type: 'bytes32[]'},
3333
{name: 'signer', type: 'address'},
34-
{name: 'nonce', type: 'uint'},
34+
{name: 'nonce', type: 'uint256'},
3535
]
3636
}
3737

@@ -42,7 +42,7 @@ export const EIP712ChangeStatusesInListDelegatedType = {
4242
{name: 'revocationList', type: 'bytes32'},
4343
{name: 'revocationKeys', type: 'bytes32[]'},
4444
{name: 'signer', type: 'address'},
45-
{name: 'nonce', type: 'uint'},
45+
{name: 'nonce', type: 'uint256'},
4646
]
4747
}
4848

@@ -52,7 +52,7 @@ export const EIP712ChangeListOwnerType = {
5252
{name: 'newOwner', type: 'address'},
5353
{name: 'revocationList', type: 'bytes32'},
5454
{name: 'signer', type: 'address'},
55-
{name: 'nonce', type: 'uint'},
55+
{name: 'nonce', type: 'uint256'},
5656
]
5757
}
5858

@@ -61,9 +61,9 @@ export const EIP712AddListDelegateType = {
6161
{name: 'namespace', type: 'address'},
6262
{name: 'delegate', type: 'address'},
6363
{name: 'revocationList', type: 'bytes32'},
64-
{name: 'validity', type: 'uint'},
64+
{name: 'validity', type: 'uint256'},
6565
{name: 'signer', type: 'address'},
66-
{name: 'nonce', type: 'uint'},
66+
{name: 'nonce', type: 'uint256'},
6767
]
6868
}
6969

@@ -73,7 +73,7 @@ export const EIP712RemoveListDelegateType = {
7373
{name: 'delegate', type: 'address'},
7474
{name: 'revocationList', type: 'bytes32'},
7575
{name: 'signer', type: 'address'},
76-
{name: 'nonce', type: 'uint'},
76+
{name: 'nonce', type: 'uint256'},
7777
]
7878
}
7979

@@ -83,6 +83,6 @@ export const EIP712ChangeListStatusType = {
8383
{name: 'namespace', type: 'address'},
8484
{name: 'revocationList', type: 'bytes32'},
8585
{name: 'signer', type: 'address'},
86-
{name: 'nonce', type: 'uint'},
86+
{name: 'nonce', type: 'uint256'},
8787
]
8888
}

0 commit comments

Comments
 (0)