@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,316 @@
1
+ {
2
+ "_format": "hh-sol-artifact-1",
3
+ "contractName": "OAppReceiver",
4
+ "sourceName": "contracts/oapp/OAppReceiver.sol",
5
+ "abi": [
6
+ {
7
+ "inputs": [],
8
+ "name": "InvalidEndpointCall",
9
+ "type": "error"
10
+ },
11
+ {
12
+ "inputs": [
13
+ {
14
+ "internalType": "uint32",
15
+ "name": "eid",
16
+ "type": "uint32"
17
+ }
18
+ ],
19
+ "name": "NoPeer",
20
+ "type": "error"
21
+ },
22
+ {
23
+ "inputs": [
24
+ {
25
+ "internalType": "address",
26
+ "name": "addr",
27
+ "type": "address"
28
+ }
29
+ ],
30
+ "name": "OnlyEndpoint",
31
+ "type": "error"
32
+ },
33
+ {
34
+ "inputs": [
35
+ {
36
+ "internalType": "uint32",
37
+ "name": "eid",
38
+ "type": "uint32"
39
+ },
40
+ {
41
+ "internalType": "bytes32",
42
+ "name": "sender",
43
+ "type": "bytes32"
44
+ }
45
+ ],
46
+ "name": "OnlyPeer",
47
+ "type": "error"
48
+ },
49
+ {
50
+ "anonymous": false,
51
+ "inputs": [
52
+ {
53
+ "indexed": true,
54
+ "internalType": "address",
55
+ "name": "previousOwner",
56
+ "type": "address"
57
+ },
58
+ {
59
+ "indexed": true,
60
+ "internalType": "address",
61
+ "name": "newOwner",
62
+ "type": "address"
63
+ }
64
+ ],
65
+ "name": "OwnershipTransferred",
66
+ "type": "event"
67
+ },
68
+ {
69
+ "anonymous": false,
70
+ "inputs": [
71
+ {
72
+ "indexed": false,
73
+ "internalType": "uint32",
74
+ "name": "eid",
75
+ "type": "uint32"
76
+ },
77
+ {
78
+ "indexed": false,
79
+ "internalType": "bytes32",
80
+ "name": "peer",
81
+ "type": "bytes32"
82
+ }
83
+ ],
84
+ "name": "PeerSet",
85
+ "type": "event"
86
+ },
87
+ {
88
+ "inputs": [
89
+ {
90
+ "components": [
91
+ {
92
+ "internalType": "uint32",
93
+ "name": "srcEid",
94
+ "type": "uint32"
95
+ },
96
+ {
97
+ "internalType": "bytes32",
98
+ "name": "sender",
99
+ "type": "bytes32"
100
+ },
101
+ {
102
+ "internalType": "uint64",
103
+ "name": "nonce",
104
+ "type": "uint64"
105
+ }
106
+ ],
107
+ "internalType": "struct Origin",
108
+ "name": "origin",
109
+ "type": "tuple"
110
+ }
111
+ ],
112
+ "name": "allowInitializePath",
113
+ "outputs": [
114
+ {
115
+ "internalType": "bool",
116
+ "name": "",
117
+ "type": "bool"
118
+ }
119
+ ],
120
+ "stateMutability": "view",
121
+ "type": "function"
122
+ },
123
+ {
124
+ "inputs": [],
125
+ "name": "endpoint",
126
+ "outputs": [
127
+ {
128
+ "internalType": "contract ILayerZeroEndpointV2",
129
+ "name": "",
130
+ "type": "address"
131
+ }
132
+ ],
133
+ "stateMutability": "view",
134
+ "type": "function"
135
+ },
136
+ {
137
+ "inputs": [
138
+ {
139
+ "components": [
140
+ {
141
+ "internalType": "uint32",
142
+ "name": "srcEid",
143
+ "type": "uint32"
144
+ },
145
+ {
146
+ "internalType": "bytes32",
147
+ "name": "sender",
148
+ "type": "bytes32"
149
+ },
150
+ {
151
+ "internalType": "uint64",
152
+ "name": "nonce",
153
+ "type": "uint64"
154
+ }
155
+ ],
156
+ "internalType": "struct Origin",
157
+ "name": "_origin",
158
+ "type": "tuple"
159
+ },
160
+ {
161
+ "internalType": "bytes32",
162
+ "name": "_guid",
163
+ "type": "bytes32"
164
+ },
165
+ {
166
+ "internalType": "bytes",
167
+ "name": "_message",
168
+ "type": "bytes"
169
+ },
170
+ {
171
+ "internalType": "address",
172
+ "name": "_executor",
173
+ "type": "address"
174
+ },
175
+ {
176
+ "internalType": "bytes",
177
+ "name": "_extraData",
178
+ "type": "bytes"
179
+ }
180
+ ],
181
+ "name": "lzReceive",
182
+ "outputs": [],
183
+ "stateMutability": "payable",
184
+ "type": "function"
185
+ },
186
+ {
187
+ "inputs": [
188
+ {
189
+ "internalType": "uint32",
190
+ "name": "",
191
+ "type": "uint32"
192
+ },
193
+ {
194
+ "internalType": "bytes32",
195
+ "name": "",
196
+ "type": "bytes32"
197
+ }
198
+ ],
199
+ "name": "nextNonce",
200
+ "outputs": [
201
+ {
202
+ "internalType": "uint64",
203
+ "name": "nonce",
204
+ "type": "uint64"
205
+ }
206
+ ],
207
+ "stateMutability": "view",
208
+ "type": "function"
209
+ },
210
+ {
211
+ "inputs": [],
212
+ "name": "oAppVersion",
213
+ "outputs": [
214
+ {
215
+ "internalType": "uint64",
216
+ "name": "senderVersion",
217
+ "type": "uint64"
218
+ },
219
+ {
220
+ "internalType": "uint64",
221
+ "name": "receiverVersion",
222
+ "type": "uint64"
223
+ }
224
+ ],
225
+ "stateMutability": "view",
226
+ "type": "function"
227
+ },
228
+ {
229
+ "inputs": [],
230
+ "name": "owner",
231
+ "outputs": [
232
+ {
233
+ "internalType": "address",
234
+ "name": "",
235
+ "type": "address"
236
+ }
237
+ ],
238
+ "stateMutability": "view",
239
+ "type": "function"
240
+ },
241
+ {
242
+ "inputs": [
243
+ {
244
+ "internalType": "uint32",
245
+ "name": "eid",
246
+ "type": "uint32"
247
+ }
248
+ ],
249
+ "name": "peers",
250
+ "outputs": [
251
+ {
252
+ "internalType": "bytes32",
253
+ "name": "peer",
254
+ "type": "bytes32"
255
+ }
256
+ ],
257
+ "stateMutability": "view",
258
+ "type": "function"
259
+ },
260
+ {
261
+ "inputs": [],
262
+ "name": "renounceOwnership",
263
+ "outputs": [],
264
+ "stateMutability": "nonpayable",
265
+ "type": "function"
266
+ },
267
+ {
268
+ "inputs": [
269
+ {
270
+ "internalType": "address",
271
+ "name": "_delegate",
272
+ "type": "address"
273
+ }
274
+ ],
275
+ "name": "setDelegate",
276
+ "outputs": [],
277
+ "stateMutability": "nonpayable",
278
+ "type": "function"
279
+ },
280
+ {
281
+ "inputs": [
282
+ {
283
+ "internalType": "uint32",
284
+ "name": "_eid",
285
+ "type": "uint32"
286
+ },
287
+ {
288
+ "internalType": "bytes32",
289
+ "name": "_peer",
290
+ "type": "bytes32"
291
+ }
292
+ ],
293
+ "name": "setPeer",
294
+ "outputs": [],
295
+ "stateMutability": "nonpayable",
296
+ "type": "function"
297
+ },
298
+ {
299
+ "inputs": [
300
+ {
301
+ "internalType": "address",
302
+ "name": "newOwner",
303
+ "type": "address"
304
+ }
305
+ ],
306
+ "name": "transferOwnership",
307
+ "outputs": [],
308
+ "stateMutability": "nonpayable",
309
+ "type": "function"
310
+ }
311
+ ],
312
+ "bytecode": "0x",
313
+ "deployedBytecode": "0x",
314
+ "linkReferences": {},
315
+ "deployedLinkReferences": {}
316
+ }
@@ -0,0 +1,211 @@
1
+ {
2
+ "_format": "hh-sol-artifact-1",
3
+ "contractName": "OAppSender",
4
+ "sourceName": "contracts/oapp/OAppSender.sol",
5
+ "abi": [
6
+ {
7
+ "inputs": [],
8
+ "name": "InvalidEndpointCall",
9
+ "type": "error"
10
+ },
11
+ {
12
+ "inputs": [],
13
+ "name": "LzTokenUnavailable",
14
+ "type": "error"
15
+ },
16
+ {
17
+ "inputs": [
18
+ {
19
+ "internalType": "uint32",
20
+ "name": "eid",
21
+ "type": "uint32"
22
+ }
23
+ ],
24
+ "name": "NoPeer",
25
+ "type": "error"
26
+ },
27
+ {
28
+ "inputs": [
29
+ {
30
+ "internalType": "uint256",
31
+ "name": "msgValue",
32
+ "type": "uint256"
33
+ }
34
+ ],
35
+ "name": "NotEnoughNative",
36
+ "type": "error"
37
+ },
38
+ {
39
+ "inputs": [
40
+ {
41
+ "internalType": "uint32",
42
+ "name": "eid",
43
+ "type": "uint32"
44
+ },
45
+ {
46
+ "internalType": "bytes32",
47
+ "name": "sender",
48
+ "type": "bytes32"
49
+ }
50
+ ],
51
+ "name": "OnlyPeer",
52
+ "type": "error"
53
+ },
54
+ {
55
+ "anonymous": false,
56
+ "inputs": [
57
+ {
58
+ "indexed": true,
59
+ "internalType": "address",
60
+ "name": "previousOwner",
61
+ "type": "address"
62
+ },
63
+ {
64
+ "indexed": true,
65
+ "internalType": "address",
66
+ "name": "newOwner",
67
+ "type": "address"
68
+ }
69
+ ],
70
+ "name": "OwnershipTransferred",
71
+ "type": "event"
72
+ },
73
+ {
74
+ "anonymous": false,
75
+ "inputs": [
76
+ {
77
+ "indexed": false,
78
+ "internalType": "uint32",
79
+ "name": "eid",
80
+ "type": "uint32"
81
+ },
82
+ {
83
+ "indexed": false,
84
+ "internalType": "bytes32",
85
+ "name": "peer",
86
+ "type": "bytes32"
87
+ }
88
+ ],
89
+ "name": "PeerSet",
90
+ "type": "event"
91
+ },
92
+ {
93
+ "inputs": [],
94
+ "name": "endpoint",
95
+ "outputs": [
96
+ {
97
+ "internalType": "contract ILayerZeroEndpointV2",
98
+ "name": "",
99
+ "type": "address"
100
+ }
101
+ ],
102
+ "stateMutability": "view",
103
+ "type": "function"
104
+ },
105
+ {
106
+ "inputs": [],
107
+ "name": "oAppVersion",
108
+ "outputs": [
109
+ {
110
+ "internalType": "uint64",
111
+ "name": "senderVersion",
112
+ "type": "uint64"
113
+ },
114
+ {
115
+ "internalType": "uint64",
116
+ "name": "receiverVersion",
117
+ "type": "uint64"
118
+ }
119
+ ],
120
+ "stateMutability": "view",
121
+ "type": "function"
122
+ },
123
+ {
124
+ "inputs": [],
125
+ "name": "owner",
126
+ "outputs": [
127
+ {
128
+ "internalType": "address",
129
+ "name": "",
130
+ "type": "address"
131
+ }
132
+ ],
133
+ "stateMutability": "view",
134
+ "type": "function"
135
+ },
136
+ {
137
+ "inputs": [
138
+ {
139
+ "internalType": "uint32",
140
+ "name": "eid",
141
+ "type": "uint32"
142
+ }
143
+ ],
144
+ "name": "peers",
145
+ "outputs": [
146
+ {
147
+ "internalType": "bytes32",
148
+ "name": "peer",
149
+ "type": "bytes32"
150
+ }
151
+ ],
152
+ "stateMutability": "view",
153
+ "type": "function"
154
+ },
155
+ {
156
+ "inputs": [],
157
+ "name": "renounceOwnership",
158
+ "outputs": [],
159
+ "stateMutability": "nonpayable",
160
+ "type": "function"
161
+ },
162
+ {
163
+ "inputs": [
164
+ {
165
+ "internalType": "address",
166
+ "name": "_delegate",
167
+ "type": "address"
168
+ }
169
+ ],
170
+ "name": "setDelegate",
171
+ "outputs": [],
172
+ "stateMutability": "nonpayable",
173
+ "type": "function"
174
+ },
175
+ {
176
+ "inputs": [
177
+ {
178
+ "internalType": "uint32",
179
+ "name": "_eid",
180
+ "type": "uint32"
181
+ },
182
+ {
183
+ "internalType": "bytes32",
184
+ "name": "_peer",
185
+ "type": "bytes32"
186
+ }
187
+ ],
188
+ "name": "setPeer",
189
+ "outputs": [],
190
+ "stateMutability": "nonpayable",
191
+ "type": "function"
192
+ },
193
+ {
194
+ "inputs": [
195
+ {
196
+ "internalType": "address",
197
+ "name": "newOwner",
198
+ "type": "address"
199
+ }
200
+ ],
201
+ "name": "transferOwnership",
202
+ "outputs": [],
203
+ "stateMutability": "nonpayable",
204
+ "type": "function"
205
+ }
206
+ ],
207
+ "bytecode": "0x",
208
+ "deployedBytecode": "0x",
209
+ "linkReferences": {},
210
+ "deployedLinkReferences": {}
211
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "_format": "hh-sol-artifact-1",
3
+ "contractName": "MsgCodec",
4
+ "sourceName": "contracts/oapp/examples/OmniCounter.sol",
5
+ "abi": [],
6
+ "bytecode": "0x60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220532762e4a92be016a18021f95c23248c8f74e98428e46a99430129f241f5b92564736f6c63430008160033",
7
+ "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220532762e4a92be016a18021f95c23248c8f74e98428e46a99430129f241f5b92564736f6c63430008160033",
8
+ "linkReferences": {},
9
+ "deployedLinkReferences": {}
10
+ }