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