@gitmyabi/codexproxyadmin 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 +108 -0
- package/contracts/CodeXProxyAdmin_json.d.ts +1909 -0
- package/contracts/CodeXProxyAdmin_json.js +2083 -0
- package/contracts/CodeXProxyAdmin_json.ts +2535 -0
- package/contracts/CodeXProxy_json.d.ts +148 -0
- package/contracts/CodeXProxy_json.js +185 -0
- package/contracts/CodeXProxy_json.ts +214 -0
- package/contracts/index.d.ts +4 -0
- package/contracts/index.js +10 -0
- package/contracts/index.ts +5 -0
- package/index.d.ts +1 -0
- package/index.js +19 -0
- package/package.json +43 -0
|
@@ -0,0 +1,2535 @@
|
|
|
1
|
+
import type { Abi, Address, PublicClient, WalletClient, GetContractReturnType } from 'viem';
|
|
2
|
+
import { getContract } from 'viem';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* CodeXProxyAdmin_json ABI
|
|
6
|
+
*
|
|
7
|
+
* This ABI is typed using viem's type system for full type safety.
|
|
8
|
+
*/
|
|
9
|
+
export const CodeXProxyAdmin_jsonAbi = [
|
|
10
|
+
{
|
|
11
|
+
"inputs": [],
|
|
12
|
+
"stateMutability": "nonpayable",
|
|
13
|
+
"type": "constructor"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"inputs": [],
|
|
17
|
+
"name": "AccessControlBadConfirmation",
|
|
18
|
+
"type": "error"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"inputs": [
|
|
22
|
+
{
|
|
23
|
+
"internalType": "address",
|
|
24
|
+
"name": "account",
|
|
25
|
+
"type": "address"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"internalType": "bytes32",
|
|
29
|
+
"name": "neededRole",
|
|
30
|
+
"type": "bytes32"
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
"name": "AccessControlUnauthorizedAccount",
|
|
34
|
+
"type": "error"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"inputs": [
|
|
38
|
+
{
|
|
39
|
+
"internalType": "address",
|
|
40
|
+
"name": "target",
|
|
41
|
+
"type": "address"
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
"name": "AddressEmptyCode",
|
|
45
|
+
"type": "error"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"inputs": [],
|
|
49
|
+
"name": "AuditApprovalMissing",
|
|
50
|
+
"type": "error"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"inputs": [
|
|
54
|
+
{
|
|
55
|
+
"internalType": "address",
|
|
56
|
+
"name": "implementation",
|
|
57
|
+
"type": "address"
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
"name": "ERC1967InvalidImplementation",
|
|
61
|
+
"type": "error"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"inputs": [],
|
|
65
|
+
"name": "ERC1967NonPayable",
|
|
66
|
+
"type": "error"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"inputs": [],
|
|
70
|
+
"name": "EnforcedPause",
|
|
71
|
+
"type": "error"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"inputs": [],
|
|
75
|
+
"name": "ExpectedPause",
|
|
76
|
+
"type": "error"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"inputs": [],
|
|
80
|
+
"name": "FailedCall",
|
|
81
|
+
"type": "error"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"inputs": [],
|
|
85
|
+
"name": "InsufficientApprovals",
|
|
86
|
+
"type": "error"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"inputs": [],
|
|
90
|
+
"name": "InvalidAddress",
|
|
91
|
+
"type": "error"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"inputs": [],
|
|
95
|
+
"name": "InvalidInitialization",
|
|
96
|
+
"type": "error"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"inputs": [],
|
|
100
|
+
"name": "NoPendingUpgrade",
|
|
101
|
+
"type": "error"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"inputs": [],
|
|
105
|
+
"name": "NotInitializing",
|
|
106
|
+
"type": "error"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"inputs": [],
|
|
110
|
+
"name": "ProxyAlreadyRegistered",
|
|
111
|
+
"type": "error"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"inputs": [],
|
|
115
|
+
"name": "ProxyNotRegistered",
|
|
116
|
+
"type": "error"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"inputs": [],
|
|
120
|
+
"name": "ReentrancyDetected",
|
|
121
|
+
"type": "error"
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"inputs": [],
|
|
125
|
+
"name": "TimelockPending",
|
|
126
|
+
"type": "error"
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"inputs": [],
|
|
130
|
+
"name": "UUPSUnauthorizedCallContext",
|
|
131
|
+
"type": "error"
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"inputs": [
|
|
135
|
+
{
|
|
136
|
+
"internalType": "bytes32",
|
|
137
|
+
"name": "slot",
|
|
138
|
+
"type": "bytes32"
|
|
139
|
+
}
|
|
140
|
+
],
|
|
141
|
+
"name": "UUPSUnsupportedProxiableUUID",
|
|
142
|
+
"type": "error"
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"inputs": [
|
|
146
|
+
{
|
|
147
|
+
"internalType": "bytes",
|
|
148
|
+
"name": "reason",
|
|
149
|
+
"type": "bytes"
|
|
150
|
+
}
|
|
151
|
+
],
|
|
152
|
+
"name": "UpgradeCallFailed",
|
|
153
|
+
"type": "error"
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"inputs": [],
|
|
157
|
+
"name": "UpgradeFrozen",
|
|
158
|
+
"type": "error"
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"anonymous": false,
|
|
162
|
+
"inputs": [
|
|
163
|
+
{
|
|
164
|
+
"indexed": false,
|
|
165
|
+
"internalType": "uint64",
|
|
166
|
+
"name": "version",
|
|
167
|
+
"type": "uint64"
|
|
168
|
+
}
|
|
169
|
+
],
|
|
170
|
+
"name": "Initialized",
|
|
171
|
+
"type": "event"
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"anonymous": false,
|
|
175
|
+
"inputs": [
|
|
176
|
+
{
|
|
177
|
+
"indexed": false,
|
|
178
|
+
"internalType": "address",
|
|
179
|
+
"name": "account",
|
|
180
|
+
"type": "address"
|
|
181
|
+
}
|
|
182
|
+
],
|
|
183
|
+
"name": "Paused",
|
|
184
|
+
"type": "event"
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
"anonymous": false,
|
|
188
|
+
"inputs": [
|
|
189
|
+
{
|
|
190
|
+
"indexed": true,
|
|
191
|
+
"internalType": "address",
|
|
192
|
+
"name": "proxy",
|
|
193
|
+
"type": "address"
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
"indexed": true,
|
|
197
|
+
"internalType": "address",
|
|
198
|
+
"name": "implementation",
|
|
199
|
+
"type": "address"
|
|
200
|
+
}
|
|
201
|
+
],
|
|
202
|
+
"name": "ProxyRegistered",
|
|
203
|
+
"type": "event"
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
"anonymous": false,
|
|
207
|
+
"inputs": [
|
|
208
|
+
{
|
|
209
|
+
"indexed": true,
|
|
210
|
+
"internalType": "bytes32",
|
|
211
|
+
"name": "role",
|
|
212
|
+
"type": "bytes32"
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
"indexed": true,
|
|
216
|
+
"internalType": "bytes32",
|
|
217
|
+
"name": "previousAdminRole",
|
|
218
|
+
"type": "bytes32"
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"indexed": true,
|
|
222
|
+
"internalType": "bytes32",
|
|
223
|
+
"name": "newAdminRole",
|
|
224
|
+
"type": "bytes32"
|
|
225
|
+
}
|
|
226
|
+
],
|
|
227
|
+
"name": "RoleAdminChanged",
|
|
228
|
+
"type": "event"
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
"anonymous": false,
|
|
232
|
+
"inputs": [
|
|
233
|
+
{
|
|
234
|
+
"indexed": true,
|
|
235
|
+
"internalType": "bytes32",
|
|
236
|
+
"name": "role",
|
|
237
|
+
"type": "bytes32"
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
"indexed": true,
|
|
241
|
+
"internalType": "address",
|
|
242
|
+
"name": "account",
|
|
243
|
+
"type": "address"
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
"indexed": true,
|
|
247
|
+
"internalType": "address",
|
|
248
|
+
"name": "sender",
|
|
249
|
+
"type": "address"
|
|
250
|
+
}
|
|
251
|
+
],
|
|
252
|
+
"name": "RoleGranted",
|
|
253
|
+
"type": "event"
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
"anonymous": false,
|
|
257
|
+
"inputs": [
|
|
258
|
+
{
|
|
259
|
+
"indexed": true,
|
|
260
|
+
"internalType": "bytes32",
|
|
261
|
+
"name": "role",
|
|
262
|
+
"type": "bytes32"
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
"indexed": true,
|
|
266
|
+
"internalType": "address",
|
|
267
|
+
"name": "account",
|
|
268
|
+
"type": "address"
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
"indexed": true,
|
|
272
|
+
"internalType": "address",
|
|
273
|
+
"name": "sender",
|
|
274
|
+
"type": "address"
|
|
275
|
+
}
|
|
276
|
+
],
|
|
277
|
+
"name": "RoleRevoked",
|
|
278
|
+
"type": "event"
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
"anonymous": false,
|
|
282
|
+
"inputs": [
|
|
283
|
+
{
|
|
284
|
+
"indexed": false,
|
|
285
|
+
"internalType": "address",
|
|
286
|
+
"name": "account",
|
|
287
|
+
"type": "address"
|
|
288
|
+
}
|
|
289
|
+
],
|
|
290
|
+
"name": "Unpaused",
|
|
291
|
+
"type": "event"
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
"anonymous": false,
|
|
295
|
+
"inputs": [
|
|
296
|
+
{
|
|
297
|
+
"indexed": true,
|
|
298
|
+
"internalType": "address",
|
|
299
|
+
"name": "approver",
|
|
300
|
+
"type": "address"
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
"indexed": true,
|
|
304
|
+
"internalType": "address",
|
|
305
|
+
"name": "implementation",
|
|
306
|
+
"type": "address"
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
"indexed": false,
|
|
310
|
+
"internalType": "uint256",
|
|
311
|
+
"name": "approvalCount",
|
|
312
|
+
"type": "uint256"
|
|
313
|
+
}
|
|
314
|
+
],
|
|
315
|
+
"name": "UpgradeApproved",
|
|
316
|
+
"type": "event"
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
"anonymous": false,
|
|
320
|
+
"inputs": [
|
|
321
|
+
{
|
|
322
|
+
"indexed": true,
|
|
323
|
+
"internalType": "address",
|
|
324
|
+
"name": "auditor",
|
|
325
|
+
"type": "address"
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
"indexed": true,
|
|
329
|
+
"internalType": "address",
|
|
330
|
+
"name": "implementation",
|
|
331
|
+
"type": "address"
|
|
332
|
+
}
|
|
333
|
+
],
|
|
334
|
+
"name": "UpgradeAuditApproved",
|
|
335
|
+
"type": "event"
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
"anonymous": false,
|
|
339
|
+
"inputs": [
|
|
340
|
+
{
|
|
341
|
+
"indexed": true,
|
|
342
|
+
"internalType": "address",
|
|
343
|
+
"name": "implementation",
|
|
344
|
+
"type": "address"
|
|
345
|
+
}
|
|
346
|
+
],
|
|
347
|
+
"name": "UpgradeCancelled",
|
|
348
|
+
"type": "event"
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
"anonymous": false,
|
|
352
|
+
"inputs": [
|
|
353
|
+
{
|
|
354
|
+
"indexed": true,
|
|
355
|
+
"internalType": "address",
|
|
356
|
+
"name": "oldImplementation",
|
|
357
|
+
"type": "address"
|
|
358
|
+
},
|
|
359
|
+
{
|
|
360
|
+
"indexed": true,
|
|
361
|
+
"internalType": "address",
|
|
362
|
+
"name": "newImplementation",
|
|
363
|
+
"type": "address"
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
"indexed": true,
|
|
367
|
+
"internalType": "uint256",
|
|
368
|
+
"name": "version",
|
|
369
|
+
"type": "uint256"
|
|
370
|
+
}
|
|
371
|
+
],
|
|
372
|
+
"name": "UpgradeExecuted",
|
|
373
|
+
"type": "event"
|
|
374
|
+
},
|
|
375
|
+
{
|
|
376
|
+
"anonymous": false,
|
|
377
|
+
"inputs": [
|
|
378
|
+
{
|
|
379
|
+
"indexed": false,
|
|
380
|
+
"internalType": "bool",
|
|
381
|
+
"name": "status",
|
|
382
|
+
"type": "bool"
|
|
383
|
+
}
|
|
384
|
+
],
|
|
385
|
+
"name": "UpgradeFreezeChanged",
|
|
386
|
+
"type": "event"
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
"anonymous": false,
|
|
390
|
+
"inputs": [
|
|
391
|
+
{
|
|
392
|
+
"indexed": true,
|
|
393
|
+
"internalType": "address",
|
|
394
|
+
"name": "oldImplementation",
|
|
395
|
+
"type": "address"
|
|
396
|
+
},
|
|
397
|
+
{
|
|
398
|
+
"indexed": true,
|
|
399
|
+
"internalType": "address",
|
|
400
|
+
"name": "newImplementation",
|
|
401
|
+
"type": "address"
|
|
402
|
+
}
|
|
403
|
+
],
|
|
404
|
+
"name": "UpgradeProposed",
|
|
405
|
+
"type": "event"
|
|
406
|
+
},
|
|
407
|
+
{
|
|
408
|
+
"anonymous": false,
|
|
409
|
+
"inputs": [
|
|
410
|
+
{
|
|
411
|
+
"indexed": true,
|
|
412
|
+
"internalType": "address",
|
|
413
|
+
"name": "oldImplementation",
|
|
414
|
+
"type": "address"
|
|
415
|
+
},
|
|
416
|
+
{
|
|
417
|
+
"indexed": true,
|
|
418
|
+
"internalType": "address",
|
|
419
|
+
"name": "rollbackImplementation",
|
|
420
|
+
"type": "address"
|
|
421
|
+
},
|
|
422
|
+
{
|
|
423
|
+
"indexed": true,
|
|
424
|
+
"internalType": "uint256",
|
|
425
|
+
"name": "version",
|
|
426
|
+
"type": "uint256"
|
|
427
|
+
}
|
|
428
|
+
],
|
|
429
|
+
"name": "UpgradeRollback",
|
|
430
|
+
"type": "event"
|
|
431
|
+
},
|
|
432
|
+
{
|
|
433
|
+
"anonymous": false,
|
|
434
|
+
"inputs": [
|
|
435
|
+
{
|
|
436
|
+
"indexed": true,
|
|
437
|
+
"internalType": "address",
|
|
438
|
+
"name": "implementation",
|
|
439
|
+
"type": "address"
|
|
440
|
+
}
|
|
441
|
+
],
|
|
442
|
+
"name": "Upgraded",
|
|
443
|
+
"type": "event"
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
"inputs": [],
|
|
447
|
+
"name": "APPROVER_ROLE",
|
|
448
|
+
"outputs": [
|
|
449
|
+
{
|
|
450
|
+
"internalType": "bytes32",
|
|
451
|
+
"name": "",
|
|
452
|
+
"type": "bytes32"
|
|
453
|
+
}
|
|
454
|
+
],
|
|
455
|
+
"stateMutability": "view",
|
|
456
|
+
"type": "function"
|
|
457
|
+
},
|
|
458
|
+
{
|
|
459
|
+
"inputs": [],
|
|
460
|
+
"name": "AUDITOR_ROLE",
|
|
461
|
+
"outputs": [
|
|
462
|
+
{
|
|
463
|
+
"internalType": "bytes32",
|
|
464
|
+
"name": "",
|
|
465
|
+
"type": "bytes32"
|
|
466
|
+
}
|
|
467
|
+
],
|
|
468
|
+
"stateMutability": "view",
|
|
469
|
+
"type": "function"
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
"inputs": [],
|
|
473
|
+
"name": "DEFAULT_ADMIN_ROLE",
|
|
474
|
+
"outputs": [
|
|
475
|
+
{
|
|
476
|
+
"internalType": "bytes32",
|
|
477
|
+
"name": "",
|
|
478
|
+
"type": "bytes32"
|
|
479
|
+
}
|
|
480
|
+
],
|
|
481
|
+
"stateMutability": "view",
|
|
482
|
+
"type": "function"
|
|
483
|
+
},
|
|
484
|
+
{
|
|
485
|
+
"inputs": [],
|
|
486
|
+
"name": "EMERGENCY_ROLE",
|
|
487
|
+
"outputs": [
|
|
488
|
+
{
|
|
489
|
+
"internalType": "bytes32",
|
|
490
|
+
"name": "",
|
|
491
|
+
"type": "bytes32"
|
|
492
|
+
}
|
|
493
|
+
],
|
|
494
|
+
"stateMutability": "view",
|
|
495
|
+
"type": "function"
|
|
496
|
+
},
|
|
497
|
+
{
|
|
498
|
+
"inputs": [],
|
|
499
|
+
"name": "GOVERNANCE_ROLE",
|
|
500
|
+
"outputs": [
|
|
501
|
+
{
|
|
502
|
+
"internalType": "bytes32",
|
|
503
|
+
"name": "",
|
|
504
|
+
"type": "bytes32"
|
|
505
|
+
}
|
|
506
|
+
],
|
|
507
|
+
"stateMutability": "view",
|
|
508
|
+
"type": "function"
|
|
509
|
+
},
|
|
510
|
+
{
|
|
511
|
+
"inputs": [],
|
|
512
|
+
"name": "UPGRADE_INTERFACE_VERSION",
|
|
513
|
+
"outputs": [
|
|
514
|
+
{
|
|
515
|
+
"internalType": "string",
|
|
516
|
+
"name": "",
|
|
517
|
+
"type": "string"
|
|
518
|
+
}
|
|
519
|
+
],
|
|
520
|
+
"stateMutability": "view",
|
|
521
|
+
"type": "function"
|
|
522
|
+
},
|
|
523
|
+
{
|
|
524
|
+
"inputs": [],
|
|
525
|
+
"name": "UPGRADE_ROLE",
|
|
526
|
+
"outputs": [
|
|
527
|
+
{
|
|
528
|
+
"internalType": "bytes32",
|
|
529
|
+
"name": "",
|
|
530
|
+
"type": "bytes32"
|
|
531
|
+
}
|
|
532
|
+
],
|
|
533
|
+
"stateMutability": "view",
|
|
534
|
+
"type": "function"
|
|
535
|
+
},
|
|
536
|
+
{
|
|
537
|
+
"inputs": [],
|
|
538
|
+
"name": "approvalCount",
|
|
539
|
+
"outputs": [
|
|
540
|
+
{
|
|
541
|
+
"internalType": "uint256",
|
|
542
|
+
"name": "",
|
|
543
|
+
"type": "uint256"
|
|
544
|
+
}
|
|
545
|
+
],
|
|
546
|
+
"stateMutability": "view",
|
|
547
|
+
"type": "function"
|
|
548
|
+
},
|
|
549
|
+
{
|
|
550
|
+
"inputs": [],
|
|
551
|
+
"name": "approveUpgrade",
|
|
552
|
+
"outputs": [],
|
|
553
|
+
"stateMutability": "nonpayable",
|
|
554
|
+
"type": "function"
|
|
555
|
+
},
|
|
556
|
+
{
|
|
557
|
+
"inputs": [],
|
|
558
|
+
"name": "approveUpgradeAudit",
|
|
559
|
+
"outputs": [],
|
|
560
|
+
"stateMutability": "nonpayable",
|
|
561
|
+
"type": "function"
|
|
562
|
+
},
|
|
563
|
+
{
|
|
564
|
+
"inputs": [
|
|
565
|
+
{
|
|
566
|
+
"internalType": "address",
|
|
567
|
+
"name": "",
|
|
568
|
+
"type": "address"
|
|
569
|
+
}
|
|
570
|
+
],
|
|
571
|
+
"name": "approvedPendingUpgrade",
|
|
572
|
+
"outputs": [
|
|
573
|
+
{
|
|
574
|
+
"internalType": "bool",
|
|
575
|
+
"name": "",
|
|
576
|
+
"type": "bool"
|
|
577
|
+
}
|
|
578
|
+
],
|
|
579
|
+
"stateMutability": "view",
|
|
580
|
+
"type": "function"
|
|
581
|
+
},
|
|
582
|
+
{
|
|
583
|
+
"inputs": [
|
|
584
|
+
{
|
|
585
|
+
"internalType": "address",
|
|
586
|
+
"name": "",
|
|
587
|
+
"type": "address"
|
|
588
|
+
},
|
|
589
|
+
{
|
|
590
|
+
"internalType": "address",
|
|
591
|
+
"name": "",
|
|
592
|
+
"type": "address"
|
|
593
|
+
}
|
|
594
|
+
],
|
|
595
|
+
"name": "approvedUpgradeByImplementation",
|
|
596
|
+
"outputs": [
|
|
597
|
+
{
|
|
598
|
+
"internalType": "bool",
|
|
599
|
+
"name": "",
|
|
600
|
+
"type": "bool"
|
|
601
|
+
}
|
|
602
|
+
],
|
|
603
|
+
"stateMutability": "view",
|
|
604
|
+
"type": "function"
|
|
605
|
+
},
|
|
606
|
+
{
|
|
607
|
+
"inputs": [],
|
|
608
|
+
"name": "auditApprovalRequired",
|
|
609
|
+
"outputs": [
|
|
610
|
+
{
|
|
611
|
+
"internalType": "bool",
|
|
612
|
+
"name": "",
|
|
613
|
+
"type": "bool"
|
|
614
|
+
}
|
|
615
|
+
],
|
|
616
|
+
"stateMutability": "view",
|
|
617
|
+
"type": "function"
|
|
618
|
+
},
|
|
619
|
+
{
|
|
620
|
+
"inputs": [],
|
|
621
|
+
"name": "cancelUpgrade",
|
|
622
|
+
"outputs": [],
|
|
623
|
+
"stateMutability": "nonpayable",
|
|
624
|
+
"type": "function"
|
|
625
|
+
},
|
|
626
|
+
{
|
|
627
|
+
"inputs": [
|
|
628
|
+
{
|
|
629
|
+
"internalType": "uint256",
|
|
630
|
+
"name": "delay",
|
|
631
|
+
"type": "uint256"
|
|
632
|
+
},
|
|
633
|
+
{
|
|
634
|
+
"internalType": "uint256",
|
|
635
|
+
"name": "approvals",
|
|
636
|
+
"type": "uint256"
|
|
637
|
+
},
|
|
638
|
+
{
|
|
639
|
+
"internalType": "bool",
|
|
640
|
+
"name": "requireAuditApproval",
|
|
641
|
+
"type": "bool"
|
|
642
|
+
}
|
|
643
|
+
],
|
|
644
|
+
"name": "configureUpgradePolicy",
|
|
645
|
+
"outputs": [],
|
|
646
|
+
"stateMutability": "nonpayable",
|
|
647
|
+
"type": "function"
|
|
648
|
+
},
|
|
649
|
+
{
|
|
650
|
+
"inputs": [],
|
|
651
|
+
"name": "currentImplementation",
|
|
652
|
+
"outputs": [
|
|
653
|
+
{
|
|
654
|
+
"internalType": "address",
|
|
655
|
+
"name": "",
|
|
656
|
+
"type": "address"
|
|
657
|
+
}
|
|
658
|
+
],
|
|
659
|
+
"stateMutability": "view",
|
|
660
|
+
"type": "function"
|
|
661
|
+
},
|
|
662
|
+
{
|
|
663
|
+
"inputs": [],
|
|
664
|
+
"name": "executeUpgrade",
|
|
665
|
+
"outputs": [],
|
|
666
|
+
"stateMutability": "nonpayable",
|
|
667
|
+
"type": "function"
|
|
668
|
+
},
|
|
669
|
+
{
|
|
670
|
+
"inputs": [
|
|
671
|
+
{
|
|
672
|
+
"internalType": "bytes",
|
|
673
|
+
"name": "data",
|
|
674
|
+
"type": "bytes"
|
|
675
|
+
}
|
|
676
|
+
],
|
|
677
|
+
"name": "executeUpgradeAndCall",
|
|
678
|
+
"outputs": [],
|
|
679
|
+
"stateMutability": "payable",
|
|
680
|
+
"type": "function"
|
|
681
|
+
},
|
|
682
|
+
{
|
|
683
|
+
"inputs": [
|
|
684
|
+
{
|
|
685
|
+
"internalType": "bytes32",
|
|
686
|
+
"name": "role",
|
|
687
|
+
"type": "bytes32"
|
|
688
|
+
}
|
|
689
|
+
],
|
|
690
|
+
"name": "getRoleAdmin",
|
|
691
|
+
"outputs": [
|
|
692
|
+
{
|
|
693
|
+
"internalType": "bytes32",
|
|
694
|
+
"name": "",
|
|
695
|
+
"type": "bytes32"
|
|
696
|
+
}
|
|
697
|
+
],
|
|
698
|
+
"stateMutability": "view",
|
|
699
|
+
"type": "function"
|
|
700
|
+
},
|
|
701
|
+
{
|
|
702
|
+
"inputs": [],
|
|
703
|
+
"name": "getUpgradeState",
|
|
704
|
+
"outputs": [
|
|
705
|
+
{
|
|
706
|
+
"internalType": "address",
|
|
707
|
+
"name": "proxyAddress",
|
|
708
|
+
"type": "address"
|
|
709
|
+
},
|
|
710
|
+
{
|
|
711
|
+
"internalType": "address",
|
|
712
|
+
"name": "activeImplementation",
|
|
713
|
+
"type": "address"
|
|
714
|
+
},
|
|
715
|
+
{
|
|
716
|
+
"internalType": "address",
|
|
717
|
+
"name": "queuedImplementation",
|
|
718
|
+
"type": "address"
|
|
719
|
+
},
|
|
720
|
+
{
|
|
721
|
+
"internalType": "bool",
|
|
722
|
+
"name": "frozen",
|
|
723
|
+
"type": "bool"
|
|
724
|
+
},
|
|
725
|
+
{
|
|
726
|
+
"internalType": "uint256",
|
|
727
|
+
"name": "version",
|
|
728
|
+
"type": "uint256"
|
|
729
|
+
},
|
|
730
|
+
{
|
|
731
|
+
"internalType": "uint256",
|
|
732
|
+
"name": "upgradedAt",
|
|
733
|
+
"type": "uint256"
|
|
734
|
+
}
|
|
735
|
+
],
|
|
736
|
+
"stateMutability": "view",
|
|
737
|
+
"type": "function"
|
|
738
|
+
},
|
|
739
|
+
{
|
|
740
|
+
"inputs": [
|
|
741
|
+
{
|
|
742
|
+
"internalType": "bytes32",
|
|
743
|
+
"name": "role",
|
|
744
|
+
"type": "bytes32"
|
|
745
|
+
},
|
|
746
|
+
{
|
|
747
|
+
"internalType": "address",
|
|
748
|
+
"name": "account",
|
|
749
|
+
"type": "address"
|
|
750
|
+
}
|
|
751
|
+
],
|
|
752
|
+
"name": "grantRole",
|
|
753
|
+
"outputs": [],
|
|
754
|
+
"stateMutability": "nonpayable",
|
|
755
|
+
"type": "function"
|
|
756
|
+
},
|
|
757
|
+
{
|
|
758
|
+
"inputs": [
|
|
759
|
+
{
|
|
760
|
+
"internalType": "bytes32",
|
|
761
|
+
"name": "role",
|
|
762
|
+
"type": "bytes32"
|
|
763
|
+
},
|
|
764
|
+
{
|
|
765
|
+
"internalType": "address",
|
|
766
|
+
"name": "account",
|
|
767
|
+
"type": "address"
|
|
768
|
+
}
|
|
769
|
+
],
|
|
770
|
+
"name": "hasRole",
|
|
771
|
+
"outputs": [
|
|
772
|
+
{
|
|
773
|
+
"internalType": "bool",
|
|
774
|
+
"name": "",
|
|
775
|
+
"type": "bool"
|
|
776
|
+
}
|
|
777
|
+
],
|
|
778
|
+
"stateMutability": "view",
|
|
779
|
+
"type": "function"
|
|
780
|
+
},
|
|
781
|
+
{
|
|
782
|
+
"inputs": [
|
|
783
|
+
{
|
|
784
|
+
"internalType": "address",
|
|
785
|
+
"name": "admin",
|
|
786
|
+
"type": "address"
|
|
787
|
+
}
|
|
788
|
+
],
|
|
789
|
+
"name": "initialize",
|
|
790
|
+
"outputs": [],
|
|
791
|
+
"stateMutability": "nonpayable",
|
|
792
|
+
"type": "function"
|
|
793
|
+
},
|
|
794
|
+
{
|
|
795
|
+
"inputs": [],
|
|
796
|
+
"name": "lastUpgradeTime",
|
|
797
|
+
"outputs": [
|
|
798
|
+
{
|
|
799
|
+
"internalType": "uint256",
|
|
800
|
+
"name": "",
|
|
801
|
+
"type": "uint256"
|
|
802
|
+
}
|
|
803
|
+
],
|
|
804
|
+
"stateMutability": "view",
|
|
805
|
+
"type": "function"
|
|
806
|
+
},
|
|
807
|
+
{
|
|
808
|
+
"inputs": [],
|
|
809
|
+
"name": "minApprovals",
|
|
810
|
+
"outputs": [
|
|
811
|
+
{
|
|
812
|
+
"internalType": "uint256",
|
|
813
|
+
"name": "",
|
|
814
|
+
"type": "uint256"
|
|
815
|
+
}
|
|
816
|
+
],
|
|
817
|
+
"stateMutability": "view",
|
|
818
|
+
"type": "function"
|
|
819
|
+
},
|
|
820
|
+
{
|
|
821
|
+
"inputs": [],
|
|
822
|
+
"name": "pause",
|
|
823
|
+
"outputs": [],
|
|
824
|
+
"stateMutability": "nonpayable",
|
|
825
|
+
"type": "function"
|
|
826
|
+
},
|
|
827
|
+
{
|
|
828
|
+
"inputs": [],
|
|
829
|
+
"name": "paused",
|
|
830
|
+
"outputs": [
|
|
831
|
+
{
|
|
832
|
+
"internalType": "bool",
|
|
833
|
+
"name": "",
|
|
834
|
+
"type": "bool"
|
|
835
|
+
}
|
|
836
|
+
],
|
|
837
|
+
"stateMutability": "view",
|
|
838
|
+
"type": "function"
|
|
839
|
+
},
|
|
840
|
+
{
|
|
841
|
+
"inputs": [],
|
|
842
|
+
"name": "pendingAuditApproved",
|
|
843
|
+
"outputs": [
|
|
844
|
+
{
|
|
845
|
+
"internalType": "bool",
|
|
846
|
+
"name": "",
|
|
847
|
+
"type": "bool"
|
|
848
|
+
}
|
|
849
|
+
],
|
|
850
|
+
"stateMutability": "view",
|
|
851
|
+
"type": "function"
|
|
852
|
+
},
|
|
853
|
+
{
|
|
854
|
+
"inputs": [],
|
|
855
|
+
"name": "pendingImplementation",
|
|
856
|
+
"outputs": [
|
|
857
|
+
{
|
|
858
|
+
"internalType": "address",
|
|
859
|
+
"name": "",
|
|
860
|
+
"type": "address"
|
|
861
|
+
}
|
|
862
|
+
],
|
|
863
|
+
"stateMutability": "view",
|
|
864
|
+
"type": "function"
|
|
865
|
+
},
|
|
866
|
+
{
|
|
867
|
+
"inputs": [
|
|
868
|
+
{
|
|
869
|
+
"internalType": "address",
|
|
870
|
+
"name": "implementation",
|
|
871
|
+
"type": "address"
|
|
872
|
+
}
|
|
873
|
+
],
|
|
874
|
+
"name": "proposeUpgrade",
|
|
875
|
+
"outputs": [],
|
|
876
|
+
"stateMutability": "nonpayable",
|
|
877
|
+
"type": "function"
|
|
878
|
+
},
|
|
879
|
+
{
|
|
880
|
+
"inputs": [],
|
|
881
|
+
"name": "proposedAt",
|
|
882
|
+
"outputs": [
|
|
883
|
+
{
|
|
884
|
+
"internalType": "uint256",
|
|
885
|
+
"name": "",
|
|
886
|
+
"type": "uint256"
|
|
887
|
+
}
|
|
888
|
+
],
|
|
889
|
+
"stateMutability": "view",
|
|
890
|
+
"type": "function"
|
|
891
|
+
},
|
|
892
|
+
{
|
|
893
|
+
"inputs": [],
|
|
894
|
+
"name": "proxiableUUID",
|
|
895
|
+
"outputs": [
|
|
896
|
+
{
|
|
897
|
+
"internalType": "bytes32",
|
|
898
|
+
"name": "",
|
|
899
|
+
"type": "bytes32"
|
|
900
|
+
}
|
|
901
|
+
],
|
|
902
|
+
"stateMutability": "view",
|
|
903
|
+
"type": "function"
|
|
904
|
+
},
|
|
905
|
+
{
|
|
906
|
+
"inputs": [],
|
|
907
|
+
"name": "proxy",
|
|
908
|
+
"outputs": [
|
|
909
|
+
{
|
|
910
|
+
"internalType": "address",
|
|
911
|
+
"name": "",
|
|
912
|
+
"type": "address"
|
|
913
|
+
}
|
|
914
|
+
],
|
|
915
|
+
"stateMutability": "view",
|
|
916
|
+
"type": "function"
|
|
917
|
+
},
|
|
918
|
+
{
|
|
919
|
+
"inputs": [
|
|
920
|
+
{
|
|
921
|
+
"internalType": "address",
|
|
922
|
+
"name": "proxyAddress",
|
|
923
|
+
"type": "address"
|
|
924
|
+
},
|
|
925
|
+
{
|
|
926
|
+
"internalType": "address",
|
|
927
|
+
"name": "implementation",
|
|
928
|
+
"type": "address"
|
|
929
|
+
}
|
|
930
|
+
],
|
|
931
|
+
"name": "registerProxy",
|
|
932
|
+
"outputs": [],
|
|
933
|
+
"stateMutability": "nonpayable",
|
|
934
|
+
"type": "function"
|
|
935
|
+
},
|
|
936
|
+
{
|
|
937
|
+
"inputs": [
|
|
938
|
+
{
|
|
939
|
+
"internalType": "bytes32",
|
|
940
|
+
"name": "role",
|
|
941
|
+
"type": "bytes32"
|
|
942
|
+
},
|
|
943
|
+
{
|
|
944
|
+
"internalType": "address",
|
|
945
|
+
"name": "callerConfirmation",
|
|
946
|
+
"type": "address"
|
|
947
|
+
}
|
|
948
|
+
],
|
|
949
|
+
"name": "renounceRole",
|
|
950
|
+
"outputs": [],
|
|
951
|
+
"stateMutability": "nonpayable",
|
|
952
|
+
"type": "function"
|
|
953
|
+
},
|
|
954
|
+
{
|
|
955
|
+
"inputs": [
|
|
956
|
+
{
|
|
957
|
+
"internalType": "bytes32",
|
|
958
|
+
"name": "role",
|
|
959
|
+
"type": "bytes32"
|
|
960
|
+
},
|
|
961
|
+
{
|
|
962
|
+
"internalType": "address",
|
|
963
|
+
"name": "account",
|
|
964
|
+
"type": "address"
|
|
965
|
+
}
|
|
966
|
+
],
|
|
967
|
+
"name": "revokeRole",
|
|
968
|
+
"outputs": [],
|
|
969
|
+
"stateMutability": "nonpayable",
|
|
970
|
+
"type": "function"
|
|
971
|
+
},
|
|
972
|
+
{
|
|
973
|
+
"inputs": [],
|
|
974
|
+
"name": "rollbackCounter",
|
|
975
|
+
"outputs": [
|
|
976
|
+
{
|
|
977
|
+
"internalType": "uint256",
|
|
978
|
+
"name": "",
|
|
979
|
+
"type": "uint256"
|
|
980
|
+
}
|
|
981
|
+
],
|
|
982
|
+
"stateMutability": "view",
|
|
983
|
+
"type": "function"
|
|
984
|
+
},
|
|
985
|
+
{
|
|
986
|
+
"inputs": [
|
|
987
|
+
{
|
|
988
|
+
"internalType": "uint256",
|
|
989
|
+
"name": "",
|
|
990
|
+
"type": "uint256"
|
|
991
|
+
}
|
|
992
|
+
],
|
|
993
|
+
"name": "rollbackHistory",
|
|
994
|
+
"outputs": [
|
|
995
|
+
{
|
|
996
|
+
"internalType": "address",
|
|
997
|
+
"name": "oldImplementation",
|
|
998
|
+
"type": "address"
|
|
999
|
+
},
|
|
1000
|
+
{
|
|
1001
|
+
"internalType": "address",
|
|
1002
|
+
"name": "newImplementation",
|
|
1003
|
+
"type": "address"
|
|
1004
|
+
},
|
|
1005
|
+
{
|
|
1006
|
+
"internalType": "address",
|
|
1007
|
+
"name": "executor",
|
|
1008
|
+
"type": "address"
|
|
1009
|
+
},
|
|
1010
|
+
{
|
|
1011
|
+
"internalType": "uint256",
|
|
1012
|
+
"name": "timestamp",
|
|
1013
|
+
"type": "uint256"
|
|
1014
|
+
},
|
|
1015
|
+
{
|
|
1016
|
+
"internalType": "bytes",
|
|
1017
|
+
"name": "data",
|
|
1018
|
+
"type": "bytes"
|
|
1019
|
+
}
|
|
1020
|
+
],
|
|
1021
|
+
"stateMutability": "view",
|
|
1022
|
+
"type": "function"
|
|
1023
|
+
},
|
|
1024
|
+
{
|
|
1025
|
+
"inputs": [
|
|
1026
|
+
{
|
|
1027
|
+
"internalType": "address",
|
|
1028
|
+
"name": "rollbackImplementation",
|
|
1029
|
+
"type": "address"
|
|
1030
|
+
},
|
|
1031
|
+
{
|
|
1032
|
+
"internalType": "bytes",
|
|
1033
|
+
"name": "data",
|
|
1034
|
+
"type": "bytes"
|
|
1035
|
+
}
|
|
1036
|
+
],
|
|
1037
|
+
"name": "rollbackUpgrade",
|
|
1038
|
+
"outputs": [],
|
|
1039
|
+
"stateMutability": "payable",
|
|
1040
|
+
"type": "function"
|
|
1041
|
+
},
|
|
1042
|
+
{
|
|
1043
|
+
"inputs": [
|
|
1044
|
+
{
|
|
1045
|
+
"internalType": "bool",
|
|
1046
|
+
"name": "status",
|
|
1047
|
+
"type": "bool"
|
|
1048
|
+
}
|
|
1049
|
+
],
|
|
1050
|
+
"name": "setUpgradeFreeze",
|
|
1051
|
+
"outputs": [],
|
|
1052
|
+
"stateMutability": "nonpayable",
|
|
1053
|
+
"type": "function"
|
|
1054
|
+
},
|
|
1055
|
+
{
|
|
1056
|
+
"inputs": [
|
|
1057
|
+
{
|
|
1058
|
+
"internalType": "bytes4",
|
|
1059
|
+
"name": "interfaceId",
|
|
1060
|
+
"type": "bytes4"
|
|
1061
|
+
}
|
|
1062
|
+
],
|
|
1063
|
+
"name": "supportsInterface",
|
|
1064
|
+
"outputs": [
|
|
1065
|
+
{
|
|
1066
|
+
"internalType": "bool",
|
|
1067
|
+
"name": "",
|
|
1068
|
+
"type": "bool"
|
|
1069
|
+
}
|
|
1070
|
+
],
|
|
1071
|
+
"stateMutability": "view",
|
|
1072
|
+
"type": "function"
|
|
1073
|
+
},
|
|
1074
|
+
{
|
|
1075
|
+
"inputs": [],
|
|
1076
|
+
"name": "timelockDelay",
|
|
1077
|
+
"outputs": [
|
|
1078
|
+
{
|
|
1079
|
+
"internalType": "uint256",
|
|
1080
|
+
"name": "",
|
|
1081
|
+
"type": "uint256"
|
|
1082
|
+
}
|
|
1083
|
+
],
|
|
1084
|
+
"stateMutability": "view",
|
|
1085
|
+
"type": "function"
|
|
1086
|
+
},
|
|
1087
|
+
{
|
|
1088
|
+
"inputs": [],
|
|
1089
|
+
"name": "unpause",
|
|
1090
|
+
"outputs": [],
|
|
1091
|
+
"stateMutability": "nonpayable",
|
|
1092
|
+
"type": "function"
|
|
1093
|
+
},
|
|
1094
|
+
{
|
|
1095
|
+
"inputs": [],
|
|
1096
|
+
"name": "upgradeCounter",
|
|
1097
|
+
"outputs": [
|
|
1098
|
+
{
|
|
1099
|
+
"internalType": "uint256",
|
|
1100
|
+
"name": "",
|
|
1101
|
+
"type": "uint256"
|
|
1102
|
+
}
|
|
1103
|
+
],
|
|
1104
|
+
"stateMutability": "view",
|
|
1105
|
+
"type": "function"
|
|
1106
|
+
},
|
|
1107
|
+
{
|
|
1108
|
+
"inputs": [
|
|
1109
|
+
{
|
|
1110
|
+
"internalType": "uint256",
|
|
1111
|
+
"name": "",
|
|
1112
|
+
"type": "uint256"
|
|
1113
|
+
}
|
|
1114
|
+
],
|
|
1115
|
+
"name": "upgradeHistory",
|
|
1116
|
+
"outputs": [
|
|
1117
|
+
{
|
|
1118
|
+
"internalType": "address",
|
|
1119
|
+
"name": "oldImplementation",
|
|
1120
|
+
"type": "address"
|
|
1121
|
+
},
|
|
1122
|
+
{
|
|
1123
|
+
"internalType": "address",
|
|
1124
|
+
"name": "newImplementation",
|
|
1125
|
+
"type": "address"
|
|
1126
|
+
},
|
|
1127
|
+
{
|
|
1128
|
+
"internalType": "address",
|
|
1129
|
+
"name": "executor",
|
|
1130
|
+
"type": "address"
|
|
1131
|
+
},
|
|
1132
|
+
{
|
|
1133
|
+
"internalType": "uint256",
|
|
1134
|
+
"name": "timestamp",
|
|
1135
|
+
"type": "uint256"
|
|
1136
|
+
},
|
|
1137
|
+
{
|
|
1138
|
+
"internalType": "bytes",
|
|
1139
|
+
"name": "data",
|
|
1140
|
+
"type": "bytes"
|
|
1141
|
+
}
|
|
1142
|
+
],
|
|
1143
|
+
"stateMutability": "view",
|
|
1144
|
+
"type": "function"
|
|
1145
|
+
},
|
|
1146
|
+
{
|
|
1147
|
+
"inputs": [
|
|
1148
|
+
{
|
|
1149
|
+
"internalType": "address",
|
|
1150
|
+
"name": "newImplementation",
|
|
1151
|
+
"type": "address"
|
|
1152
|
+
},
|
|
1153
|
+
{
|
|
1154
|
+
"internalType": "bytes",
|
|
1155
|
+
"name": "data",
|
|
1156
|
+
"type": "bytes"
|
|
1157
|
+
}
|
|
1158
|
+
],
|
|
1159
|
+
"name": "upgradeToAndCall",
|
|
1160
|
+
"outputs": [],
|
|
1161
|
+
"stateMutability": "payable",
|
|
1162
|
+
"type": "function"
|
|
1163
|
+
},
|
|
1164
|
+
{
|
|
1165
|
+
"inputs": [],
|
|
1166
|
+
"name": "upgradesFrozen",
|
|
1167
|
+
"outputs": [
|
|
1168
|
+
{
|
|
1169
|
+
"internalType": "bool",
|
|
1170
|
+
"name": "",
|
|
1171
|
+
"type": "bool"
|
|
1172
|
+
}
|
|
1173
|
+
],
|
|
1174
|
+
"stateMutability": "view",
|
|
1175
|
+
"type": "function"
|
|
1176
|
+
}
|
|
1177
|
+
] as const satisfies Abi;
|
|
1178
|
+
|
|
1179
|
+
/**
|
|
1180
|
+
* Type-safe ABI for CodeXProxyAdmin_json
|
|
1181
|
+
*/
|
|
1182
|
+
export type CodeXProxyAdmin_jsonAbi = typeof CodeXProxyAdmin_jsonAbi;
|
|
1183
|
+
|
|
1184
|
+
/**
|
|
1185
|
+
* Contract instance type for CodeXProxyAdmin_json
|
|
1186
|
+
*/
|
|
1187
|
+
// Use any for contract type to avoid complex viem type issues
|
|
1188
|
+
// The runtime behavior is type-safe through viem's ABI typing
|
|
1189
|
+
export type CodeXProxyAdmin_jsonContract = any;
|
|
1190
|
+
|
|
1191
|
+
/**
|
|
1192
|
+
* CodeXProxyAdmin_json Contract Class
|
|
1193
|
+
*
|
|
1194
|
+
* Provides a class-based API similar to TypeChain for interacting with the contract.
|
|
1195
|
+
*
|
|
1196
|
+
* @example
|
|
1197
|
+
* ```typescript
|
|
1198
|
+
* import { createPublicClient, createWalletClient, http } from 'viem';
|
|
1199
|
+
* import { mainnet } from 'viem/chains';
|
|
1200
|
+
* import { CodeXProxyAdmin_json } from 'CodeXProxyAdmin_json';
|
|
1201
|
+
*
|
|
1202
|
+
* const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
1203
|
+
* const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
1204
|
+
*
|
|
1205
|
+
* const contract = new CodeXProxyAdmin_json('0x...', { publicClient, walletClient });
|
|
1206
|
+
*
|
|
1207
|
+
* // Read functions
|
|
1208
|
+
* const result = await contract.balanceOf('0x...');
|
|
1209
|
+
*
|
|
1210
|
+
* // Write functions
|
|
1211
|
+
* const hash = await contract.transfer('0x...', 1000n);
|
|
1212
|
+
*
|
|
1213
|
+
* // Simulate transactions (dry-run)
|
|
1214
|
+
* const simulation = await contract.simulate.transfer('0x...', 1000n);
|
|
1215
|
+
* console.log('Gas estimate:', simulation.request.gas);
|
|
1216
|
+
*
|
|
1217
|
+
* // Watch events
|
|
1218
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
1219
|
+
* console.log('Transfer event:', event);
|
|
1220
|
+
* });
|
|
1221
|
+
* ```
|
|
1222
|
+
*/
|
|
1223
|
+
export class CodeXProxyAdmin_json {
|
|
1224
|
+
private contract: CodeXProxyAdmin_jsonContract;
|
|
1225
|
+
private contractAddress: Address;
|
|
1226
|
+
private publicClient: PublicClient;
|
|
1227
|
+
|
|
1228
|
+
constructor(
|
|
1229
|
+
address: Address,
|
|
1230
|
+
clients: {
|
|
1231
|
+
publicClient: PublicClient;
|
|
1232
|
+
walletClient?: WalletClient;
|
|
1233
|
+
}
|
|
1234
|
+
) {
|
|
1235
|
+
this.contractAddress = address;
|
|
1236
|
+
this.publicClient = clients.publicClient;
|
|
1237
|
+
this.contract = getContract({
|
|
1238
|
+
address,
|
|
1239
|
+
abi: CodeXProxyAdmin_jsonAbi,
|
|
1240
|
+
client: {
|
|
1241
|
+
public: clients.publicClient,
|
|
1242
|
+
wallet: clients.walletClient,
|
|
1243
|
+
},
|
|
1244
|
+
});
|
|
1245
|
+
}
|
|
1246
|
+
|
|
1247
|
+
/**
|
|
1248
|
+
* Get the contract address
|
|
1249
|
+
*/
|
|
1250
|
+
get address(): Address {
|
|
1251
|
+
return this.contractAddress;
|
|
1252
|
+
}
|
|
1253
|
+
|
|
1254
|
+
/**
|
|
1255
|
+
* Get the underlying viem contract instance
|
|
1256
|
+
*/
|
|
1257
|
+
getContract(): CodeXProxyAdmin_jsonContract {
|
|
1258
|
+
return this.contract;
|
|
1259
|
+
}
|
|
1260
|
+
|
|
1261
|
+
/**
|
|
1262
|
+
* APPROVER_ROLE
|
|
1263
|
+
* view
|
|
1264
|
+
*/
|
|
1265
|
+
async APPROVER_ROLE(): Promise<`0x${string}`> {
|
|
1266
|
+
return this.contract.read.APPROVER_ROLE() as Promise<`0x${string}`>;
|
|
1267
|
+
}
|
|
1268
|
+
|
|
1269
|
+
/**
|
|
1270
|
+
* AUDITOR_ROLE
|
|
1271
|
+
* view
|
|
1272
|
+
*/
|
|
1273
|
+
async AUDITOR_ROLE(): Promise<`0x${string}`> {
|
|
1274
|
+
return this.contract.read.AUDITOR_ROLE() as Promise<`0x${string}`>;
|
|
1275
|
+
}
|
|
1276
|
+
|
|
1277
|
+
/**
|
|
1278
|
+
* DEFAULT_ADMIN_ROLE
|
|
1279
|
+
* view
|
|
1280
|
+
*/
|
|
1281
|
+
async DEFAULT_ADMIN_ROLE(): Promise<`0x${string}`> {
|
|
1282
|
+
return this.contract.read.DEFAULT_ADMIN_ROLE() as Promise<`0x${string}`>;
|
|
1283
|
+
}
|
|
1284
|
+
|
|
1285
|
+
/**
|
|
1286
|
+
* EMERGENCY_ROLE
|
|
1287
|
+
* view
|
|
1288
|
+
*/
|
|
1289
|
+
async EMERGENCY_ROLE(): Promise<`0x${string}`> {
|
|
1290
|
+
return this.contract.read.EMERGENCY_ROLE() as Promise<`0x${string}`>;
|
|
1291
|
+
}
|
|
1292
|
+
|
|
1293
|
+
/**
|
|
1294
|
+
* GOVERNANCE_ROLE
|
|
1295
|
+
* view
|
|
1296
|
+
*/
|
|
1297
|
+
async GOVERNANCE_ROLE(): Promise<`0x${string}`> {
|
|
1298
|
+
return this.contract.read.GOVERNANCE_ROLE() as Promise<`0x${string}`>;
|
|
1299
|
+
}
|
|
1300
|
+
|
|
1301
|
+
/**
|
|
1302
|
+
* UPGRADE_INTERFACE_VERSION
|
|
1303
|
+
* view
|
|
1304
|
+
*/
|
|
1305
|
+
async UPGRADE_INTERFACE_VERSION(): Promise<string> {
|
|
1306
|
+
return this.contract.read.UPGRADE_INTERFACE_VERSION() as Promise<string>;
|
|
1307
|
+
}
|
|
1308
|
+
|
|
1309
|
+
/**
|
|
1310
|
+
* UPGRADE_ROLE
|
|
1311
|
+
* view
|
|
1312
|
+
*/
|
|
1313
|
+
async UPGRADE_ROLE(): Promise<`0x${string}`> {
|
|
1314
|
+
return this.contract.read.UPGRADE_ROLE() as Promise<`0x${string}`>;
|
|
1315
|
+
}
|
|
1316
|
+
|
|
1317
|
+
/**
|
|
1318
|
+
* approvalCount
|
|
1319
|
+
* view
|
|
1320
|
+
*/
|
|
1321
|
+
async approvalCount(): Promise<bigint> {
|
|
1322
|
+
return this.contract.read.approvalCount() as Promise<bigint>;
|
|
1323
|
+
}
|
|
1324
|
+
|
|
1325
|
+
/**
|
|
1326
|
+
* approvedPendingUpgrade
|
|
1327
|
+
* view
|
|
1328
|
+
*/
|
|
1329
|
+
async approvedPendingUpgrade(arg0: `0x${string}`): Promise<boolean> {
|
|
1330
|
+
return this.contract.read.approvedPendingUpgrade([arg0] as const) as Promise<boolean>;
|
|
1331
|
+
}
|
|
1332
|
+
|
|
1333
|
+
/**
|
|
1334
|
+
* approvedUpgradeByImplementation
|
|
1335
|
+
* view
|
|
1336
|
+
*/
|
|
1337
|
+
async approvedUpgradeByImplementation(arg0: `0x${string}`, arg1: `0x${string}`): Promise<boolean> {
|
|
1338
|
+
return this.contract.read.approvedUpgradeByImplementation([arg0, arg1] as const) as Promise<boolean>;
|
|
1339
|
+
}
|
|
1340
|
+
|
|
1341
|
+
/**
|
|
1342
|
+
* auditApprovalRequired
|
|
1343
|
+
* view
|
|
1344
|
+
*/
|
|
1345
|
+
async auditApprovalRequired(): Promise<boolean> {
|
|
1346
|
+
return this.contract.read.auditApprovalRequired() as Promise<boolean>;
|
|
1347
|
+
}
|
|
1348
|
+
|
|
1349
|
+
/**
|
|
1350
|
+
* currentImplementation
|
|
1351
|
+
* view
|
|
1352
|
+
*/
|
|
1353
|
+
async currentImplementation(): Promise<`0x${string}`> {
|
|
1354
|
+
return this.contract.read.currentImplementation() as Promise<`0x${string}`>;
|
|
1355
|
+
}
|
|
1356
|
+
|
|
1357
|
+
/**
|
|
1358
|
+
* getRoleAdmin
|
|
1359
|
+
* view
|
|
1360
|
+
*/
|
|
1361
|
+
async getRoleAdmin(role: `0x${string}`): Promise<`0x${string}`> {
|
|
1362
|
+
return this.contract.read.getRoleAdmin([role] as const) as Promise<`0x${string}`>;
|
|
1363
|
+
}
|
|
1364
|
+
|
|
1365
|
+
/**
|
|
1366
|
+
* getUpgradeState
|
|
1367
|
+
* view
|
|
1368
|
+
*/
|
|
1369
|
+
async getUpgradeState(): Promise<[`0x${string}`, `0x${string}`, `0x${string}`, boolean, bigint, bigint]> {
|
|
1370
|
+
return this.contract.read.getUpgradeState() as Promise<[`0x${string}`, `0x${string}`, `0x${string}`, boolean, bigint, bigint]>;
|
|
1371
|
+
}
|
|
1372
|
+
|
|
1373
|
+
/**
|
|
1374
|
+
* hasRole
|
|
1375
|
+
* view
|
|
1376
|
+
*/
|
|
1377
|
+
async hasRole(role: `0x${string}`, account: `0x${string}`): Promise<boolean> {
|
|
1378
|
+
return this.contract.read.hasRole([role, account] as const) as Promise<boolean>;
|
|
1379
|
+
}
|
|
1380
|
+
|
|
1381
|
+
/**
|
|
1382
|
+
* lastUpgradeTime
|
|
1383
|
+
* view
|
|
1384
|
+
*/
|
|
1385
|
+
async lastUpgradeTime(): Promise<bigint> {
|
|
1386
|
+
return this.contract.read.lastUpgradeTime() as Promise<bigint>;
|
|
1387
|
+
}
|
|
1388
|
+
|
|
1389
|
+
/**
|
|
1390
|
+
* minApprovals
|
|
1391
|
+
* view
|
|
1392
|
+
*/
|
|
1393
|
+
async minApprovals(): Promise<bigint> {
|
|
1394
|
+
return this.contract.read.minApprovals() as Promise<bigint>;
|
|
1395
|
+
}
|
|
1396
|
+
|
|
1397
|
+
/**
|
|
1398
|
+
* paused
|
|
1399
|
+
* view
|
|
1400
|
+
*/
|
|
1401
|
+
async paused(): Promise<boolean> {
|
|
1402
|
+
return this.contract.read.paused() as Promise<boolean>;
|
|
1403
|
+
}
|
|
1404
|
+
|
|
1405
|
+
/**
|
|
1406
|
+
* pendingAuditApproved
|
|
1407
|
+
* view
|
|
1408
|
+
*/
|
|
1409
|
+
async pendingAuditApproved(): Promise<boolean> {
|
|
1410
|
+
return this.contract.read.pendingAuditApproved() as Promise<boolean>;
|
|
1411
|
+
}
|
|
1412
|
+
|
|
1413
|
+
/**
|
|
1414
|
+
* pendingImplementation
|
|
1415
|
+
* view
|
|
1416
|
+
*/
|
|
1417
|
+
async pendingImplementation(): Promise<`0x${string}`> {
|
|
1418
|
+
return this.contract.read.pendingImplementation() as Promise<`0x${string}`>;
|
|
1419
|
+
}
|
|
1420
|
+
|
|
1421
|
+
/**
|
|
1422
|
+
* proposedAt
|
|
1423
|
+
* view
|
|
1424
|
+
*/
|
|
1425
|
+
async proposedAt(): Promise<bigint> {
|
|
1426
|
+
return this.contract.read.proposedAt() as Promise<bigint>;
|
|
1427
|
+
}
|
|
1428
|
+
|
|
1429
|
+
/**
|
|
1430
|
+
* proxiableUUID
|
|
1431
|
+
* view
|
|
1432
|
+
*/
|
|
1433
|
+
async proxiableUUID(): Promise<`0x${string}`> {
|
|
1434
|
+
return this.contract.read.proxiableUUID() as Promise<`0x${string}`>;
|
|
1435
|
+
}
|
|
1436
|
+
|
|
1437
|
+
/**
|
|
1438
|
+
* proxy
|
|
1439
|
+
* view
|
|
1440
|
+
*/
|
|
1441
|
+
async proxy(): Promise<`0x${string}`> {
|
|
1442
|
+
return this.contract.read.proxy() as Promise<`0x${string}`>;
|
|
1443
|
+
}
|
|
1444
|
+
|
|
1445
|
+
/**
|
|
1446
|
+
* rollbackCounter
|
|
1447
|
+
* view
|
|
1448
|
+
*/
|
|
1449
|
+
async rollbackCounter(): Promise<bigint> {
|
|
1450
|
+
return this.contract.read.rollbackCounter() as Promise<bigint>;
|
|
1451
|
+
}
|
|
1452
|
+
|
|
1453
|
+
/**
|
|
1454
|
+
* rollbackHistory
|
|
1455
|
+
* view
|
|
1456
|
+
*/
|
|
1457
|
+
async rollbackHistory(arg0: bigint): Promise<[`0x${string}`, `0x${string}`, `0x${string}`, bigint, `0x${string}`]> {
|
|
1458
|
+
return this.contract.read.rollbackHistory([arg0] as const) as Promise<[`0x${string}`, `0x${string}`, `0x${string}`, bigint, `0x${string}`]>;
|
|
1459
|
+
}
|
|
1460
|
+
|
|
1461
|
+
/**
|
|
1462
|
+
* supportsInterface
|
|
1463
|
+
* view
|
|
1464
|
+
*/
|
|
1465
|
+
async supportsInterface(interfaceId: `0x${string}`): Promise<boolean> {
|
|
1466
|
+
return this.contract.read.supportsInterface([interfaceId] as const) as Promise<boolean>;
|
|
1467
|
+
}
|
|
1468
|
+
|
|
1469
|
+
/**
|
|
1470
|
+
* timelockDelay
|
|
1471
|
+
* view
|
|
1472
|
+
*/
|
|
1473
|
+
async timelockDelay(): Promise<bigint> {
|
|
1474
|
+
return this.contract.read.timelockDelay() as Promise<bigint>;
|
|
1475
|
+
}
|
|
1476
|
+
|
|
1477
|
+
/**
|
|
1478
|
+
* upgradeCounter
|
|
1479
|
+
* view
|
|
1480
|
+
*/
|
|
1481
|
+
async upgradeCounter(): Promise<bigint> {
|
|
1482
|
+
return this.contract.read.upgradeCounter() as Promise<bigint>;
|
|
1483
|
+
}
|
|
1484
|
+
|
|
1485
|
+
/**
|
|
1486
|
+
* upgradeHistory
|
|
1487
|
+
* view
|
|
1488
|
+
*/
|
|
1489
|
+
async upgradeHistory(arg0: bigint): Promise<[`0x${string}`, `0x${string}`, `0x${string}`, bigint, `0x${string}`]> {
|
|
1490
|
+
return this.contract.read.upgradeHistory([arg0] as const) as Promise<[`0x${string}`, `0x${string}`, `0x${string}`, bigint, `0x${string}`]>;
|
|
1491
|
+
}
|
|
1492
|
+
|
|
1493
|
+
/**
|
|
1494
|
+
* upgradesFrozen
|
|
1495
|
+
* view
|
|
1496
|
+
*/
|
|
1497
|
+
async upgradesFrozen(): Promise<boolean> {
|
|
1498
|
+
return this.contract.read.upgradesFrozen() as Promise<boolean>;
|
|
1499
|
+
}
|
|
1500
|
+
|
|
1501
|
+
/**
|
|
1502
|
+
* approveUpgrade
|
|
1503
|
+
* nonpayable
|
|
1504
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1505
|
+
*/
|
|
1506
|
+
async approveUpgrade(options?: {
|
|
1507
|
+
accessList?: import('viem').AccessList;
|
|
1508
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1509
|
+
chain?: import('viem').Chain | null;
|
|
1510
|
+
dataSuffix?: `0x${string}`;
|
|
1511
|
+
gas?: bigint;
|
|
1512
|
+
gasPrice?: bigint;
|
|
1513
|
+
maxFeePerGas?: bigint;
|
|
1514
|
+
maxPriorityFeePerGas?: bigint;
|
|
1515
|
+
nonce?: number;
|
|
1516
|
+
value?: bigint;
|
|
1517
|
+
}): Promise<`0x${string}`> {
|
|
1518
|
+
if (!this.contract.write) {
|
|
1519
|
+
throw new Error('Wallet client is required for write operations');
|
|
1520
|
+
}
|
|
1521
|
+
return this.contract.write.approveUpgrade(options) as Promise<`0x${string}`>;
|
|
1522
|
+
}
|
|
1523
|
+
|
|
1524
|
+
/**
|
|
1525
|
+
* approveUpgradeAudit
|
|
1526
|
+
* nonpayable
|
|
1527
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1528
|
+
*/
|
|
1529
|
+
async approveUpgradeAudit(options?: {
|
|
1530
|
+
accessList?: import('viem').AccessList;
|
|
1531
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1532
|
+
chain?: import('viem').Chain | null;
|
|
1533
|
+
dataSuffix?: `0x${string}`;
|
|
1534
|
+
gas?: bigint;
|
|
1535
|
+
gasPrice?: bigint;
|
|
1536
|
+
maxFeePerGas?: bigint;
|
|
1537
|
+
maxPriorityFeePerGas?: bigint;
|
|
1538
|
+
nonce?: number;
|
|
1539
|
+
value?: bigint;
|
|
1540
|
+
}): Promise<`0x${string}`> {
|
|
1541
|
+
if (!this.contract.write) {
|
|
1542
|
+
throw new Error('Wallet client is required for write operations');
|
|
1543
|
+
}
|
|
1544
|
+
return this.contract.write.approveUpgradeAudit(options) as Promise<`0x${string}`>;
|
|
1545
|
+
}
|
|
1546
|
+
|
|
1547
|
+
/**
|
|
1548
|
+
* cancelUpgrade
|
|
1549
|
+
* nonpayable
|
|
1550
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1551
|
+
*/
|
|
1552
|
+
async cancelUpgrade(options?: {
|
|
1553
|
+
accessList?: import('viem').AccessList;
|
|
1554
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1555
|
+
chain?: import('viem').Chain | null;
|
|
1556
|
+
dataSuffix?: `0x${string}`;
|
|
1557
|
+
gas?: bigint;
|
|
1558
|
+
gasPrice?: bigint;
|
|
1559
|
+
maxFeePerGas?: bigint;
|
|
1560
|
+
maxPriorityFeePerGas?: bigint;
|
|
1561
|
+
nonce?: number;
|
|
1562
|
+
value?: bigint;
|
|
1563
|
+
}): Promise<`0x${string}`> {
|
|
1564
|
+
if (!this.contract.write) {
|
|
1565
|
+
throw new Error('Wallet client is required for write operations');
|
|
1566
|
+
}
|
|
1567
|
+
return this.contract.write.cancelUpgrade(options) as Promise<`0x${string}`>;
|
|
1568
|
+
}
|
|
1569
|
+
|
|
1570
|
+
/**
|
|
1571
|
+
* configureUpgradePolicy
|
|
1572
|
+
* nonpayable
|
|
1573
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1574
|
+
*/
|
|
1575
|
+
async configureUpgradePolicy(delay: bigint, approvals: bigint, requireAuditApproval: boolean, options?: {
|
|
1576
|
+
accessList?: import('viem').AccessList;
|
|
1577
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1578
|
+
chain?: import('viem').Chain | null;
|
|
1579
|
+
dataSuffix?: `0x${string}`;
|
|
1580
|
+
gas?: bigint;
|
|
1581
|
+
gasPrice?: bigint;
|
|
1582
|
+
maxFeePerGas?: bigint;
|
|
1583
|
+
maxPriorityFeePerGas?: bigint;
|
|
1584
|
+
nonce?: number;
|
|
1585
|
+
value?: bigint;
|
|
1586
|
+
}): Promise<`0x${string}`> {
|
|
1587
|
+
if (!this.contract.write) {
|
|
1588
|
+
throw new Error('Wallet client is required for write operations');
|
|
1589
|
+
}
|
|
1590
|
+
return this.contract.write.configureUpgradePolicy([delay, approvals, requireAuditApproval] as const, options) as Promise<`0x${string}`>;
|
|
1591
|
+
}
|
|
1592
|
+
|
|
1593
|
+
/**
|
|
1594
|
+
* executeUpgrade
|
|
1595
|
+
* nonpayable
|
|
1596
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1597
|
+
*/
|
|
1598
|
+
async executeUpgrade(options?: {
|
|
1599
|
+
accessList?: import('viem').AccessList;
|
|
1600
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1601
|
+
chain?: import('viem').Chain | null;
|
|
1602
|
+
dataSuffix?: `0x${string}`;
|
|
1603
|
+
gas?: bigint;
|
|
1604
|
+
gasPrice?: bigint;
|
|
1605
|
+
maxFeePerGas?: bigint;
|
|
1606
|
+
maxPriorityFeePerGas?: bigint;
|
|
1607
|
+
nonce?: number;
|
|
1608
|
+
value?: bigint;
|
|
1609
|
+
}): Promise<`0x${string}`> {
|
|
1610
|
+
if (!this.contract.write) {
|
|
1611
|
+
throw new Error('Wallet client is required for write operations');
|
|
1612
|
+
}
|
|
1613
|
+
return this.contract.write.executeUpgrade(options) as Promise<`0x${string}`>;
|
|
1614
|
+
}
|
|
1615
|
+
|
|
1616
|
+
/**
|
|
1617
|
+
* executeUpgradeAndCall
|
|
1618
|
+
* payable
|
|
1619
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1620
|
+
*/
|
|
1621
|
+
async executeUpgradeAndCall(data: `0x${string}`, options?: {
|
|
1622
|
+
accessList?: import('viem').AccessList;
|
|
1623
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1624
|
+
chain?: import('viem').Chain | null;
|
|
1625
|
+
dataSuffix?: `0x${string}`;
|
|
1626
|
+
gas?: bigint;
|
|
1627
|
+
gasPrice?: bigint;
|
|
1628
|
+
maxFeePerGas?: bigint;
|
|
1629
|
+
maxPriorityFeePerGas?: bigint;
|
|
1630
|
+
nonce?: number;
|
|
1631
|
+
value?: bigint;
|
|
1632
|
+
}): Promise<`0x${string}`> {
|
|
1633
|
+
if (!this.contract.write) {
|
|
1634
|
+
throw new Error('Wallet client is required for write operations');
|
|
1635
|
+
}
|
|
1636
|
+
return this.contract.write.executeUpgradeAndCall([data] as const, options) as Promise<`0x${string}`>;
|
|
1637
|
+
}
|
|
1638
|
+
|
|
1639
|
+
/**
|
|
1640
|
+
* grantRole
|
|
1641
|
+
* nonpayable
|
|
1642
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1643
|
+
*/
|
|
1644
|
+
async grantRole(role: `0x${string}`, account: `0x${string}`, options?: {
|
|
1645
|
+
accessList?: import('viem').AccessList;
|
|
1646
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1647
|
+
chain?: import('viem').Chain | null;
|
|
1648
|
+
dataSuffix?: `0x${string}`;
|
|
1649
|
+
gas?: bigint;
|
|
1650
|
+
gasPrice?: bigint;
|
|
1651
|
+
maxFeePerGas?: bigint;
|
|
1652
|
+
maxPriorityFeePerGas?: bigint;
|
|
1653
|
+
nonce?: number;
|
|
1654
|
+
value?: bigint;
|
|
1655
|
+
}): Promise<`0x${string}`> {
|
|
1656
|
+
if (!this.contract.write) {
|
|
1657
|
+
throw new Error('Wallet client is required for write operations');
|
|
1658
|
+
}
|
|
1659
|
+
return this.contract.write.grantRole([role, account] as const, options) as Promise<`0x${string}`>;
|
|
1660
|
+
}
|
|
1661
|
+
|
|
1662
|
+
/**
|
|
1663
|
+
* initialize
|
|
1664
|
+
* nonpayable
|
|
1665
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1666
|
+
*/
|
|
1667
|
+
async initialize(admin: `0x${string}`, options?: {
|
|
1668
|
+
accessList?: import('viem').AccessList;
|
|
1669
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1670
|
+
chain?: import('viem').Chain | null;
|
|
1671
|
+
dataSuffix?: `0x${string}`;
|
|
1672
|
+
gas?: bigint;
|
|
1673
|
+
gasPrice?: bigint;
|
|
1674
|
+
maxFeePerGas?: bigint;
|
|
1675
|
+
maxPriorityFeePerGas?: bigint;
|
|
1676
|
+
nonce?: number;
|
|
1677
|
+
value?: bigint;
|
|
1678
|
+
}): Promise<`0x${string}`> {
|
|
1679
|
+
if (!this.contract.write) {
|
|
1680
|
+
throw new Error('Wallet client is required for write operations');
|
|
1681
|
+
}
|
|
1682
|
+
return this.contract.write.initialize([admin] as const, options) as Promise<`0x${string}`>;
|
|
1683
|
+
}
|
|
1684
|
+
|
|
1685
|
+
/**
|
|
1686
|
+
* pause
|
|
1687
|
+
* nonpayable
|
|
1688
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1689
|
+
*/
|
|
1690
|
+
async pause(options?: {
|
|
1691
|
+
accessList?: import('viem').AccessList;
|
|
1692
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1693
|
+
chain?: import('viem').Chain | null;
|
|
1694
|
+
dataSuffix?: `0x${string}`;
|
|
1695
|
+
gas?: bigint;
|
|
1696
|
+
gasPrice?: bigint;
|
|
1697
|
+
maxFeePerGas?: bigint;
|
|
1698
|
+
maxPriorityFeePerGas?: bigint;
|
|
1699
|
+
nonce?: number;
|
|
1700
|
+
value?: bigint;
|
|
1701
|
+
}): Promise<`0x${string}`> {
|
|
1702
|
+
if (!this.contract.write) {
|
|
1703
|
+
throw new Error('Wallet client is required for write operations');
|
|
1704
|
+
}
|
|
1705
|
+
return this.contract.write.pause(options) as Promise<`0x${string}`>;
|
|
1706
|
+
}
|
|
1707
|
+
|
|
1708
|
+
/**
|
|
1709
|
+
* proposeUpgrade
|
|
1710
|
+
* nonpayable
|
|
1711
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1712
|
+
*/
|
|
1713
|
+
async proposeUpgrade(implementation: `0x${string}`, options?: {
|
|
1714
|
+
accessList?: import('viem').AccessList;
|
|
1715
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1716
|
+
chain?: import('viem').Chain | null;
|
|
1717
|
+
dataSuffix?: `0x${string}`;
|
|
1718
|
+
gas?: bigint;
|
|
1719
|
+
gasPrice?: bigint;
|
|
1720
|
+
maxFeePerGas?: bigint;
|
|
1721
|
+
maxPriorityFeePerGas?: bigint;
|
|
1722
|
+
nonce?: number;
|
|
1723
|
+
value?: bigint;
|
|
1724
|
+
}): Promise<`0x${string}`> {
|
|
1725
|
+
if (!this.contract.write) {
|
|
1726
|
+
throw new Error('Wallet client is required for write operations');
|
|
1727
|
+
}
|
|
1728
|
+
return this.contract.write.proposeUpgrade([implementation] as const, options) as Promise<`0x${string}`>;
|
|
1729
|
+
}
|
|
1730
|
+
|
|
1731
|
+
/**
|
|
1732
|
+
* registerProxy
|
|
1733
|
+
* nonpayable
|
|
1734
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1735
|
+
*/
|
|
1736
|
+
async registerProxy(proxyAddress: `0x${string}`, implementation: `0x${string}`, options?: {
|
|
1737
|
+
accessList?: import('viem').AccessList;
|
|
1738
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1739
|
+
chain?: import('viem').Chain | null;
|
|
1740
|
+
dataSuffix?: `0x${string}`;
|
|
1741
|
+
gas?: bigint;
|
|
1742
|
+
gasPrice?: bigint;
|
|
1743
|
+
maxFeePerGas?: bigint;
|
|
1744
|
+
maxPriorityFeePerGas?: bigint;
|
|
1745
|
+
nonce?: number;
|
|
1746
|
+
value?: bigint;
|
|
1747
|
+
}): Promise<`0x${string}`> {
|
|
1748
|
+
if (!this.contract.write) {
|
|
1749
|
+
throw new Error('Wallet client is required for write operations');
|
|
1750
|
+
}
|
|
1751
|
+
return this.contract.write.registerProxy([proxyAddress, implementation] as const, options) as Promise<`0x${string}`>;
|
|
1752
|
+
}
|
|
1753
|
+
|
|
1754
|
+
/**
|
|
1755
|
+
* renounceRole
|
|
1756
|
+
* nonpayable
|
|
1757
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1758
|
+
*/
|
|
1759
|
+
async renounceRole(role: `0x${string}`, callerConfirmation: `0x${string}`, options?: {
|
|
1760
|
+
accessList?: import('viem').AccessList;
|
|
1761
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1762
|
+
chain?: import('viem').Chain | null;
|
|
1763
|
+
dataSuffix?: `0x${string}`;
|
|
1764
|
+
gas?: bigint;
|
|
1765
|
+
gasPrice?: bigint;
|
|
1766
|
+
maxFeePerGas?: bigint;
|
|
1767
|
+
maxPriorityFeePerGas?: bigint;
|
|
1768
|
+
nonce?: number;
|
|
1769
|
+
value?: bigint;
|
|
1770
|
+
}): Promise<`0x${string}`> {
|
|
1771
|
+
if (!this.contract.write) {
|
|
1772
|
+
throw new Error('Wallet client is required for write operations');
|
|
1773
|
+
}
|
|
1774
|
+
return this.contract.write.renounceRole([role, callerConfirmation] as const, options) as Promise<`0x${string}`>;
|
|
1775
|
+
}
|
|
1776
|
+
|
|
1777
|
+
/**
|
|
1778
|
+
* revokeRole
|
|
1779
|
+
* nonpayable
|
|
1780
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1781
|
+
*/
|
|
1782
|
+
async revokeRole(role: `0x${string}`, account: `0x${string}`, options?: {
|
|
1783
|
+
accessList?: import('viem').AccessList;
|
|
1784
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1785
|
+
chain?: import('viem').Chain | null;
|
|
1786
|
+
dataSuffix?: `0x${string}`;
|
|
1787
|
+
gas?: bigint;
|
|
1788
|
+
gasPrice?: bigint;
|
|
1789
|
+
maxFeePerGas?: bigint;
|
|
1790
|
+
maxPriorityFeePerGas?: bigint;
|
|
1791
|
+
nonce?: number;
|
|
1792
|
+
value?: bigint;
|
|
1793
|
+
}): Promise<`0x${string}`> {
|
|
1794
|
+
if (!this.contract.write) {
|
|
1795
|
+
throw new Error('Wallet client is required for write operations');
|
|
1796
|
+
}
|
|
1797
|
+
return this.contract.write.revokeRole([role, account] as const, options) as Promise<`0x${string}`>;
|
|
1798
|
+
}
|
|
1799
|
+
|
|
1800
|
+
/**
|
|
1801
|
+
* rollbackUpgrade
|
|
1802
|
+
* payable
|
|
1803
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1804
|
+
*/
|
|
1805
|
+
async rollbackUpgrade(rollbackImplementation: `0x${string}`, data: `0x${string}`, options?: {
|
|
1806
|
+
accessList?: import('viem').AccessList;
|
|
1807
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1808
|
+
chain?: import('viem').Chain | null;
|
|
1809
|
+
dataSuffix?: `0x${string}`;
|
|
1810
|
+
gas?: bigint;
|
|
1811
|
+
gasPrice?: bigint;
|
|
1812
|
+
maxFeePerGas?: bigint;
|
|
1813
|
+
maxPriorityFeePerGas?: bigint;
|
|
1814
|
+
nonce?: number;
|
|
1815
|
+
value?: bigint;
|
|
1816
|
+
}): Promise<`0x${string}`> {
|
|
1817
|
+
if (!this.contract.write) {
|
|
1818
|
+
throw new Error('Wallet client is required for write operations');
|
|
1819
|
+
}
|
|
1820
|
+
return this.contract.write.rollbackUpgrade([rollbackImplementation, data] as const, options) as Promise<`0x${string}`>;
|
|
1821
|
+
}
|
|
1822
|
+
|
|
1823
|
+
/**
|
|
1824
|
+
* setUpgradeFreeze
|
|
1825
|
+
* nonpayable
|
|
1826
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1827
|
+
*/
|
|
1828
|
+
async setUpgradeFreeze(status: boolean, options?: {
|
|
1829
|
+
accessList?: import('viem').AccessList;
|
|
1830
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1831
|
+
chain?: import('viem').Chain | null;
|
|
1832
|
+
dataSuffix?: `0x${string}`;
|
|
1833
|
+
gas?: bigint;
|
|
1834
|
+
gasPrice?: bigint;
|
|
1835
|
+
maxFeePerGas?: bigint;
|
|
1836
|
+
maxPriorityFeePerGas?: bigint;
|
|
1837
|
+
nonce?: number;
|
|
1838
|
+
value?: bigint;
|
|
1839
|
+
}): Promise<`0x${string}`> {
|
|
1840
|
+
if (!this.contract.write) {
|
|
1841
|
+
throw new Error('Wallet client is required for write operations');
|
|
1842
|
+
}
|
|
1843
|
+
return this.contract.write.setUpgradeFreeze([status] as const, options) as Promise<`0x${string}`>;
|
|
1844
|
+
}
|
|
1845
|
+
|
|
1846
|
+
/**
|
|
1847
|
+
* unpause
|
|
1848
|
+
* nonpayable
|
|
1849
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1850
|
+
*/
|
|
1851
|
+
async unpause(options?: {
|
|
1852
|
+
accessList?: import('viem').AccessList;
|
|
1853
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1854
|
+
chain?: import('viem').Chain | null;
|
|
1855
|
+
dataSuffix?: `0x${string}`;
|
|
1856
|
+
gas?: bigint;
|
|
1857
|
+
gasPrice?: bigint;
|
|
1858
|
+
maxFeePerGas?: bigint;
|
|
1859
|
+
maxPriorityFeePerGas?: bigint;
|
|
1860
|
+
nonce?: number;
|
|
1861
|
+
value?: bigint;
|
|
1862
|
+
}): Promise<`0x${string}`> {
|
|
1863
|
+
if (!this.contract.write) {
|
|
1864
|
+
throw new Error('Wallet client is required for write operations');
|
|
1865
|
+
}
|
|
1866
|
+
return this.contract.write.unpause(options) as Promise<`0x${string}`>;
|
|
1867
|
+
}
|
|
1868
|
+
|
|
1869
|
+
/**
|
|
1870
|
+
* upgradeToAndCall
|
|
1871
|
+
* payable
|
|
1872
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1873
|
+
*/
|
|
1874
|
+
async upgradeToAndCall(newImplementation: `0x${string}`, data: `0x${string}`, options?: {
|
|
1875
|
+
accessList?: import('viem').AccessList;
|
|
1876
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1877
|
+
chain?: import('viem').Chain | null;
|
|
1878
|
+
dataSuffix?: `0x${string}`;
|
|
1879
|
+
gas?: bigint;
|
|
1880
|
+
gasPrice?: bigint;
|
|
1881
|
+
maxFeePerGas?: bigint;
|
|
1882
|
+
maxPriorityFeePerGas?: bigint;
|
|
1883
|
+
nonce?: number;
|
|
1884
|
+
value?: bigint;
|
|
1885
|
+
}): Promise<`0x${string}`> {
|
|
1886
|
+
if (!this.contract.write) {
|
|
1887
|
+
throw new Error('Wallet client is required for write operations');
|
|
1888
|
+
}
|
|
1889
|
+
return this.contract.write.upgradeToAndCall([newImplementation, data] as const, options) as Promise<`0x${string}`>;
|
|
1890
|
+
}
|
|
1891
|
+
|
|
1892
|
+
|
|
1893
|
+
|
|
1894
|
+
/**
|
|
1895
|
+
* Simulate contract write operations (dry-run without sending transaction)
|
|
1896
|
+
*
|
|
1897
|
+
* @example
|
|
1898
|
+
* const result = await contract.simulate.transfer('0x...', 1000n);
|
|
1899
|
+
* console.log('Gas estimate:', result.request.gas);
|
|
1900
|
+
* console.log('Would succeed:', result.result);
|
|
1901
|
+
*/
|
|
1902
|
+
get simulate() {
|
|
1903
|
+
const contract = this.contract;
|
|
1904
|
+
if (!contract.simulate) {
|
|
1905
|
+
throw new Error('Public client is required for simulation');
|
|
1906
|
+
}
|
|
1907
|
+
return {
|
|
1908
|
+
/**
|
|
1909
|
+
* Simulate approveUpgrade
|
|
1910
|
+
* Returns gas estimate and result without sending transaction
|
|
1911
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1912
|
+
*/
|
|
1913
|
+
async approveUpgrade(options?: {
|
|
1914
|
+
accessList?: import('viem').AccessList;
|
|
1915
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1916
|
+
chain?: import('viem').Chain | null;
|
|
1917
|
+
dataSuffix?: `0x${string}`;
|
|
1918
|
+
gas?: bigint;
|
|
1919
|
+
gasPrice?: bigint;
|
|
1920
|
+
maxFeePerGas?: bigint;
|
|
1921
|
+
maxPriorityFeePerGas?: bigint;
|
|
1922
|
+
nonce?: number;
|
|
1923
|
+
value?: bigint;
|
|
1924
|
+
}): Promise<void> {
|
|
1925
|
+
return contract.simulate.approveUpgrade(options) as Promise<void>;
|
|
1926
|
+
},
|
|
1927
|
+
/**
|
|
1928
|
+
* Simulate approveUpgradeAudit
|
|
1929
|
+
* Returns gas estimate and result without sending transaction
|
|
1930
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1931
|
+
*/
|
|
1932
|
+
async approveUpgradeAudit(options?: {
|
|
1933
|
+
accessList?: import('viem').AccessList;
|
|
1934
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1935
|
+
chain?: import('viem').Chain | null;
|
|
1936
|
+
dataSuffix?: `0x${string}`;
|
|
1937
|
+
gas?: bigint;
|
|
1938
|
+
gasPrice?: bigint;
|
|
1939
|
+
maxFeePerGas?: bigint;
|
|
1940
|
+
maxPriorityFeePerGas?: bigint;
|
|
1941
|
+
nonce?: number;
|
|
1942
|
+
value?: bigint;
|
|
1943
|
+
}): Promise<void> {
|
|
1944
|
+
return contract.simulate.approveUpgradeAudit(options) as Promise<void>;
|
|
1945
|
+
},
|
|
1946
|
+
/**
|
|
1947
|
+
* Simulate cancelUpgrade
|
|
1948
|
+
* Returns gas estimate and result without sending transaction
|
|
1949
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1950
|
+
*/
|
|
1951
|
+
async cancelUpgrade(options?: {
|
|
1952
|
+
accessList?: import('viem').AccessList;
|
|
1953
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1954
|
+
chain?: import('viem').Chain | null;
|
|
1955
|
+
dataSuffix?: `0x${string}`;
|
|
1956
|
+
gas?: bigint;
|
|
1957
|
+
gasPrice?: bigint;
|
|
1958
|
+
maxFeePerGas?: bigint;
|
|
1959
|
+
maxPriorityFeePerGas?: bigint;
|
|
1960
|
+
nonce?: number;
|
|
1961
|
+
value?: bigint;
|
|
1962
|
+
}): Promise<void> {
|
|
1963
|
+
return contract.simulate.cancelUpgrade(options) as Promise<void>;
|
|
1964
|
+
},
|
|
1965
|
+
/**
|
|
1966
|
+
* Simulate configureUpgradePolicy
|
|
1967
|
+
* Returns gas estimate and result without sending transaction
|
|
1968
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1969
|
+
*/
|
|
1970
|
+
async configureUpgradePolicy(delay: bigint, approvals: bigint, requireAuditApproval: boolean, options?: {
|
|
1971
|
+
accessList?: import('viem').AccessList;
|
|
1972
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1973
|
+
chain?: import('viem').Chain | null;
|
|
1974
|
+
dataSuffix?: `0x${string}`;
|
|
1975
|
+
gas?: bigint;
|
|
1976
|
+
gasPrice?: bigint;
|
|
1977
|
+
maxFeePerGas?: bigint;
|
|
1978
|
+
maxPriorityFeePerGas?: bigint;
|
|
1979
|
+
nonce?: number;
|
|
1980
|
+
value?: bigint;
|
|
1981
|
+
}): Promise<void> {
|
|
1982
|
+
return contract.simulate.configureUpgradePolicy([delay, approvals, requireAuditApproval] as const, options) as Promise<void>;
|
|
1983
|
+
},
|
|
1984
|
+
/**
|
|
1985
|
+
* Simulate executeUpgrade
|
|
1986
|
+
* Returns gas estimate and result without sending transaction
|
|
1987
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1988
|
+
*/
|
|
1989
|
+
async executeUpgrade(options?: {
|
|
1990
|
+
accessList?: import('viem').AccessList;
|
|
1991
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1992
|
+
chain?: import('viem').Chain | null;
|
|
1993
|
+
dataSuffix?: `0x${string}`;
|
|
1994
|
+
gas?: bigint;
|
|
1995
|
+
gasPrice?: bigint;
|
|
1996
|
+
maxFeePerGas?: bigint;
|
|
1997
|
+
maxPriorityFeePerGas?: bigint;
|
|
1998
|
+
nonce?: number;
|
|
1999
|
+
value?: bigint;
|
|
2000
|
+
}): Promise<void> {
|
|
2001
|
+
return contract.simulate.executeUpgrade(options) as Promise<void>;
|
|
2002
|
+
},
|
|
2003
|
+
/**
|
|
2004
|
+
* Simulate executeUpgradeAndCall
|
|
2005
|
+
* Returns gas estimate and result without sending transaction
|
|
2006
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
2007
|
+
*/
|
|
2008
|
+
async executeUpgradeAndCall(data: `0x${string}`, options?: {
|
|
2009
|
+
accessList?: import('viem').AccessList;
|
|
2010
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
2011
|
+
chain?: import('viem').Chain | null;
|
|
2012
|
+
dataSuffix?: `0x${string}`;
|
|
2013
|
+
gas?: bigint;
|
|
2014
|
+
gasPrice?: bigint;
|
|
2015
|
+
maxFeePerGas?: bigint;
|
|
2016
|
+
maxPriorityFeePerGas?: bigint;
|
|
2017
|
+
nonce?: number;
|
|
2018
|
+
value?: bigint;
|
|
2019
|
+
}): Promise<void> {
|
|
2020
|
+
return contract.simulate.executeUpgradeAndCall([data] as const, options) as Promise<void>;
|
|
2021
|
+
},
|
|
2022
|
+
/**
|
|
2023
|
+
* Simulate grantRole
|
|
2024
|
+
* Returns gas estimate and result without sending transaction
|
|
2025
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
2026
|
+
*/
|
|
2027
|
+
async grantRole(role: `0x${string}`, account: `0x${string}`, options?: {
|
|
2028
|
+
accessList?: import('viem').AccessList;
|
|
2029
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
2030
|
+
chain?: import('viem').Chain | null;
|
|
2031
|
+
dataSuffix?: `0x${string}`;
|
|
2032
|
+
gas?: bigint;
|
|
2033
|
+
gasPrice?: bigint;
|
|
2034
|
+
maxFeePerGas?: bigint;
|
|
2035
|
+
maxPriorityFeePerGas?: bigint;
|
|
2036
|
+
nonce?: number;
|
|
2037
|
+
value?: bigint;
|
|
2038
|
+
}): Promise<void> {
|
|
2039
|
+
return contract.simulate.grantRole([role, account] as const, options) as Promise<void>;
|
|
2040
|
+
},
|
|
2041
|
+
/**
|
|
2042
|
+
* Simulate initialize
|
|
2043
|
+
* Returns gas estimate and result without sending transaction
|
|
2044
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
2045
|
+
*/
|
|
2046
|
+
async initialize(admin: `0x${string}`, options?: {
|
|
2047
|
+
accessList?: import('viem').AccessList;
|
|
2048
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
2049
|
+
chain?: import('viem').Chain | null;
|
|
2050
|
+
dataSuffix?: `0x${string}`;
|
|
2051
|
+
gas?: bigint;
|
|
2052
|
+
gasPrice?: bigint;
|
|
2053
|
+
maxFeePerGas?: bigint;
|
|
2054
|
+
maxPriorityFeePerGas?: bigint;
|
|
2055
|
+
nonce?: number;
|
|
2056
|
+
value?: bigint;
|
|
2057
|
+
}): Promise<void> {
|
|
2058
|
+
return contract.simulate.initialize([admin] as const, options) as Promise<void>;
|
|
2059
|
+
},
|
|
2060
|
+
/**
|
|
2061
|
+
* Simulate pause
|
|
2062
|
+
* Returns gas estimate and result without sending transaction
|
|
2063
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
2064
|
+
*/
|
|
2065
|
+
async pause(options?: {
|
|
2066
|
+
accessList?: import('viem').AccessList;
|
|
2067
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
2068
|
+
chain?: import('viem').Chain | null;
|
|
2069
|
+
dataSuffix?: `0x${string}`;
|
|
2070
|
+
gas?: bigint;
|
|
2071
|
+
gasPrice?: bigint;
|
|
2072
|
+
maxFeePerGas?: bigint;
|
|
2073
|
+
maxPriorityFeePerGas?: bigint;
|
|
2074
|
+
nonce?: number;
|
|
2075
|
+
value?: bigint;
|
|
2076
|
+
}): Promise<void> {
|
|
2077
|
+
return contract.simulate.pause(options) as Promise<void>;
|
|
2078
|
+
},
|
|
2079
|
+
/**
|
|
2080
|
+
* Simulate proposeUpgrade
|
|
2081
|
+
* Returns gas estimate and result without sending transaction
|
|
2082
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
2083
|
+
*/
|
|
2084
|
+
async proposeUpgrade(implementation: `0x${string}`, options?: {
|
|
2085
|
+
accessList?: import('viem').AccessList;
|
|
2086
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
2087
|
+
chain?: import('viem').Chain | null;
|
|
2088
|
+
dataSuffix?: `0x${string}`;
|
|
2089
|
+
gas?: bigint;
|
|
2090
|
+
gasPrice?: bigint;
|
|
2091
|
+
maxFeePerGas?: bigint;
|
|
2092
|
+
maxPriorityFeePerGas?: bigint;
|
|
2093
|
+
nonce?: number;
|
|
2094
|
+
value?: bigint;
|
|
2095
|
+
}): Promise<void> {
|
|
2096
|
+
return contract.simulate.proposeUpgrade([implementation] as const, options) as Promise<void>;
|
|
2097
|
+
},
|
|
2098
|
+
/**
|
|
2099
|
+
* Simulate registerProxy
|
|
2100
|
+
* Returns gas estimate and result without sending transaction
|
|
2101
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
2102
|
+
*/
|
|
2103
|
+
async registerProxy(proxyAddress: `0x${string}`, implementation: `0x${string}`, options?: {
|
|
2104
|
+
accessList?: import('viem').AccessList;
|
|
2105
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
2106
|
+
chain?: import('viem').Chain | null;
|
|
2107
|
+
dataSuffix?: `0x${string}`;
|
|
2108
|
+
gas?: bigint;
|
|
2109
|
+
gasPrice?: bigint;
|
|
2110
|
+
maxFeePerGas?: bigint;
|
|
2111
|
+
maxPriorityFeePerGas?: bigint;
|
|
2112
|
+
nonce?: number;
|
|
2113
|
+
value?: bigint;
|
|
2114
|
+
}): Promise<void> {
|
|
2115
|
+
return contract.simulate.registerProxy([proxyAddress, implementation] as const, options) as Promise<void>;
|
|
2116
|
+
},
|
|
2117
|
+
/**
|
|
2118
|
+
* Simulate renounceRole
|
|
2119
|
+
* Returns gas estimate and result without sending transaction
|
|
2120
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
2121
|
+
*/
|
|
2122
|
+
async renounceRole(role: `0x${string}`, callerConfirmation: `0x${string}`, options?: {
|
|
2123
|
+
accessList?: import('viem').AccessList;
|
|
2124
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
2125
|
+
chain?: import('viem').Chain | null;
|
|
2126
|
+
dataSuffix?: `0x${string}`;
|
|
2127
|
+
gas?: bigint;
|
|
2128
|
+
gasPrice?: bigint;
|
|
2129
|
+
maxFeePerGas?: bigint;
|
|
2130
|
+
maxPriorityFeePerGas?: bigint;
|
|
2131
|
+
nonce?: number;
|
|
2132
|
+
value?: bigint;
|
|
2133
|
+
}): Promise<void> {
|
|
2134
|
+
return contract.simulate.renounceRole([role, callerConfirmation] as const, options) as Promise<void>;
|
|
2135
|
+
},
|
|
2136
|
+
/**
|
|
2137
|
+
* Simulate revokeRole
|
|
2138
|
+
* Returns gas estimate and result without sending transaction
|
|
2139
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
2140
|
+
*/
|
|
2141
|
+
async revokeRole(role: `0x${string}`, account: `0x${string}`, options?: {
|
|
2142
|
+
accessList?: import('viem').AccessList;
|
|
2143
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
2144
|
+
chain?: import('viem').Chain | null;
|
|
2145
|
+
dataSuffix?: `0x${string}`;
|
|
2146
|
+
gas?: bigint;
|
|
2147
|
+
gasPrice?: bigint;
|
|
2148
|
+
maxFeePerGas?: bigint;
|
|
2149
|
+
maxPriorityFeePerGas?: bigint;
|
|
2150
|
+
nonce?: number;
|
|
2151
|
+
value?: bigint;
|
|
2152
|
+
}): Promise<void> {
|
|
2153
|
+
return contract.simulate.revokeRole([role, account] as const, options) as Promise<void>;
|
|
2154
|
+
},
|
|
2155
|
+
/**
|
|
2156
|
+
* Simulate rollbackUpgrade
|
|
2157
|
+
* Returns gas estimate and result without sending transaction
|
|
2158
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
2159
|
+
*/
|
|
2160
|
+
async rollbackUpgrade(rollbackImplementation: `0x${string}`, data: `0x${string}`, options?: {
|
|
2161
|
+
accessList?: import('viem').AccessList;
|
|
2162
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
2163
|
+
chain?: import('viem').Chain | null;
|
|
2164
|
+
dataSuffix?: `0x${string}`;
|
|
2165
|
+
gas?: bigint;
|
|
2166
|
+
gasPrice?: bigint;
|
|
2167
|
+
maxFeePerGas?: bigint;
|
|
2168
|
+
maxPriorityFeePerGas?: bigint;
|
|
2169
|
+
nonce?: number;
|
|
2170
|
+
value?: bigint;
|
|
2171
|
+
}): Promise<void> {
|
|
2172
|
+
return contract.simulate.rollbackUpgrade([rollbackImplementation, data] as const, options) as Promise<void>;
|
|
2173
|
+
},
|
|
2174
|
+
/**
|
|
2175
|
+
* Simulate setUpgradeFreeze
|
|
2176
|
+
* Returns gas estimate and result without sending transaction
|
|
2177
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
2178
|
+
*/
|
|
2179
|
+
async setUpgradeFreeze(status: boolean, options?: {
|
|
2180
|
+
accessList?: import('viem').AccessList;
|
|
2181
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
2182
|
+
chain?: import('viem').Chain | null;
|
|
2183
|
+
dataSuffix?: `0x${string}`;
|
|
2184
|
+
gas?: bigint;
|
|
2185
|
+
gasPrice?: bigint;
|
|
2186
|
+
maxFeePerGas?: bigint;
|
|
2187
|
+
maxPriorityFeePerGas?: bigint;
|
|
2188
|
+
nonce?: number;
|
|
2189
|
+
value?: bigint;
|
|
2190
|
+
}): Promise<void> {
|
|
2191
|
+
return contract.simulate.setUpgradeFreeze([status] as const, options) as Promise<void>;
|
|
2192
|
+
},
|
|
2193
|
+
/**
|
|
2194
|
+
* Simulate unpause
|
|
2195
|
+
* Returns gas estimate and result without sending transaction
|
|
2196
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
2197
|
+
*/
|
|
2198
|
+
async unpause(options?: {
|
|
2199
|
+
accessList?: import('viem').AccessList;
|
|
2200
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
2201
|
+
chain?: import('viem').Chain | null;
|
|
2202
|
+
dataSuffix?: `0x${string}`;
|
|
2203
|
+
gas?: bigint;
|
|
2204
|
+
gasPrice?: bigint;
|
|
2205
|
+
maxFeePerGas?: bigint;
|
|
2206
|
+
maxPriorityFeePerGas?: bigint;
|
|
2207
|
+
nonce?: number;
|
|
2208
|
+
value?: bigint;
|
|
2209
|
+
}): Promise<void> {
|
|
2210
|
+
return contract.simulate.unpause(options) as Promise<void>;
|
|
2211
|
+
},
|
|
2212
|
+
/**
|
|
2213
|
+
* Simulate upgradeToAndCall
|
|
2214
|
+
* Returns gas estimate and result without sending transaction
|
|
2215
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
2216
|
+
*/
|
|
2217
|
+
async upgradeToAndCall(newImplementation: `0x${string}`, data: `0x${string}`, options?: {
|
|
2218
|
+
accessList?: import('viem').AccessList;
|
|
2219
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
2220
|
+
chain?: import('viem').Chain | null;
|
|
2221
|
+
dataSuffix?: `0x${string}`;
|
|
2222
|
+
gas?: bigint;
|
|
2223
|
+
gasPrice?: bigint;
|
|
2224
|
+
maxFeePerGas?: bigint;
|
|
2225
|
+
maxPriorityFeePerGas?: bigint;
|
|
2226
|
+
nonce?: number;
|
|
2227
|
+
value?: bigint;
|
|
2228
|
+
}): Promise<void> {
|
|
2229
|
+
return contract.simulate.upgradeToAndCall([newImplementation, data] as const, options) as Promise<void>;
|
|
2230
|
+
}
|
|
2231
|
+
};
|
|
2232
|
+
}
|
|
2233
|
+
|
|
2234
|
+
/**
|
|
2235
|
+
* Watch contract events
|
|
2236
|
+
*
|
|
2237
|
+
* @example
|
|
2238
|
+
* // Watch all Transfer events
|
|
2239
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
2240
|
+
* console.log('Transfer:', event);
|
|
2241
|
+
* });
|
|
2242
|
+
*
|
|
2243
|
+
* // Stop watching
|
|
2244
|
+
* unwatch();
|
|
2245
|
+
*/
|
|
2246
|
+
get watch() {
|
|
2247
|
+
return {
|
|
2248
|
+
/**
|
|
2249
|
+
* Watch Initialized events
|
|
2250
|
+
* @param callback Function to call when event is emitted
|
|
2251
|
+
* @param filter Optional filter for indexed parameters
|
|
2252
|
+
* @returns Unwatch function to stop listening
|
|
2253
|
+
*/
|
|
2254
|
+
Initialized: (callback: (event: { version: bigint }) => void) => {
|
|
2255
|
+
return this.publicClient.watchContractEvent({
|
|
2256
|
+
address: this.contractAddress,
|
|
2257
|
+
abi: CodeXProxyAdmin_jsonAbi,
|
|
2258
|
+
eventName: 'Initialized',
|
|
2259
|
+
|
|
2260
|
+
onLogs: (logs: any[]) => {
|
|
2261
|
+
logs.forEach((log: any) => {
|
|
2262
|
+
callback(log.args as any);
|
|
2263
|
+
});
|
|
2264
|
+
},
|
|
2265
|
+
}) as () => void;
|
|
2266
|
+
},
|
|
2267
|
+
/**
|
|
2268
|
+
* Watch Paused events
|
|
2269
|
+
* @param callback Function to call when event is emitted
|
|
2270
|
+
* @param filter Optional filter for indexed parameters
|
|
2271
|
+
* @returns Unwatch function to stop listening
|
|
2272
|
+
*/
|
|
2273
|
+
Paused: (callback: (event: { account: `0x${string}` }) => void) => {
|
|
2274
|
+
return this.publicClient.watchContractEvent({
|
|
2275
|
+
address: this.contractAddress,
|
|
2276
|
+
abi: CodeXProxyAdmin_jsonAbi,
|
|
2277
|
+
eventName: 'Paused',
|
|
2278
|
+
|
|
2279
|
+
onLogs: (logs: any[]) => {
|
|
2280
|
+
logs.forEach((log: any) => {
|
|
2281
|
+
callback(log.args as any);
|
|
2282
|
+
});
|
|
2283
|
+
},
|
|
2284
|
+
}) as () => void;
|
|
2285
|
+
},
|
|
2286
|
+
/**
|
|
2287
|
+
* Watch ProxyRegistered events
|
|
2288
|
+
* @param callback Function to call when event is emitted
|
|
2289
|
+
* @param filter Optional filter for indexed parameters
|
|
2290
|
+
* @returns Unwatch function to stop listening
|
|
2291
|
+
*/
|
|
2292
|
+
ProxyRegistered: (callback: (event: { proxy: `0x${string}`; implementation: `0x${string}` }) => void, filter?: { proxy: `0x${string}`; implementation: `0x${string}` }) => {
|
|
2293
|
+
return this.publicClient.watchContractEvent({
|
|
2294
|
+
address: this.contractAddress,
|
|
2295
|
+
abi: CodeXProxyAdmin_jsonAbi,
|
|
2296
|
+
eventName: 'ProxyRegistered',
|
|
2297
|
+
args: filter,
|
|
2298
|
+
onLogs: (logs: any[]) => {
|
|
2299
|
+
logs.forEach((log: any) => {
|
|
2300
|
+
callback(log.args as any);
|
|
2301
|
+
});
|
|
2302
|
+
},
|
|
2303
|
+
}) as () => void;
|
|
2304
|
+
},
|
|
2305
|
+
/**
|
|
2306
|
+
* Watch RoleAdminChanged events
|
|
2307
|
+
* @param callback Function to call when event is emitted
|
|
2308
|
+
* @param filter Optional filter for indexed parameters
|
|
2309
|
+
* @returns Unwatch function to stop listening
|
|
2310
|
+
*/
|
|
2311
|
+
RoleAdminChanged: (callback: (event: { role: `0x${string}`; previousAdminRole: `0x${string}`; newAdminRole: `0x${string}` }) => void, filter?: { role: `0x${string}`; previousAdminRole: `0x${string}`; newAdminRole: `0x${string}` }) => {
|
|
2312
|
+
return this.publicClient.watchContractEvent({
|
|
2313
|
+
address: this.contractAddress,
|
|
2314
|
+
abi: CodeXProxyAdmin_jsonAbi,
|
|
2315
|
+
eventName: 'RoleAdminChanged',
|
|
2316
|
+
args: filter,
|
|
2317
|
+
onLogs: (logs: any[]) => {
|
|
2318
|
+
logs.forEach((log: any) => {
|
|
2319
|
+
callback(log.args as any);
|
|
2320
|
+
});
|
|
2321
|
+
},
|
|
2322
|
+
}) as () => void;
|
|
2323
|
+
},
|
|
2324
|
+
/**
|
|
2325
|
+
* Watch RoleGranted events
|
|
2326
|
+
* @param callback Function to call when event is emitted
|
|
2327
|
+
* @param filter Optional filter for indexed parameters
|
|
2328
|
+
* @returns Unwatch function to stop listening
|
|
2329
|
+
*/
|
|
2330
|
+
RoleGranted: (callback: (event: { role: `0x${string}`; account: `0x${string}`; sender: `0x${string}` }) => void, filter?: { role: `0x${string}`; account: `0x${string}`; sender: `0x${string}` }) => {
|
|
2331
|
+
return this.publicClient.watchContractEvent({
|
|
2332
|
+
address: this.contractAddress,
|
|
2333
|
+
abi: CodeXProxyAdmin_jsonAbi,
|
|
2334
|
+
eventName: 'RoleGranted',
|
|
2335
|
+
args: filter,
|
|
2336
|
+
onLogs: (logs: any[]) => {
|
|
2337
|
+
logs.forEach((log: any) => {
|
|
2338
|
+
callback(log.args as any);
|
|
2339
|
+
});
|
|
2340
|
+
},
|
|
2341
|
+
}) as () => void;
|
|
2342
|
+
},
|
|
2343
|
+
/**
|
|
2344
|
+
* Watch RoleRevoked events
|
|
2345
|
+
* @param callback Function to call when event is emitted
|
|
2346
|
+
* @param filter Optional filter for indexed parameters
|
|
2347
|
+
* @returns Unwatch function to stop listening
|
|
2348
|
+
*/
|
|
2349
|
+
RoleRevoked: (callback: (event: { role: `0x${string}`; account: `0x${string}`; sender: `0x${string}` }) => void, filter?: { role: `0x${string}`; account: `0x${string}`; sender: `0x${string}` }) => {
|
|
2350
|
+
return this.publicClient.watchContractEvent({
|
|
2351
|
+
address: this.contractAddress,
|
|
2352
|
+
abi: CodeXProxyAdmin_jsonAbi,
|
|
2353
|
+
eventName: 'RoleRevoked',
|
|
2354
|
+
args: filter,
|
|
2355
|
+
onLogs: (logs: any[]) => {
|
|
2356
|
+
logs.forEach((log: any) => {
|
|
2357
|
+
callback(log.args as any);
|
|
2358
|
+
});
|
|
2359
|
+
},
|
|
2360
|
+
}) as () => void;
|
|
2361
|
+
},
|
|
2362
|
+
/**
|
|
2363
|
+
* Watch Unpaused events
|
|
2364
|
+
* @param callback Function to call when event is emitted
|
|
2365
|
+
* @param filter Optional filter for indexed parameters
|
|
2366
|
+
* @returns Unwatch function to stop listening
|
|
2367
|
+
*/
|
|
2368
|
+
Unpaused: (callback: (event: { account: `0x${string}` }) => void) => {
|
|
2369
|
+
return this.publicClient.watchContractEvent({
|
|
2370
|
+
address: this.contractAddress,
|
|
2371
|
+
abi: CodeXProxyAdmin_jsonAbi,
|
|
2372
|
+
eventName: 'Unpaused',
|
|
2373
|
+
|
|
2374
|
+
onLogs: (logs: any[]) => {
|
|
2375
|
+
logs.forEach((log: any) => {
|
|
2376
|
+
callback(log.args as any);
|
|
2377
|
+
});
|
|
2378
|
+
},
|
|
2379
|
+
}) as () => void;
|
|
2380
|
+
},
|
|
2381
|
+
/**
|
|
2382
|
+
* Watch UpgradeApproved events
|
|
2383
|
+
* @param callback Function to call when event is emitted
|
|
2384
|
+
* @param filter Optional filter for indexed parameters
|
|
2385
|
+
* @returns Unwatch function to stop listening
|
|
2386
|
+
*/
|
|
2387
|
+
UpgradeApproved: (callback: (event: { approver: `0x${string}`; implementation: `0x${string}`; approvalCount: bigint }) => void, filter?: { approver: `0x${string}`; implementation: `0x${string}` }) => {
|
|
2388
|
+
return this.publicClient.watchContractEvent({
|
|
2389
|
+
address: this.contractAddress,
|
|
2390
|
+
abi: CodeXProxyAdmin_jsonAbi,
|
|
2391
|
+
eventName: 'UpgradeApproved',
|
|
2392
|
+
args: filter,
|
|
2393
|
+
onLogs: (logs: any[]) => {
|
|
2394
|
+
logs.forEach((log: any) => {
|
|
2395
|
+
callback(log.args as any);
|
|
2396
|
+
});
|
|
2397
|
+
},
|
|
2398
|
+
}) as () => void;
|
|
2399
|
+
},
|
|
2400
|
+
/**
|
|
2401
|
+
* Watch UpgradeAuditApproved events
|
|
2402
|
+
* @param callback Function to call when event is emitted
|
|
2403
|
+
* @param filter Optional filter for indexed parameters
|
|
2404
|
+
* @returns Unwatch function to stop listening
|
|
2405
|
+
*/
|
|
2406
|
+
UpgradeAuditApproved: (callback: (event: { auditor: `0x${string}`; implementation: `0x${string}` }) => void, filter?: { auditor: `0x${string}`; implementation: `0x${string}` }) => {
|
|
2407
|
+
return this.publicClient.watchContractEvent({
|
|
2408
|
+
address: this.contractAddress,
|
|
2409
|
+
abi: CodeXProxyAdmin_jsonAbi,
|
|
2410
|
+
eventName: 'UpgradeAuditApproved',
|
|
2411
|
+
args: filter,
|
|
2412
|
+
onLogs: (logs: any[]) => {
|
|
2413
|
+
logs.forEach((log: any) => {
|
|
2414
|
+
callback(log.args as any);
|
|
2415
|
+
});
|
|
2416
|
+
},
|
|
2417
|
+
}) as () => void;
|
|
2418
|
+
},
|
|
2419
|
+
/**
|
|
2420
|
+
* Watch UpgradeCancelled events
|
|
2421
|
+
* @param callback Function to call when event is emitted
|
|
2422
|
+
* @param filter Optional filter for indexed parameters
|
|
2423
|
+
* @returns Unwatch function to stop listening
|
|
2424
|
+
*/
|
|
2425
|
+
UpgradeCancelled: (callback: (event: { implementation: `0x${string}` }) => void, filter?: { implementation: `0x${string}` }) => {
|
|
2426
|
+
return this.publicClient.watchContractEvent({
|
|
2427
|
+
address: this.contractAddress,
|
|
2428
|
+
abi: CodeXProxyAdmin_jsonAbi,
|
|
2429
|
+
eventName: 'UpgradeCancelled',
|
|
2430
|
+
args: filter,
|
|
2431
|
+
onLogs: (logs: any[]) => {
|
|
2432
|
+
logs.forEach((log: any) => {
|
|
2433
|
+
callback(log.args as any);
|
|
2434
|
+
});
|
|
2435
|
+
},
|
|
2436
|
+
}) as () => void;
|
|
2437
|
+
},
|
|
2438
|
+
/**
|
|
2439
|
+
* Watch UpgradeExecuted events
|
|
2440
|
+
* @param callback Function to call when event is emitted
|
|
2441
|
+
* @param filter Optional filter for indexed parameters
|
|
2442
|
+
* @returns Unwatch function to stop listening
|
|
2443
|
+
*/
|
|
2444
|
+
UpgradeExecuted: (callback: (event: { oldImplementation: `0x${string}`; newImplementation: `0x${string}`; version: bigint }) => void, filter?: { oldImplementation: `0x${string}`; newImplementation: `0x${string}`; version: bigint }) => {
|
|
2445
|
+
return this.publicClient.watchContractEvent({
|
|
2446
|
+
address: this.contractAddress,
|
|
2447
|
+
abi: CodeXProxyAdmin_jsonAbi,
|
|
2448
|
+
eventName: 'UpgradeExecuted',
|
|
2449
|
+
args: filter,
|
|
2450
|
+
onLogs: (logs: any[]) => {
|
|
2451
|
+
logs.forEach((log: any) => {
|
|
2452
|
+
callback(log.args as any);
|
|
2453
|
+
});
|
|
2454
|
+
},
|
|
2455
|
+
}) as () => void;
|
|
2456
|
+
},
|
|
2457
|
+
/**
|
|
2458
|
+
* Watch UpgradeFreezeChanged events
|
|
2459
|
+
* @param callback Function to call when event is emitted
|
|
2460
|
+
* @param filter Optional filter for indexed parameters
|
|
2461
|
+
* @returns Unwatch function to stop listening
|
|
2462
|
+
*/
|
|
2463
|
+
UpgradeFreezeChanged: (callback: (event: { status: boolean }) => void) => {
|
|
2464
|
+
return this.publicClient.watchContractEvent({
|
|
2465
|
+
address: this.contractAddress,
|
|
2466
|
+
abi: CodeXProxyAdmin_jsonAbi,
|
|
2467
|
+
eventName: 'UpgradeFreezeChanged',
|
|
2468
|
+
|
|
2469
|
+
onLogs: (logs: any[]) => {
|
|
2470
|
+
logs.forEach((log: any) => {
|
|
2471
|
+
callback(log.args as any);
|
|
2472
|
+
});
|
|
2473
|
+
},
|
|
2474
|
+
}) as () => void;
|
|
2475
|
+
},
|
|
2476
|
+
/**
|
|
2477
|
+
* Watch UpgradeProposed events
|
|
2478
|
+
* @param callback Function to call when event is emitted
|
|
2479
|
+
* @param filter Optional filter for indexed parameters
|
|
2480
|
+
* @returns Unwatch function to stop listening
|
|
2481
|
+
*/
|
|
2482
|
+
UpgradeProposed: (callback: (event: { oldImplementation: `0x${string}`; newImplementation: `0x${string}` }) => void, filter?: { oldImplementation: `0x${string}`; newImplementation: `0x${string}` }) => {
|
|
2483
|
+
return this.publicClient.watchContractEvent({
|
|
2484
|
+
address: this.contractAddress,
|
|
2485
|
+
abi: CodeXProxyAdmin_jsonAbi,
|
|
2486
|
+
eventName: 'UpgradeProposed',
|
|
2487
|
+
args: filter,
|
|
2488
|
+
onLogs: (logs: any[]) => {
|
|
2489
|
+
logs.forEach((log: any) => {
|
|
2490
|
+
callback(log.args as any);
|
|
2491
|
+
});
|
|
2492
|
+
},
|
|
2493
|
+
}) as () => void;
|
|
2494
|
+
},
|
|
2495
|
+
/**
|
|
2496
|
+
* Watch UpgradeRollback events
|
|
2497
|
+
* @param callback Function to call when event is emitted
|
|
2498
|
+
* @param filter Optional filter for indexed parameters
|
|
2499
|
+
* @returns Unwatch function to stop listening
|
|
2500
|
+
*/
|
|
2501
|
+
UpgradeRollback: (callback: (event: { oldImplementation: `0x${string}`; rollbackImplementation: `0x${string}`; version: bigint }) => void, filter?: { oldImplementation: `0x${string}`; rollbackImplementation: `0x${string}`; version: bigint }) => {
|
|
2502
|
+
return this.publicClient.watchContractEvent({
|
|
2503
|
+
address: this.contractAddress,
|
|
2504
|
+
abi: CodeXProxyAdmin_jsonAbi,
|
|
2505
|
+
eventName: 'UpgradeRollback',
|
|
2506
|
+
args: filter,
|
|
2507
|
+
onLogs: (logs: any[]) => {
|
|
2508
|
+
logs.forEach((log: any) => {
|
|
2509
|
+
callback(log.args as any);
|
|
2510
|
+
});
|
|
2511
|
+
},
|
|
2512
|
+
}) as () => void;
|
|
2513
|
+
},
|
|
2514
|
+
/**
|
|
2515
|
+
* Watch Upgraded events
|
|
2516
|
+
* @param callback Function to call when event is emitted
|
|
2517
|
+
* @param filter Optional filter for indexed parameters
|
|
2518
|
+
* @returns Unwatch function to stop listening
|
|
2519
|
+
*/
|
|
2520
|
+
Upgraded: (callback: (event: { implementation: `0x${string}` }) => void, filter?: { implementation: `0x${string}` }) => {
|
|
2521
|
+
return this.publicClient.watchContractEvent({
|
|
2522
|
+
address: this.contractAddress,
|
|
2523
|
+
abi: CodeXProxyAdmin_jsonAbi,
|
|
2524
|
+
eventName: 'Upgraded',
|
|
2525
|
+
args: filter,
|
|
2526
|
+
onLogs: (logs: any[]) => {
|
|
2527
|
+
logs.forEach((log: any) => {
|
|
2528
|
+
callback(log.args as any);
|
|
2529
|
+
});
|
|
2530
|
+
},
|
|
2531
|
+
}) as () => void;
|
|
2532
|
+
}
|
|
2533
|
+
};
|
|
2534
|
+
}
|
|
2535
|
+
}
|