@layerzerolabs/lz-evm-oapp-v2 2.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.
Files changed (51) hide show
  1. package/artifacts/contracts/oapp/OApp.sol/OApp.json +332 -0
  2. package/artifacts/contracts/oapp/OAppCore.sol/OAppCore.json +195 -0
  3. package/artifacts/contracts/oapp/OAppReceiver.sol/OAppReceiver.json +316 -0
  4. package/artifacts/contracts/oapp/OAppSender.sol/OAppSender.json +211 -0
  5. package/artifacts/contracts/oapp/examples/OmniCounter.sol/MsgCodec.json +10 -0
  6. package/artifacts/contracts/oapp/examples/OmniCounter.sol/OmniCounter.json +874 -0
  7. package/artifacts/contracts/oapp/examples/OmniCounterPreCrime.sol/OmniCounterPreCrime.json +373 -0
  8. package/artifacts/contracts/oapp/interfaces/IOAppComposer.sol/IOAppComposer.json +44 -0
  9. package/artifacts/contracts/oapp/interfaces/IOAppCore.sol/IOAppCore.json +143 -0
  10. package/artifacts/contracts/oapp/interfaces/IOAppMsgInspector.sol/IOAppMsgInspector.json +51 -0
  11. package/artifacts/contracts/oapp/interfaces/IOAppOptionsType3.sol/IOAppOptionsType3.json +111 -0
  12. package/artifacts/contracts/oapp/libs/OAppOptionsType3.sol/OAppOptionsType3.json +187 -0
  13. package/artifacts/contracts/oapp/libs/OptionsBuilder.sol/OptionsBuilder.json +38 -0
  14. package/artifacts/contracts/oft/OFT.sol/OFT.json +1466 -0
  15. package/artifacts/contracts/oft/OFTAdapter.sol/OFTAdapter.json +1204 -0
  16. package/artifacts/contracts/oft/OFTCore.sol/OFTCore.json +1170 -0
  17. package/artifacts/contracts/oft/interfaces/IOFT.sol/IOFT.json +472 -0
  18. package/artifacts/contracts/oft/libs/OFTComposeMsgCodec.sol/OFTComposeMsgCodec.json +10 -0
  19. package/artifacts/contracts/oft/libs/OFTMsgCodec.sol/OFTMsgCodec.json +10 -0
  20. package/artifacts/contracts/precrime/OAppPreCrimeSimulator.sol/OAppPreCrimeSimulator.json +277 -0
  21. package/artifacts/contracts/precrime/PreCrime.sol/PreCrime.json +352 -0
  22. package/artifacts/contracts/precrime/extensions/PreCrimeE1.sol/PreCrimeE1.json +352 -0
  23. package/artifacts/contracts/precrime/interfaces/IOAppPreCrimeSimulator.sol/IOAppPreCrimeSimulator.json +175 -0
  24. package/artifacts/contracts/precrime/interfaces/IPreCrime.sol/IPreCrime.json +188 -0
  25. package/artifacts/contracts/precrime/libs/Packet.sol/PacketDecoder.json +10 -0
  26. package/contracts/oapp/OApp.sol +39 -0
  27. package/contracts/oapp/OAppCore.sol +68 -0
  28. package/contracts/oapp/OAppReceiver.sol +101 -0
  29. package/contracts/oapp/OAppSender.sol +124 -0
  30. package/contracts/oapp/examples/OmniCounter.sol +283 -0
  31. package/contracts/oapp/examples/OmniCounterPreCrime.sol +102 -0
  32. package/contracts/oapp/interfaces/IOAppComposer.sol +12 -0
  33. package/contracts/oapp/interfaces/IOAppCore.sol +51 -0
  34. package/contracts/oapp/interfaces/IOAppMsgInspector.sol +22 -0
  35. package/contracts/oapp/interfaces/IOAppOptionsType3.sol +43 -0
  36. package/contracts/oapp/libs/OAppOptionsType3.sol +82 -0
  37. package/contracts/oapp/libs/OptionsBuilder.sol +200 -0
  38. package/contracts/oft/OFT.sol +116 -0
  39. package/contracts/oft/OFTAdapter.sol +131 -0
  40. package/contracts/oft/OFTCore.sol +456 -0
  41. package/contracts/oft/OFTPrecrime.sol +99 -0
  42. package/contracts/oft/interfaces/IOFT.sol +168 -0
  43. package/contracts/oft/libs/OFTComposeMsgCodec.sol +91 -0
  44. package/contracts/oft/libs/OFTMsgCodec.sol +83 -0
  45. package/contracts/precrime/OAppPreCrimeSimulator.sol +125 -0
  46. package/contracts/precrime/PreCrime.sol +208 -0
  47. package/contracts/precrime/extensions/PreCrimeE1.sol +30 -0
  48. package/contracts/precrime/interfaces/IOAppPreCrimeSimulator.sol +55 -0
  49. package/contracts/precrime/interfaces/IPreCrime.sol +40 -0
  50. package/contracts/precrime/libs/Packet.sol +61 -0
  51. package/package.json +35 -0
