@gitmyabi/cap 1.0.0 → 1.0.1

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