@layerzerolabs/layerzero-v2-ton 3.0.27 → 3.0.28
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/CHANGELOG.md +6 -0
- package/build/ActionsSerde.test.compiled.json +1 -0
- package/build/AllStorages.compiled.json +1 -1
- package/build/AllStorages.test.compiled.json +1 -1
- package/build/BaseContract.test.compiled.json +1 -1
- package/build/Channel.compiled.json +1 -1
- package/build/Channel.permissions.test.compiled.json +1 -1
- package/build/ChannelBurn.test.compiled.json +1 -1
- package/build/ChannelCommitPacket.test.compiled.json +1 -1
- package/build/ChannelConfig.test.compiled.json +1 -1
- package/build/ChannelInitialize.test.compiled.json +1 -1
- package/build/ChannelMsglibIntegration.test.compiled.json +1 -1
- package/build/ChannelMsglibSendCallback.test.compiled.json +1 -1
- package/build/ChannelNilify.test.compiled.json +1 -1
- package/build/ChannelReceive.test.compiled.json +1 -1
- package/build/ChannelReceiveCallback.test.compiled.json +1 -1
- package/build/ChannelReceiveView.test.compiled.json +1 -1
- package/build/ChannelSend.test.compiled.json +1 -1
- package/build/ChannelSerde.test.compiled.json +1 -0
- package/build/Classlib.test.compiled.json +1 -1
- package/build/ComputeDataSizeGas.test.compiled.json +1 -1
- package/build/Connection.compiled.json +1 -1
- package/build/Controller.assertions.test.compiled.json +1 -1
- package/build/Controller.compiled.json +1 -1
- package/build/Controller.permissions.test.compiled.json +1 -1
- package/build/Controller.test.compiled.json +1 -1
- package/build/Counter.compiled.json +1 -1
- package/build/Counter.permissions.test.compiled.json +1 -1
- package/build/Counter.setters.test.compiled.json +1 -1
- package/build/Counter.test.compiled.json +1 -1
- package/build/Dvn.compiled.json +1 -1
- package/build/Dvn.test.compiled.json +1 -1
- package/build/DvnFeeLib.compiled.json +1 -1
- package/build/DvnFeeLibSerde.test.compiled.json +1 -0
- package/build/DvnPermissions.test.compiled.json +1 -1
- package/build/DvnSerde.test.compiled.json +1 -0
- package/build/Endpoint.compiled.json +1 -1
- package/build/Endpoint.permissions.test.compiled.json +1 -1
- package/build/Endpoint.test.compiled.json +1 -1
- package/build/EndpointSerde.test.compiled.json +1 -0
- package/build/EndpointSetEpConfigDefaults.test.compiled.json +1 -1
- package/build/Executor.compiled.json +1 -1
- package/build/Executor.test.compiled.json +1 -1
- package/build/ExecutorFeeLib.compiled.json +1 -1
- package/build/ExecutorFeeLibSerde.test.compiled.json +1 -0
- package/build/ExecutorPermissions.test.compiled.json +1 -1
- package/build/ExecutorSerde.test.compiled.json +1 -0
- package/build/LzClasses.test.compiled.json +1 -1
- package/build/LzClassesSerde.test.compiled.json +1 -0
- package/build/LzUtil.test.compiled.json +1 -1
- package/build/MsgData.test.compiled.json +1 -1
- package/build/MsgDataSerde.test.compiled.json +1 -0
- package/build/MsglibPacketCodec.test.compiled.json +1 -1
- package/build/PipelinedOutOfOrder.test.compiled.json +1 -1
- package/build/PipelinedOutOfOrderSerde.test.compiled.json +1 -0
- package/build/PriceFeedCache.compiled.json +1 -1
- package/build/PriceFeedCache.test.compiled.json +1 -1
- package/build/PriceFeedCache.test.permissions.compiled.json +1 -1
- package/build/PriceFeedCacheSerde.test.compiled.json +1 -0
- package/build/PriceFeedFeeLibSerde.test.compiled.json +1 -0
- package/build/Proxy.compiled.json +1 -1
- package/build/Proxy.permissions.test.compiled.json +1 -1
- package/build/Proxy.test.compiled.json +1 -1
- package/build/SmlConnection.compiled.json +1 -1
- package/build/SmlConnection.permissions.test.compiled.json +1 -1
- package/build/SmlConnection.test.compiled.json +1 -1
- package/build/SmlManager.compiled.json +1 -1
- package/build/SmlManager.permissions.test.compiled.json +1 -1
- package/build/SmlManager.test.compiled.json +1 -1
- package/build/Uln.compiled.json +1 -1
- package/build/Uln.test.compiled.json +1 -1
- package/build/UlnConnection.compiled.json +1 -1
- package/build/UlnConnection.test.compiled.json +1 -1
- package/build/UlnConnectionPermissions.test.compiled.json +1 -1
- package/build/UlnConnectionSerde.test.compiled.json +1 -0
- package/build/UlnManagement.test.compiled.json +1 -1
- package/build/UlnManager.compiled.json +1 -1
- package/build/UlnManager.test.compiled.json +1 -1
- package/build/UlnManagerPermissions.test.compiled.json +1 -1
- package/build/UlnManagerUtil.test.compiled.json +1 -1
- package/build/UlnMsgDataSerde.test.compiled.json +1 -0
- package/build/UlnPermissions.test.compiled.json +1 -1
- package/build/UlnReceiveConfig.test.compiled.json +1 -1
- package/build/UlnSend.test.compiled.json +1 -1
- package/build/UlnSendConfig.test.compiled.json +1 -1
- package/build/UlnSendWithDvnFeeLib.test.compiled.json +1 -1
- package/build/UlnSendWithExecFeeLib.test.compiled.json +1 -1
- package/build/UlnSendWorkerFactory.test.compiled.json +1 -1
- package/build/UlnSerde.test.compiled.json +1 -0
- package/build/UlnUtil.test.compiled.json +1 -1
- package/build/WorkerCore.test.compiled.json +1 -1
- package/build/WorkerCoreMsgDataSerde.test.compiled.json +1 -0
- package/build/WorkerCoreSerde.test.compiled.json +1 -0
- package/build/badFeeLib1.test.compiled.json +1 -1
- package/build/badFeeLib10.test.compiled.json +1 -1
- package/build/badFeeLib11.test.compiled.json +1 -1
- package/build/badFeeLib12.test.compiled.json +1 -1
- package/build/badFeeLib2.test.compiled.json +1 -1
- package/build/badFeeLib3.test.compiled.json +1 -1
- package/build/badFeeLib4.test.compiled.json +1 -1
- package/build/badFeeLib5.test.compiled.json +1 -1
- package/build/badFeeLib6.test.compiled.json +1 -1
- package/build/badFeeLib7.test.compiled.json +1 -1
- package/build/badFeeLib8.test.compiled.json +1 -1
- package/build/badFeeLib9.test.compiled.json +1 -1
- package/package.json +1 -1
- package/src/classes/lz/EpConfig.fc +90 -23
- package/src/classes/lz/MsglibInfo.fc +32 -5
- package/src/classes/lz/Packet.fc +109 -48
- package/src/classes/lz/Path.fc +55 -4
- package/src/classes/lz/ReceiveEpConfig.fc +36 -5
- package/src/classes/lz/SendEpConfig.fc +55 -5
- package/src/classes/msgdata/AddMsglib.fc +11 -0
- package/src/classes/msgdata/ChannelNonceInfo.fc +20 -0
- package/src/classes/msgdata/CoinsAmount.fc +8 -0
- package/src/classes/msgdata/Deploy.fc +19 -0
- package/src/classes/msgdata/ExtendedMd.fc +52 -1
- package/src/classes/msgdata/LzReceivePrepare.fc +21 -1
- package/src/classes/msgdata/LzReceiveStatus.fc +72 -1
- package/src/classes/msgdata/LzSend.fc +143 -24
- package/src/classes/msgdata/MdAddress.fc +42 -0
- package/src/classes/msgdata/MdEid.fc +8 -0
- package/src/classes/msgdata/MdObj.fc +32 -0
- package/src/classes/msgdata/MessagingReceipt.fc +34 -1
- package/src/classes/msgdata/MsglibSendCallback.fc +82 -0
- package/src/classes/msgdata/Nonce.fc +30 -0
- package/src/classes/msgdata/OptionsV1.fc +21 -1
- package/src/classes/msgdata/OptionsV2.fc +27 -0
- package/src/classes/msgdata/PacketId.fc +24 -0
- package/src/classes/msgdata/PacketSent.fc +35 -1
- package/src/classes/msgdata/SetAddress.fc +7 -0
- package/src/classes/msgdata/SetEpConfig.fc +17 -0
- package/src/funC++/actions/event.fc +17 -2
- package/src/funC++/actions/utils.fc +2 -2
- package/src/funC++/classlib.fc +33 -43
- package/src/funC++/constants.fc +28 -28
- package/src/funC++/dataStructures/PipelinedOutOfOrder.fc +75 -59
- package/src/funC++/stdlib.fc +26 -11
- package/src/funC++/testutils.fc +2 -2
- package/src/funC++/txnContext.fc +14 -14
- package/src/funC++/utils.fc +97 -1
- package/src/protocol/channel/handler.fc +247 -189
- package/src/protocol/channel/storage.fc +206 -1
- package/src/protocol/controller/handler.fc +35 -17
- package/src/protocol/controller/main.fc +1 -1
- package/src/protocol/core/abstract/protocolHandler.fc +11 -21
- package/src/protocol/core/baseStorage.fc +24 -0
- package/src/protocol/endpoint/handler.fc +99 -57
- package/src/protocol/endpoint/storage.fc +69 -5
- package/src/protocol/msglibs/BytesEncoder.fc +11 -10
- package/src/protocol/msglibs/simpleMsglib/smlManager/handler.fc +1 -4
- package/src/protocol/msglibs/ultralightnode/feeLibInterface.fc +1 -0
- package/src/protocol/msglibs/ultralightnode/msgdata/Attestation.fc +7 -8
- package/src/protocol/msglibs/ultralightnode/msgdata/DvnFeesPaidEvent.fc +20 -0
- package/src/protocol/msglibs/ultralightnode/msgdata/ExecutorFeePaidEvent.fc +15 -0
- package/src/protocol/msglibs/ultralightnode/msgdata/InitUln.fc +1 -1
- package/src/protocol/msglibs/ultralightnode/msgdata/InitUlnConnection.fc +1 -1
- package/src/protocol/msglibs/ultralightnode/msgdata/SetAdminWorkerAddresses.fc +6 -0
- package/src/protocol/msglibs/ultralightnode/msgdata/UlnEvents.fc +20 -0
- package/src/protocol/msglibs/ultralightnode/msgdata/UlnReceiveConfig.fc +114 -28
- package/src/protocol/msglibs/ultralightnode/msgdata/UlnSend.fc +51 -1
- package/src/protocol/msglibs/ultralightnode/msgdata/UlnSendConfig.fc +1 -1
- package/src/protocol/msglibs/ultralightnode/msgdata/UlnVerification.fc +10 -0
- package/src/protocol/msglibs/ultralightnode/msgdata/UlnWorkerFeelibBytecode.fc +6 -0
- package/src/protocol/msglibs/ultralightnode/msgdata/UlnWorkerFeelibInfo.fc +51 -1
- package/src/protocol/msglibs/ultralightnode/msgdata/VerificationStatus.fc +15 -0
- package/src/protocol/msglibs/ultralightnode/uln/handler.fc +84 -107
- package/src/protocol/msglibs/ultralightnode/uln/storage.fc +77 -1
- package/src/protocol/msglibs/ultralightnode/ulnConnection/handler.fc +92 -66
- package/src/protocol/msglibs/ultralightnode/ulnConnection/storage.fc +113 -6
- package/src/protocol/msglibs/ultralightnode/ulnConnection/utils.fc +6 -91
- package/src/protocol/msglibs/ultralightnode/ulnManager/handler.fc +55 -31
- package/src/protocol/msglibs/ultralightnode/workerFeeLibs/dvnFeeLib/handler.fc +13 -9
- package/src/protocol/msglibs/ultralightnode/workerFeeLibs/dvnFeeLib/storage.fc +23 -0
- package/src/protocol/msglibs/ultralightnode/workerFeeLibs/executorFeeLib/handler.fc +63 -27
- package/src/protocol/msglibs/ultralightnode/workerFeeLibs/executorFeeLib/storage.fc +19 -0
- package/src/protocol/msglibs/ultralightnode/workerFeeLibs/priceFeedFeeLib/storage.fc +55 -6
- package/src/workers/core/abstract/workerHandler.fc +20 -19
- package/src/workers/core/interface.fc +2 -1
- package/src/workers/core/workerCoreStorage.fc +16 -1
- package/src/workers/dvn/handler.fc +67 -26
- package/src/workers/dvn/storage.fc +15 -2
- package/src/workers/executor/handler.fc +18 -6
- package/src/workers/executor/interface.fc +1 -0
- package/src/workers/executor/storage.fc +8 -1
- package/src/workers/msgdata/DropEvent.fc +18 -0
- package/src/workers/msgdata/ExecuteParams.fc +66 -3
- package/src/workers/msgdata/NativeDrop.fc +4 -0
- package/src/workers/msgdata/SetDict.fc +6 -4
- package/src/workers/msgdata/SetQuorum.fc +4 -2
- package/src/workers/msgdata/SignedRequest.fc +8 -0
- package/src/workers/priceFeedCache/handler.fc +21 -27
- package/src/workers/priceFeedCache/storage.fc +16 -1
- package/src/workers/proxy/handler.fc +2 -1
- package/src/workers/proxy/storage.fc +1 -1
- package/tests/baseContractTest.fc +2 -6
- package/tests/testMain.fc +2 -2
- package/src/classes/msgdata/Amount.fc +0 -16
- package/src/funC++/actions/destroy.fc +0 -27
package/src/funC++/utils.fc
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
#include "constants.fc";
|
|
2
2
|
#include "stdlib.fc";
|
|
3
3
|
|
|
4
|
+
const int ERROR::WrongWorkchain = 2047;
|
|
5
|
+
|
|
4
6
|
forall X -> tuple unsafeTuple(X x) asm "NOP";
|
|
5
7
|
(slice) as_slice(builder b) asm "ENDC CTOS";
|
|
6
8
|
(slice, int) load_uint8(slice s) asm "8 LDU SWAP";
|
|
@@ -36,6 +38,7 @@ builder store_ones(builder b, int x) asm "STONES";
|
|
|
36
38
|
cell preload_first_ref(slice s) asm "0 PLDREFIDX";
|
|
37
39
|
slice preload_bits_offset(slice s, int offset, int len) asm "SDSUBSTR";
|
|
38
40
|
(slice, int) load_bool(slice s) asm(-> 1 0) "1 LDI";
|
|
41
|
+
int preload_bool(slice s) asm "1 PUSHINT PLDIX";
|
|
39
42
|
(builder) store_bool(builder b, int v) asm(v b) "1 STI";
|
|
40
43
|
cell empty_cell() asm "<b b> PUSHREF";
|
|
41
44
|
forall X -> tuple tset(tuple t, int k, X x) asm(t x k) "SETINDEXVAR";
|
|
@@ -58,6 +61,7 @@ slice scutfirst(slice s, int bits, int refs) inline asm "SCUTFIRST";
|
|
|
58
61
|
slice scutlast(slice s, int bits, int refs) inline asm "SCUTLAST";
|
|
59
62
|
slice subslice(slice s, int start_bits, int start_refs, int bits, int refs) inline asm "SUBSLICE";
|
|
60
63
|
slice sskipfirst(slice s, int bits, int refs) inline asm "SSKIPFIRST";
|
|
64
|
+
slice sskiplast(slice s, int bits, int refs) inline asm "SSKIPLAST";
|
|
61
65
|
slice sdskipfirst(slice s, int bits) inline asm "SDSKIPFIRST";
|
|
62
66
|
forall X -> builder cast_to_builder(X x) inline asm "NOP";
|
|
63
67
|
int abs(int x) inline asm "ABS";
|
|
@@ -67,7 +71,7 @@ int abs(int x) inline asm "ABS";
|
|
|
67
71
|
throw(reason.slice_hash() & ERRORCODE_MASK);
|
|
68
72
|
}
|
|
69
73
|
|
|
70
|
-
() throwErrorUnless(int condition, slice reason) inline {
|
|
74
|
+
() throwErrorUnless(int condition, slice reason) impure inline {
|
|
71
75
|
ifnot (condition) {
|
|
72
76
|
throwError(reason);
|
|
73
77
|
}
|
|
@@ -185,6 +189,7 @@ int _gasToNanoton(int gas) inline {
|
|
|
185
189
|
;;; ====================== Address functions ======================
|
|
186
190
|
int basechainAddressStdToHashpart(slice full_address) inline {
|
|
187
191
|
(int wc, int hp) = parseStdAddress(full_address);
|
|
192
|
+
throw_if(ERROR::WrongWorkchain, wc != BASECHAIN);
|
|
188
193
|
return hp;
|
|
189
194
|
}
|
|
190
195
|
|
|
@@ -216,3 +221,94 @@ int computeContractAddress(cell $storage, cell code) impure inline {
|
|
|
216
221
|
.end_cell()
|
|
217
222
|
.cell_hash();
|
|
218
223
|
}
|
|
224
|
+
|
|
225
|
+
;; ============================== Optimization Functions ==============================
|
|
226
|
+
|
|
227
|
+
;; ========================== For Slices ==========================
|
|
228
|
+
|
|
229
|
+
int preloadBoolAt(slice self, int offset) impure inline {
|
|
230
|
+
;; bools should be returned as bools
|
|
231
|
+
return self.preload_bits_offset(offset, 1).preload_bool();
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
int preloadUint8At(slice self, int offset) impure inline {
|
|
235
|
+
return self.preload_bits_offset(offset, 8).preload_uint(8);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
int preloadUint16At(slice self, int offset) impure inline {
|
|
239
|
+
return self.preload_bits_offset(offset, 16).preload_uint(16);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
int preloadUint32At(slice self, int offset) impure inline {
|
|
243
|
+
return self.preload_bits_offset(offset, 32).preload_uint(32);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
int preloadUint64At(slice self, int offset) impure inline {
|
|
247
|
+
return self.preload_bits_offset(offset, 64).preload_uint(64);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
int preloadCoinsAt(slice self, int offset) impure inline {
|
|
251
|
+
return self.preload_bits_offset(offset, 128).preload_uint(128);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
int preloadUint256At(slice self, int offset) impure inline {
|
|
255
|
+
return self.preload_bits_offset(offset, 256).preload_uint(256);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
int preloadAddressAt(slice self, int offset) impure inline {
|
|
259
|
+
return self.preloadUint256At(offset);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
;; slice -> cell
|
|
263
|
+
cell preloadRefAt(slice self, int offset) impure inline {
|
|
264
|
+
return self.preload_ref_at(offset);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
;; slice -> slice
|
|
268
|
+
slice preloadRefSliceAt(slice self, int offset) impure inline {
|
|
269
|
+
return self.preload_ref_at(offset).begin_parse();
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
;; ========================== For Cells ==========================
|
|
273
|
+
|
|
274
|
+
int cellPreloadBoolAt(cell self, int offset) impure inline {
|
|
275
|
+
return self.begin_parse().preloadBoolAt(offset);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
int cellPreloadUint8At(cell self, int offset) impure inline {
|
|
279
|
+
return self.begin_parse().preloadUint8At(offset);
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
int cellPreloadUint16At(cell self, int offset) impure inline {
|
|
283
|
+
return self.begin_parse().preloadUint16At(offset);
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
int cellPreloadUint32At(cell self, int offset) impure inline {
|
|
287
|
+
return self.begin_parse().preloadUint32At(offset);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
int cellPreloadUint64At(cell self, int offset) impure inline {
|
|
291
|
+
return self.begin_parse().preloadUint64At(offset);
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
int cellPreloadCoinsAt(cell self, int offset) impure inline {
|
|
295
|
+
return self.begin_parse().preloadCoinsAt(offset);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
int cellPreloadUint256At(cell self, int offset) impure inline {
|
|
299
|
+
return self.begin_parse().preloadUint256At(offset);
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
int cellPreloadAddressAt(cell self, int offset) impure inline {
|
|
303
|
+
return self.cellPreloadUint256At(offset);
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
;; cell -> cell
|
|
307
|
+
cell cellPreloadRefAt(cell self, int offset) impure inline {
|
|
308
|
+
return self.begin_parse().preloadRefAt(offset);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
;; cell -> slice
|
|
312
|
+
slice cellPreloadRefSliceAt(cell self, int offset) impure inline {
|
|
313
|
+
return self.begin_parse().preloadRefAt(offset).begin_parse();
|
|
314
|
+
}
|