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