@@ -0,0 +1,472 @@
1
+ {
2
+ "_format": "hh-sol-artifact-1",
3
+ "contractName": "IOFT",
4
+ "sourceName": "contracts/oft/interfaces/IOFT.sol",
5
+ "abi": [
6
+ {
7
+ "inputs": [],
8
+ "name": "InvalidLocalDecimals",
9
+ "type": "error"
10
+ },
11
+ {
12
+ "inputs": [
13
+ {
14
+ "internalType": "uint256",
15
+ "name": "amountToCreditLD",
16
+ "type": "uint256"
17
+ },
18
+ {
19
+ "internalType": "uint256",
20
+ "name": "minAmountToCreditLD",
21
+ "type": "uint256"
22
+ }
23
+ ],
24
+ "name": "SlippageExceeded",
25
+ "type": "error"
26
+ },
27
+ {
28
+ "anonymous": false,
29
+ "inputs": [
30
+ {
31
+ "indexed": false,
32
+ "internalType": "address",
33
+ "name": "inspector",
34
+ "type": "address"
35
+ }
36
+ ],
37
+ "name": "MsgInspectorSet",
38
+ "type": "event"
39
+ },
40
+ {
41
+ "anonymous": false,
42
+ "inputs": [
43
+ {
44
+ "indexed": true,
45
+ "internalType": "bytes32",
46
+ "name": "guid",
47
+ "type": "bytes32"
48
+ },
49
+ {
50
+ "indexed": true,
51
+ "internalType": "address",
52
+ "name": "toAddress",
53
+ "type": "address"
54
+ },
55
+ {
56
+ "indexed": false,
57
+ "internalType": "uint256",
58
+ "name": "amountToCreditLD",
59
+ "type": "uint256"
60
+ },
61
+ {
62
+ "indexed": false,
63
+ "internalType": "uint256",
64
+ "name": "amountReceivedLD",
65
+ "type": "uint256"
66
+ }
67
+ ],
68
+ "name": "OFTReceived",
69
+ "type": "event"
70
+ },
71
+ {
72
+ "anonymous": false,
73
+ "inputs": [
74
+ {
75
+ "indexed": true,
76
+ "internalType": "bytes32",
77
+ "name": "guid",
78
+ "type": "bytes32"
79
+ },
80
+ {
81
+ "indexed": true,
82
+ "internalType": "address",
83
+ "name": "fromAddress",
84
+ "type": "address"
85
+ },
86
+ {
87
+ "indexed": false,
88
+ "internalType": "uint256",
89
+ "name": "amountDebitedLD",
90
+ "type": "uint256"
91
+ },
92
+ {
93
+ "indexed": false,
94
+ "internalType": "uint256",
95
+ "name": "amountToCreditLD",
96
+ "type": "uint256"
97
+ },
98
+ {
99
+ "indexed": false,
100
+ "internalType": "bytes",
101
+ "name": "composeMsg",
102
+ "type": "bytes"
103
+ }
104
+ ],
105
+ "name": "OFTSent",
106
+ "type": "event"
107
+ },
108
+ {
109
+ "inputs": [],
110
+ "name": "msgInspector",
111
+ "outputs": [
112
+ {
113
+ "internalType": "address",
114
+ "name": "",
115
+ "type": "address"
116
+ }
117
+ ],
118
+ "stateMutability": "view",
119
+ "type": "function"
120
+ },
121
+ {
122
+ "inputs": [],
123
+ "name": "oftVersion",
124
+ "outputs": [
125
+ {
126
+ "internalType": "uint64",
127
+ "name": "major",
128
+ "type": "uint64"
129
+ },
130
+ {
131
+ "internalType": "uint64",
132
+ "name": "minor",
133
+ "type": "uint64"
134
+ }
135
+ ],
136
+ "stateMutability": "view",
137
+ "type": "function"
138
+ },
139
+ {
140
+ "inputs": [
141
+ {
142
+ "components": [
143
+ {
144
+ "internalType": "uint32",
145
+ "name": "dstEid",
146
+ "type": "uint32"
147
+ },
148
+ {
149
+ "internalType": "bytes32",
150
+ "name": "to",
151
+ "type": "bytes32"
152
+ },
153
+ {
154
+ "internalType": "uint256",
155
+ "name": "amountToSendLD",
156
+ "type": "uint256"
157
+ },
158
+ {
159
+ "internalType": "uint256",
160
+ "name": "minAmountToCreditLD",
161
+ "type": "uint256"
162
+ }
163
+ ],
164
+ "internalType": "struct SendParam",
165
+ "name": "_sendParam",
166
+ "type": "tuple"
167
+ },
168
+ {
169
+ "internalType": "bytes",
170
+ "name": "_oftCmd",
171
+ "type": "bytes"
172
+ }
173
+ ],
174
+ "name": "quoteOFT",
175
+ "outputs": [
176
+ {
177
+ "components": [
178
+ {
179
+ "internalType": "uint256",
180
+ "name": "minAmountLD",
181
+ "type": "uint256"
182
+ },
183
+ {
184
+ "internalType": "uint256",
185
+ "name": "maxAmountLD",
186
+ "type": "uint256"
187
+ }
188
+ ],
189
+ "internalType": "struct OFTLimit",
190
+ "name": "",
191
+ "type": "tuple"
192
+ },
193
+ {
194
+ "components": [
195
+ {
196
+ "internalType": "uint256",
197
+ "name": "feeAmountLD",
198
+ "type": "uint256"
199
+ },
200
+ {
201
+ "internalType": "string",
202
+ "name": "description",
203
+ "type": "string"
204
+ }
205
+ ],
206
+ "internalType": "struct OFTFeeDetail[]",
207
+ "name": "oftFeeDetails",
208
+ "type": "tuple[]"
209
+ },
210
+ {
211
+ "components": [
212
+ {
213
+ "internalType": "uint256",
214
+ "name": "amountDebitLD",
215
+ "type": "uint256"
216
+ },
217
+ {
218
+ "internalType": "uint256",
219
+ "name": "amountCreditLD",
220
+ "type": "uint256"
221
+ }
222
+ ],
223
+ "internalType": "struct OFTReceipt",
224
+ "name": "",
225
+ "type": "tuple"
226
+ }
227
+ ],
228
+ "stateMutability": "view",
229
+ "type": "function"
230
+ },
231
+ {
232
+ "inputs": [
233
+ {
234
+ "components": [
235
+ {
236
+ "internalType": "uint32",
237
+ "name": "dstEid",
238
+ "type": "uint32"
239
+ },
240
+ {
241
+ "internalType": "bytes32",
242
+ "name": "to",
243
+ "type": "bytes32"
244
+ },
245
+ {
246
+ "internalType": "uint256",
247
+ "name": "amountToSendLD",
248
+ "type": "uint256"
249
+ },
250
+ {
251
+ "internalType": "uint256",
252
+ "name": "minAmountToCreditLD",
253
+ "type": "uint256"
254
+ }
255
+ ],
256
+ "internalType": "struct SendParam",
257
+ "name": "_sendParam",
258
+ "type": "tuple"
259
+ },
260
+ {
261
+ "internalType": "bytes",
262
+ "name": "_extraOptions",
263
+ "type": "bytes"
264
+ },
265
+ {
266
+ "internalType": "bool",
267
+ "name": "_payInLzToken",
268
+ "type": "bool"
269
+ },
270
+ {
271
+ "internalType": "bytes",
272
+ "name": "_composeMsg",
273
+ "type": "bytes"
274
+ },
275
+ {
276
+ "internalType": "bytes",
277
+ "name": "_oftCmd",
278
+ "type": "bytes"
279
+ }
280
+ ],
281
+ "name": "quoteSend",
282
+ "outputs": [
283
+ {
284
+ "components": [
285
+ {
286
+ "internalType": "uint256",
287
+ "name": "nativeFee",
288
+ "type": "uint256"
289
+ },
290
+ {
291
+ "internalType": "uint256",
292
+ "name": "lzTokenFee",
293
+ "type": "uint256"
294
+ }
295
+ ],
296
+ "internalType": "struct MessagingFee",
297
+ "name": "",
298
+ "type": "tuple"
299
+ }
300
+ ],
301
+ "stateMutability": "view",
302
+ "type": "function"
303
+ },
304
+ {
305
+ "inputs": [
306
+ {
307
+ "components": [
308
+ {
309
+ "internalType": "uint32",
310
+ "name": "dstEid",
311
+ "type": "uint32"
312
+ },
313
+ {
314
+ "internalType": "bytes32",
315
+ "name": "to",
316
+ "type": "bytes32"
317
+ },
318
+ {
319
+ "internalType": "uint256",
320
+ "name": "amountToSendLD",
321
+ "type": "uint256"
322
+ },
323
+ {
324
+ "internalType": "uint256",
325
+ "name": "minAmountToCreditLD",
326
+ "type": "uint256"
327
+ }
328
+ ],
329
+ "internalType": "struct SendParam",
330
+ "name": "_sendParam",
331
+ "type": "tuple"
332
+ },
333
+ {
334
+ "internalType": "bytes",
335
+ "name": "_extraOptions",
336
+ "type": "bytes"
337
+ },
338
+ {
339
+ "components": [
340
+ {
341
+ "internalType": "uint256",
342
+ "name": "nativeFee",
343
+ "type": "uint256"
344
+ },
345
+ {
346
+ "internalType": "uint256",
347
+ "name": "lzTokenFee",
348
+ "type": "uint256"
349
+ }
350
+ ],
351
+ "internalType": "struct MessagingFee",
352
+ "name": "_fee",
353
+ "type": "tuple"
354
+ },
355
+ {
356
+ "internalType": "address",
357
+ "name": "_refundAddress",
358
+ "type": "address"
359
+ },
360
+ {
361
+ "internalType": "bytes",
362
+ "name": "_composeMsg",
363
+ "type": "bytes"
364
+ },
365
+ {
366
+ "internalType": "bytes",
367
+ "name": "_oftCmd",
368
+ "type": "bytes"
369
+ }
370
+ ],
371
+ "name": "send",
372
+ "outputs": [
373
+ {
374
+ "components": [
375
+ {
376
+ "internalType": "bytes32",
377
+ "name": "guid",
378
+ "type": "bytes32"
379
+ },
380
+ {
381
+ "internalType": "uint64",
382
+ "name": "nonce",
383
+ "type": "uint64"
384
+ },
385
+ {
386
+ "components": [
387
+ {
388
+ "internalType": "uint256",
389
+ "name": "nativeFee",
390
+ "type": "uint256"
391
+ },
392
+ {
393
+ "internalType": "uint256",
394
+ "name": "lzTokenFee",
395
+ "type": "uint256"
396
+ }
397
+ ],
398
+ "internalType": "struct MessagingFee",
399
+ "name": "fee",
400
+ "type": "tuple"
401
+ }
402
+ ],
403
+ "internalType": "struct MessagingReceipt",
404
+ "name": "",
405
+ "type": "tuple"
406
+ },
407
+ {
408
+ "components": [
409
+ {
410
+ "internalType": "uint256",
411
+ "name": "amountDebitLD",
412
+ "type": "uint256"
413
+ },
414
+ {
415
+ "internalType": "uint256",
416
+ "name": "amountCreditLD",
417
+ "type": "uint256"
418
+ }
419
+ ],
420
+ "internalType": "struct OFTReceipt",
421
+ "name": "",
422
+ "type": "tuple"
423
+ }
424
+ ],
425
+ "stateMutability": "payable",
426
+ "type": "function"
427
+ },
428
+ {
429
+ "inputs": [
430
+ {
431
+ "internalType": "address",
432
+ "name": "_msgInspector",
433
+ "type": "address"
434
+ }
435
+ ],
436
+ "name": "setMsgInspector",
437
+ "outputs": [],
438
+ "stateMutability": "nonpayable",
439
+ "type": "function"
440
+ },
441
+ {
442
+ "inputs": [],
443
+ "name": "sharedDecimals",
444
+ "outputs": [
445
+ {
446
+ "internalType": "uint8",
447
+ "name": "",
448
+ "type": "uint8"
449
+ }
450
+ ],
451
+ "stateMutability": "view",
452
+ "type": "function"
453
+ },
454
+ {
455
+ "inputs": [],
456
+ "name": "token",
457
+ "outputs": [
458
+ {
459
+ "internalType": "address",
460
+ "name": "",
461
+ "type": "address"
462
+ }
463
+ ],
464
+ "stateMutability": "view",
465
+ "type": "function"
466
+ }
467
+ ],
468
+ "bytecode": "0x",
469
+ "deployedBytecode": "0x",
470
+ "linkReferences": {},
471
+ "deployedLinkReferences": {}
472
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "_format": "hh-sol-artifact-1",
3
+ "contractName": "OFTComposeMsgCodec",
4
+ "sourceName": "contracts/oft/libs/OFTComposeMsgCodec.sol",
5
+ "abi": [],
6
+ "bytecode": "0x60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220dc23dbf428bae1069f2bf58195b78c235349382fa20020b0b97e7cf3e0693acd64736f6c63430008160033",
7
+ "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220dc23dbf428bae1069f2bf58195b78c235349382fa20020b0b97e7cf3e0693acd64736f6c63430008160033",
8
+ "linkReferences": {},
9
+ "deployedLinkReferences": {}
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "_format": "hh-sol-artifact-1",
3
+ "contractName": "OFTMsgCodec",
4
+ "sourceName": "contracts/oft/libs/OFTMsgCodec.sol",
5
+ "abi": [],
6
+ "bytecode": "0x60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220f1f84dd56c556fbc9a380b21c6778570460be192f4e29414a149bc1578fc741c64736f6c63430008160033",
7
+ "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220f1f84dd56c556fbc9a380b21c6778570460be192f4e29414a149bc1578fc741c64736f6c63430008160033",
8
+ "linkReferences": {},
9
+ "deployedLinkReferences": {}
10
+ }