@gitmyabi/unlockprotocoltimelock 0.0.0-stage → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +107 -2
- package/contracts/UnlockProtocolTimelock_json.d.ts +1179 -0
- package/contracts/UnlockProtocolTimelock_json.js +1271 -0
- package/contracts/UnlockProtocolTimelock_json.ts +1544 -0
- package/contracts/index.d.ts +2 -0
- package/contracts/index.js +7 -0
- package/contracts/index.ts +3 -0
- package/index.d.ts +1 -0
- package/index.js +19 -0
- package/package.json +40 -3
|
@@ -0,0 +1,1271 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UnlockProtocolTimelock_json = exports.UnlockProtocolTimelock_jsonAbi = void 0;
|
|
4
|
+
const viem_1 = require("viem");
|
|
5
|
+
/**
|
|
6
|
+
* UnlockProtocolTimelock_json ABI
|
|
7
|
+
*
|
|
8
|
+
* This ABI is typed using viem's type system for full type safety.
|
|
9
|
+
*/
|
|
10
|
+
exports.UnlockProtocolTimelock_jsonAbi = [
|
|
11
|
+
{
|
|
12
|
+
"anonymous": false,
|
|
13
|
+
"inputs": [
|
|
14
|
+
{
|
|
15
|
+
"indexed": true,
|
|
16
|
+
"internalType": "bytes32",
|
|
17
|
+
"name": "id",
|
|
18
|
+
"type": "bytes32"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"indexed": true,
|
|
22
|
+
"internalType": "uint256",
|
|
23
|
+
"name": "index",
|
|
24
|
+
"type": "uint256"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"indexed": false,
|
|
28
|
+
"internalType": "address",
|
|
29
|
+
"name": "target",
|
|
30
|
+
"type": "address"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"indexed": false,
|
|
34
|
+
"internalType": "uint256",
|
|
35
|
+
"name": "value",
|
|
36
|
+
"type": "uint256"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"indexed": false,
|
|
40
|
+
"internalType": "bytes",
|
|
41
|
+
"name": "data",
|
|
42
|
+
"type": "bytes"
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
"name": "CallExecuted",
|
|
46
|
+
"type": "event"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"anonymous": false,
|
|
50
|
+
"inputs": [
|
|
51
|
+
{
|
|
52
|
+
"indexed": true,
|
|
53
|
+
"internalType": "bytes32",
|
|
54
|
+
"name": "id",
|
|
55
|
+
"type": "bytes32"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"indexed": true,
|
|
59
|
+
"internalType": "uint256",
|
|
60
|
+
"name": "index",
|
|
61
|
+
"type": "uint256"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"indexed": false,
|
|
65
|
+
"internalType": "address",
|
|
66
|
+
"name": "target",
|
|
67
|
+
"type": "address"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"indexed": false,
|
|
71
|
+
"internalType": "uint256",
|
|
72
|
+
"name": "value",
|
|
73
|
+
"type": "uint256"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"indexed": false,
|
|
77
|
+
"internalType": "bytes",
|
|
78
|
+
"name": "data",
|
|
79
|
+
"type": "bytes"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"indexed": false,
|
|
83
|
+
"internalType": "bytes32",
|
|
84
|
+
"name": "predecessor",
|
|
85
|
+
"type": "bytes32"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"indexed": false,
|
|
89
|
+
"internalType": "uint256",
|
|
90
|
+
"name": "delay",
|
|
91
|
+
"type": "uint256"
|
|
92
|
+
}
|
|
93
|
+
],
|
|
94
|
+
"name": "CallScheduled",
|
|
95
|
+
"type": "event"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"anonymous": false,
|
|
99
|
+
"inputs": [
|
|
100
|
+
{
|
|
101
|
+
"indexed": true,
|
|
102
|
+
"internalType": "bytes32",
|
|
103
|
+
"name": "id",
|
|
104
|
+
"type": "bytes32"
|
|
105
|
+
}
|
|
106
|
+
],
|
|
107
|
+
"name": "Cancelled",
|
|
108
|
+
"type": "event"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"anonymous": false,
|
|
112
|
+
"inputs": [
|
|
113
|
+
{
|
|
114
|
+
"indexed": false,
|
|
115
|
+
"internalType": "uint256",
|
|
116
|
+
"name": "oldDuration",
|
|
117
|
+
"type": "uint256"
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"indexed": false,
|
|
121
|
+
"internalType": "uint256",
|
|
122
|
+
"name": "newDuration",
|
|
123
|
+
"type": "uint256"
|
|
124
|
+
}
|
|
125
|
+
],
|
|
126
|
+
"name": "MinDelayChange",
|
|
127
|
+
"type": "event"
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"anonymous": false,
|
|
131
|
+
"inputs": [
|
|
132
|
+
{
|
|
133
|
+
"indexed": true,
|
|
134
|
+
"internalType": "bytes32",
|
|
135
|
+
"name": "role",
|
|
136
|
+
"type": "bytes32"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"indexed": true,
|
|
140
|
+
"internalType": "bytes32",
|
|
141
|
+
"name": "previousAdminRole",
|
|
142
|
+
"type": "bytes32"
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"indexed": true,
|
|
146
|
+
"internalType": "bytes32",
|
|
147
|
+
"name": "newAdminRole",
|
|
148
|
+
"type": "bytes32"
|
|
149
|
+
}
|
|
150
|
+
],
|
|
151
|
+
"name": "RoleAdminChanged",
|
|
152
|
+
"type": "event"
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"anonymous": false,
|
|
156
|
+
"inputs": [
|
|
157
|
+
{
|
|
158
|
+
"indexed": true,
|
|
159
|
+
"internalType": "bytes32",
|
|
160
|
+
"name": "role",
|
|
161
|
+
"type": "bytes32"
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"indexed": true,
|
|
165
|
+
"internalType": "address",
|
|
166
|
+
"name": "account",
|
|
167
|
+
"type": "address"
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
"indexed": true,
|
|
171
|
+
"internalType": "address",
|
|
172
|
+
"name": "sender",
|
|
173
|
+
"type": "address"
|
|
174
|
+
}
|
|
175
|
+
],
|
|
176
|
+
"name": "RoleGranted",
|
|
177
|
+
"type": "event"
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"anonymous": false,
|
|
181
|
+
"inputs": [
|
|
182
|
+
{
|
|
183
|
+
"indexed": true,
|
|
184
|
+
"internalType": "bytes32",
|
|
185
|
+
"name": "role",
|
|
186
|
+
"type": "bytes32"
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
"indexed": true,
|
|
190
|
+
"internalType": "address",
|
|
191
|
+
"name": "account",
|
|
192
|
+
"type": "address"
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"indexed": true,
|
|
196
|
+
"internalType": "address",
|
|
197
|
+
"name": "sender",
|
|
198
|
+
"type": "address"
|
|
199
|
+
}
|
|
200
|
+
],
|
|
201
|
+
"name": "RoleRevoked",
|
|
202
|
+
"type": "event"
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
"inputs": [],
|
|
206
|
+
"name": "DEFAULT_ADMIN_ROLE",
|
|
207
|
+
"outputs": [
|
|
208
|
+
{
|
|
209
|
+
"internalType": "bytes32",
|
|
210
|
+
"name": "",
|
|
211
|
+
"type": "bytes32"
|
|
212
|
+
}
|
|
213
|
+
],
|
|
214
|
+
"stateMutability": "view",
|
|
215
|
+
"type": "function"
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
"inputs": [],
|
|
219
|
+
"name": "EXECUTOR_ROLE",
|
|
220
|
+
"outputs": [
|
|
221
|
+
{
|
|
222
|
+
"internalType": "bytes32",
|
|
223
|
+
"name": "",
|
|
224
|
+
"type": "bytes32"
|
|
225
|
+
}
|
|
226
|
+
],
|
|
227
|
+
"stateMutability": "view",
|
|
228
|
+
"type": "function"
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
"inputs": [],
|
|
232
|
+
"name": "PROPOSER_ROLE",
|
|
233
|
+
"outputs": [
|
|
234
|
+
{
|
|
235
|
+
"internalType": "bytes32",
|
|
236
|
+
"name": "",
|
|
237
|
+
"type": "bytes32"
|
|
238
|
+
}
|
|
239
|
+
],
|
|
240
|
+
"stateMutability": "view",
|
|
241
|
+
"type": "function"
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
"inputs": [],
|
|
245
|
+
"name": "TIMELOCK_ADMIN_ROLE",
|
|
246
|
+
"outputs": [
|
|
247
|
+
{
|
|
248
|
+
"internalType": "bytes32",
|
|
249
|
+
"name": "",
|
|
250
|
+
"type": "bytes32"
|
|
251
|
+
}
|
|
252
|
+
],
|
|
253
|
+
"stateMutability": "view",
|
|
254
|
+
"type": "function"
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
"inputs": [
|
|
258
|
+
{
|
|
259
|
+
"internalType": "bytes32",
|
|
260
|
+
"name": "id",
|
|
261
|
+
"type": "bytes32"
|
|
262
|
+
}
|
|
263
|
+
],
|
|
264
|
+
"name": "cancel",
|
|
265
|
+
"outputs": [],
|
|
266
|
+
"stateMutability": "nonpayable",
|
|
267
|
+
"type": "function"
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
"inputs": [
|
|
271
|
+
{
|
|
272
|
+
"internalType": "address",
|
|
273
|
+
"name": "target",
|
|
274
|
+
"type": "address"
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
"internalType": "uint256",
|
|
278
|
+
"name": "value",
|
|
279
|
+
"type": "uint256"
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
"internalType": "bytes",
|
|
283
|
+
"name": "data",
|
|
284
|
+
"type": "bytes"
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
"internalType": "bytes32",
|
|
288
|
+
"name": "predecessor",
|
|
289
|
+
"type": "bytes32"
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
"internalType": "bytes32",
|
|
293
|
+
"name": "salt",
|
|
294
|
+
"type": "bytes32"
|
|
295
|
+
}
|
|
296
|
+
],
|
|
297
|
+
"name": "execute",
|
|
298
|
+
"outputs": [],
|
|
299
|
+
"stateMutability": "payable",
|
|
300
|
+
"type": "function"
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
"inputs": [
|
|
304
|
+
{
|
|
305
|
+
"internalType": "address[]",
|
|
306
|
+
"name": "targets",
|
|
307
|
+
"type": "address[]"
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
"internalType": "uint256[]",
|
|
311
|
+
"name": "values",
|
|
312
|
+
"type": "uint256[]"
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
"internalType": "bytes[]",
|
|
316
|
+
"name": "datas",
|
|
317
|
+
"type": "bytes[]"
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
"internalType": "bytes32",
|
|
321
|
+
"name": "predecessor",
|
|
322
|
+
"type": "bytes32"
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
"internalType": "bytes32",
|
|
326
|
+
"name": "salt",
|
|
327
|
+
"type": "bytes32"
|
|
328
|
+
}
|
|
329
|
+
],
|
|
330
|
+
"name": "executeBatch",
|
|
331
|
+
"outputs": [],
|
|
332
|
+
"stateMutability": "payable",
|
|
333
|
+
"type": "function"
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
"inputs": [],
|
|
337
|
+
"name": "getMinDelay",
|
|
338
|
+
"outputs": [
|
|
339
|
+
{
|
|
340
|
+
"internalType": "uint256",
|
|
341
|
+
"name": "duration",
|
|
342
|
+
"type": "uint256"
|
|
343
|
+
}
|
|
344
|
+
],
|
|
345
|
+
"stateMutability": "view",
|
|
346
|
+
"type": "function"
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
"inputs": [
|
|
350
|
+
{
|
|
351
|
+
"internalType": "bytes32",
|
|
352
|
+
"name": "role",
|
|
353
|
+
"type": "bytes32"
|
|
354
|
+
}
|
|
355
|
+
],
|
|
356
|
+
"name": "getRoleAdmin",
|
|
357
|
+
"outputs": [
|
|
358
|
+
{
|
|
359
|
+
"internalType": "bytes32",
|
|
360
|
+
"name": "",
|
|
361
|
+
"type": "bytes32"
|
|
362
|
+
}
|
|
363
|
+
],
|
|
364
|
+
"stateMutability": "view",
|
|
365
|
+
"type": "function"
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
"inputs": [
|
|
369
|
+
{
|
|
370
|
+
"internalType": "bytes32",
|
|
371
|
+
"name": "id",
|
|
372
|
+
"type": "bytes32"
|
|
373
|
+
}
|
|
374
|
+
],
|
|
375
|
+
"name": "getTimestamp",
|
|
376
|
+
"outputs": [
|
|
377
|
+
{
|
|
378
|
+
"internalType": "uint256",
|
|
379
|
+
"name": "timestamp",
|
|
380
|
+
"type": "uint256"
|
|
381
|
+
}
|
|
382
|
+
],
|
|
383
|
+
"stateMutability": "view",
|
|
384
|
+
"type": "function"
|
|
385
|
+
},
|
|
386
|
+
{
|
|
387
|
+
"inputs": [
|
|
388
|
+
{
|
|
389
|
+
"internalType": "bytes32",
|
|
390
|
+
"name": "role",
|
|
391
|
+
"type": "bytes32"
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
"internalType": "address",
|
|
395
|
+
"name": "account",
|
|
396
|
+
"type": "address"
|
|
397
|
+
}
|
|
398
|
+
],
|
|
399
|
+
"name": "grantRole",
|
|
400
|
+
"outputs": [],
|
|
401
|
+
"stateMutability": "nonpayable",
|
|
402
|
+
"type": "function"
|
|
403
|
+
},
|
|
404
|
+
{
|
|
405
|
+
"inputs": [
|
|
406
|
+
{
|
|
407
|
+
"internalType": "bytes32",
|
|
408
|
+
"name": "role",
|
|
409
|
+
"type": "bytes32"
|
|
410
|
+
},
|
|
411
|
+
{
|
|
412
|
+
"internalType": "address",
|
|
413
|
+
"name": "account",
|
|
414
|
+
"type": "address"
|
|
415
|
+
}
|
|
416
|
+
],
|
|
417
|
+
"name": "hasRole",
|
|
418
|
+
"outputs": [
|
|
419
|
+
{
|
|
420
|
+
"internalType": "bool",
|
|
421
|
+
"name": "",
|
|
422
|
+
"type": "bool"
|
|
423
|
+
}
|
|
424
|
+
],
|
|
425
|
+
"stateMutability": "view",
|
|
426
|
+
"type": "function"
|
|
427
|
+
},
|
|
428
|
+
{
|
|
429
|
+
"inputs": [
|
|
430
|
+
{
|
|
431
|
+
"internalType": "address",
|
|
432
|
+
"name": "target",
|
|
433
|
+
"type": "address"
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
"internalType": "uint256",
|
|
437
|
+
"name": "value",
|
|
438
|
+
"type": "uint256"
|
|
439
|
+
},
|
|
440
|
+
{
|
|
441
|
+
"internalType": "bytes",
|
|
442
|
+
"name": "data",
|
|
443
|
+
"type": "bytes"
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
"internalType": "bytes32",
|
|
447
|
+
"name": "predecessor",
|
|
448
|
+
"type": "bytes32"
|
|
449
|
+
},
|
|
450
|
+
{
|
|
451
|
+
"internalType": "bytes32",
|
|
452
|
+
"name": "salt",
|
|
453
|
+
"type": "bytes32"
|
|
454
|
+
}
|
|
455
|
+
],
|
|
456
|
+
"name": "hashOperation",
|
|
457
|
+
"outputs": [
|
|
458
|
+
{
|
|
459
|
+
"internalType": "bytes32",
|
|
460
|
+
"name": "hash",
|
|
461
|
+
"type": "bytes32"
|
|
462
|
+
}
|
|
463
|
+
],
|
|
464
|
+
"stateMutability": "pure",
|
|
465
|
+
"type": "function"
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
"inputs": [
|
|
469
|
+
{
|
|
470
|
+
"internalType": "address[]",
|
|
471
|
+
"name": "targets",
|
|
472
|
+
"type": "address[]"
|
|
473
|
+
},
|
|
474
|
+
{
|
|
475
|
+
"internalType": "uint256[]",
|
|
476
|
+
"name": "values",
|
|
477
|
+
"type": "uint256[]"
|
|
478
|
+
},
|
|
479
|
+
{
|
|
480
|
+
"internalType": "bytes[]",
|
|
481
|
+
"name": "datas",
|
|
482
|
+
"type": "bytes[]"
|
|
483
|
+
},
|
|
484
|
+
{
|
|
485
|
+
"internalType": "bytes32",
|
|
486
|
+
"name": "predecessor",
|
|
487
|
+
"type": "bytes32"
|
|
488
|
+
},
|
|
489
|
+
{
|
|
490
|
+
"internalType": "bytes32",
|
|
491
|
+
"name": "salt",
|
|
492
|
+
"type": "bytes32"
|
|
493
|
+
}
|
|
494
|
+
],
|
|
495
|
+
"name": "hashOperationBatch",
|
|
496
|
+
"outputs": [
|
|
497
|
+
{
|
|
498
|
+
"internalType": "bytes32",
|
|
499
|
+
"name": "hash",
|
|
500
|
+
"type": "bytes32"
|
|
501
|
+
}
|
|
502
|
+
],
|
|
503
|
+
"stateMutability": "pure",
|
|
504
|
+
"type": "function"
|
|
505
|
+
},
|
|
506
|
+
{
|
|
507
|
+
"inputs": [
|
|
508
|
+
{
|
|
509
|
+
"internalType": "uint256",
|
|
510
|
+
"name": "minDelay",
|
|
511
|
+
"type": "uint256"
|
|
512
|
+
},
|
|
513
|
+
{
|
|
514
|
+
"internalType": "address[]",
|
|
515
|
+
"name": "proposers",
|
|
516
|
+
"type": "address[]"
|
|
517
|
+
},
|
|
518
|
+
{
|
|
519
|
+
"internalType": "address[]",
|
|
520
|
+
"name": "executors",
|
|
521
|
+
"type": "address[]"
|
|
522
|
+
}
|
|
523
|
+
],
|
|
524
|
+
"name": "initialize",
|
|
525
|
+
"outputs": [],
|
|
526
|
+
"stateMutability": "nonpayable",
|
|
527
|
+
"type": "function"
|
|
528
|
+
},
|
|
529
|
+
{
|
|
530
|
+
"inputs": [
|
|
531
|
+
{
|
|
532
|
+
"internalType": "bytes32",
|
|
533
|
+
"name": "id",
|
|
534
|
+
"type": "bytes32"
|
|
535
|
+
}
|
|
536
|
+
],
|
|
537
|
+
"name": "isOperation",
|
|
538
|
+
"outputs": [
|
|
539
|
+
{
|
|
540
|
+
"internalType": "bool",
|
|
541
|
+
"name": "pending",
|
|
542
|
+
"type": "bool"
|
|
543
|
+
}
|
|
544
|
+
],
|
|
545
|
+
"stateMutability": "view",
|
|
546
|
+
"type": "function"
|
|
547
|
+
},
|
|
548
|
+
{
|
|
549
|
+
"inputs": [
|
|
550
|
+
{
|
|
551
|
+
"internalType": "bytes32",
|
|
552
|
+
"name": "id",
|
|
553
|
+
"type": "bytes32"
|
|
554
|
+
}
|
|
555
|
+
],
|
|
556
|
+
"name": "isOperationDone",
|
|
557
|
+
"outputs": [
|
|
558
|
+
{
|
|
559
|
+
"internalType": "bool",
|
|
560
|
+
"name": "done",
|
|
561
|
+
"type": "bool"
|
|
562
|
+
}
|
|
563
|
+
],
|
|
564
|
+
"stateMutability": "view",
|
|
565
|
+
"type": "function"
|
|
566
|
+
},
|
|
567
|
+
{
|
|
568
|
+
"inputs": [
|
|
569
|
+
{
|
|
570
|
+
"internalType": "bytes32",
|
|
571
|
+
"name": "id",
|
|
572
|
+
"type": "bytes32"
|
|
573
|
+
}
|
|
574
|
+
],
|
|
575
|
+
"name": "isOperationPending",
|
|
576
|
+
"outputs": [
|
|
577
|
+
{
|
|
578
|
+
"internalType": "bool",
|
|
579
|
+
"name": "pending",
|
|
580
|
+
"type": "bool"
|
|
581
|
+
}
|
|
582
|
+
],
|
|
583
|
+
"stateMutability": "view",
|
|
584
|
+
"type": "function"
|
|
585
|
+
},
|
|
586
|
+
{
|
|
587
|
+
"inputs": [
|
|
588
|
+
{
|
|
589
|
+
"internalType": "bytes32",
|
|
590
|
+
"name": "id",
|
|
591
|
+
"type": "bytes32"
|
|
592
|
+
}
|
|
593
|
+
],
|
|
594
|
+
"name": "isOperationReady",
|
|
595
|
+
"outputs": [
|
|
596
|
+
{
|
|
597
|
+
"internalType": "bool",
|
|
598
|
+
"name": "ready",
|
|
599
|
+
"type": "bool"
|
|
600
|
+
}
|
|
601
|
+
],
|
|
602
|
+
"stateMutability": "view",
|
|
603
|
+
"type": "function"
|
|
604
|
+
},
|
|
605
|
+
{
|
|
606
|
+
"inputs": [
|
|
607
|
+
{
|
|
608
|
+
"internalType": "bytes32",
|
|
609
|
+
"name": "role",
|
|
610
|
+
"type": "bytes32"
|
|
611
|
+
},
|
|
612
|
+
{
|
|
613
|
+
"internalType": "address",
|
|
614
|
+
"name": "account",
|
|
615
|
+
"type": "address"
|
|
616
|
+
}
|
|
617
|
+
],
|
|
618
|
+
"name": "renounceRole",
|
|
619
|
+
"outputs": [],
|
|
620
|
+
"stateMutability": "nonpayable",
|
|
621
|
+
"type": "function"
|
|
622
|
+
},
|
|
623
|
+
{
|
|
624
|
+
"inputs": [
|
|
625
|
+
{
|
|
626
|
+
"internalType": "bytes32",
|
|
627
|
+
"name": "role",
|
|
628
|
+
"type": "bytes32"
|
|
629
|
+
},
|
|
630
|
+
{
|
|
631
|
+
"internalType": "address",
|
|
632
|
+
"name": "account",
|
|
633
|
+
"type": "address"
|
|
634
|
+
}
|
|
635
|
+
],
|
|
636
|
+
"name": "revokeRole",
|
|
637
|
+
"outputs": [],
|
|
638
|
+
"stateMutability": "nonpayable",
|
|
639
|
+
"type": "function"
|
|
640
|
+
},
|
|
641
|
+
{
|
|
642
|
+
"inputs": [
|
|
643
|
+
{
|
|
644
|
+
"internalType": "address",
|
|
645
|
+
"name": "target",
|
|
646
|
+
"type": "address"
|
|
647
|
+
},
|
|
648
|
+
{
|
|
649
|
+
"internalType": "uint256",
|
|
650
|
+
"name": "value",
|
|
651
|
+
"type": "uint256"
|
|
652
|
+
},
|
|
653
|
+
{
|
|
654
|
+
"internalType": "bytes",
|
|
655
|
+
"name": "data",
|
|
656
|
+
"type": "bytes"
|
|
657
|
+
},
|
|
658
|
+
{
|
|
659
|
+
"internalType": "bytes32",
|
|
660
|
+
"name": "predecessor",
|
|
661
|
+
"type": "bytes32"
|
|
662
|
+
},
|
|
663
|
+
{
|
|
664
|
+
"internalType": "bytes32",
|
|
665
|
+
"name": "salt",
|
|
666
|
+
"type": "bytes32"
|
|
667
|
+
},
|
|
668
|
+
{
|
|
669
|
+
"internalType": "uint256",
|
|
670
|
+
"name": "delay",
|
|
671
|
+
"type": "uint256"
|
|
672
|
+
}
|
|
673
|
+
],
|
|
674
|
+
"name": "schedule",
|
|
675
|
+
"outputs": [],
|
|
676
|
+
"stateMutability": "nonpayable",
|
|
677
|
+
"type": "function"
|
|
678
|
+
},
|
|
679
|
+
{
|
|
680
|
+
"inputs": [
|
|
681
|
+
{
|
|
682
|
+
"internalType": "address[]",
|
|
683
|
+
"name": "targets",
|
|
684
|
+
"type": "address[]"
|
|
685
|
+
},
|
|
686
|
+
{
|
|
687
|
+
"internalType": "uint256[]",
|
|
688
|
+
"name": "values",
|
|
689
|
+
"type": "uint256[]"
|
|
690
|
+
},
|
|
691
|
+
{
|
|
692
|
+
"internalType": "bytes[]",
|
|
693
|
+
"name": "datas",
|
|
694
|
+
"type": "bytes[]"
|
|
695
|
+
},
|
|
696
|
+
{
|
|
697
|
+
"internalType": "bytes32",
|
|
698
|
+
"name": "predecessor",
|
|
699
|
+
"type": "bytes32"
|
|
700
|
+
},
|
|
701
|
+
{
|
|
702
|
+
"internalType": "bytes32",
|
|
703
|
+
"name": "salt",
|
|
704
|
+
"type": "bytes32"
|
|
705
|
+
},
|
|
706
|
+
{
|
|
707
|
+
"internalType": "uint256",
|
|
708
|
+
"name": "delay",
|
|
709
|
+
"type": "uint256"
|
|
710
|
+
}
|
|
711
|
+
],
|
|
712
|
+
"name": "scheduleBatch",
|
|
713
|
+
"outputs": [],
|
|
714
|
+
"stateMutability": "nonpayable",
|
|
715
|
+
"type": "function"
|
|
716
|
+
},
|
|
717
|
+
{
|
|
718
|
+
"inputs": [
|
|
719
|
+
{
|
|
720
|
+
"internalType": "bytes4",
|
|
721
|
+
"name": "interfaceId",
|
|
722
|
+
"type": "bytes4"
|
|
723
|
+
}
|
|
724
|
+
],
|
|
725
|
+
"name": "supportsInterface",
|
|
726
|
+
"outputs": [
|
|
727
|
+
{
|
|
728
|
+
"internalType": "bool",
|
|
729
|
+
"name": "",
|
|
730
|
+
"type": "bool"
|
|
731
|
+
}
|
|
732
|
+
],
|
|
733
|
+
"stateMutability": "view",
|
|
734
|
+
"type": "function"
|
|
735
|
+
},
|
|
736
|
+
{
|
|
737
|
+
"inputs": [
|
|
738
|
+
{
|
|
739
|
+
"internalType": "uint256",
|
|
740
|
+
"name": "newDelay",
|
|
741
|
+
"type": "uint256"
|
|
742
|
+
}
|
|
743
|
+
],
|
|
744
|
+
"name": "updateDelay",
|
|
745
|
+
"outputs": [],
|
|
746
|
+
"stateMutability": "nonpayable",
|
|
747
|
+
"type": "function"
|
|
748
|
+
},
|
|
749
|
+
{
|
|
750
|
+
"stateMutability": "payable",
|
|
751
|
+
"type": "receive"
|
|
752
|
+
}
|
|
753
|
+
];
|
|
754
|
+
/**
|
|
755
|
+
* UnlockProtocolTimelock_json Contract Class
|
|
756
|
+
*
|
|
757
|
+
* Provides a class-based API similar to TypeChain for interacting with the contract.
|
|
758
|
+
*
|
|
759
|
+
* @example
|
|
760
|
+
* ```typescript
|
|
761
|
+
* import { createPublicClient, createWalletClient, http } from 'viem';
|
|
762
|
+
* import { mainnet } from 'viem/chains';
|
|
763
|
+
* import { UnlockProtocolTimelock_json } from 'UnlockProtocolTimelock_json';
|
|
764
|
+
*
|
|
765
|
+
* const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
766
|
+
* const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
767
|
+
*
|
|
768
|
+
* const contract = new UnlockProtocolTimelock_json('0x...', { publicClient, walletClient });
|
|
769
|
+
*
|
|
770
|
+
* // Read functions
|
|
771
|
+
* const result = await contract.balanceOf('0x...');
|
|
772
|
+
*
|
|
773
|
+
* // Write functions
|
|
774
|
+
* const hash = await contract.transfer('0x...', 1000n);
|
|
775
|
+
*
|
|
776
|
+
* // Simulate transactions (dry-run)
|
|
777
|
+
* const simulation = await contract.simulate.transfer('0x...', 1000n);
|
|
778
|
+
* console.log('Gas estimate:', simulation.request.gas);
|
|
779
|
+
*
|
|
780
|
+
* // Watch events
|
|
781
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
782
|
+
* console.log('Transfer event:', event);
|
|
783
|
+
* });
|
|
784
|
+
* ```
|
|
785
|
+
*/
|
|
786
|
+
class UnlockProtocolTimelock_json {
|
|
787
|
+
constructor(address, clients) {
|
|
788
|
+
this.contractAddress = address;
|
|
789
|
+
this.publicClient = clients.publicClient;
|
|
790
|
+
this.contract = (0, viem_1.getContract)({
|
|
791
|
+
address,
|
|
792
|
+
abi: exports.UnlockProtocolTimelock_jsonAbi,
|
|
793
|
+
client: {
|
|
794
|
+
public: clients.publicClient,
|
|
795
|
+
wallet: clients.walletClient,
|
|
796
|
+
},
|
|
797
|
+
});
|
|
798
|
+
}
|
|
799
|
+
/**
|
|
800
|
+
* Get the contract address
|
|
801
|
+
*/
|
|
802
|
+
get address() {
|
|
803
|
+
return this.contractAddress;
|
|
804
|
+
}
|
|
805
|
+
/**
|
|
806
|
+
* Get the underlying viem contract instance
|
|
807
|
+
*/
|
|
808
|
+
getContract() {
|
|
809
|
+
return this.contract;
|
|
810
|
+
}
|
|
811
|
+
/**
|
|
812
|
+
* DEFAULT_ADMIN_ROLE
|
|
813
|
+
* view
|
|
814
|
+
*/
|
|
815
|
+
async DEFAULT_ADMIN_ROLE() {
|
|
816
|
+
return this.contract.read.DEFAULT_ADMIN_ROLE();
|
|
817
|
+
}
|
|
818
|
+
/**
|
|
819
|
+
* EXECUTOR_ROLE
|
|
820
|
+
* view
|
|
821
|
+
*/
|
|
822
|
+
async EXECUTOR_ROLE() {
|
|
823
|
+
return this.contract.read.EXECUTOR_ROLE();
|
|
824
|
+
}
|
|
825
|
+
/**
|
|
826
|
+
* PROPOSER_ROLE
|
|
827
|
+
* view
|
|
828
|
+
*/
|
|
829
|
+
async PROPOSER_ROLE() {
|
|
830
|
+
return this.contract.read.PROPOSER_ROLE();
|
|
831
|
+
}
|
|
832
|
+
/**
|
|
833
|
+
* TIMELOCK_ADMIN_ROLE
|
|
834
|
+
* view
|
|
835
|
+
*/
|
|
836
|
+
async TIMELOCK_ADMIN_ROLE() {
|
|
837
|
+
return this.contract.read.TIMELOCK_ADMIN_ROLE();
|
|
838
|
+
}
|
|
839
|
+
/**
|
|
840
|
+
* getMinDelay
|
|
841
|
+
* view
|
|
842
|
+
*/
|
|
843
|
+
async getMinDelay() {
|
|
844
|
+
return this.contract.read.getMinDelay();
|
|
845
|
+
}
|
|
846
|
+
/**
|
|
847
|
+
* getRoleAdmin
|
|
848
|
+
* view
|
|
849
|
+
*/
|
|
850
|
+
async getRoleAdmin(role) {
|
|
851
|
+
return this.contract.read.getRoleAdmin([role]);
|
|
852
|
+
}
|
|
853
|
+
/**
|
|
854
|
+
* getTimestamp
|
|
855
|
+
* view
|
|
856
|
+
*/
|
|
857
|
+
async getTimestamp(id) {
|
|
858
|
+
return this.contract.read.getTimestamp([id]);
|
|
859
|
+
}
|
|
860
|
+
/**
|
|
861
|
+
* hasRole
|
|
862
|
+
* view
|
|
863
|
+
*/
|
|
864
|
+
async hasRole(role, account) {
|
|
865
|
+
return this.contract.read.hasRole([role, account]);
|
|
866
|
+
}
|
|
867
|
+
/**
|
|
868
|
+
* hashOperation
|
|
869
|
+
* pure
|
|
870
|
+
*/
|
|
871
|
+
async hashOperation(target, value, data, predecessor, salt) {
|
|
872
|
+
return this.contract.read.hashOperation([target, value, data, predecessor, salt]);
|
|
873
|
+
}
|
|
874
|
+
/**
|
|
875
|
+
* hashOperationBatch
|
|
876
|
+
* pure
|
|
877
|
+
*/
|
|
878
|
+
async hashOperationBatch(targets, values, datas, predecessor, salt) {
|
|
879
|
+
return this.contract.read.hashOperationBatch([targets, values, datas, predecessor, salt]);
|
|
880
|
+
}
|
|
881
|
+
/**
|
|
882
|
+
* isOperation
|
|
883
|
+
* view
|
|
884
|
+
*/
|
|
885
|
+
async isOperation(id) {
|
|
886
|
+
return this.contract.read.isOperation([id]);
|
|
887
|
+
}
|
|
888
|
+
/**
|
|
889
|
+
* isOperationDone
|
|
890
|
+
* view
|
|
891
|
+
*/
|
|
892
|
+
async isOperationDone(id) {
|
|
893
|
+
return this.contract.read.isOperationDone([id]);
|
|
894
|
+
}
|
|
895
|
+
/**
|
|
896
|
+
* isOperationPending
|
|
897
|
+
* view
|
|
898
|
+
*/
|
|
899
|
+
async isOperationPending(id) {
|
|
900
|
+
return this.contract.read.isOperationPending([id]);
|
|
901
|
+
}
|
|
902
|
+
/**
|
|
903
|
+
* isOperationReady
|
|
904
|
+
* view
|
|
905
|
+
*/
|
|
906
|
+
async isOperationReady(id) {
|
|
907
|
+
return this.contract.read.isOperationReady([id]);
|
|
908
|
+
}
|
|
909
|
+
/**
|
|
910
|
+
* supportsInterface
|
|
911
|
+
* view
|
|
912
|
+
*/
|
|
913
|
+
async supportsInterface(interfaceId) {
|
|
914
|
+
return this.contract.read.supportsInterface([interfaceId]);
|
|
915
|
+
}
|
|
916
|
+
/**
|
|
917
|
+
* cancel
|
|
918
|
+
* nonpayable
|
|
919
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
920
|
+
*/
|
|
921
|
+
async cancel(id, options) {
|
|
922
|
+
if (!this.contract.write) {
|
|
923
|
+
throw new Error('Wallet client is required for write operations');
|
|
924
|
+
}
|
|
925
|
+
return this.contract.write.cancel([id], options);
|
|
926
|
+
}
|
|
927
|
+
/**
|
|
928
|
+
* execute
|
|
929
|
+
* payable
|
|
930
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
931
|
+
*/
|
|
932
|
+
async execute(target, value, data, predecessor, salt, options) {
|
|
933
|
+
if (!this.contract.write) {
|
|
934
|
+
throw new Error('Wallet client is required for write operations');
|
|
935
|
+
}
|
|
936
|
+
return this.contract.write.execute([target, value, data, predecessor, salt], options);
|
|
937
|
+
}
|
|
938
|
+
/**
|
|
939
|
+
* executeBatch
|
|
940
|
+
* payable
|
|
941
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
942
|
+
*/
|
|
943
|
+
async executeBatch(targets, values, datas, predecessor, salt, options) {
|
|
944
|
+
if (!this.contract.write) {
|
|
945
|
+
throw new Error('Wallet client is required for write operations');
|
|
946
|
+
}
|
|
947
|
+
return this.contract.write.executeBatch([targets, values, datas, predecessor, salt], options);
|
|
948
|
+
}
|
|
949
|
+
/**
|
|
950
|
+
* grantRole
|
|
951
|
+
* nonpayable
|
|
952
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
953
|
+
*/
|
|
954
|
+
async grantRole(role, account, options) {
|
|
955
|
+
if (!this.contract.write) {
|
|
956
|
+
throw new Error('Wallet client is required for write operations');
|
|
957
|
+
}
|
|
958
|
+
return this.contract.write.grantRole([role, account], options);
|
|
959
|
+
}
|
|
960
|
+
/**
|
|
961
|
+
* initialize
|
|
962
|
+
* nonpayable
|
|
963
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
964
|
+
*/
|
|
965
|
+
async initialize(minDelay, proposers, executors, options) {
|
|
966
|
+
if (!this.contract.write) {
|
|
967
|
+
throw new Error('Wallet client is required for write operations');
|
|
968
|
+
}
|
|
969
|
+
return this.contract.write.initialize([minDelay, proposers, executors], options);
|
|
970
|
+
}
|
|
971
|
+
/**
|
|
972
|
+
* renounceRole
|
|
973
|
+
* nonpayable
|
|
974
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
975
|
+
*/
|
|
976
|
+
async renounceRole(role, account, options) {
|
|
977
|
+
if (!this.contract.write) {
|
|
978
|
+
throw new Error('Wallet client is required for write operations');
|
|
979
|
+
}
|
|
980
|
+
return this.contract.write.renounceRole([role, account], options);
|
|
981
|
+
}
|
|
982
|
+
/**
|
|
983
|
+
* revokeRole
|
|
984
|
+
* nonpayable
|
|
985
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
986
|
+
*/
|
|
987
|
+
async revokeRole(role, account, options) {
|
|
988
|
+
if (!this.contract.write) {
|
|
989
|
+
throw new Error('Wallet client is required for write operations');
|
|
990
|
+
}
|
|
991
|
+
return this.contract.write.revokeRole([role, account], options);
|
|
992
|
+
}
|
|
993
|
+
/**
|
|
994
|
+
* schedule
|
|
995
|
+
* nonpayable
|
|
996
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
997
|
+
*/
|
|
998
|
+
async schedule(target, value, data, predecessor, salt, delay, options) {
|
|
999
|
+
if (!this.contract.write) {
|
|
1000
|
+
throw new Error('Wallet client is required for write operations');
|
|
1001
|
+
}
|
|
1002
|
+
return this.contract.write.schedule([target, value, data, predecessor, salt, delay], options);
|
|
1003
|
+
}
|
|
1004
|
+
/**
|
|
1005
|
+
* scheduleBatch
|
|
1006
|
+
* nonpayable
|
|
1007
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1008
|
+
*/
|
|
1009
|
+
async scheduleBatch(targets, values, datas, predecessor, salt, delay, options) {
|
|
1010
|
+
if (!this.contract.write) {
|
|
1011
|
+
throw new Error('Wallet client is required for write operations');
|
|
1012
|
+
}
|
|
1013
|
+
return this.contract.write.scheduleBatch([targets, values, datas, predecessor, salt, delay], options);
|
|
1014
|
+
}
|
|
1015
|
+
/**
|
|
1016
|
+
* updateDelay
|
|
1017
|
+
* nonpayable
|
|
1018
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1019
|
+
*/
|
|
1020
|
+
async updateDelay(newDelay, options) {
|
|
1021
|
+
if (!this.contract.write) {
|
|
1022
|
+
throw new Error('Wallet client is required for write operations');
|
|
1023
|
+
}
|
|
1024
|
+
return this.contract.write.updateDelay([newDelay], options);
|
|
1025
|
+
}
|
|
1026
|
+
/**
|
|
1027
|
+
* Simulate contract write operations (dry-run without sending transaction)
|
|
1028
|
+
*
|
|
1029
|
+
* @example
|
|
1030
|
+
* const result = await contract.simulate.transfer('0x...', 1000n);
|
|
1031
|
+
* console.log('Gas estimate:', result.request.gas);
|
|
1032
|
+
* console.log('Would succeed:', result.result);
|
|
1033
|
+
*/
|
|
1034
|
+
get simulate() {
|
|
1035
|
+
const contract = this.contract;
|
|
1036
|
+
if (!contract.simulate) {
|
|
1037
|
+
throw new Error('Public client is required for simulation');
|
|
1038
|
+
}
|
|
1039
|
+
return {
|
|
1040
|
+
/**
|
|
1041
|
+
* Simulate cancel
|
|
1042
|
+
* Returns gas estimate and result without sending transaction
|
|
1043
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1044
|
+
*/
|
|
1045
|
+
async cancel(id, options) {
|
|
1046
|
+
return contract.simulate.cancel([id], options);
|
|
1047
|
+
},
|
|
1048
|
+
/**
|
|
1049
|
+
* Simulate execute
|
|
1050
|
+
* Returns gas estimate and result without sending transaction
|
|
1051
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1052
|
+
*/
|
|
1053
|
+
async execute(target, value, data, predecessor, salt, options) {
|
|
1054
|
+
return contract.simulate.execute([target, value, data, predecessor, salt], options);
|
|
1055
|
+
},
|
|
1056
|
+
/**
|
|
1057
|
+
* Simulate executeBatch
|
|
1058
|
+
* Returns gas estimate and result without sending transaction
|
|
1059
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1060
|
+
*/
|
|
1061
|
+
async executeBatch(targets, values, datas, predecessor, salt, options) {
|
|
1062
|
+
return contract.simulate.executeBatch([targets, values, datas, predecessor, salt], options);
|
|
1063
|
+
},
|
|
1064
|
+
/**
|
|
1065
|
+
* Simulate grantRole
|
|
1066
|
+
* Returns gas estimate and result without sending transaction
|
|
1067
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1068
|
+
*/
|
|
1069
|
+
async grantRole(role, account, options) {
|
|
1070
|
+
return contract.simulate.grantRole([role, account], options);
|
|
1071
|
+
},
|
|
1072
|
+
/**
|
|
1073
|
+
* Simulate initialize
|
|
1074
|
+
* Returns gas estimate and result without sending transaction
|
|
1075
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1076
|
+
*/
|
|
1077
|
+
async initialize(minDelay, proposers, executors, options) {
|
|
1078
|
+
return contract.simulate.initialize([minDelay, proposers, executors], options);
|
|
1079
|
+
},
|
|
1080
|
+
/**
|
|
1081
|
+
* Simulate renounceRole
|
|
1082
|
+
* Returns gas estimate and result without sending transaction
|
|
1083
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1084
|
+
*/
|
|
1085
|
+
async renounceRole(role, account, options) {
|
|
1086
|
+
return contract.simulate.renounceRole([role, account], options);
|
|
1087
|
+
},
|
|
1088
|
+
/**
|
|
1089
|
+
* Simulate revokeRole
|
|
1090
|
+
* Returns gas estimate and result without sending transaction
|
|
1091
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1092
|
+
*/
|
|
1093
|
+
async revokeRole(role, account, options) {
|
|
1094
|
+
return contract.simulate.revokeRole([role, account], options);
|
|
1095
|
+
},
|
|
1096
|
+
/**
|
|
1097
|
+
* Simulate schedule
|
|
1098
|
+
* Returns gas estimate and result without sending transaction
|
|
1099
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1100
|
+
*/
|
|
1101
|
+
async schedule(target, value, data, predecessor, salt, delay, options) {
|
|
1102
|
+
return contract.simulate.schedule([target, value, data, predecessor, salt, delay], options);
|
|
1103
|
+
},
|
|
1104
|
+
/**
|
|
1105
|
+
* Simulate scheduleBatch
|
|
1106
|
+
* Returns gas estimate and result without sending transaction
|
|
1107
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1108
|
+
*/
|
|
1109
|
+
async scheduleBatch(targets, values, datas, predecessor, salt, delay, options) {
|
|
1110
|
+
return contract.simulate.scheduleBatch([targets, values, datas, predecessor, salt, delay], options);
|
|
1111
|
+
},
|
|
1112
|
+
/**
|
|
1113
|
+
* Simulate updateDelay
|
|
1114
|
+
* Returns gas estimate and result without sending transaction
|
|
1115
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1116
|
+
*/
|
|
1117
|
+
async updateDelay(newDelay, options) {
|
|
1118
|
+
return contract.simulate.updateDelay([newDelay], options);
|
|
1119
|
+
}
|
|
1120
|
+
};
|
|
1121
|
+
}
|
|
1122
|
+
/**
|
|
1123
|
+
* Watch contract events
|
|
1124
|
+
*
|
|
1125
|
+
* @example
|
|
1126
|
+
* // Watch all Transfer events
|
|
1127
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
1128
|
+
* console.log('Transfer:', event);
|
|
1129
|
+
* });
|
|
1130
|
+
*
|
|
1131
|
+
* // Stop watching
|
|
1132
|
+
* unwatch();
|
|
1133
|
+
*/
|
|
1134
|
+
get watch() {
|
|
1135
|
+
return {
|
|
1136
|
+
/**
|
|
1137
|
+
* Watch CallExecuted events
|
|
1138
|
+
* @param callback Function to call when event is emitted
|
|
1139
|
+
* @param filter Optional filter for indexed parameters
|
|
1140
|
+
* @returns Unwatch function to stop listening
|
|
1141
|
+
*/
|
|
1142
|
+
CallExecuted: (callback, filter) => {
|
|
1143
|
+
return this.publicClient.watchContractEvent({
|
|
1144
|
+
address: this.contractAddress,
|
|
1145
|
+
abi: exports.UnlockProtocolTimelock_jsonAbi,
|
|
1146
|
+
eventName: 'CallExecuted',
|
|
1147
|
+
args: filter,
|
|
1148
|
+
onLogs: (logs) => {
|
|
1149
|
+
logs.forEach((log) => {
|
|
1150
|
+
callback(log.args);
|
|
1151
|
+
});
|
|
1152
|
+
},
|
|
1153
|
+
});
|
|
1154
|
+
},
|
|
1155
|
+
/**
|
|
1156
|
+
* Watch CallScheduled events
|
|
1157
|
+
* @param callback Function to call when event is emitted
|
|
1158
|
+
* @param filter Optional filter for indexed parameters
|
|
1159
|
+
* @returns Unwatch function to stop listening
|
|
1160
|
+
*/
|
|
1161
|
+
CallScheduled: (callback, filter) => {
|
|
1162
|
+
return this.publicClient.watchContractEvent({
|
|
1163
|
+
address: this.contractAddress,
|
|
1164
|
+
abi: exports.UnlockProtocolTimelock_jsonAbi,
|
|
1165
|
+
eventName: 'CallScheduled',
|
|
1166
|
+
args: filter,
|
|
1167
|
+
onLogs: (logs) => {
|
|
1168
|
+
logs.forEach((log) => {
|
|
1169
|
+
callback(log.args);
|
|
1170
|
+
});
|
|
1171
|
+
},
|
|
1172
|
+
});
|
|
1173
|
+
},
|
|
1174
|
+
/**
|
|
1175
|
+
* Watch Cancelled events
|
|
1176
|
+
* @param callback Function to call when event is emitted
|
|
1177
|
+
* @param filter Optional filter for indexed parameters
|
|
1178
|
+
* @returns Unwatch function to stop listening
|
|
1179
|
+
*/
|
|
1180
|
+
Cancelled: (callback, filter) => {
|
|
1181
|
+
return this.publicClient.watchContractEvent({
|
|
1182
|
+
address: this.contractAddress,
|
|
1183
|
+
abi: exports.UnlockProtocolTimelock_jsonAbi,
|
|
1184
|
+
eventName: 'Cancelled',
|
|
1185
|
+
args: filter,
|
|
1186
|
+
onLogs: (logs) => {
|
|
1187
|
+
logs.forEach((log) => {
|
|
1188
|
+
callback(log.args);
|
|
1189
|
+
});
|
|
1190
|
+
},
|
|
1191
|
+
});
|
|
1192
|
+
},
|
|
1193
|
+
/**
|
|
1194
|
+
* Watch MinDelayChange events
|
|
1195
|
+
* @param callback Function to call when event is emitted
|
|
1196
|
+
* @param filter Optional filter for indexed parameters
|
|
1197
|
+
* @returns Unwatch function to stop listening
|
|
1198
|
+
*/
|
|
1199
|
+
MinDelayChange: (callback) => {
|
|
1200
|
+
return this.publicClient.watchContractEvent({
|
|
1201
|
+
address: this.contractAddress,
|
|
1202
|
+
abi: exports.UnlockProtocolTimelock_jsonAbi,
|
|
1203
|
+
eventName: 'MinDelayChange',
|
|
1204
|
+
onLogs: (logs) => {
|
|
1205
|
+
logs.forEach((log) => {
|
|
1206
|
+
callback(log.args);
|
|
1207
|
+
});
|
|
1208
|
+
},
|
|
1209
|
+
});
|
|
1210
|
+
},
|
|
1211
|
+
/**
|
|
1212
|
+
* Watch RoleAdminChanged events
|
|
1213
|
+
* @param callback Function to call when event is emitted
|
|
1214
|
+
* @param filter Optional filter for indexed parameters
|
|
1215
|
+
* @returns Unwatch function to stop listening
|
|
1216
|
+
*/
|
|
1217
|
+
RoleAdminChanged: (callback, filter) => {
|
|
1218
|
+
return this.publicClient.watchContractEvent({
|
|
1219
|
+
address: this.contractAddress,
|
|
1220
|
+
abi: exports.UnlockProtocolTimelock_jsonAbi,
|
|
1221
|
+
eventName: 'RoleAdminChanged',
|
|
1222
|
+
args: filter,
|
|
1223
|
+
onLogs: (logs) => {
|
|
1224
|
+
logs.forEach((log) => {
|
|
1225
|
+
callback(log.args);
|
|
1226
|
+
});
|
|
1227
|
+
},
|
|
1228
|
+
});
|
|
1229
|
+
},
|
|
1230
|
+
/**
|
|
1231
|
+
* Watch RoleGranted events
|
|
1232
|
+
* @param callback Function to call when event is emitted
|
|
1233
|
+
* @param filter Optional filter for indexed parameters
|
|
1234
|
+
* @returns Unwatch function to stop listening
|
|
1235
|
+
*/
|
|
1236
|
+
RoleGranted: (callback, filter) => {
|
|
1237
|
+
return this.publicClient.watchContractEvent({
|
|
1238
|
+
address: this.contractAddress,
|
|
1239
|
+
abi: exports.UnlockProtocolTimelock_jsonAbi,
|
|
1240
|
+
eventName: 'RoleGranted',
|
|
1241
|
+
args: filter,
|
|
1242
|
+
onLogs: (logs) => {
|
|
1243
|
+
logs.forEach((log) => {
|
|
1244
|
+
callback(log.args);
|
|
1245
|
+
});
|
|
1246
|
+
},
|
|
1247
|
+
});
|
|
1248
|
+
},
|
|
1249
|
+
/**
|
|
1250
|
+
* Watch RoleRevoked events
|
|
1251
|
+
* @param callback Function to call when event is emitted
|
|
1252
|
+
* @param filter Optional filter for indexed parameters
|
|
1253
|
+
* @returns Unwatch function to stop listening
|
|
1254
|
+
*/
|
|
1255
|
+
RoleRevoked: (callback, filter) => {
|
|
1256
|
+
return this.publicClient.watchContractEvent({
|
|
1257
|
+
address: this.contractAddress,
|
|
1258
|
+
abi: exports.UnlockProtocolTimelock_jsonAbi,
|
|
1259
|
+
eventName: 'RoleRevoked',
|
|
1260
|
+
args: filter,
|
|
1261
|
+
onLogs: (logs) => {
|
|
1262
|
+
logs.forEach((log) => {
|
|
1263
|
+
callback(log.args);
|
|
1264
|
+
});
|
|
1265
|
+
},
|
|
1266
|
+
});
|
|
1267
|
+
}
|
|
1268
|
+
};
|
|
1269
|
+
}
|
|
1270
|
+
}
|
|
1271
|
+
exports.UnlockProtocolTimelock_json = UnlockProtocolTimelock_json;
|