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