@gitmyabi/popo 1.0.1 → 1.0.2
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 +3 -3
- package/contracts/POPO.d.ts +1371 -0
- package/contracts/POPO.js +1343 -0
- package/contracts/POPO.ts +1823 -0
- package/contracts/index.d.ts +2 -2
- package/contracts/index.js +4 -4
- package/contracts/index.ts +2 -2
- package/package.json +3 -3
- package/contracts/Token.d.ts +0 -486
- package/contracts/Token.js +0 -552
- package/contracts/Token.ts +0 -654
|
@@ -0,0 +1,1823 @@
|
|
|
1
|
+
import type { Abi, Address, PublicClient, WalletClient, GetContractReturnType } from 'viem';
|
|
2
|
+
import { getContract } from 'viem';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* POPO ABI
|
|
6
|
+
*
|
|
7
|
+
* This ABI is typed using viem's type system for full type safety.
|
|
8
|
+
*/
|
|
9
|
+
export const POPOAbi = [
|
|
10
|
+
{
|
|
11
|
+
"inputs": [],
|
|
12
|
+
"stateMutability": "nonpayable",
|
|
13
|
+
"type": "constructor"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"anonymous": false,
|
|
17
|
+
"inputs": [
|
|
18
|
+
{
|
|
19
|
+
"indexed": true,
|
|
20
|
+
"internalType": "address",
|
|
21
|
+
"name": "owner",
|
|
22
|
+
"type": "address"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"indexed": true,
|
|
26
|
+
"internalType": "address",
|
|
27
|
+
"name": "spender",
|
|
28
|
+
"type": "address"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"indexed": false,
|
|
32
|
+
"internalType": "uint256",
|
|
33
|
+
"name": "value",
|
|
34
|
+
"type": "uint256"
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
"name": "Approval",
|
|
38
|
+
"type": "event"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"anonymous": false,
|
|
42
|
+
"inputs": [
|
|
43
|
+
{
|
|
44
|
+
"indexed": false,
|
|
45
|
+
"internalType": "address",
|
|
46
|
+
"name": "account",
|
|
47
|
+
"type": "address"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"indexed": false,
|
|
51
|
+
"internalType": "bool",
|
|
52
|
+
"name": "status",
|
|
53
|
+
"type": "bool"
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
"name": "ExcludedFromFee",
|
|
57
|
+
"type": "event"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"anonymous": false,
|
|
61
|
+
"inputs": [
|
|
62
|
+
{
|
|
63
|
+
"indexed": false,
|
|
64
|
+
"internalType": "address",
|
|
65
|
+
"name": "_taxWallet",
|
|
66
|
+
"type": "address"
|
|
67
|
+
}
|
|
68
|
+
],
|
|
69
|
+
"name": "FeeReceiverUpdated",
|
|
70
|
+
"type": "event"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"anonymous": false,
|
|
74
|
+
"inputs": [
|
|
75
|
+
{
|
|
76
|
+
"indexed": false,
|
|
77
|
+
"internalType": "uint256",
|
|
78
|
+
"name": "buyFee",
|
|
79
|
+
"type": "uint256"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"indexed": false,
|
|
83
|
+
"internalType": "uint256",
|
|
84
|
+
"name": "sellFee",
|
|
85
|
+
"type": "uint256"
|
|
86
|
+
}
|
|
87
|
+
],
|
|
88
|
+
"name": "FeesUpdated",
|
|
89
|
+
"type": "event"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"anonymous": false,
|
|
93
|
+
"inputs": [],
|
|
94
|
+
"name": "LimitsRemoved",
|
|
95
|
+
"type": "event"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"anonymous": false,
|
|
99
|
+
"inputs": [
|
|
100
|
+
{
|
|
101
|
+
"indexed": false,
|
|
102
|
+
"internalType": "uint256",
|
|
103
|
+
"name": "_txAmountLimit",
|
|
104
|
+
"type": "uint256"
|
|
105
|
+
}
|
|
106
|
+
],
|
|
107
|
+
"name": "MaxTxAmountUpdated",
|
|
108
|
+
"type": "event"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"anonymous": false,
|
|
112
|
+
"inputs": [
|
|
113
|
+
{
|
|
114
|
+
"indexed": false,
|
|
115
|
+
"internalType": "uint256",
|
|
116
|
+
"name": "_walletAmountLimit",
|
|
117
|
+
"type": "uint256"
|
|
118
|
+
}
|
|
119
|
+
],
|
|
120
|
+
"name": "MaxWalletAmountUpdated",
|
|
121
|
+
"type": "event"
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"anonymous": false,
|
|
125
|
+
"inputs": [
|
|
126
|
+
{
|
|
127
|
+
"indexed": true,
|
|
128
|
+
"internalType": "address",
|
|
129
|
+
"name": "previousOwner",
|
|
130
|
+
"type": "address"
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"indexed": true,
|
|
134
|
+
"internalType": "address",
|
|
135
|
+
"name": "newOwner",
|
|
136
|
+
"type": "address"
|
|
137
|
+
}
|
|
138
|
+
],
|
|
139
|
+
"name": "OwnershipTransferred",
|
|
140
|
+
"type": "event"
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"anonymous": false,
|
|
144
|
+
"inputs": [
|
|
145
|
+
{
|
|
146
|
+
"indexed": false,
|
|
147
|
+
"internalType": "uint256",
|
|
148
|
+
"name": "_swapbackMin",
|
|
149
|
+
"type": "uint256"
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"indexed": false,
|
|
153
|
+
"internalType": "uint256",
|
|
154
|
+
"name": "_swapbackMax",
|
|
155
|
+
"type": "uint256"
|
|
156
|
+
}
|
|
157
|
+
],
|
|
158
|
+
"name": "SwapbackUpdated",
|
|
159
|
+
"type": "event"
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"anonymous": false,
|
|
163
|
+
"inputs": [],
|
|
164
|
+
"name": "TradingOpened",
|
|
165
|
+
"type": "event"
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
"anonymous": false,
|
|
169
|
+
"inputs": [
|
|
170
|
+
{
|
|
171
|
+
"indexed": true,
|
|
172
|
+
"internalType": "address",
|
|
173
|
+
"name": "from",
|
|
174
|
+
"type": "address"
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
"indexed": true,
|
|
178
|
+
"internalType": "address",
|
|
179
|
+
"name": "to",
|
|
180
|
+
"type": "address"
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
"indexed": false,
|
|
184
|
+
"internalType": "uint256",
|
|
185
|
+
"name": "value",
|
|
186
|
+
"type": "uint256"
|
|
187
|
+
}
|
|
188
|
+
],
|
|
189
|
+
"name": "Transfer",
|
|
190
|
+
"type": "event"
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
"inputs": [
|
|
194
|
+
{
|
|
195
|
+
"internalType": "address",
|
|
196
|
+
"name": "owner",
|
|
197
|
+
"type": "address"
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
"internalType": "address",
|
|
201
|
+
"name": "spender",
|
|
202
|
+
"type": "address"
|
|
203
|
+
}
|
|
204
|
+
],
|
|
205
|
+
"name": "allowance",
|
|
206
|
+
"outputs": [
|
|
207
|
+
{
|
|
208
|
+
"internalType": "uint256",
|
|
209
|
+
"name": "",
|
|
210
|
+
"type": "uint256"
|
|
211
|
+
}
|
|
212
|
+
],
|
|
213
|
+
"stateMutability": "view",
|
|
214
|
+
"type": "function"
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
"inputs": [
|
|
218
|
+
{
|
|
219
|
+
"internalType": "address",
|
|
220
|
+
"name": "spender",
|
|
221
|
+
"type": "address"
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
"internalType": "uint256",
|
|
225
|
+
"name": "amount",
|
|
226
|
+
"type": "uint256"
|
|
227
|
+
}
|
|
228
|
+
],
|
|
229
|
+
"name": "approve",
|
|
230
|
+
"outputs": [
|
|
231
|
+
{
|
|
232
|
+
"internalType": "bool",
|
|
233
|
+
"name": "",
|
|
234
|
+
"type": "bool"
|
|
235
|
+
}
|
|
236
|
+
],
|
|
237
|
+
"stateMutability": "nonpayable",
|
|
238
|
+
"type": "function"
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
"inputs": [
|
|
242
|
+
{
|
|
243
|
+
"internalType": "address",
|
|
244
|
+
"name": "account",
|
|
245
|
+
"type": "address"
|
|
246
|
+
}
|
|
247
|
+
],
|
|
248
|
+
"name": "balanceOf",
|
|
249
|
+
"outputs": [
|
|
250
|
+
{
|
|
251
|
+
"internalType": "uint256",
|
|
252
|
+
"name": "",
|
|
253
|
+
"type": "uint256"
|
|
254
|
+
}
|
|
255
|
+
],
|
|
256
|
+
"stateMutability": "view",
|
|
257
|
+
"type": "function"
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
"inputs": [],
|
|
261
|
+
"name": "decimals",
|
|
262
|
+
"outputs": [
|
|
263
|
+
{
|
|
264
|
+
"internalType": "uint8",
|
|
265
|
+
"name": "",
|
|
266
|
+
"type": "uint8"
|
|
267
|
+
}
|
|
268
|
+
],
|
|
269
|
+
"stateMutability": "view",
|
|
270
|
+
"type": "function"
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
"inputs": [
|
|
274
|
+
{
|
|
275
|
+
"internalType": "address",
|
|
276
|
+
"name": "spender",
|
|
277
|
+
"type": "address"
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
"internalType": "uint256",
|
|
281
|
+
"name": "subtractedValue",
|
|
282
|
+
"type": "uint256"
|
|
283
|
+
}
|
|
284
|
+
],
|
|
285
|
+
"name": "decreaseAllowance",
|
|
286
|
+
"outputs": [
|
|
287
|
+
{
|
|
288
|
+
"internalType": "bool",
|
|
289
|
+
"name": "",
|
|
290
|
+
"type": "bool"
|
|
291
|
+
}
|
|
292
|
+
],
|
|
293
|
+
"stateMutability": "nonpayable",
|
|
294
|
+
"type": "function"
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
"inputs": [
|
|
298
|
+
{
|
|
299
|
+
"internalType": "address",
|
|
300
|
+
"name": "spender",
|
|
301
|
+
"type": "address"
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
"internalType": "uint256",
|
|
305
|
+
"name": "addedValue",
|
|
306
|
+
"type": "uint256"
|
|
307
|
+
}
|
|
308
|
+
],
|
|
309
|
+
"name": "increaseAllowance",
|
|
310
|
+
"outputs": [
|
|
311
|
+
{
|
|
312
|
+
"internalType": "bool",
|
|
313
|
+
"name": "",
|
|
314
|
+
"type": "bool"
|
|
315
|
+
}
|
|
316
|
+
],
|
|
317
|
+
"stateMutability": "nonpayable",
|
|
318
|
+
"type": "function"
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
"inputs": [],
|
|
322
|
+
"name": "infoReadP",
|
|
323
|
+
"outputs": [
|
|
324
|
+
{
|
|
325
|
+
"internalType": "uint256",
|
|
326
|
+
"name": "_buyFee",
|
|
327
|
+
"type": "uint256"
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
"internalType": "uint256",
|
|
331
|
+
"name": "_sellFee",
|
|
332
|
+
"type": "uint256"
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
"internalType": "uint256",
|
|
336
|
+
"name": "maxTxAmount",
|
|
337
|
+
"type": "uint256"
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
"internalType": "uint256",
|
|
341
|
+
"name": "maxWalletSize",
|
|
342
|
+
"type": "uint256"
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
"internalType": "uint256",
|
|
346
|
+
"name": "taxSwapThreshold",
|
|
347
|
+
"type": "uint256"
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
"internalType": "uint256",
|
|
351
|
+
"name": "maxTaxSwap",
|
|
352
|
+
"type": "uint256"
|
|
353
|
+
}
|
|
354
|
+
],
|
|
355
|
+
"stateMutability": "view",
|
|
356
|
+
"type": "function"
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
"inputs": [
|
|
360
|
+
{
|
|
361
|
+
"internalType": "address[]",
|
|
362
|
+
"name": "lst",
|
|
363
|
+
"type": "address[]"
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
"internalType": "bool",
|
|
367
|
+
"name": "status",
|
|
368
|
+
"type": "bool"
|
|
369
|
+
}
|
|
370
|
+
],
|
|
371
|
+
"name": "ltSetP",
|
|
372
|
+
"outputs": [],
|
|
373
|
+
"stateMutability": "nonpayable",
|
|
374
|
+
"type": "function"
|
|
375
|
+
},
|
|
376
|
+
{
|
|
377
|
+
"inputs": [],
|
|
378
|
+
"name": "maxLimitPDisable",
|
|
379
|
+
"outputs": [],
|
|
380
|
+
"stateMutability": "nonpayable",
|
|
381
|
+
"type": "function"
|
|
382
|
+
},
|
|
383
|
+
{
|
|
384
|
+
"inputs": [
|
|
385
|
+
{
|
|
386
|
+
"internalType": "uint256",
|
|
387
|
+
"name": "newTxMax",
|
|
388
|
+
"type": "uint256"
|
|
389
|
+
}
|
|
390
|
+
],
|
|
391
|
+
"name": "maxLimitTxPChange",
|
|
392
|
+
"outputs": [],
|
|
393
|
+
"stateMutability": "nonpayable",
|
|
394
|
+
"type": "function"
|
|
395
|
+
},
|
|
396
|
+
{
|
|
397
|
+
"inputs": [
|
|
398
|
+
{
|
|
399
|
+
"internalType": "uint256",
|
|
400
|
+
"name": "newWalletMax",
|
|
401
|
+
"type": "uint256"
|
|
402
|
+
}
|
|
403
|
+
],
|
|
404
|
+
"name": "maxLimitWalletPChange",
|
|
405
|
+
"outputs": [],
|
|
406
|
+
"stateMutability": "nonpayable",
|
|
407
|
+
"type": "function"
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
"inputs": [],
|
|
411
|
+
"name": "mdPDisable",
|
|
412
|
+
"outputs": [],
|
|
413
|
+
"stateMutability": "nonpayable",
|
|
414
|
+
"type": "function"
|
|
415
|
+
},
|
|
416
|
+
{
|
|
417
|
+
"inputs": [],
|
|
418
|
+
"name": "name",
|
|
419
|
+
"outputs": [
|
|
420
|
+
{
|
|
421
|
+
"internalType": "string",
|
|
422
|
+
"name": "",
|
|
423
|
+
"type": "string"
|
|
424
|
+
}
|
|
425
|
+
],
|
|
426
|
+
"stateMutability": "view",
|
|
427
|
+
"type": "function"
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
"inputs": [],
|
|
431
|
+
"name": "owner",
|
|
432
|
+
"outputs": [
|
|
433
|
+
{
|
|
434
|
+
"internalType": "address",
|
|
435
|
+
"name": "",
|
|
436
|
+
"type": "address"
|
|
437
|
+
}
|
|
438
|
+
],
|
|
439
|
+
"stateMutability": "view",
|
|
440
|
+
"type": "function"
|
|
441
|
+
},
|
|
442
|
+
{
|
|
443
|
+
"inputs": [],
|
|
444
|
+
"name": "popoTime",
|
|
445
|
+
"outputs": [],
|
|
446
|
+
"stateMutability": "nonpayable",
|
|
447
|
+
"type": "function"
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
"inputs": [],
|
|
451
|
+
"name": "renounceOwnership",
|
|
452
|
+
"outputs": [],
|
|
453
|
+
"stateMutability": "nonpayable",
|
|
454
|
+
"type": "function"
|
|
455
|
+
},
|
|
456
|
+
{
|
|
457
|
+
"inputs": [
|
|
458
|
+
{
|
|
459
|
+
"internalType": "address payable",
|
|
460
|
+
"name": "newRcv",
|
|
461
|
+
"type": "address"
|
|
462
|
+
}
|
|
463
|
+
],
|
|
464
|
+
"name": "setNewPMarketingReceiver",
|
|
465
|
+
"outputs": [],
|
|
466
|
+
"stateMutability": "nonpayable",
|
|
467
|
+
"type": "function"
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
"inputs": [],
|
|
471
|
+
"name": "stuckEthPRemove",
|
|
472
|
+
"outputs": [],
|
|
473
|
+
"stateMutability": "nonpayable",
|
|
474
|
+
"type": "function"
|
|
475
|
+
},
|
|
476
|
+
{
|
|
477
|
+
"inputs": [
|
|
478
|
+
{
|
|
479
|
+
"internalType": "uint256",
|
|
480
|
+
"name": "taxSwapThreshold",
|
|
481
|
+
"type": "uint256"
|
|
482
|
+
},
|
|
483
|
+
{
|
|
484
|
+
"internalType": "uint256",
|
|
485
|
+
"name": "maxTaxSwap",
|
|
486
|
+
"type": "uint256"
|
|
487
|
+
}
|
|
488
|
+
],
|
|
489
|
+
"name": "swapbackRangePSet",
|
|
490
|
+
"outputs": [],
|
|
491
|
+
"stateMutability": "nonpayable",
|
|
492
|
+
"type": "function"
|
|
493
|
+
},
|
|
494
|
+
{
|
|
495
|
+
"inputs": [],
|
|
496
|
+
"name": "symbol",
|
|
497
|
+
"outputs": [
|
|
498
|
+
{
|
|
499
|
+
"internalType": "string",
|
|
500
|
+
"name": "",
|
|
501
|
+
"type": "string"
|
|
502
|
+
}
|
|
503
|
+
],
|
|
504
|
+
"stateMutability": "view",
|
|
505
|
+
"type": "function"
|
|
506
|
+
},
|
|
507
|
+
{
|
|
508
|
+
"inputs": [],
|
|
509
|
+
"name": "totalSupply",
|
|
510
|
+
"outputs": [
|
|
511
|
+
{
|
|
512
|
+
"internalType": "uint256",
|
|
513
|
+
"name": "",
|
|
514
|
+
"type": "uint256"
|
|
515
|
+
}
|
|
516
|
+
],
|
|
517
|
+
"stateMutability": "view",
|
|
518
|
+
"type": "function"
|
|
519
|
+
},
|
|
520
|
+
{
|
|
521
|
+
"inputs": [
|
|
522
|
+
{
|
|
523
|
+
"internalType": "uint256",
|
|
524
|
+
"name": "feeBuy",
|
|
525
|
+
"type": "uint256"
|
|
526
|
+
},
|
|
527
|
+
{
|
|
528
|
+
"internalType": "uint256",
|
|
529
|
+
"name": "feeSell",
|
|
530
|
+
"type": "uint256"
|
|
531
|
+
}
|
|
532
|
+
],
|
|
533
|
+
"name": "tradingFeesPSetBuySell",
|
|
534
|
+
"outputs": [],
|
|
535
|
+
"stateMutability": "nonpayable",
|
|
536
|
+
"type": "function"
|
|
537
|
+
},
|
|
538
|
+
{
|
|
539
|
+
"inputs": [
|
|
540
|
+
{
|
|
541
|
+
"internalType": "address",
|
|
542
|
+
"name": "target",
|
|
543
|
+
"type": "address"
|
|
544
|
+
},
|
|
545
|
+
{
|
|
546
|
+
"internalType": "bool",
|
|
547
|
+
"name": "exempt",
|
|
548
|
+
"type": "bool"
|
|
549
|
+
}
|
|
550
|
+
],
|
|
551
|
+
"name": "tradingFeesPSetExempt",
|
|
552
|
+
"outputs": [],
|
|
553
|
+
"stateMutability": "nonpayable",
|
|
554
|
+
"type": "function"
|
|
555
|
+
},
|
|
556
|
+
{
|
|
557
|
+
"inputs": [
|
|
558
|
+
{
|
|
559
|
+
"internalType": "address",
|
|
560
|
+
"name": "recipient",
|
|
561
|
+
"type": "address"
|
|
562
|
+
},
|
|
563
|
+
{
|
|
564
|
+
"internalType": "uint256",
|
|
565
|
+
"name": "amount",
|
|
566
|
+
"type": "uint256"
|
|
567
|
+
}
|
|
568
|
+
],
|
|
569
|
+
"name": "transfer",
|
|
570
|
+
"outputs": [
|
|
571
|
+
{
|
|
572
|
+
"internalType": "bool",
|
|
573
|
+
"name": "",
|
|
574
|
+
"type": "bool"
|
|
575
|
+
}
|
|
576
|
+
],
|
|
577
|
+
"stateMutability": "nonpayable",
|
|
578
|
+
"type": "function"
|
|
579
|
+
},
|
|
580
|
+
{
|
|
581
|
+
"inputs": [
|
|
582
|
+
{
|
|
583
|
+
"internalType": "address",
|
|
584
|
+
"name": "sender",
|
|
585
|
+
"type": "address"
|
|
586
|
+
},
|
|
587
|
+
{
|
|
588
|
+
"internalType": "address",
|
|
589
|
+
"name": "recipient",
|
|
590
|
+
"type": "address"
|
|
591
|
+
},
|
|
592
|
+
{
|
|
593
|
+
"internalType": "uint256",
|
|
594
|
+
"name": "amount",
|
|
595
|
+
"type": "uint256"
|
|
596
|
+
}
|
|
597
|
+
],
|
|
598
|
+
"name": "transferFrom",
|
|
599
|
+
"outputs": [
|
|
600
|
+
{
|
|
601
|
+
"internalType": "bool",
|
|
602
|
+
"name": "",
|
|
603
|
+
"type": "bool"
|
|
604
|
+
}
|
|
605
|
+
],
|
|
606
|
+
"stateMutability": "nonpayable",
|
|
607
|
+
"type": "function"
|
|
608
|
+
},
|
|
609
|
+
{
|
|
610
|
+
"inputs": [
|
|
611
|
+
{
|
|
612
|
+
"internalType": "address",
|
|
613
|
+
"name": "newOwner",
|
|
614
|
+
"type": "address"
|
|
615
|
+
}
|
|
616
|
+
],
|
|
617
|
+
"name": "transferOwnership",
|
|
618
|
+
"outputs": [],
|
|
619
|
+
"stateMutability": "nonpayable",
|
|
620
|
+
"type": "function"
|
|
621
|
+
},
|
|
622
|
+
{
|
|
623
|
+
"inputs": [],
|
|
624
|
+
"name": "triggerSwap",
|
|
625
|
+
"outputs": [],
|
|
626
|
+
"stateMutability": "nonpayable",
|
|
627
|
+
"type": "function"
|
|
628
|
+
},
|
|
629
|
+
{
|
|
630
|
+
"stateMutability": "payable",
|
|
631
|
+
"type": "receive"
|
|
632
|
+
}
|
|
633
|
+
] as const satisfies Abi;
|
|
634
|
+
|
|
635
|
+
/**
|
|
636
|
+
* Type-safe ABI for POPO
|
|
637
|
+
*/
|
|
638
|
+
export type POPOAbi = typeof POPOAbi;
|
|
639
|
+
|
|
640
|
+
/**
|
|
641
|
+
* Contract instance type for POPO
|
|
642
|
+
*/
|
|
643
|
+
// Use any for contract type to avoid complex viem type issues
|
|
644
|
+
// The runtime behavior is type-safe through viem's ABI typing
|
|
645
|
+
export type POPOContract = any;
|
|
646
|
+
|
|
647
|
+
/**
|
|
648
|
+
* POPO Contract Class
|
|
649
|
+
*
|
|
650
|
+
* Provides a class-based API similar to TypeChain for interacting with the contract.
|
|
651
|
+
*
|
|
652
|
+
* @example
|
|
653
|
+
* ```typescript
|
|
654
|
+
* import { createPublicClient, createWalletClient, http } from 'viem';
|
|
655
|
+
* import { mainnet } from 'viem/chains';
|
|
656
|
+
* import { POPO } from 'POPO';
|
|
657
|
+
*
|
|
658
|
+
* const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
659
|
+
* const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
660
|
+
*
|
|
661
|
+
* const contract = new POPO('0x...', { publicClient, walletClient });
|
|
662
|
+
*
|
|
663
|
+
* // Read functions
|
|
664
|
+
* const result = await contract.balanceOf('0x...');
|
|
665
|
+
*
|
|
666
|
+
* // Write functions
|
|
667
|
+
* const hash = await contract.transfer('0x...', 1000n);
|
|
668
|
+
*
|
|
669
|
+
* // Simulate transactions (dry-run)
|
|
670
|
+
* const simulation = await contract.simulate.transfer('0x...', 1000n);
|
|
671
|
+
* console.log('Gas estimate:', simulation.request.gas);
|
|
672
|
+
*
|
|
673
|
+
* // Watch events
|
|
674
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
675
|
+
* console.log('Transfer event:', event);
|
|
676
|
+
* });
|
|
677
|
+
* ```
|
|
678
|
+
*/
|
|
679
|
+
export class POPO {
|
|
680
|
+
private contract: POPOContract;
|
|
681
|
+
private contractAddress: Address;
|
|
682
|
+
private publicClient: PublicClient;
|
|
683
|
+
|
|
684
|
+
constructor(
|
|
685
|
+
address: Address,
|
|
686
|
+
clients: {
|
|
687
|
+
publicClient: PublicClient;
|
|
688
|
+
walletClient?: WalletClient;
|
|
689
|
+
}
|
|
690
|
+
) {
|
|
691
|
+
this.contractAddress = address;
|
|
692
|
+
this.publicClient = clients.publicClient;
|
|
693
|
+
this.contract = getContract({
|
|
694
|
+
address,
|
|
695
|
+
abi: POPOAbi,
|
|
696
|
+
client: {
|
|
697
|
+
public: clients.publicClient,
|
|
698
|
+
wallet: clients.walletClient,
|
|
699
|
+
},
|
|
700
|
+
});
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
/**
|
|
704
|
+
* Get the contract address
|
|
705
|
+
*/
|
|
706
|
+
get address(): Address {
|
|
707
|
+
return this.contractAddress;
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
/**
|
|
711
|
+
* Get the underlying viem contract instance.
|
|
712
|
+
*/
|
|
713
|
+
getContract(): POPOContract {
|
|
714
|
+
return this.contract;
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
/**
|
|
718
|
+
* allowance
|
|
719
|
+
* view
|
|
720
|
+
*/
|
|
721
|
+
async allowance(owner: `0x${string}`, spender: `0x${string}`): Promise<bigint> {
|
|
722
|
+
return this.contract.read.allowance([owner, spender] as const) as Promise<bigint>;
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
/**
|
|
726
|
+
* balanceOf
|
|
727
|
+
* view
|
|
728
|
+
*/
|
|
729
|
+
async balanceOf(account: `0x${string}`): Promise<bigint> {
|
|
730
|
+
return this.contract.read.balanceOf([account] as const) as Promise<bigint>;
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
/**
|
|
734
|
+
* decimals
|
|
735
|
+
* view
|
|
736
|
+
*/
|
|
737
|
+
async decimals(): Promise<bigint> {
|
|
738
|
+
return this.contract.read.decimals() as Promise<bigint>;
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
/**
|
|
742
|
+
* infoReadP
|
|
743
|
+
* view
|
|
744
|
+
*/
|
|
745
|
+
async infoReadP(): Promise<[bigint, bigint, bigint, bigint, bigint, bigint]> {
|
|
746
|
+
return this.contract.read.infoReadP() as Promise<[bigint, bigint, bigint, bigint, bigint, bigint]>;
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
/**
|
|
750
|
+
* name
|
|
751
|
+
* view
|
|
752
|
+
*/
|
|
753
|
+
async name(): Promise<string> {
|
|
754
|
+
return this.contract.read.name() as Promise<string>;
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
/**
|
|
758
|
+
* owner
|
|
759
|
+
* view
|
|
760
|
+
*/
|
|
761
|
+
async owner(): Promise<`0x${string}`> {
|
|
762
|
+
return this.contract.read.owner() as Promise<`0x${string}`>;
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
/**
|
|
766
|
+
* symbol
|
|
767
|
+
* view
|
|
768
|
+
*/
|
|
769
|
+
async symbol(): Promise<string> {
|
|
770
|
+
return this.contract.read.symbol() as Promise<string>;
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
/**
|
|
774
|
+
* totalSupply
|
|
775
|
+
* view
|
|
776
|
+
*/
|
|
777
|
+
async totalSupply(): Promise<bigint> {
|
|
778
|
+
return this.contract.read.totalSupply() as Promise<bigint>;
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
/**
|
|
782
|
+
* approve
|
|
783
|
+
* nonpayable
|
|
784
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
785
|
+
*/
|
|
786
|
+
async approve(spender: `0x${string}`, amount: bigint, options?: {
|
|
787
|
+
accessList?: import('viem').AccessList;
|
|
788
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
789
|
+
chain?: import('viem').Chain | null;
|
|
790
|
+
dataSuffix?: `0x${string}`;
|
|
791
|
+
gas?: bigint;
|
|
792
|
+
gasPrice?: bigint;
|
|
793
|
+
maxFeePerGas?: bigint;
|
|
794
|
+
maxPriorityFeePerGas?: bigint;
|
|
795
|
+
nonce?: number;
|
|
796
|
+
value?: bigint;
|
|
797
|
+
}): Promise<`0x${string}`> {
|
|
798
|
+
if (!this.contract.write) {
|
|
799
|
+
throw new Error('Wallet client is required for write operations');
|
|
800
|
+
}
|
|
801
|
+
return this.contract.write.approve([spender, amount] as const, options) as Promise<`0x${string}`>;
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
/**
|
|
805
|
+
* decreaseAllowance
|
|
806
|
+
* nonpayable
|
|
807
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
808
|
+
*/
|
|
809
|
+
async decreaseAllowance(spender: `0x${string}`, subtractedValue: bigint, options?: {
|
|
810
|
+
accessList?: import('viem').AccessList;
|
|
811
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
812
|
+
chain?: import('viem').Chain | null;
|
|
813
|
+
dataSuffix?: `0x${string}`;
|
|
814
|
+
gas?: bigint;
|
|
815
|
+
gasPrice?: bigint;
|
|
816
|
+
maxFeePerGas?: bigint;
|
|
817
|
+
maxPriorityFeePerGas?: bigint;
|
|
818
|
+
nonce?: number;
|
|
819
|
+
value?: bigint;
|
|
820
|
+
}): Promise<`0x${string}`> {
|
|
821
|
+
if (!this.contract.write) {
|
|
822
|
+
throw new Error('Wallet client is required for write operations');
|
|
823
|
+
}
|
|
824
|
+
return this.contract.write.decreaseAllowance([spender, subtractedValue] as const, options) as Promise<`0x${string}`>;
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
/**
|
|
828
|
+
* increaseAllowance
|
|
829
|
+
* nonpayable
|
|
830
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
831
|
+
*/
|
|
832
|
+
async increaseAllowance(spender: `0x${string}`, addedValue: bigint, options?: {
|
|
833
|
+
accessList?: import('viem').AccessList;
|
|
834
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
835
|
+
chain?: import('viem').Chain | null;
|
|
836
|
+
dataSuffix?: `0x${string}`;
|
|
837
|
+
gas?: bigint;
|
|
838
|
+
gasPrice?: bigint;
|
|
839
|
+
maxFeePerGas?: bigint;
|
|
840
|
+
maxPriorityFeePerGas?: bigint;
|
|
841
|
+
nonce?: number;
|
|
842
|
+
value?: bigint;
|
|
843
|
+
}): Promise<`0x${string}`> {
|
|
844
|
+
if (!this.contract.write) {
|
|
845
|
+
throw new Error('Wallet client is required for write operations');
|
|
846
|
+
}
|
|
847
|
+
return this.contract.write.increaseAllowance([spender, addedValue] as const, options) as Promise<`0x${string}`>;
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
/**
|
|
851
|
+
* ltSetP
|
|
852
|
+
* nonpayable
|
|
853
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
854
|
+
*/
|
|
855
|
+
async ltSetP(lst: `0x${string}`[], status: boolean, options?: {
|
|
856
|
+
accessList?: import('viem').AccessList;
|
|
857
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
858
|
+
chain?: import('viem').Chain | null;
|
|
859
|
+
dataSuffix?: `0x${string}`;
|
|
860
|
+
gas?: bigint;
|
|
861
|
+
gasPrice?: bigint;
|
|
862
|
+
maxFeePerGas?: bigint;
|
|
863
|
+
maxPriorityFeePerGas?: bigint;
|
|
864
|
+
nonce?: number;
|
|
865
|
+
value?: bigint;
|
|
866
|
+
}): Promise<`0x${string}`> {
|
|
867
|
+
if (!this.contract.write) {
|
|
868
|
+
throw new Error('Wallet client is required for write operations');
|
|
869
|
+
}
|
|
870
|
+
return this.contract.write.ltSetP([lst, status] as const, options) as Promise<`0x${string}`>;
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
/**
|
|
874
|
+
* maxLimitPDisable
|
|
875
|
+
* nonpayable
|
|
876
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
877
|
+
*/
|
|
878
|
+
async maxLimitPDisable(options?: {
|
|
879
|
+
accessList?: import('viem').AccessList;
|
|
880
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
881
|
+
chain?: import('viem').Chain | null;
|
|
882
|
+
dataSuffix?: `0x${string}`;
|
|
883
|
+
gas?: bigint;
|
|
884
|
+
gasPrice?: bigint;
|
|
885
|
+
maxFeePerGas?: bigint;
|
|
886
|
+
maxPriorityFeePerGas?: bigint;
|
|
887
|
+
nonce?: number;
|
|
888
|
+
value?: bigint;
|
|
889
|
+
}): Promise<`0x${string}`> {
|
|
890
|
+
if (!this.contract.write) {
|
|
891
|
+
throw new Error('Wallet client is required for write operations');
|
|
892
|
+
}
|
|
893
|
+
return this.contract.write.maxLimitPDisable(options) as Promise<`0x${string}`>;
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
/**
|
|
897
|
+
* maxLimitTxPChange
|
|
898
|
+
* nonpayable
|
|
899
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
900
|
+
*/
|
|
901
|
+
async maxLimitTxPChange(newTxMax: bigint, options?: {
|
|
902
|
+
accessList?: import('viem').AccessList;
|
|
903
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
904
|
+
chain?: import('viem').Chain | null;
|
|
905
|
+
dataSuffix?: `0x${string}`;
|
|
906
|
+
gas?: bigint;
|
|
907
|
+
gasPrice?: bigint;
|
|
908
|
+
maxFeePerGas?: bigint;
|
|
909
|
+
maxPriorityFeePerGas?: bigint;
|
|
910
|
+
nonce?: number;
|
|
911
|
+
value?: bigint;
|
|
912
|
+
}): Promise<`0x${string}`> {
|
|
913
|
+
if (!this.contract.write) {
|
|
914
|
+
throw new Error('Wallet client is required for write operations');
|
|
915
|
+
}
|
|
916
|
+
return this.contract.write.maxLimitTxPChange([newTxMax] as const, options) as Promise<`0x${string}`>;
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
/**
|
|
920
|
+
* maxLimitWalletPChange
|
|
921
|
+
* nonpayable
|
|
922
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
923
|
+
*/
|
|
924
|
+
async maxLimitWalletPChange(newWalletMax: bigint, options?: {
|
|
925
|
+
accessList?: import('viem').AccessList;
|
|
926
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
927
|
+
chain?: import('viem').Chain | null;
|
|
928
|
+
dataSuffix?: `0x${string}`;
|
|
929
|
+
gas?: bigint;
|
|
930
|
+
gasPrice?: bigint;
|
|
931
|
+
maxFeePerGas?: bigint;
|
|
932
|
+
maxPriorityFeePerGas?: bigint;
|
|
933
|
+
nonce?: number;
|
|
934
|
+
value?: bigint;
|
|
935
|
+
}): Promise<`0x${string}`> {
|
|
936
|
+
if (!this.contract.write) {
|
|
937
|
+
throw new Error('Wallet client is required for write operations');
|
|
938
|
+
}
|
|
939
|
+
return this.contract.write.maxLimitWalletPChange([newWalletMax] as const, options) as Promise<`0x${string}`>;
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
/**
|
|
943
|
+
* mdPDisable
|
|
944
|
+
* nonpayable
|
|
945
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
946
|
+
*/
|
|
947
|
+
async mdPDisable(options?: {
|
|
948
|
+
accessList?: import('viem').AccessList;
|
|
949
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
950
|
+
chain?: import('viem').Chain | null;
|
|
951
|
+
dataSuffix?: `0x${string}`;
|
|
952
|
+
gas?: bigint;
|
|
953
|
+
gasPrice?: bigint;
|
|
954
|
+
maxFeePerGas?: bigint;
|
|
955
|
+
maxPriorityFeePerGas?: bigint;
|
|
956
|
+
nonce?: number;
|
|
957
|
+
value?: bigint;
|
|
958
|
+
}): Promise<`0x${string}`> {
|
|
959
|
+
if (!this.contract.write) {
|
|
960
|
+
throw new Error('Wallet client is required for write operations');
|
|
961
|
+
}
|
|
962
|
+
return this.contract.write.mdPDisable(options) as Promise<`0x${string}`>;
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
/**
|
|
966
|
+
* popoTime
|
|
967
|
+
* nonpayable
|
|
968
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
969
|
+
*/
|
|
970
|
+
async popoTime(options?: {
|
|
971
|
+
accessList?: import('viem').AccessList;
|
|
972
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
973
|
+
chain?: import('viem').Chain | null;
|
|
974
|
+
dataSuffix?: `0x${string}`;
|
|
975
|
+
gas?: bigint;
|
|
976
|
+
gasPrice?: bigint;
|
|
977
|
+
maxFeePerGas?: bigint;
|
|
978
|
+
maxPriorityFeePerGas?: bigint;
|
|
979
|
+
nonce?: number;
|
|
980
|
+
value?: bigint;
|
|
981
|
+
}): Promise<`0x${string}`> {
|
|
982
|
+
if (!this.contract.write) {
|
|
983
|
+
throw new Error('Wallet client is required for write operations');
|
|
984
|
+
}
|
|
985
|
+
return this.contract.write.popoTime(options) as Promise<`0x${string}`>;
|
|
986
|
+
}
|
|
987
|
+
|
|
988
|
+
/**
|
|
989
|
+
* renounceOwnership
|
|
990
|
+
* nonpayable
|
|
991
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
992
|
+
*/
|
|
993
|
+
async renounceOwnership(options?: {
|
|
994
|
+
accessList?: import('viem').AccessList;
|
|
995
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
996
|
+
chain?: import('viem').Chain | null;
|
|
997
|
+
dataSuffix?: `0x${string}`;
|
|
998
|
+
gas?: bigint;
|
|
999
|
+
gasPrice?: bigint;
|
|
1000
|
+
maxFeePerGas?: bigint;
|
|
1001
|
+
maxPriorityFeePerGas?: bigint;
|
|
1002
|
+
nonce?: number;
|
|
1003
|
+
value?: bigint;
|
|
1004
|
+
}): Promise<`0x${string}`> {
|
|
1005
|
+
if (!this.contract.write) {
|
|
1006
|
+
throw new Error('Wallet client is required for write operations');
|
|
1007
|
+
}
|
|
1008
|
+
return this.contract.write.renounceOwnership(options) as Promise<`0x${string}`>;
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
/**
|
|
1012
|
+
* setNewPMarketingReceiver
|
|
1013
|
+
* nonpayable
|
|
1014
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1015
|
+
*/
|
|
1016
|
+
async setNewPMarketingReceiver(newRcv: `0x${string}`, options?: {
|
|
1017
|
+
accessList?: import('viem').AccessList;
|
|
1018
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1019
|
+
chain?: import('viem').Chain | null;
|
|
1020
|
+
dataSuffix?: `0x${string}`;
|
|
1021
|
+
gas?: bigint;
|
|
1022
|
+
gasPrice?: bigint;
|
|
1023
|
+
maxFeePerGas?: bigint;
|
|
1024
|
+
maxPriorityFeePerGas?: bigint;
|
|
1025
|
+
nonce?: number;
|
|
1026
|
+
value?: bigint;
|
|
1027
|
+
}): Promise<`0x${string}`> {
|
|
1028
|
+
if (!this.contract.write) {
|
|
1029
|
+
throw new Error('Wallet client is required for write operations');
|
|
1030
|
+
}
|
|
1031
|
+
return this.contract.write.setNewPMarketingReceiver([newRcv] as const, options) as Promise<`0x${string}`>;
|
|
1032
|
+
}
|
|
1033
|
+
|
|
1034
|
+
/**
|
|
1035
|
+
* stuckEthPRemove
|
|
1036
|
+
* nonpayable
|
|
1037
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1038
|
+
*/
|
|
1039
|
+
async stuckEthPRemove(options?: {
|
|
1040
|
+
accessList?: import('viem').AccessList;
|
|
1041
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1042
|
+
chain?: import('viem').Chain | null;
|
|
1043
|
+
dataSuffix?: `0x${string}`;
|
|
1044
|
+
gas?: bigint;
|
|
1045
|
+
gasPrice?: bigint;
|
|
1046
|
+
maxFeePerGas?: bigint;
|
|
1047
|
+
maxPriorityFeePerGas?: bigint;
|
|
1048
|
+
nonce?: number;
|
|
1049
|
+
value?: bigint;
|
|
1050
|
+
}): Promise<`0x${string}`> {
|
|
1051
|
+
if (!this.contract.write) {
|
|
1052
|
+
throw new Error('Wallet client is required for write operations');
|
|
1053
|
+
}
|
|
1054
|
+
return this.contract.write.stuckEthPRemove(options) as Promise<`0x${string}`>;
|
|
1055
|
+
}
|
|
1056
|
+
|
|
1057
|
+
/**
|
|
1058
|
+
* swapbackRangePSet
|
|
1059
|
+
* nonpayable
|
|
1060
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1061
|
+
*/
|
|
1062
|
+
async swapbackRangePSet(taxSwapThreshold: bigint, maxTaxSwap: bigint, options?: {
|
|
1063
|
+
accessList?: import('viem').AccessList;
|
|
1064
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1065
|
+
chain?: import('viem').Chain | null;
|
|
1066
|
+
dataSuffix?: `0x${string}`;
|
|
1067
|
+
gas?: bigint;
|
|
1068
|
+
gasPrice?: bigint;
|
|
1069
|
+
maxFeePerGas?: bigint;
|
|
1070
|
+
maxPriorityFeePerGas?: bigint;
|
|
1071
|
+
nonce?: number;
|
|
1072
|
+
value?: bigint;
|
|
1073
|
+
}): Promise<`0x${string}`> {
|
|
1074
|
+
if (!this.contract.write) {
|
|
1075
|
+
throw new Error('Wallet client is required for write operations');
|
|
1076
|
+
}
|
|
1077
|
+
return this.contract.write.swapbackRangePSet([taxSwapThreshold, maxTaxSwap] as const, options) as Promise<`0x${string}`>;
|
|
1078
|
+
}
|
|
1079
|
+
|
|
1080
|
+
/**
|
|
1081
|
+
* tradingFeesPSetBuySell
|
|
1082
|
+
* nonpayable
|
|
1083
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1084
|
+
*/
|
|
1085
|
+
async tradingFeesPSetBuySell(feeBuy: bigint, feeSell: bigint, options?: {
|
|
1086
|
+
accessList?: import('viem').AccessList;
|
|
1087
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1088
|
+
chain?: import('viem').Chain | null;
|
|
1089
|
+
dataSuffix?: `0x${string}`;
|
|
1090
|
+
gas?: bigint;
|
|
1091
|
+
gasPrice?: bigint;
|
|
1092
|
+
maxFeePerGas?: bigint;
|
|
1093
|
+
maxPriorityFeePerGas?: bigint;
|
|
1094
|
+
nonce?: number;
|
|
1095
|
+
value?: bigint;
|
|
1096
|
+
}): Promise<`0x${string}`> {
|
|
1097
|
+
if (!this.contract.write) {
|
|
1098
|
+
throw new Error('Wallet client is required for write operations');
|
|
1099
|
+
}
|
|
1100
|
+
return this.contract.write.tradingFeesPSetBuySell([feeBuy, feeSell] as const, options) as Promise<`0x${string}`>;
|
|
1101
|
+
}
|
|
1102
|
+
|
|
1103
|
+
/**
|
|
1104
|
+
* tradingFeesPSetExempt
|
|
1105
|
+
* nonpayable
|
|
1106
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1107
|
+
*/
|
|
1108
|
+
async tradingFeesPSetExempt(target: `0x${string}`, exempt: boolean, options?: {
|
|
1109
|
+
accessList?: import('viem').AccessList;
|
|
1110
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1111
|
+
chain?: import('viem').Chain | null;
|
|
1112
|
+
dataSuffix?: `0x${string}`;
|
|
1113
|
+
gas?: bigint;
|
|
1114
|
+
gasPrice?: bigint;
|
|
1115
|
+
maxFeePerGas?: bigint;
|
|
1116
|
+
maxPriorityFeePerGas?: bigint;
|
|
1117
|
+
nonce?: number;
|
|
1118
|
+
value?: bigint;
|
|
1119
|
+
}): Promise<`0x${string}`> {
|
|
1120
|
+
if (!this.contract.write) {
|
|
1121
|
+
throw new Error('Wallet client is required for write operations');
|
|
1122
|
+
}
|
|
1123
|
+
return this.contract.write.tradingFeesPSetExempt([target, exempt] as const, options) as Promise<`0x${string}`>;
|
|
1124
|
+
}
|
|
1125
|
+
|
|
1126
|
+
/**
|
|
1127
|
+
* transfer
|
|
1128
|
+
* nonpayable
|
|
1129
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1130
|
+
*/
|
|
1131
|
+
async transfer(recipient: `0x${string}`, amount: bigint, options?: {
|
|
1132
|
+
accessList?: import('viem').AccessList;
|
|
1133
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1134
|
+
chain?: import('viem').Chain | null;
|
|
1135
|
+
dataSuffix?: `0x${string}`;
|
|
1136
|
+
gas?: bigint;
|
|
1137
|
+
gasPrice?: bigint;
|
|
1138
|
+
maxFeePerGas?: bigint;
|
|
1139
|
+
maxPriorityFeePerGas?: bigint;
|
|
1140
|
+
nonce?: number;
|
|
1141
|
+
value?: bigint;
|
|
1142
|
+
}): Promise<`0x${string}`> {
|
|
1143
|
+
if (!this.contract.write) {
|
|
1144
|
+
throw new Error('Wallet client is required for write operations');
|
|
1145
|
+
}
|
|
1146
|
+
return this.contract.write.transfer([recipient, amount] as const, options) as Promise<`0x${string}`>;
|
|
1147
|
+
}
|
|
1148
|
+
|
|
1149
|
+
/**
|
|
1150
|
+
* transferFrom
|
|
1151
|
+
* nonpayable
|
|
1152
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1153
|
+
*/
|
|
1154
|
+
async transferFrom(sender: `0x${string}`, recipient: `0x${string}`, amount: bigint, options?: {
|
|
1155
|
+
accessList?: import('viem').AccessList;
|
|
1156
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1157
|
+
chain?: import('viem').Chain | null;
|
|
1158
|
+
dataSuffix?: `0x${string}`;
|
|
1159
|
+
gas?: bigint;
|
|
1160
|
+
gasPrice?: bigint;
|
|
1161
|
+
maxFeePerGas?: bigint;
|
|
1162
|
+
maxPriorityFeePerGas?: bigint;
|
|
1163
|
+
nonce?: number;
|
|
1164
|
+
value?: bigint;
|
|
1165
|
+
}): Promise<`0x${string}`> {
|
|
1166
|
+
if (!this.contract.write) {
|
|
1167
|
+
throw new Error('Wallet client is required for write operations');
|
|
1168
|
+
}
|
|
1169
|
+
return this.contract.write.transferFrom([sender, recipient, amount] as const, options) as Promise<`0x${string}`>;
|
|
1170
|
+
}
|
|
1171
|
+
|
|
1172
|
+
/**
|
|
1173
|
+
* transferOwnership
|
|
1174
|
+
* nonpayable
|
|
1175
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1176
|
+
*/
|
|
1177
|
+
async transferOwnership(newOwner: `0x${string}`, options?: {
|
|
1178
|
+
accessList?: import('viem').AccessList;
|
|
1179
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1180
|
+
chain?: import('viem').Chain | null;
|
|
1181
|
+
dataSuffix?: `0x${string}`;
|
|
1182
|
+
gas?: bigint;
|
|
1183
|
+
gasPrice?: bigint;
|
|
1184
|
+
maxFeePerGas?: bigint;
|
|
1185
|
+
maxPriorityFeePerGas?: bigint;
|
|
1186
|
+
nonce?: number;
|
|
1187
|
+
value?: bigint;
|
|
1188
|
+
}): Promise<`0x${string}`> {
|
|
1189
|
+
if (!this.contract.write) {
|
|
1190
|
+
throw new Error('Wallet client is required for write operations');
|
|
1191
|
+
}
|
|
1192
|
+
return this.contract.write.transferOwnership([newOwner] as const, options) as Promise<`0x${string}`>;
|
|
1193
|
+
}
|
|
1194
|
+
|
|
1195
|
+
/**
|
|
1196
|
+
* triggerSwap
|
|
1197
|
+
* nonpayable
|
|
1198
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1199
|
+
*/
|
|
1200
|
+
async triggerSwap(options?: {
|
|
1201
|
+
accessList?: import('viem').AccessList;
|
|
1202
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1203
|
+
chain?: import('viem').Chain | null;
|
|
1204
|
+
dataSuffix?: `0x${string}`;
|
|
1205
|
+
gas?: bigint;
|
|
1206
|
+
gasPrice?: bigint;
|
|
1207
|
+
maxFeePerGas?: bigint;
|
|
1208
|
+
maxPriorityFeePerGas?: bigint;
|
|
1209
|
+
nonce?: number;
|
|
1210
|
+
value?: bigint;
|
|
1211
|
+
}): Promise<`0x${string}`> {
|
|
1212
|
+
if (!this.contract.write) {
|
|
1213
|
+
throw new Error('Wallet client is required for write operations');
|
|
1214
|
+
}
|
|
1215
|
+
return this.contract.write.triggerSwap(options) as Promise<`0x${string}`>;
|
|
1216
|
+
}
|
|
1217
|
+
|
|
1218
|
+
|
|
1219
|
+
|
|
1220
|
+
/**
|
|
1221
|
+
* Simulate contract write operations (dry-run without sending transaction)
|
|
1222
|
+
*
|
|
1223
|
+
* @example
|
|
1224
|
+
* const result = await contract.simulate.transfer('0x...', 1000n);
|
|
1225
|
+
* console.log('Gas estimate:', result.request.gas);
|
|
1226
|
+
* console.log('Would succeed:', result.result);
|
|
1227
|
+
*/
|
|
1228
|
+
get simulate() {
|
|
1229
|
+
const contract = this.contract;
|
|
1230
|
+
if (!contract.simulate) {
|
|
1231
|
+
throw new Error('Public client is required for simulation');
|
|
1232
|
+
}
|
|
1233
|
+
return {
|
|
1234
|
+
/**
|
|
1235
|
+
* Simulate approve
|
|
1236
|
+
* Returns gas estimate and result without sending transaction
|
|
1237
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1238
|
+
*/
|
|
1239
|
+
async approve(spender: `0x${string}`, amount: bigint, options?: {
|
|
1240
|
+
accessList?: import('viem').AccessList;
|
|
1241
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1242
|
+
chain?: import('viem').Chain | null;
|
|
1243
|
+
dataSuffix?: `0x${string}`;
|
|
1244
|
+
gas?: bigint;
|
|
1245
|
+
gasPrice?: bigint;
|
|
1246
|
+
maxFeePerGas?: bigint;
|
|
1247
|
+
maxPriorityFeePerGas?: bigint;
|
|
1248
|
+
nonce?: number;
|
|
1249
|
+
value?: bigint;
|
|
1250
|
+
}): Promise<boolean> {
|
|
1251
|
+
return contract.simulate.approve([spender, amount] as const, options) as Promise<boolean>;
|
|
1252
|
+
},
|
|
1253
|
+
/**
|
|
1254
|
+
* Simulate decreaseAllowance
|
|
1255
|
+
* Returns gas estimate and result without sending transaction
|
|
1256
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1257
|
+
*/
|
|
1258
|
+
async decreaseAllowance(spender: `0x${string}`, subtractedValue: bigint, options?: {
|
|
1259
|
+
accessList?: import('viem').AccessList;
|
|
1260
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1261
|
+
chain?: import('viem').Chain | null;
|
|
1262
|
+
dataSuffix?: `0x${string}`;
|
|
1263
|
+
gas?: bigint;
|
|
1264
|
+
gasPrice?: bigint;
|
|
1265
|
+
maxFeePerGas?: bigint;
|
|
1266
|
+
maxPriorityFeePerGas?: bigint;
|
|
1267
|
+
nonce?: number;
|
|
1268
|
+
value?: bigint;
|
|
1269
|
+
}): Promise<boolean> {
|
|
1270
|
+
return contract.simulate.decreaseAllowance([spender, subtractedValue] as const, options) as Promise<boolean>;
|
|
1271
|
+
},
|
|
1272
|
+
/**
|
|
1273
|
+
* Simulate increaseAllowance
|
|
1274
|
+
* Returns gas estimate and result without sending transaction
|
|
1275
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1276
|
+
*/
|
|
1277
|
+
async increaseAllowance(spender: `0x${string}`, addedValue: bigint, options?: {
|
|
1278
|
+
accessList?: import('viem').AccessList;
|
|
1279
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1280
|
+
chain?: import('viem').Chain | null;
|
|
1281
|
+
dataSuffix?: `0x${string}`;
|
|
1282
|
+
gas?: bigint;
|
|
1283
|
+
gasPrice?: bigint;
|
|
1284
|
+
maxFeePerGas?: bigint;
|
|
1285
|
+
maxPriorityFeePerGas?: bigint;
|
|
1286
|
+
nonce?: number;
|
|
1287
|
+
value?: bigint;
|
|
1288
|
+
}): Promise<boolean> {
|
|
1289
|
+
return contract.simulate.increaseAllowance([spender, addedValue] as const, options) as Promise<boolean>;
|
|
1290
|
+
},
|
|
1291
|
+
/**
|
|
1292
|
+
* Simulate ltSetP
|
|
1293
|
+
* Returns gas estimate and result without sending transaction
|
|
1294
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1295
|
+
*/
|
|
1296
|
+
async ltSetP(lst: `0x${string}`[], status: boolean, options?: {
|
|
1297
|
+
accessList?: import('viem').AccessList;
|
|
1298
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1299
|
+
chain?: import('viem').Chain | null;
|
|
1300
|
+
dataSuffix?: `0x${string}`;
|
|
1301
|
+
gas?: bigint;
|
|
1302
|
+
gasPrice?: bigint;
|
|
1303
|
+
maxFeePerGas?: bigint;
|
|
1304
|
+
maxPriorityFeePerGas?: bigint;
|
|
1305
|
+
nonce?: number;
|
|
1306
|
+
value?: bigint;
|
|
1307
|
+
}): Promise<void> {
|
|
1308
|
+
return contract.simulate.ltSetP([lst, status] as const, options) as Promise<void>;
|
|
1309
|
+
},
|
|
1310
|
+
/**
|
|
1311
|
+
* Simulate maxLimitPDisable
|
|
1312
|
+
* Returns gas estimate and result without sending transaction
|
|
1313
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1314
|
+
*/
|
|
1315
|
+
async maxLimitPDisable(options?: {
|
|
1316
|
+
accessList?: import('viem').AccessList;
|
|
1317
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1318
|
+
chain?: import('viem').Chain | null;
|
|
1319
|
+
dataSuffix?: `0x${string}`;
|
|
1320
|
+
gas?: bigint;
|
|
1321
|
+
gasPrice?: bigint;
|
|
1322
|
+
maxFeePerGas?: bigint;
|
|
1323
|
+
maxPriorityFeePerGas?: bigint;
|
|
1324
|
+
nonce?: number;
|
|
1325
|
+
value?: bigint;
|
|
1326
|
+
}): Promise<void> {
|
|
1327
|
+
return contract.simulate.maxLimitPDisable(options) as Promise<void>;
|
|
1328
|
+
},
|
|
1329
|
+
/**
|
|
1330
|
+
* Simulate maxLimitTxPChange
|
|
1331
|
+
* Returns gas estimate and result without sending transaction
|
|
1332
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1333
|
+
*/
|
|
1334
|
+
async maxLimitTxPChange(newTxMax: bigint, options?: {
|
|
1335
|
+
accessList?: import('viem').AccessList;
|
|
1336
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1337
|
+
chain?: import('viem').Chain | null;
|
|
1338
|
+
dataSuffix?: `0x${string}`;
|
|
1339
|
+
gas?: bigint;
|
|
1340
|
+
gasPrice?: bigint;
|
|
1341
|
+
maxFeePerGas?: bigint;
|
|
1342
|
+
maxPriorityFeePerGas?: bigint;
|
|
1343
|
+
nonce?: number;
|
|
1344
|
+
value?: bigint;
|
|
1345
|
+
}): Promise<void> {
|
|
1346
|
+
return contract.simulate.maxLimitTxPChange([newTxMax] as const, options) as Promise<void>;
|
|
1347
|
+
},
|
|
1348
|
+
/**
|
|
1349
|
+
* Simulate maxLimitWalletPChange
|
|
1350
|
+
* Returns gas estimate and result without sending transaction
|
|
1351
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1352
|
+
*/
|
|
1353
|
+
async maxLimitWalletPChange(newWalletMax: bigint, options?: {
|
|
1354
|
+
accessList?: import('viem').AccessList;
|
|
1355
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1356
|
+
chain?: import('viem').Chain | null;
|
|
1357
|
+
dataSuffix?: `0x${string}`;
|
|
1358
|
+
gas?: bigint;
|
|
1359
|
+
gasPrice?: bigint;
|
|
1360
|
+
maxFeePerGas?: bigint;
|
|
1361
|
+
maxPriorityFeePerGas?: bigint;
|
|
1362
|
+
nonce?: number;
|
|
1363
|
+
value?: bigint;
|
|
1364
|
+
}): Promise<void> {
|
|
1365
|
+
return contract.simulate.maxLimitWalletPChange([newWalletMax] as const, options) as Promise<void>;
|
|
1366
|
+
},
|
|
1367
|
+
/**
|
|
1368
|
+
* Simulate mdPDisable
|
|
1369
|
+
* Returns gas estimate and result without sending transaction
|
|
1370
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1371
|
+
*/
|
|
1372
|
+
async mdPDisable(options?: {
|
|
1373
|
+
accessList?: import('viem').AccessList;
|
|
1374
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1375
|
+
chain?: import('viem').Chain | null;
|
|
1376
|
+
dataSuffix?: `0x${string}`;
|
|
1377
|
+
gas?: bigint;
|
|
1378
|
+
gasPrice?: bigint;
|
|
1379
|
+
maxFeePerGas?: bigint;
|
|
1380
|
+
maxPriorityFeePerGas?: bigint;
|
|
1381
|
+
nonce?: number;
|
|
1382
|
+
value?: bigint;
|
|
1383
|
+
}): Promise<void> {
|
|
1384
|
+
return contract.simulate.mdPDisable(options) as Promise<void>;
|
|
1385
|
+
},
|
|
1386
|
+
/**
|
|
1387
|
+
* Simulate popoTime
|
|
1388
|
+
* Returns gas estimate and result without sending transaction
|
|
1389
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1390
|
+
*/
|
|
1391
|
+
async popoTime(options?: {
|
|
1392
|
+
accessList?: import('viem').AccessList;
|
|
1393
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1394
|
+
chain?: import('viem').Chain | null;
|
|
1395
|
+
dataSuffix?: `0x${string}`;
|
|
1396
|
+
gas?: bigint;
|
|
1397
|
+
gasPrice?: bigint;
|
|
1398
|
+
maxFeePerGas?: bigint;
|
|
1399
|
+
maxPriorityFeePerGas?: bigint;
|
|
1400
|
+
nonce?: number;
|
|
1401
|
+
value?: bigint;
|
|
1402
|
+
}): Promise<void> {
|
|
1403
|
+
return contract.simulate.popoTime(options) as Promise<void>;
|
|
1404
|
+
},
|
|
1405
|
+
/**
|
|
1406
|
+
* Simulate renounceOwnership
|
|
1407
|
+
* Returns gas estimate and result without sending transaction
|
|
1408
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1409
|
+
*/
|
|
1410
|
+
async renounceOwnership(options?: {
|
|
1411
|
+
accessList?: import('viem').AccessList;
|
|
1412
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1413
|
+
chain?: import('viem').Chain | null;
|
|
1414
|
+
dataSuffix?: `0x${string}`;
|
|
1415
|
+
gas?: bigint;
|
|
1416
|
+
gasPrice?: bigint;
|
|
1417
|
+
maxFeePerGas?: bigint;
|
|
1418
|
+
maxPriorityFeePerGas?: bigint;
|
|
1419
|
+
nonce?: number;
|
|
1420
|
+
value?: bigint;
|
|
1421
|
+
}): Promise<void> {
|
|
1422
|
+
return contract.simulate.renounceOwnership(options) as Promise<void>;
|
|
1423
|
+
},
|
|
1424
|
+
/**
|
|
1425
|
+
* Simulate setNewPMarketingReceiver
|
|
1426
|
+
* Returns gas estimate and result without sending transaction
|
|
1427
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1428
|
+
*/
|
|
1429
|
+
async setNewPMarketingReceiver(newRcv: `0x${string}`, options?: {
|
|
1430
|
+
accessList?: import('viem').AccessList;
|
|
1431
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1432
|
+
chain?: import('viem').Chain | null;
|
|
1433
|
+
dataSuffix?: `0x${string}`;
|
|
1434
|
+
gas?: bigint;
|
|
1435
|
+
gasPrice?: bigint;
|
|
1436
|
+
maxFeePerGas?: bigint;
|
|
1437
|
+
maxPriorityFeePerGas?: bigint;
|
|
1438
|
+
nonce?: number;
|
|
1439
|
+
value?: bigint;
|
|
1440
|
+
}): Promise<void> {
|
|
1441
|
+
return contract.simulate.setNewPMarketingReceiver([newRcv] as const, options) as Promise<void>;
|
|
1442
|
+
},
|
|
1443
|
+
/**
|
|
1444
|
+
* Simulate stuckEthPRemove
|
|
1445
|
+
* Returns gas estimate and result without sending transaction
|
|
1446
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1447
|
+
*/
|
|
1448
|
+
async stuckEthPRemove(options?: {
|
|
1449
|
+
accessList?: import('viem').AccessList;
|
|
1450
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1451
|
+
chain?: import('viem').Chain | null;
|
|
1452
|
+
dataSuffix?: `0x${string}`;
|
|
1453
|
+
gas?: bigint;
|
|
1454
|
+
gasPrice?: bigint;
|
|
1455
|
+
maxFeePerGas?: bigint;
|
|
1456
|
+
maxPriorityFeePerGas?: bigint;
|
|
1457
|
+
nonce?: number;
|
|
1458
|
+
value?: bigint;
|
|
1459
|
+
}): Promise<void> {
|
|
1460
|
+
return contract.simulate.stuckEthPRemove(options) as Promise<void>;
|
|
1461
|
+
},
|
|
1462
|
+
/**
|
|
1463
|
+
* Simulate swapbackRangePSet
|
|
1464
|
+
* Returns gas estimate and result without sending transaction
|
|
1465
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1466
|
+
*/
|
|
1467
|
+
async swapbackRangePSet(taxSwapThreshold: bigint, maxTaxSwap: bigint, options?: {
|
|
1468
|
+
accessList?: import('viem').AccessList;
|
|
1469
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1470
|
+
chain?: import('viem').Chain | null;
|
|
1471
|
+
dataSuffix?: `0x${string}`;
|
|
1472
|
+
gas?: bigint;
|
|
1473
|
+
gasPrice?: bigint;
|
|
1474
|
+
maxFeePerGas?: bigint;
|
|
1475
|
+
maxPriorityFeePerGas?: bigint;
|
|
1476
|
+
nonce?: number;
|
|
1477
|
+
value?: bigint;
|
|
1478
|
+
}): Promise<void> {
|
|
1479
|
+
return contract.simulate.swapbackRangePSet([taxSwapThreshold, maxTaxSwap] as const, options) as Promise<void>;
|
|
1480
|
+
},
|
|
1481
|
+
/**
|
|
1482
|
+
* Simulate tradingFeesPSetBuySell
|
|
1483
|
+
* Returns gas estimate and result without sending transaction
|
|
1484
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1485
|
+
*/
|
|
1486
|
+
async tradingFeesPSetBuySell(feeBuy: bigint, feeSell: bigint, 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<void> {
|
|
1498
|
+
return contract.simulate.tradingFeesPSetBuySell([feeBuy, feeSell] as const, options) as Promise<void>;
|
|
1499
|
+
},
|
|
1500
|
+
/**
|
|
1501
|
+
* Simulate tradingFeesPSetExempt
|
|
1502
|
+
* Returns gas estimate and result without sending transaction
|
|
1503
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1504
|
+
*/
|
|
1505
|
+
async tradingFeesPSetExempt(target: `0x${string}`, exempt: boolean, options?: {
|
|
1506
|
+
accessList?: import('viem').AccessList;
|
|
1507
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1508
|
+
chain?: import('viem').Chain | null;
|
|
1509
|
+
dataSuffix?: `0x${string}`;
|
|
1510
|
+
gas?: bigint;
|
|
1511
|
+
gasPrice?: bigint;
|
|
1512
|
+
maxFeePerGas?: bigint;
|
|
1513
|
+
maxPriorityFeePerGas?: bigint;
|
|
1514
|
+
nonce?: number;
|
|
1515
|
+
value?: bigint;
|
|
1516
|
+
}): Promise<void> {
|
|
1517
|
+
return contract.simulate.tradingFeesPSetExempt([target, exempt] as const, options) as Promise<void>;
|
|
1518
|
+
},
|
|
1519
|
+
/**
|
|
1520
|
+
* Simulate transfer
|
|
1521
|
+
* Returns gas estimate and result without sending transaction
|
|
1522
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1523
|
+
*/
|
|
1524
|
+
async transfer(recipient: `0x${string}`, amount: bigint, options?: {
|
|
1525
|
+
accessList?: import('viem').AccessList;
|
|
1526
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1527
|
+
chain?: import('viem').Chain | null;
|
|
1528
|
+
dataSuffix?: `0x${string}`;
|
|
1529
|
+
gas?: bigint;
|
|
1530
|
+
gasPrice?: bigint;
|
|
1531
|
+
maxFeePerGas?: bigint;
|
|
1532
|
+
maxPriorityFeePerGas?: bigint;
|
|
1533
|
+
nonce?: number;
|
|
1534
|
+
value?: bigint;
|
|
1535
|
+
}): Promise<boolean> {
|
|
1536
|
+
return contract.simulate.transfer([recipient, amount] as const, options) as Promise<boolean>;
|
|
1537
|
+
},
|
|
1538
|
+
/**
|
|
1539
|
+
* Simulate transferFrom
|
|
1540
|
+
* Returns gas estimate and result without sending transaction
|
|
1541
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1542
|
+
*/
|
|
1543
|
+
async transferFrom(sender: `0x${string}`, recipient: `0x${string}`, amount: bigint, options?: {
|
|
1544
|
+
accessList?: import('viem').AccessList;
|
|
1545
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1546
|
+
chain?: import('viem').Chain | null;
|
|
1547
|
+
dataSuffix?: `0x${string}`;
|
|
1548
|
+
gas?: bigint;
|
|
1549
|
+
gasPrice?: bigint;
|
|
1550
|
+
maxFeePerGas?: bigint;
|
|
1551
|
+
maxPriorityFeePerGas?: bigint;
|
|
1552
|
+
nonce?: number;
|
|
1553
|
+
value?: bigint;
|
|
1554
|
+
}): Promise<boolean> {
|
|
1555
|
+
return contract.simulate.transferFrom([sender, recipient, amount] as const, options) as Promise<boolean>;
|
|
1556
|
+
},
|
|
1557
|
+
/**
|
|
1558
|
+
* Simulate transferOwnership
|
|
1559
|
+
* Returns gas estimate and result without sending transaction
|
|
1560
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1561
|
+
*/
|
|
1562
|
+
async transferOwnership(newOwner: `0x${string}`, options?: {
|
|
1563
|
+
accessList?: import('viem').AccessList;
|
|
1564
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1565
|
+
chain?: import('viem').Chain | null;
|
|
1566
|
+
dataSuffix?: `0x${string}`;
|
|
1567
|
+
gas?: bigint;
|
|
1568
|
+
gasPrice?: bigint;
|
|
1569
|
+
maxFeePerGas?: bigint;
|
|
1570
|
+
maxPriorityFeePerGas?: bigint;
|
|
1571
|
+
nonce?: number;
|
|
1572
|
+
value?: bigint;
|
|
1573
|
+
}): Promise<void> {
|
|
1574
|
+
return contract.simulate.transferOwnership([newOwner] as const, options) as Promise<void>;
|
|
1575
|
+
},
|
|
1576
|
+
/**
|
|
1577
|
+
* Simulate triggerSwap
|
|
1578
|
+
* Returns gas estimate and result without sending transaction
|
|
1579
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1580
|
+
*/
|
|
1581
|
+
async triggerSwap(options?: {
|
|
1582
|
+
accessList?: import('viem').AccessList;
|
|
1583
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1584
|
+
chain?: import('viem').Chain | null;
|
|
1585
|
+
dataSuffix?: `0x${string}`;
|
|
1586
|
+
gas?: bigint;
|
|
1587
|
+
gasPrice?: bigint;
|
|
1588
|
+
maxFeePerGas?: bigint;
|
|
1589
|
+
maxPriorityFeePerGas?: bigint;
|
|
1590
|
+
nonce?: number;
|
|
1591
|
+
value?: bigint;
|
|
1592
|
+
}): Promise<void> {
|
|
1593
|
+
return contract.simulate.triggerSwap(options) as Promise<void>;
|
|
1594
|
+
}
|
|
1595
|
+
};
|
|
1596
|
+
}
|
|
1597
|
+
|
|
1598
|
+
/**
|
|
1599
|
+
* Watch contract events
|
|
1600
|
+
*
|
|
1601
|
+
* @example
|
|
1602
|
+
* // Watch all Transfer events
|
|
1603
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
1604
|
+
* console.log('Transfer:', event);
|
|
1605
|
+
* });
|
|
1606
|
+
*
|
|
1607
|
+
* // Stop watching
|
|
1608
|
+
* unwatch();
|
|
1609
|
+
*/
|
|
1610
|
+
get watch() {
|
|
1611
|
+
return {
|
|
1612
|
+
/**
|
|
1613
|
+
* Watch Approval events
|
|
1614
|
+
* @param callback Function to call when event is emitted
|
|
1615
|
+
* @param filter Optional filter for indexed parameters
|
|
1616
|
+
* @returns Unwatch function to stop listening
|
|
1617
|
+
*/
|
|
1618
|
+
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 }) => {
|
|
1619
|
+
return this.publicClient.watchContractEvent({
|
|
1620
|
+
address: this.contractAddress,
|
|
1621
|
+
abi: POPOAbi,
|
|
1622
|
+
eventName: 'Approval',
|
|
1623
|
+
args: filter as any,
|
|
1624
|
+
onLogs: (logs: any[]) => {
|
|
1625
|
+
logs.forEach((log: any) => {
|
|
1626
|
+
callback(log.args as any);
|
|
1627
|
+
});
|
|
1628
|
+
},
|
|
1629
|
+
}) as () => void;
|
|
1630
|
+
},
|
|
1631
|
+
/**
|
|
1632
|
+
* Watch ExcludedFromFee events
|
|
1633
|
+
* @param callback Function to call when event is emitted
|
|
1634
|
+
* @param filter Optional filter for indexed parameters
|
|
1635
|
+
* @returns Unwatch function to stop listening
|
|
1636
|
+
*/
|
|
1637
|
+
ExcludedFromFee: (callback: (event: { account: `0x${string}`; status: boolean }) => void) => {
|
|
1638
|
+
return this.publicClient.watchContractEvent({
|
|
1639
|
+
address: this.contractAddress,
|
|
1640
|
+
abi: POPOAbi,
|
|
1641
|
+
eventName: 'ExcludedFromFee',
|
|
1642
|
+
|
|
1643
|
+
onLogs: (logs: any[]) => {
|
|
1644
|
+
logs.forEach((log: any) => {
|
|
1645
|
+
callback(log.args as any);
|
|
1646
|
+
});
|
|
1647
|
+
},
|
|
1648
|
+
}) as () => void;
|
|
1649
|
+
},
|
|
1650
|
+
/**
|
|
1651
|
+
* Watch FeeReceiverUpdated events
|
|
1652
|
+
* @param callback Function to call when event is emitted
|
|
1653
|
+
* @param filter Optional filter for indexed parameters
|
|
1654
|
+
* @returns Unwatch function to stop listening
|
|
1655
|
+
*/
|
|
1656
|
+
FeeReceiverUpdated: (callback: (event: { _taxWallet: `0x${string}` }) => void) => {
|
|
1657
|
+
return this.publicClient.watchContractEvent({
|
|
1658
|
+
address: this.contractAddress,
|
|
1659
|
+
abi: POPOAbi,
|
|
1660
|
+
eventName: 'FeeReceiverUpdated',
|
|
1661
|
+
|
|
1662
|
+
onLogs: (logs: any[]) => {
|
|
1663
|
+
logs.forEach((log: any) => {
|
|
1664
|
+
callback(log.args as any);
|
|
1665
|
+
});
|
|
1666
|
+
},
|
|
1667
|
+
}) as () => void;
|
|
1668
|
+
},
|
|
1669
|
+
/**
|
|
1670
|
+
* Watch FeesUpdated events
|
|
1671
|
+
* @param callback Function to call when event is emitted
|
|
1672
|
+
* @param filter Optional filter for indexed parameters
|
|
1673
|
+
* @returns Unwatch function to stop listening
|
|
1674
|
+
*/
|
|
1675
|
+
FeesUpdated: (callback: (event: { buyFee: bigint; sellFee: bigint }) => void) => {
|
|
1676
|
+
return this.publicClient.watchContractEvent({
|
|
1677
|
+
address: this.contractAddress,
|
|
1678
|
+
abi: POPOAbi,
|
|
1679
|
+
eventName: 'FeesUpdated',
|
|
1680
|
+
|
|
1681
|
+
onLogs: (logs: any[]) => {
|
|
1682
|
+
logs.forEach((log: any) => {
|
|
1683
|
+
callback(log.args as any);
|
|
1684
|
+
});
|
|
1685
|
+
},
|
|
1686
|
+
}) as () => void;
|
|
1687
|
+
},
|
|
1688
|
+
/**
|
|
1689
|
+
* Watch LimitsRemoved events
|
|
1690
|
+
* @param callback Function to call when event is emitted
|
|
1691
|
+
* @param filter Optional filter for indexed parameters
|
|
1692
|
+
* @returns Unwatch function to stop listening
|
|
1693
|
+
*/
|
|
1694
|
+
LimitsRemoved: (callback: (event: { }) => void) => {
|
|
1695
|
+
return this.publicClient.watchContractEvent({
|
|
1696
|
+
address: this.contractAddress,
|
|
1697
|
+
abi: POPOAbi,
|
|
1698
|
+
eventName: 'LimitsRemoved',
|
|
1699
|
+
|
|
1700
|
+
onLogs: (logs: any[]) => {
|
|
1701
|
+
logs.forEach((log: any) => {
|
|
1702
|
+
callback(log.args as any);
|
|
1703
|
+
});
|
|
1704
|
+
},
|
|
1705
|
+
}) as () => void;
|
|
1706
|
+
},
|
|
1707
|
+
/**
|
|
1708
|
+
* Watch MaxTxAmountUpdated events
|
|
1709
|
+
* @param callback Function to call when event is emitted
|
|
1710
|
+
* @param filter Optional filter for indexed parameters
|
|
1711
|
+
* @returns Unwatch function to stop listening
|
|
1712
|
+
*/
|
|
1713
|
+
MaxTxAmountUpdated: (callback: (event: { _txAmountLimit: bigint }) => void) => {
|
|
1714
|
+
return this.publicClient.watchContractEvent({
|
|
1715
|
+
address: this.contractAddress,
|
|
1716
|
+
abi: POPOAbi,
|
|
1717
|
+
eventName: 'MaxTxAmountUpdated',
|
|
1718
|
+
|
|
1719
|
+
onLogs: (logs: any[]) => {
|
|
1720
|
+
logs.forEach((log: any) => {
|
|
1721
|
+
callback(log.args as any);
|
|
1722
|
+
});
|
|
1723
|
+
},
|
|
1724
|
+
}) as () => void;
|
|
1725
|
+
},
|
|
1726
|
+
/**
|
|
1727
|
+
* Watch MaxWalletAmountUpdated events
|
|
1728
|
+
* @param callback Function to call when event is emitted
|
|
1729
|
+
* @param filter Optional filter for indexed parameters
|
|
1730
|
+
* @returns Unwatch function to stop listening
|
|
1731
|
+
*/
|
|
1732
|
+
MaxWalletAmountUpdated: (callback: (event: { _walletAmountLimit: bigint }) => void) => {
|
|
1733
|
+
return this.publicClient.watchContractEvent({
|
|
1734
|
+
address: this.contractAddress,
|
|
1735
|
+
abi: POPOAbi,
|
|
1736
|
+
eventName: 'MaxWalletAmountUpdated',
|
|
1737
|
+
|
|
1738
|
+
onLogs: (logs: any[]) => {
|
|
1739
|
+
logs.forEach((log: any) => {
|
|
1740
|
+
callback(log.args as any);
|
|
1741
|
+
});
|
|
1742
|
+
},
|
|
1743
|
+
}) as () => void;
|
|
1744
|
+
},
|
|
1745
|
+
/**
|
|
1746
|
+
* Watch OwnershipTransferred events
|
|
1747
|
+
* @param callback Function to call when event is emitted
|
|
1748
|
+
* @param filter Optional filter for indexed parameters
|
|
1749
|
+
* @returns Unwatch function to stop listening
|
|
1750
|
+
*/
|
|
1751
|
+
OwnershipTransferred: (callback: (event: { previousOwner: `0x${string}`; newOwner: `0x${string}` }) => void, filter?: { previousOwner?: `0x${string}` | `0x${string}`[] | null; newOwner?: `0x${string}` | `0x${string}`[] | null }) => {
|
|
1752
|
+
return this.publicClient.watchContractEvent({
|
|
1753
|
+
address: this.contractAddress,
|
|
1754
|
+
abi: POPOAbi,
|
|
1755
|
+
eventName: 'OwnershipTransferred',
|
|
1756
|
+
args: filter as any,
|
|
1757
|
+
onLogs: (logs: any[]) => {
|
|
1758
|
+
logs.forEach((log: any) => {
|
|
1759
|
+
callback(log.args as any);
|
|
1760
|
+
});
|
|
1761
|
+
},
|
|
1762
|
+
}) as () => void;
|
|
1763
|
+
},
|
|
1764
|
+
/**
|
|
1765
|
+
* Watch SwapbackUpdated events
|
|
1766
|
+
* @param callback Function to call when event is emitted
|
|
1767
|
+
* @param filter Optional filter for indexed parameters
|
|
1768
|
+
* @returns Unwatch function to stop listening
|
|
1769
|
+
*/
|
|
1770
|
+
SwapbackUpdated: (callback: (event: { _swapbackMin: bigint; _swapbackMax: bigint }) => void) => {
|
|
1771
|
+
return this.publicClient.watchContractEvent({
|
|
1772
|
+
address: this.contractAddress,
|
|
1773
|
+
abi: POPOAbi,
|
|
1774
|
+
eventName: 'SwapbackUpdated',
|
|
1775
|
+
|
|
1776
|
+
onLogs: (logs: any[]) => {
|
|
1777
|
+
logs.forEach((log: any) => {
|
|
1778
|
+
callback(log.args as any);
|
|
1779
|
+
});
|
|
1780
|
+
},
|
|
1781
|
+
}) as () => void;
|
|
1782
|
+
},
|
|
1783
|
+
/**
|
|
1784
|
+
* Watch TradingOpened events
|
|
1785
|
+
* @param callback Function to call when event is emitted
|
|
1786
|
+
* @param filter Optional filter for indexed parameters
|
|
1787
|
+
* @returns Unwatch function to stop listening
|
|
1788
|
+
*/
|
|
1789
|
+
TradingOpened: (callback: (event: { }) => void) => {
|
|
1790
|
+
return this.publicClient.watchContractEvent({
|
|
1791
|
+
address: this.contractAddress,
|
|
1792
|
+
abi: POPOAbi,
|
|
1793
|
+
eventName: 'TradingOpened',
|
|
1794
|
+
|
|
1795
|
+
onLogs: (logs: any[]) => {
|
|
1796
|
+
logs.forEach((log: any) => {
|
|
1797
|
+
callback(log.args as any);
|
|
1798
|
+
});
|
|
1799
|
+
},
|
|
1800
|
+
}) as () => void;
|
|
1801
|
+
},
|
|
1802
|
+
/**
|
|
1803
|
+
* Watch Transfer events
|
|
1804
|
+
* @param callback Function to call when event is emitted
|
|
1805
|
+
* @param filter Optional filter for indexed parameters
|
|
1806
|
+
* @returns Unwatch function to stop listening
|
|
1807
|
+
*/
|
|
1808
|
+
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 }) => {
|
|
1809
|
+
return this.publicClient.watchContractEvent({
|
|
1810
|
+
address: this.contractAddress,
|
|
1811
|
+
abi: POPOAbi,
|
|
1812
|
+
eventName: 'Transfer',
|
|
1813
|
+
args: filter as any,
|
|
1814
|
+
onLogs: (logs: any[]) => {
|
|
1815
|
+
logs.forEach((log: any) => {
|
|
1816
|
+
callback(log.args as any);
|
|
1817
|
+
});
|
|
1818
|
+
},
|
|
1819
|
+
}) as () => void;
|
|
1820
|
+
}
|
|
1821
|
+
};
|
|
1822
|
+
}
|
|
1823
|
+
}
|