@@ -20,6 +20,7 @@ describe('L2ReverseRegistrar', function () {
20
20
'setTextForAddrWithSignature(address,string,string,uint256,bytes)'
21
21
let setTextForAddrWithSignatureAndOwnableFuncSig =
22
22
'setTextForAddrWithSignatureAndOwnable(address,address,string,string,uint256,bytes)'
23
+ let coinType = 123
23
24
24
25
before ( async function ( ) {
25
26
signers = await ethers . getSigners ( )
@@ -31,7 +32,7 @@ describe('L2ReverseRegistrar', function () {
31
32
)
32
33
L2ReverseRegistrar = await L2ReverseRegistrarFactory . deploy (
33
34
namehash ( 'optimism.reverse' ) ,
34
- 123 ,
35
+ coinType ,
35
36
)
36
37
37
38
const MockSmartContractWalletFactory = await ethers . getContractFactory (
@@ -87,11 +88,12 @@ describe('L2ReverseRegistrar', function () {
87
88
const signature = await signers [ 0 ] . signMessage (
88
89
ethers . utils . arrayify (
89
90
keccak256 (
90
- [ 'bytes32' , 'address' , 'uint256' ] ,
91
+ [ 'bytes32' , 'address' , 'uint256' , 'uint256' ] ,
91
92
[
92
93
keccak256 ( [ 'bytes4' , 'string' ] , [ funcId , 'hello.eth' ] ) ,
93
94
account ,
94
95
inceptionDate ,
96
+ coinType ,
95
97
] ,
96
98
) ,
97
99
) ,
@@ -148,11 +150,12 @@ describe('L2ReverseRegistrar', function () {
148
150
const signature = await signers [ 0 ] . signMessage (
149
151
ethers . utils . arrayify (
150
152
keccak256 (
151
- [ 'bytes32' , 'address' , 'uint256' ] ,
153
+ [ 'bytes32' , 'address' , 'uint256' , 'uint256' ] ,
152
154
[
153
155
keccak256 ( [ 'bytes4' , 'string' ] , [ funcId , 'hello.eth' ] ) ,
154
156
account ,
155
157
inceptionDate ,
158
+ coinType ,
156
159
] ,
157
160
) ,
158
161
) ,
@@ -172,11 +175,12 @@ describe('L2ReverseRegistrar', function () {
172
175
const signature2 = await signers [ 0 ] . signMessage (
173
176
ethers . utils . arrayify (
174
177
keccak256 (
175
- [ 'bytes32' , 'address' , 'uint256' ] ,
178
+ [ 'bytes32' , 'address' , 'uint256' , 'uint256' ] ,
176
179
[
177
180
keccak256 ( [ 'bytes4' , 'string' ] , [ funcId , 'hello.eth' ] ) ,
178
181
account ,
179
182
inceptionDate2 ,
183
+ coinType ,
180
184
] ,
181
185
) ,
182
186
) ,
@@ -206,12 +210,13 @@ describe('L2ReverseRegistrar', function () {
206
210
const signature = await signers [ 0 ] . signMessage (
207
211
ethers . utils . arrayify (
208
212
keccak256 (
209
- [ 'bytes32' , 'address' , 'address' , 'uint256' ] ,
213
+ [ 'bytes32' , 'address' , 'address' , 'uint256' , 'uint256' ] ,
210
214
[
211
215
keccak256 ( [ 'bytes4' , 'string' ] , [ funcId , 'ownable.eth' ] ) ,
212
216
MockOwnable . address ,
213
217
MockSmartContractWallet . address ,
214
218
inceptionDate ,
219
+ coinType ,
215
220
] ,
216
221
) ,
217
222
) ,
@@ -257,14 +262,15 @@ describe('L2ReverseRegistrar', function () {
257
262
const signature = await signers [ 0 ] . signMessage (
258
263
ethers . utils . arrayify (
259
264
keccak256 (
260
- [ 'bytes32' , 'address' , 'uint256' ] ,
265
+ [ 'bytes32' , 'address' , 'uint256' , 'uint256' ] ,
261
266
[
262
267
keccak256 (
263
268
[ 'bytes4' , 'string' , 'string' ] ,
264
269
[ funcId , 'url' , 'http://ens.domains' ] ,
265
270
) ,
266
271
account ,
267
272
inceptionDate ,
273
+ coinType ,
268
274
] ,
269
275
) ,
270
276
) ,
@@ -329,14 +335,15 @@ describe('L2ReverseRegistrar', function () {
329
335
const signature = await signers [ 0 ] . signMessage (
330
336
ethers . utils . arrayify (
331
337
keccak256 (
332
- [ 'bytes32' , 'address' , 'uint256' ] ,
338
+ [ 'bytes32' , 'address' , 'uint256' , 'uint256' ] ,
333
339
[
334
340
keccak256 (
335
341
[ 'bytes4' , 'string' , 'string' ] ,
336
342
[ funcId , 'url' , 'http://ens.domains' ] ,
337
343
) ,
338
344
account ,
339
345
inceptionDate ,
346
+ coinType ,
340
347
] ,
341
348
) ,
342
349
) ,
@@ -360,14 +367,15 @@ describe('L2ReverseRegistrar', function () {
360
367
const signature2 = await signers [ 0 ] . signMessage (
361
368
ethers . utils . arrayify (
362
369
keccak256 (
363
- [ 'bytes32' , 'address' , 'uint256' ] ,
370
+ [ 'bytes32' , 'address' , 'uint256' , 'uint256' ] ,
364
371
[
365
372
keccak256 (
366
373
[ 'bytes4' , 'string' , 'string' ] ,
367
374
[ funcId , 'url' , 'http://ens.domains' ] ,
368
375
) ,
369
376
account ,
370
377
inceptionDate2 ,
378
+ coinType ,
371
379
] ,
372
380
) ,
373
381
) ,
@@ -398,7 +406,7 @@ describe('L2ReverseRegistrar', function () {
398
406
const signature = await signers [ 0 ] . signMessage (
399
407
ethers . utils . arrayify (
400
408
keccak256 (
401
- [ 'bytes32' , 'address' , 'address' , 'uint256' ] ,
409
+ [ 'bytes32' , 'address' , 'address' , 'uint256' , 'uint256' ] ,
402
410
[
403
411
keccak256 (
404
412
[ 'bytes4' , 'string' , 'string' ] ,
@@ -407,6 +415,7 @@ describe('L2ReverseRegistrar', function () {
407
415
MockOwnable . address ,
408
416
MockSmartContractWallet . address ,
409
417
inceptionDate ,
418
+ coinType ,
410
419
] ,
411
420
) ,
412
421
) ,
@@ -468,18 +477,18 @@ describe('L2ReverseRegistrar', function () {
468
477
const block = await ethers . provider . getBlock ( 'latest' )
469
478
const inceptionDate = block . timestamp
470
479
471
- console . log ( 'inceptionDate' , inceptionDate )
472
480
const signature1 = await signers [ 0 ] . signMessage (
473
481
ethers . utils . arrayify (
474
482
keccak256 (
475
- [ 'bytes32' , 'address' , 'uint256' ] ,
483
+ [ 'bytes32' , 'address' , 'uint256' , 'uint256' ] ,
476
484
[
477
485
keccak256 (
478
486
[ 'bytes4' , 'string' , 'string' ] ,
479
487
[ funcId1 , 'url' , 'http://ens.domains' ] ,
480
488
) ,
481
489
account ,
482
490
inceptionDate ,
491
+ coinType ,
483
492
] ,
484
493
) ,
485
494
) ,
@@ -488,11 +497,12 @@ describe('L2ReverseRegistrar', function () {
488
497
const signature2 = await signers [ 0 ] . signMessage (
489
498
ethers . utils . arrayify (
490
499
keccak256 (
491
- [ 'bytes32' , 'address' , 'uint256' ] ,
500
+ [ 'bytes32' , 'address' , 'uint256' , 'uint256' ] ,
492
501
[
493
502
keccak256 ( [ 'bytes4' , 'string' ] , [ funcId2 , 'hello.eth' ] ) ,
494
503
account ,
495
504
inceptionDate + 1 ,
505
+ coinType ,
496
506
] ,
497
507
) ,
498
508
) ,
@@ -553,8 +563,8 @@ describe('L2ReverseRegistrar', function () {
553
563
const signature = await signers [ 0 ] . signMessage (
554
564
ethers . utils . arrayify (
555
565
keccak256 (
556
- [ 'bytes32' , 'address' , 'uint256' ] ,
557
- [ keccak256 ( [ 'bytes4' ] , [ funcId ] ) , account , inceptionDate ] ,
566
+ [ 'bytes32' , 'address' , 'uint256' , 'uint256' ] ,
567
+ [ keccak256 ( [ 'bytes4' ] , [ funcId ] ) , account , inceptionDate , coinType ] ,
558
568
) ,
559
569
) ,
560
570
)
@@ -587,8 +597,8 @@ describe('L2ReverseRegistrar', function () {
587
597
const signature = await signers [ 0 ] . signMessage (
588
598
ethers . utils . arrayify (
589
599
keccak256 (
590
- [ 'bytes32' , 'address' , 'uint256' ] ,
591
- [ keccak256 ( [ 'bytes4' ] , [ funcId ] ) , account , inceptionDate ] ,
600
+ [ 'bytes32' , 'address' , 'uint256' , 'uint256' ] ,
601
+ [ keccak256 ( [ 'bytes4' ] , [ funcId ] ) , account , inceptionDate , coinType ] ,
592
602
) ,
593
603
) ,
594
604
)
0 commit comments