@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,352 @@
1
+ {
2
+ "_format": "hh-sol-artifact-1",
3
+ "contractName": "PreCrimeE1",
4
+ "sourceName": "contracts/precrime/extensions/PreCrimeE1.sol",
5
+ "abi": [
6
+ {
7
+ "inputs": [
8
+ {
9
+ "internalType": "bytes",
10
+ "name": "crime",
11
+ "type": "bytes"
12
+ }
13
+ ],
14
+ "name": "CrimeFound",
15
+ "type": "error"
16
+ },
17
+ {
18
+ "inputs": [
19
+ {
20
+ "internalType": "uint32",
21
+ "name": "eid",
22
+ "type": "uint32"
23
+ },
24
+ {
25
+ "internalType": "bytes",
26
+ "name": "reason",
27
+ "type": "bytes"
28
+ }
29
+ ],
30
+ "name": "InvalidSimulationResult",
31
+ "type": "error"
32
+ },
33
+ {
34
+ "inputs": [],
35
+ "name": "OnlyOffChain",
36
+ "type": "error"
37
+ },
38
+ {
39
+ "inputs": [
40
+ {
41
+ "internalType": "uint256",
42
+ "name": "max",
43
+ "type": "uint256"
44
+ },
45
+ {
46
+ "internalType": "uint256",
47
+ "name": "actual",
48
+ "type": "uint256"
49
+ }
50
+ ],
51
+ "name": "PacketOversize",
52
+ "type": "error"
53
+ },
54
+ {
55
+ "inputs": [],
56
+ "name": "PacketUnsorted",
57
+ "type": "error"
58
+ },
59
+ {
60
+ "inputs": [
61
+ {
62
+ "internalType": "bytes",
63
+ "name": "reason",
64
+ "type": "bytes"
65
+ }
66
+ ],
67
+ "name": "SimulationFailed",
68
+ "type": "error"
69
+ },
70
+ {
71
+ "inputs": [
72
+ {
73
+ "internalType": "uint32",
74
+ "name": "eid",
75
+ "type": "uint32"
76
+ }
77
+ ],
78
+ "name": "SimulationResultNotFound",
79
+ "type": "error"
80
+ },
81
+ {
82
+ "anonymous": false,
83
+ "inputs": [
84
+ {
85
+ "indexed": true,
86
+ "internalType": "address",
87
+ "name": "previousOwner",
88
+ "type": "address"
89
+ },
90
+ {
91
+ "indexed": true,
92
+ "internalType": "address",
93
+ "name": "newOwner",
94
+ "type": "address"
95
+ }
96
+ ],
97
+ "name": "OwnershipTransferred",
98
+ "type": "event"
99
+ },
100
+ {
101
+ "inputs": [],
102
+ "name": "buildSimulationResult",
103
+ "outputs": [
104
+ {
105
+ "internalType": "bytes",
106
+ "name": "",
107
+ "type": "bytes"
108
+ }
109
+ ],
110
+ "stateMutability": "view",
111
+ "type": "function"
112
+ },
113
+ {
114
+ "inputs": [
115
+ {
116
+ "internalType": "bytes[]",
117
+ "name": "_packets",
118
+ "type": "bytes[]"
119
+ },
120
+ {
121
+ "internalType": "uint256[]",
122
+ "name": "_packetMsgValues",
123
+ "type": "uint256[]"
124
+ }
125
+ ],
126
+ "name": "getConfig",
127
+ "outputs": [
128
+ {
129
+ "internalType": "bytes",
130
+ "name": "",
131
+ "type": "bytes"
132
+ }
133
+ ],
134
+ "stateMutability": "nonpayable",
135
+ "type": "function"
136
+ },
137
+ {
138
+ "inputs": [],
139
+ "name": "getPreCrimePeers",
140
+ "outputs": [
141
+ {
142
+ "components": [
143
+ {
144
+ "internalType": "uint32",
145
+ "name": "eid",
146
+ "type": "uint32"
147
+ },
148
+ {
149
+ "internalType": "bytes32",
150
+ "name": "preCrime",
151
+ "type": "bytes32"
152
+ },
153
+ {
154
+ "internalType": "bytes32",
155
+ "name": "oApp",
156
+ "type": "bytes32"
157
+ }
158
+ ],
159
+ "internalType": "struct PreCrimePeer[]",
160
+ "name": "",
161
+ "type": "tuple[]"
162
+ }
163
+ ],
164
+ "stateMutability": "view",
165
+ "type": "function"
166
+ },
167
+ {
168
+ "inputs": [],
169
+ "name": "maxBatchSize",
170
+ "outputs": [
171
+ {
172
+ "internalType": "uint64",
173
+ "name": "",
174
+ "type": "uint64"
175
+ }
176
+ ],
177
+ "stateMutability": "view",
178
+ "type": "function"
179
+ },
180
+ {
181
+ "inputs": [],
182
+ "name": "oApp",
183
+ "outputs": [
184
+ {
185
+ "internalType": "address",
186
+ "name": "",
187
+ "type": "address"
188
+ }
189
+ ],
190
+ "stateMutability": "view",
191
+ "type": "function"
192
+ },
193
+ {
194
+ "inputs": [],
195
+ "name": "owner",
196
+ "outputs": [
197
+ {
198
+ "internalType": "address",
199
+ "name": "",
200
+ "type": "address"
201
+ }
202
+ ],
203
+ "stateMutability": "view",
204
+ "type": "function"
205
+ },
206
+ {
207
+ "inputs": [
208
+ {
209
+ "internalType": "bytes[]",
210
+ "name": "_packets",
211
+ "type": "bytes[]"
212
+ },
213
+ {
214
+ "internalType": "uint256[]",
215
+ "name": "_packetMsgValues",
216
+ "type": "uint256[]"
217
+ },
218
+ {
219
+ "internalType": "bytes[]",
220
+ "name": "_simulations",
221
+ "type": "bytes[]"
222
+ }
223
+ ],
224
+ "name": "preCrime",
225
+ "outputs": [],
226
+ "stateMutability": "nonpayable",
227
+ "type": "function"
228
+ },
229
+ {
230
+ "inputs": [],
231
+ "name": "renounceOwnership",
232
+ "outputs": [],
233
+ "stateMutability": "nonpayable",
234
+ "type": "function"
235
+ },
236
+ {
237
+ "inputs": [
238
+ {
239
+ "internalType": "uint64",
240
+ "name": "_maxBatchSize",
241
+ "type": "uint64"
242
+ }
243
+ ],
244
+ "name": "setMaxBatchSize",
245
+ "outputs": [],
246
+ "stateMutability": "nonpayable",
247
+ "type": "function"
248
+ },
249
+ {
250
+ "inputs": [
251
+ {
252
+ "components": [
253
+ {
254
+ "internalType": "uint32",
255
+ "name": "eid",
256
+ "type": "uint32"
257
+ },
258
+ {
259
+ "internalType": "bytes32",
260
+ "name": "preCrime",
261
+ "type": "bytes32"
262
+ },
263
+ {
264
+ "internalType": "bytes32",
265
+ "name": "oApp",
266
+ "type": "bytes32"
267
+ }
268
+ ],
269
+ "internalType": "struct PreCrimePeer[]",
270
+ "name": "_preCrimePeers",
271
+ "type": "tuple[]"
272
+ }
273
+ ],
274
+ "name": "setPreCrimePeers",
275
+ "outputs": [],
276
+ "stateMutability": "nonpayable",
277
+ "type": "function"
278
+ },
279
+ {
280
+ "inputs": [
281
+ {
282
+ "internalType": "bytes[]",
283
+ "name": "_packets",
284
+ "type": "bytes[]"
285
+ },
286
+ {
287
+ "internalType": "uint256[]",
288
+ "name": "_packetMsgValues",
289
+ "type": "uint256[]"
290
+ }
291
+ ],
292
+ "name": "simulate",
293
+ "outputs": [
294
+ {
295
+ "internalType": "bytes",
296
+ "name": "",
297
+ "type": "bytes"
298
+ }
299
+ ],
300
+ "stateMutability": "payable",
301
+ "type": "function"
302
+ },
303
+ {
304
+ "inputs": [],
305
+ "name": "simulator",
306
+ "outputs": [
307
+ {
308
+ "internalType": "address",
309
+ "name": "",
310
+ "type": "address"
311
+ }
312
+ ],
313
+ "stateMutability": "view",
314
+ "type": "function"
315
+ },
316
+ {
317
+ "inputs": [
318
+ {
319
+ "internalType": "address",
320
+ "name": "newOwner",
321
+ "type": "address"
322
+ }
323
+ ],
324
+ "name": "transferOwnership",
325
+ "outputs": [],
326
+ "stateMutability": "nonpayable",
327
+ "type": "function"
328
+ },
329
+ {
330
+ "inputs": [],
331
+ "name": "version",
332
+ "outputs": [
333
+ {
334
+ "internalType": "uint64",
335
+ "name": "major",
336
+ "type": "uint64"
337
+ },
338
+ {
339
+ "internalType": "uint8",
340
+ "name": "minor",
341
+ "type": "uint8"
342
+ }
343
+ ],
344
+ "stateMutability": "pure",
345
+ "type": "function"
346
+ }
347
+ ],
348
+ "bytecode": "0x",
349
+ "deployedBytecode": "0x",
350
+ "linkReferences": {},
351
+ "deployedLinkReferences": {}
352
+ }
@@ -0,0 +1,175 @@
1
+ {
2
+ "_format": "hh-sol-artifact-1",
3
+ "contractName": "IOAppPreCrimeSimulator",
4
+ "sourceName": "contracts/precrime/interfaces/IOAppPreCrimeSimulator.sol",
5
+ "abi": [
6
+ {
7
+ "inputs": [],
8
+ "name": "OnlySelf",
9
+ "type": "error"
10
+ },
11
+ {
12
+ "inputs": [
13
+ {
14
+ "internalType": "bytes",
15
+ "name": "result",
16
+ "type": "bytes"
17
+ }
18
+ ],
19
+ "name": "SimulationResult",
20
+ "type": "error"
21
+ },
22
+ {
23
+ "anonymous": false,
24
+ "inputs": [
25
+ {
26
+ "indexed": false,
27
+ "internalType": "address",
28
+ "name": "preCrimeAddress",
29
+ "type": "address"
30
+ }
31
+ ],
32
+ "name": "PreCrimeSet",
33
+ "type": "event"
34
+ },
35
+ {
36
+ "inputs": [
37
+ {
38
+ "internalType": "uint32",
39
+ "name": "_eid",
40
+ "type": "uint32"
41
+ },
42
+ {
43
+ "internalType": "bytes32",
44
+ "name": "_peer",
45
+ "type": "bytes32"
46
+ }
47
+ ],
48
+ "name": "isPeer",
49
+ "outputs": [
50
+ {
51
+ "internalType": "bool",
52
+ "name": "",
53
+ "type": "bool"
54
+ }
55
+ ],
56
+ "stateMutability": "view",
57
+ "type": "function"
58
+ },
59
+ {
60
+ "inputs": [
61
+ {
62
+ "components": [
63
+ {
64
+ "components": [
65
+ {
66
+ "internalType": "uint32",
67
+ "name": "srcEid",
68
+ "type": "uint32"
69
+ },
70
+ {
71
+ "internalType": "bytes32",
72
+ "name": "sender",
73
+ "type": "bytes32"
74
+ },
75
+ {
76
+ "internalType": "uint64",
77
+ "name": "nonce",
78
+ "type": "uint64"
79
+ }
80
+ ],
81
+ "internalType": "struct Origin",
82
+ "name": "origin",
83
+ "type": "tuple"
84
+ },
85
+ {
86
+ "internalType": "uint32",
87
+ "name": "dstEid",
88
+ "type": "uint32"
89
+ },
90
+ {
91
+ "internalType": "address",
92
+ "name": "receiver",
93
+ "type": "address"
94
+ },
95
+ {
96
+ "internalType": "bytes32",
97
+ "name": "guid",
98
+ "type": "bytes32"
99
+ },
100
+ {
101
+ "internalType": "uint256",
102
+ "name": "value",
103
+ "type": "uint256"
104
+ },
105
+ {
106
+ "internalType": "address",
107
+ "name": "executor",
108
+ "type": "address"
109
+ },
110
+ {
111
+ "internalType": "bytes",
112
+ "name": "message",
113
+ "type": "bytes"
114
+ },
115
+ {
116
+ "internalType": "bytes",
117
+ "name": "extraData",
118
+ "type": "bytes"
119
+ }
120
+ ],
121
+ "internalType": "struct InboundPacket[]",
122
+ "name": "_packets",
123
+ "type": "tuple[]"
124
+ }
125
+ ],
126
+ "name": "lzReceiveAndRevert",
127
+ "outputs": [],
128
+ "stateMutability": "payable",
129
+ "type": "function"
130
+ },
131
+ {
132
+ "inputs": [],
133
+ "name": "oApp",
134
+ "outputs": [
135
+ {
136
+ "internalType": "address",
137
+ "name": "",
138
+ "type": "address"
139
+ }
140
+ ],
141
+ "stateMutability": "view",
142
+ "type": "function"
143
+ },
144
+ {
145
+ "inputs": [],
146
+ "name": "preCrime",
147
+ "outputs": [
148
+ {
149
+ "internalType": "address",
150
+ "name": "",
151
+ "type": "address"
152
+ }
153
+ ],
154
+ "stateMutability": "view",
155
+ "type": "function"
156
+ },
157
+ {
158
+ "inputs": [
159
+ {
160
+ "internalType": "address",
161
+ "name": "_preCrime",
162
+ "type": "address"
163
+ }
164
+ ],
165
+ "name": "setPreCrime",
166
+ "outputs": [],
167
+ "stateMutability": "nonpayable",
168
+ "type": "function"
169
+ }
170
+ ],
171
+ "bytecode": "0x",
172
+ "deployedBytecode": "0x",
173
+ "linkReferences": {},
174
+ "deployedLinkReferences": {}
175
+ }
@@ -0,0 +1,188 @@
1
+ {
2
+ "_format": "hh-sol-artifact-1",
3
+ "contractName": "IPreCrime",
4
+ "sourceName": "contracts/precrime/interfaces/IPreCrime.sol",
5
+ "abi": [
6
+ {
7
+ "inputs": [
8
+ {
9
+ "internalType": "bytes",
10
+ "name": "crime",
11
+ "type": "bytes"
12
+ }
13
+ ],
14
+ "name": "CrimeFound",
15
+ "type": "error"
16
+ },
17
+ {
18
+ "inputs": [
19
+ {
20
+ "internalType": "uint32",
21
+ "name": "eid",
22
+ "type": "uint32"
23
+ },
24
+ {
25
+ "internalType": "bytes",
26
+ "name": "reason",
27
+ "type": "bytes"
28
+ }
29
+ ],
30
+ "name": "InvalidSimulationResult",
31
+ "type": "error"
32
+ },
33
+ {
34
+ "inputs": [],
35
+ "name": "OnlyOffChain",
36
+ "type": "error"
37
+ },
38
+ {
39
+ "inputs": [
40
+ {
41
+ "internalType": "uint256",
42
+ "name": "max",
43
+ "type": "uint256"
44
+ },
45
+ {
46
+ "internalType": "uint256",
47
+ "name": "actual",
48
+ "type": "uint256"
49
+ }
50
+ ],
51
+ "name": "PacketOversize",
52
+ "type": "error"
53
+ },
54
+ {
55
+ "inputs": [],
56
+ "name": "PacketUnsorted",
57
+ "type": "error"
58
+ },
59
+ {
60
+ "inputs": [
61
+ {
62
+ "internalType": "bytes",
63
+ "name": "reason",
64
+ "type": "bytes"
65
+ }
66
+ ],
67
+ "name": "SimulationFailed",
68
+ "type": "error"
69
+ },
70
+ {
71
+ "inputs": [
72
+ {
73
+ "internalType": "uint32",
74
+ "name": "eid",
75
+ "type": "uint32"
76
+ }
77
+ ],
78
+ "name": "SimulationResultNotFound",
79
+ "type": "error"
80
+ },
81
+ {
82
+ "inputs": [],
83
+ "name": "buildSimulationResult",
84
+ "outputs": [
85
+ {
86
+ "internalType": "bytes",
87
+ "name": "",
88
+ "type": "bytes"
89
+ }
90
+ ],
91
+ "stateMutability": "view",
92
+ "type": "function"
93
+ },
94
+ {
95
+ "inputs": [
96
+ {
97
+ "internalType": "bytes[]",
98
+ "name": "_packets",
99
+ "type": "bytes[]"
100
+ },
101
+ {
102
+ "internalType": "uint256[]",
103
+ "name": "_packetMsgValues",
104
+ "type": "uint256[]"
105
+ }
106
+ ],
107
+ "name": "getConfig",
108
+ "outputs": [
109
+ {
110
+ "internalType": "bytes",
111
+ "name": "",
112
+ "type": "bytes"
113
+ }
114
+ ],
115
+ "stateMutability": "nonpayable",
116
+ "type": "function"
117
+ },
118
+ {
119
+ "inputs": [
120
+ {
121
+ "internalType": "bytes[]",
122
+ "name": "_packets",
123
+ "type": "bytes[]"
124
+ },
125
+ {
126
+ "internalType": "uint256[]",
127
+ "name": "_packetMsgValues",
128
+ "type": "uint256[]"
129
+ },
130
+ {
131
+ "internalType": "bytes[]",
132
+ "name": "_simulations",
133
+ "type": "bytes[]"
134
+ }
135
+ ],
136
+ "name": "preCrime",
137
+ "outputs": [],
138
+ "stateMutability": "nonpayable",
139
+ "type": "function"
140
+ },
141
+ {
142
+ "inputs": [
143
+ {
144
+ "internalType": "bytes[]",
145
+ "name": "_packets",
146
+ "type": "bytes[]"
147
+ },
148
+ {
149
+ "internalType": "uint256[]",
150
+ "name": "_packetMsgValues",
151
+ "type": "uint256[]"
152
+ }
153
+ ],
154
+ "name": "simulate",
155
+ "outputs": [
156
+ {
157
+ "internalType": "bytes",
158
+ "name": "",
159
+ "type": "bytes"
160
+ }
161
+ ],
162
+ "stateMutability": "payable",
163
+ "type": "function"
164
+ },
165
+ {
166
+ "inputs": [],
167
+ "name": "version",
168
+ "outputs": [
169
+ {
170
+ "internalType": "uint64",
171
+ "name": "major",
172
+ "type": "uint64"
173
+ },
174
+ {
175
+ "internalType": "uint8",
176
+ "name": "minor",
177
+ "type": "uint8"
178
+ }
179
+ ],
180
+ "stateMutability": "view",
181
+ "type": "function"
182
+ }
183
+ ],
184
+ "bytecode": "0x",
185
+ "deployedBytecode": "0x",
186
+ "linkReferences": {},
187
+ "deployedLinkReferences": {}
188
+ }