@layerzerolabs/layerzero-v2-ton 3.0.19-ton.0 → 3.0.21-ton.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/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/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/DvnPermissions.test.compiled.json +1 -1
- 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/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/ExecutorPermissions.test.compiled.json +1 -1
- package/build/LzClasses.test.compiled.json +1 -1
- package/build/LzUtil.test.compiled.json +1 -1
- package/build/MsgData.test.compiled.json +1 -1
- package/build/MsglibPacketCodec.test.compiled.json +1 -1
- package/build/PipelinedOutOfOrder.test.compiled.json +1 -1
- package/build/PriceFeedCache.compiled.json +1 -1
- package/build/PriceFeedCache.test.compiled.json +1 -1
- 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/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/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/UlnUtil.test.compiled.json +1 -1
- package/build/WorkerCore.test.compiled.json +1 -1
- 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 +6 -6
- package/src/classes/lz/EpConfig.fc +1 -1
- package/src/classes/msgdata/LzReceiveStatus.fc +0 -1
- package/src/funC++/actions/call.fc +3 -2
- package/src/funC++/actions/deploy.fc +2 -3
- package/src/funC++/actions/destroy.fc +1 -2
- package/src/funC++/actions/dispatch.fc +2 -3
- package/src/funC++/actions/event.fc +10 -5
- package/src/funC++/actions/payment.fc +2 -3
- package/src/funC++/actions/sendJettons.fc +2 -3
- package/src/funC++/actions/utils.fc +0 -2
- package/src/funC++/baseInterface.fc +0 -2
- package/src/funC++/classlib.fc +5 -37
- package/src/funC++/constants.fc +2 -2
- package/src/funC++/contractMain.fc +2 -8
- package/src/funC++/dataStructures/AddressList.fc +2 -1
- package/src/funC++/dataStructures/DeterministicInsertionCircularQueue.fc +0 -1
- package/src/funC++/dataStructures/PipelinedOutOfOrder.fc +0 -1
- package/src/funC++/handlerCore.fc +2 -6
- package/src/funC++/stringlib.fc +0 -2
- package/src/funC++/testutils.fc +0 -1
- package/src/funC++/txnContext.fc +1 -1
- package/src/funC++/utils.fc +35 -0
- package/src/protocol/channel/callbackOpcodes.fc +10 -0
- package/src/protocol/channel/handler.fc +1054 -0
- package/src/protocol/channel/interface.fc +61 -0
- package/src/protocol/channel/main.fc +39 -0
- package/src/protocol/channel/storage.fc +55 -0
- package/src/protocol/controller/handler.fc +347 -0
- package/src/protocol/controller/interface.fc +25 -0
- package/src/protocol/controller/main.fc +29 -0
- package/src/protocol/controller/storage.fc +31 -0
- package/src/protocol/core/abstract/protocolHandler.fc +110 -0
- package/src/protocol/core/abstract/protocolMain.fc +30 -0
- package/src/protocol/core/baseStorage.fc +1 -2
- package/src/protocol/endpoint/handler.fc +426 -0
- package/src/protocol/endpoint/interface.fc +20 -0
- package/src/protocol/endpoint/main.fc +23 -0
- package/src/protocol/interfaces.fc +4 -0
- package/src/protocol/msglibs/BytesDecoder.fc +135 -0
- package/src/protocol/msglibs/BytesEncoder.fc +150 -0
- package/src/protocol/msglibs/interface.fc +16 -0
- package/src/protocol/msglibs/simpleMsglib/smlConnection/handler.fc +125 -0
- package/src/protocol/msglibs/simpleMsglib/smlConnection/interface.fc +3 -0
- package/src/protocol/msglibs/simpleMsglib/smlConnection/main.fc +19 -0
- package/src/protocol/msglibs/simpleMsglib/smlConnection/storage.fc +20 -0
- package/src/protocol/msglibs/simpleMsglib/smlManager/handler.fc +281 -0
- package/src/protocol/msglibs/simpleMsglib/smlManager/interface.fc +14 -0
- package/src/protocol/msglibs/simpleMsglib/smlManager/main.fc +24 -0
- package/src/protocol/msglibs/simpleMsglib/smlManager/storage.fc +38 -0
- package/src/protocol/msglibs/ultralightnode/callbackOpcodes.fc +1 -0
- package/src/protocol/msglibs/ultralightnode/feeLibInterface.fc +10 -0
- package/src/protocol/msglibs/ultralightnode/feeLibUtils.fc +51 -0
- package/src/protocol/msglibs/ultralightnode/msgdata/Attestation.fc +49 -0
- package/src/protocol/msglibs/ultralightnode/msgdata/DvnFeesPaidEvent.fc +26 -0
- package/src/protocol/msglibs/ultralightnode/msgdata/ExecutorFeePaidEvent.fc +23 -0
- package/src/protocol/msglibs/ultralightnode/msgdata/InitUln.fc +18 -0
- package/src/protocol/msglibs/ultralightnode/msgdata/InitUlnConnection.fc +62 -0
- package/src/protocol/msglibs/ultralightnode/msgdata/InitUlnManager.fc +18 -0
- package/src/protocol/msglibs/ultralightnode/msgdata/RentRefill.fc +18 -0
- package/src/protocol/msglibs/ultralightnode/msgdata/SetAdminWorkerAddresses.fc +18 -0
- package/src/protocol/msglibs/ultralightnode/msgdata/TreasuryFeeBps.fc +16 -0
- package/src/protocol/msglibs/ultralightnode/msgdata/UlnEvents.fc +26 -0
- package/src/protocol/msglibs/ultralightnode/msgdata/UlnReceiveConfig.fc +249 -0
- package/src/protocol/msglibs/ultralightnode/msgdata/UlnSend.fc +27 -0
- package/src/protocol/msglibs/ultralightnode/msgdata/UlnSendConfig.fc +170 -0
- package/src/protocol/msglibs/ultralightnode/msgdata/UlnVerification.fc +21 -0
- package/src/protocol/msglibs/ultralightnode/msgdata/UlnWorkerFeelibBytecode.fc +16 -0
- package/src/protocol/msglibs/ultralightnode/msgdata/UlnWorkerFeelibEvents.fc +58 -0
- package/src/protocol/msglibs/ultralightnode/msgdata/UlnWorkerFeelibInfo.fc +56 -0
- package/src/protocol/msglibs/ultralightnode/msgdata/VerificationStatus.fc +18 -0
- package/src/protocol/msglibs/ultralightnode/uln/handler.fc +803 -0
- package/src/protocol/msglibs/ultralightnode/uln/interface.fc +63 -0
- package/src/protocol/msglibs/ultralightnode/uln/main.fc +37 -0
- package/src/protocol/msglibs/ultralightnode/uln/storage.fc +43 -0
- package/src/protocol/msglibs/ultralightnode/ulnConnection/handler.fc +600 -0
- package/src/protocol/msglibs/ultralightnode/ulnConnection/interface.fc +36 -0
- package/src/protocol/msglibs/ultralightnode/ulnConnection/main.fc +32 -0
- package/src/protocol/msglibs/ultralightnode/ulnConnection/storage.fc +49 -0
- package/src/protocol/msglibs/ultralightnode/ulnConnection/utils.fc +133 -0
- package/src/protocol/msglibs/ultralightnode/ulnManager/handler.fc +495 -0
- package/src/protocol/msglibs/ultralightnode/ulnManager/interface.fc +59 -0
- package/src/protocol/msglibs/ultralightnode/ulnManager/main.fc +40 -0
- package/src/protocol/msglibs/ultralightnode/ulnManager/storage.fc +44 -0
- package/src/protocol/msglibs/ultralightnode/workerFeeLibs/common.fc +27 -0
- package/src/protocol/msglibs/ultralightnode/workerFeeLibs/dvnFeeLib/handler.fc +80 -0
- package/src/protocol/msglibs/ultralightnode/workerFeeLibs/dvnFeeLib/main.fc +4 -0
- package/src/protocol/msglibs/ultralightnode/workerFeeLibs/dvnFeeLib/storage.fc +26 -0
- package/src/protocol/msglibs/ultralightnode/workerFeeLibs/executorFeeLib/handler.fc +123 -0
- package/src/protocol/msglibs/ultralightnode/workerFeeLibs/executorFeeLib/main.fc +4 -0
- package/src/protocol/msglibs/ultralightnode/workerFeeLibs/executorFeeLib/storage.fc +29 -0
- package/src/protocol/msglibs/ultralightnode/workerFeeLibs/main.fc +3 -0
- package/src/protocol/msglibs/ultralightnode/workerFeeLibs/priceFeedFeeLib/main.fc +1 -0
- package/src/protocol/msglibs/ultralightnode/workerFeeLibs/priceFeedFeeLib/storage.fc +39 -0
- package/src/protocol/msglibs/ultralightnode/workerFeeLibs/ulnSendWorkerV1.fc +363 -0
- package/src/workers/core/abstract/workerHandler.fc +150 -0
- package/src/workers/core/interface.fc +25 -0
- package/src/workers/core/workerCoreStorage.fc +44 -0
- package/src/workers/dvn/handler.fc +332 -0
- package/src/workers/dvn/interface.fc +25 -0
- package/src/workers/dvn/main.fc +36 -0
- package/src/workers/dvn/storage.fc +27 -0
- package/src/workers/executor/handler.fc +110 -0
- package/src/workers/executor/interface.fc +19 -0
- package/src/workers/executor/main.fc +26 -0
- package/src/workers/executor/storage.fc +19 -0
- package/src/workers/msgdata/ExecuteParams.fc +29 -0
- package/src/workers/msgdata/NativeDrop.fc +16 -0
- package/src/workers/msgdata/ProxyMessage.fc +20 -0
- package/src/workers/msgdata/SetDict.fc +20 -0
- package/src/workers/msgdata/SetQuorum.fc +20 -0
- package/src/workers/msgdata/SignedRequest.fc +18 -0
- package/src/workers/priceFeedCache/handler.fc +114 -0
- package/src/workers/priceFeedCache/interface.fc +4 -0
- package/src/workers/priceFeedCache/main.fc +25 -0
- package/src/workers/priceFeedCache/storage.fc +21 -0
- package/src/workers/proxy/handler.fc +81 -0
- package/src/workers/proxy/interface.fc +11 -0
- package/src/workers/proxy/main.fc +17 -0
- package/src/workers/proxy/storage.fc +21 -0
- package/tests/testMain.fc +0 -1
- package/CHANGELOG.md +0 -7
- package/build/PriceFeedCache.permissions.test.compiled.json +0 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
#include "utils.fc";
|
|
2
|
+
#include "../classlib.fc";
|
|
2
3
|
|
|
3
4
|
const int action::call::NAME = "actionCall"u;
|
|
4
5
|
|
|
@@ -9,7 +10,7 @@ const int action::call::md = 3;
|
|
|
9
10
|
;; Call a method on the contract at address `to` with the given message data `md`
|
|
10
11
|
;; optionally provide value provisioned from this contract's balance
|
|
11
12
|
;; @terminal
|
|
12
|
-
tuple action::call::
|
|
13
|
+
tuple action::call::create(int to, int opcode, cell $md) inline {
|
|
13
14
|
return unsafeTuple([action::call::NAME, to, opcode, $md]);
|
|
14
15
|
}
|
|
15
16
|
|
|
@@ -30,7 +31,7 @@ int action::call::equals(tuple self, tuple other) inline {
|
|
|
30
31
|
|
|
31
32
|
;; overloaded when you want to pass 0 outflowNanos
|
|
32
33
|
tuple _newAction<call>(int to, int opcode, cell $body) inline {
|
|
33
|
-
return action::call::
|
|
34
|
+
return action::call::create(to, opcode, $body);
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
;; overloaded when you want to pass 0 outflowNanos
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
#include "utils.fc";
|
|
2
|
-
#include "../stdlib.fc";
|
|
3
2
|
|
|
4
3
|
;;; =======================================================
|
|
5
4
|
;; Deploys a contract defined by the given code and storage object,
|
|
@@ -21,7 +20,7 @@ const int action::deploy::md = 5;
|
|
|
21
20
|
const int action::deploy::outflowNanos = 6;
|
|
22
21
|
|
|
23
22
|
;; @terminal
|
|
24
|
-
tuple action::deploy::
|
|
23
|
+
tuple action::deploy::create(
|
|
25
24
|
cell code,
|
|
26
25
|
cell $storage,
|
|
27
26
|
int donationNanos,
|
|
@@ -62,7 +61,7 @@ tuple _newAction<deployAndCall>(
|
|
|
62
61
|
cell $md,
|
|
63
62
|
int outflowNanos
|
|
64
63
|
) inline {
|
|
65
|
-
return action::deploy::
|
|
64
|
+
return action::deploy::create(
|
|
66
65
|
code,
|
|
67
66
|
$storage,
|
|
68
67
|
donationNanos,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
#include "utils.fc";
|
|
2
|
-
#include "../stdlib.fc";
|
|
3
2
|
|
|
4
3
|
const int action::destroy::NAME = "destroy"u;
|
|
5
4
|
|
|
@@ -8,7 +7,7 @@ const int action::destroy::opcode = 2;
|
|
|
8
7
|
const int action::destroy::md = 3;
|
|
9
8
|
|
|
10
9
|
;; @terminal
|
|
11
|
-
tuple action::destroy::
|
|
10
|
+
tuple action::destroy::create(int to, int opcode, cell $md) inline {
|
|
12
11
|
return unsafeTuple([action::destroy::NAME, to, opcode, $md]);
|
|
13
12
|
}
|
|
14
13
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
#include "utils.fc";
|
|
2
|
-
#include "../stdlib.fc";
|
|
3
2
|
|
|
4
3
|
#include "call.fc";
|
|
5
4
|
|
|
@@ -13,7 +12,7 @@ const int action::dispatch::gasNanos = 4;
|
|
|
13
12
|
;; Call a method on the contract at address `to` with the given message data `md`
|
|
14
13
|
;; optionally provide value provisioned from this contract's balance
|
|
15
14
|
;; @terminal
|
|
16
|
-
tuple action::dispatch::
|
|
15
|
+
tuple action::dispatch::create(int to, int opcode, cell $md, int gasNanos) inline {
|
|
17
16
|
return unsafeTuple([action::dispatch::NAME, to, opcode, $md, gasNanos]);
|
|
18
17
|
}
|
|
19
18
|
|
|
@@ -33,7 +32,7 @@ int action::dispatch::equals(tuple self, tuple other) {
|
|
|
33
32
|
}
|
|
34
33
|
|
|
35
34
|
tuple _newAction<dispatch>(int to, int opcode, cell $body, int gasNanos) inline {
|
|
36
|
-
return action::dispatch::
|
|
35
|
+
return action::dispatch::create(to, opcode, $body, gasNanos);
|
|
37
36
|
}
|
|
38
37
|
|
|
39
38
|
;; overloaded when you want to pass 0 outflowNanos
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
#include "../baseInterface.fc";
|
|
2
|
-
#include "../classlib.fc";
|
|
3
2
|
#include "utils.fc";
|
|
4
3
|
|
|
5
4
|
const int action::event::NAME = "event"u;
|
|
@@ -16,8 +15,8 @@ int _getEventSink() impure inline;
|
|
|
16
15
|
;; @info Events in LZ contracts are internal messages to an event sink
|
|
17
16
|
;; where the resulting transaction always reverts
|
|
18
17
|
;; @non-terminal
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
cell action::event::New(int topic, cell $body, cell $initialStorage) inline method_id {
|
|
19
|
+
return cl::declare(
|
|
21
20
|
action::event::NAME,
|
|
22
21
|
unsafeTuple([
|
|
23
22
|
[cl::t::uint256, topic],
|
|
@@ -25,7 +24,13 @@ tuple action::event::New(int topic, cell $body, cell $initialStorage) inline met
|
|
|
25
24
|
[cl::t::objRef, $initialStorage]
|
|
26
25
|
])
|
|
27
26
|
);
|
|
28
|
-
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
tuple action::event::create(int topic, cell $body, cell $initialStorage) inline {
|
|
30
|
+
return unsafeTuple([
|
|
31
|
+
action::event::NAME,
|
|
32
|
+
action::event::New(topic, $body, $initialStorage)
|
|
33
|
+
]);
|
|
29
34
|
}
|
|
30
35
|
|
|
31
36
|
;; returns true if equals
|
|
@@ -43,7 +48,7 @@ int action::event::equals(tuple self, tuple other) {
|
|
|
43
48
|
|
|
44
49
|
;; interface this function because it requires passing the 'getInitialStorage' from the baseHandler
|
|
45
50
|
;; tuple _newAction<event>(int topic, cell $body) impure inline {
|
|
46
|
-
;; return action::event::
|
|
51
|
+
;; return action::event::create(topic, $body, getInitialStorage());
|
|
47
52
|
;; }
|
|
48
53
|
|
|
49
54
|
tuple _newAction<event>(int topic, cell $body) impure inline;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
#include "utils.fc";
|
|
2
|
-
#include "../stdlib.fc";
|
|
3
2
|
|
|
4
3
|
const int action::payment::NAME = "payment"u;
|
|
5
4
|
|
|
@@ -11,7 +10,7 @@ const int action::payment::amount = 2;
|
|
|
11
10
|
const int action::payment::outflowNanos = 3;
|
|
12
11
|
|
|
13
12
|
;; @non-terminal
|
|
14
|
-
tuple action::payment::
|
|
13
|
+
tuple action::payment::create(int toAddress, int amount, int outflowNanos) inline {
|
|
15
14
|
return unsafeTuple([action::payment::NAME, toAddress, amount, outflowNanos]);
|
|
16
15
|
}
|
|
17
16
|
|
|
@@ -26,7 +25,7 @@ int action::payment::equals(tuple self, tuple other) {
|
|
|
26
25
|
}
|
|
27
26
|
|
|
28
27
|
tuple _newAction<payment>(int toAddress, int amount, int outflowNanos) inline {
|
|
29
|
-
return action::payment::
|
|
28
|
+
return action::payment::create(toAddress, amount, outflowNanos);
|
|
30
29
|
}
|
|
31
30
|
|
|
32
31
|
(tuple, ()) ~pushAction<payment>(tuple actions, int toAddress, int amount, int outflowNanos) inline {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
#include "../stdlib.fc";
|
|
2
1
|
#include "utils.fc";
|
|
3
2
|
|
|
4
3
|
const int action::sendJettons::NAME = "sendJetton"u;
|
|
@@ -21,7 +20,7 @@ const int Jetton::OP::TRANSFER_NOTIFICATION = 0x7362d09c;
|
|
|
21
20
|
const int Jetton::OP::TRANSFER = 0xf8a7ea5;
|
|
22
21
|
|
|
23
22
|
;; @terminal
|
|
24
|
-
tuple action::sendJettons::
|
|
23
|
+
tuple action::sendJettons::create(int walletAddress, int toAddress, int amount, int responseAddress) inline {
|
|
25
24
|
return unsafeTuple([action::sendJettons::NAME, walletAddress, toAddress, amount, responseAddress]);
|
|
26
25
|
}
|
|
27
26
|
|
|
@@ -37,7 +36,7 @@ int action::sendJettons::equals(tuple self, tuple other) {
|
|
|
37
36
|
}
|
|
38
37
|
|
|
39
38
|
tuple _newAction<sendJettons>(int walletAddress, int toAddress, int amount, int responseAddress) inline {
|
|
40
|
-
return action::sendJettons::
|
|
39
|
+
return action::sendJettons::create(walletAddress, toAddress, amount, responseAddress);
|
|
41
40
|
}
|
|
42
41
|
|
|
43
42
|
(tuple, ()) ~pushAction<sendJettons>(
|
package/src/funC++/classlib.fc
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
#include "utils.fc";
|
|
2
|
-
#include "constants.fc";
|
|
3
|
-
#include "stdlib.fc";
|
|
4
2
|
#include "stringlib.fc";
|
|
5
3
|
|
|
6
4
|
;; Types for storage abstraction
|
|
@@ -45,23 +43,6 @@ const int _HEADER_WIDTH = _BASIC_HEADER_WIDTH + _MAX_CLASS_FIELDS * _FIELD_INFO_
|
|
|
45
43
|
const int FIELD_TYPE_IDX = 0;
|
|
46
44
|
const int FIELD_VAL_IDX = 1;
|
|
47
45
|
|
|
48
|
-
;;; ====================== Address functions ======================
|
|
49
|
-
int basechainAddressStdToHashpart(slice full_address) inline {
|
|
50
|
-
(int wc, int hp) = parseStdAddress(full_address);
|
|
51
|
-
return hp;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
slice hashpartToBasechainAddressStd(int hashpart) inline {
|
|
55
|
-
return begin_cell()
|
|
56
|
-
.store_uint(4, 3) ;; 0b100
|
|
57
|
-
.store_int(BASECHAIN, 8)
|
|
58
|
-
.store_uint(hashpart, 256)
|
|
59
|
-
.as_slice();
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
int getContractAddress() impure inline {
|
|
63
|
-
return my_address().preload_bits_offset(11, 256).preload_uint(256);
|
|
64
|
-
}
|
|
65
46
|
|
|
66
47
|
;;; ====================== Class functions ======================
|
|
67
48
|
;; returns type width in bits
|
|
@@ -140,23 +121,6 @@ int cl::equalObjTypeShallow(cell $a, cell $b) {
|
|
|
140
121
|
return true;
|
|
141
122
|
}
|
|
142
123
|
|
|
143
|
-
() setContractStorage(cell $obj) impure inline {
|
|
144
|
-
set_data($obj);
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
cell getContractStorage() impure inline method_id {
|
|
148
|
-
return get_data();
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
int computeContractAddress(cell $storage, cell code) impure inline {
|
|
152
|
-
return begin_cell()
|
|
153
|
-
.store_uint(6, 5)
|
|
154
|
-
.store_ref(code)
|
|
155
|
-
.store_ref($storage)
|
|
156
|
-
.end_cell()
|
|
157
|
-
.cell_hash();
|
|
158
|
-
}
|
|
159
|
-
|
|
160
124
|
int cl::typeof(cell $obj) inline method_id {
|
|
161
125
|
if (cl::isNull($obj)) {
|
|
162
126
|
return cl::NULL_CLASS_NAME;
|
|
@@ -625,7 +589,11 @@ cell cl::dict256::New() inline {
|
|
|
625
589
|
if (dict.cell_is_empty()) {
|
|
626
590
|
return (empty_cell(), false);
|
|
627
591
|
}
|
|
628
|
-
|
|
592
|
+
(cell ret, int exists) = dict.udict_get_ref?(DICT256_KEYLEN, key);
|
|
593
|
+
ifnot (exists) {
|
|
594
|
+
return (empty_cell(), false);
|
|
595
|
+
}
|
|
596
|
+
return (ret, true);
|
|
629
597
|
}
|
|
630
598
|
|
|
631
599
|
cell cl::dict256::setRef(cell dict, int key, cell val) inline method_id {
|
package/src/funC++/constants.fc
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const int ERRORCODE_MASK = 0x7ff;
|
|
2
|
-
const int CLASSLIB::ERROR::INVALID_FIELD_TYPE =
|
|
3
|
-
const int CLASSLIB::ERROR::WRONG_ORDER_CONSTRUCTOR =
|
|
2
|
+
const int CLASSLIB::ERROR::INVALID_FIELD_TYPE = 1059;
|
|
3
|
+
const int CLASSLIB::ERROR::WRONG_ORDER_CONSTRUCTOR = 1060;
|
|
4
4
|
|
|
5
5
|
const int MAX_U8 = 0xFF;
|
|
6
6
|
const int MAX_U16 = 0xFFFF;
|
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
;;; ================================================================
|
|
2
2
|
;; The base main function for LayerZero Endpoint, UltraLightNode, and OApp
|
|
3
3
|
;;; ================================================================
|
|
4
|
-
|
|
5
|
-
#include "classlib.fc";
|
|
6
|
-
#include "constants.fc";
|
|
7
|
-
#include "stdlib.fc";
|
|
8
|
-
#include "stringlib.fc";
|
|
9
|
-
#include "txnContext.fc";
|
|
10
|
-
#include "actions/utils.fc";
|
|
11
|
-
#include "abstract/contractMainAbstract.fc";
|
|
4
|
+
|
|
12
5
|
#include "handlerCore.fc";
|
|
6
|
+
#include "abstract/contractMainAbstract.fc";
|
|
13
7
|
|
|
14
8
|
;;; ===============================
|
|
15
9
|
;; Base main - low-level builtin context
|
|
@@ -44,7 +44,8 @@ int AddressList::isValid(cell addressList, int maxCount) {
|
|
|
44
44
|
int count = 0;
|
|
45
45
|
while (addressListSlice.slice_empty?() == false) {
|
|
46
46
|
(int bits, int refs) = addressListSlice.slice_bits_refs();
|
|
47
|
-
|
|
47
|
+
;; todo: more test coverage
|
|
48
|
+
if ((refs > 1) | ((bits % 256) != 0)) {
|
|
48
49
|
return false;
|
|
49
50
|
}
|
|
50
51
|
repeat (bits / 256) {
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
;; the DeterministicInsertionCircularQueue is a deterministic-gas circular buffer
|
|
3
3
|
;; that stores key-value pairs along with one piece of metadata (8-bits) per entry.
|
|
4
4
|
#include "../utils.fc";
|
|
5
|
-
#include "../stdlib.fc";
|
|
6
5
|
|
|
7
6
|
const int DeterministicInsertionCircularQueue::statusBits = 8;
|
|
8
7
|
const int DeterministicInsertionCircularQueue::keyBits = 64;
|
|
@@ -2,16 +2,12 @@
|
|
|
2
2
|
;; This file contains the utility functions for all handler functions that follow
|
|
3
3
|
;; LayerZero Labs handler convention.
|
|
4
4
|
;;; ==========================================
|
|
5
|
+
#include "abstract/handlerAbstract.fc";
|
|
6
|
+
|
|
5
7
|
#include "actions/utils.fc";
|
|
6
8
|
|
|
7
9
|
#include "baseInterface.fc";
|
|
8
10
|
|
|
9
|
-
#include "constants.fc";
|
|
10
|
-
#include "stringlib.fc";
|
|
11
|
-
#include "txnContext.fc";
|
|
12
|
-
|
|
13
|
-
#include "abstract/handlerAbstract.fc";
|
|
14
|
-
|
|
15
11
|
;;; ===================REQUIRED VIRTUAL FUNCTIONS=======================
|
|
16
12
|
;; todo: split into permissions and utils?
|
|
17
13
|
|
package/src/funC++/stringlib.fc
CHANGED
package/src/funC++/testutils.fc
CHANGED
package/src/funC++/txnContext.fc
CHANGED
package/src/funC++/utils.fc
CHANGED
|
@@ -181,3 +181,38 @@ int _gasToNanoton(int gas) inline {
|
|
|
181
181
|
deleteDueLimit
|
|
182
182
|
);
|
|
183
183
|
}
|
|
184
|
+
|
|
185
|
+
;;; ====================== Address functions ======================
|
|
186
|
+
int basechainAddressStdToHashpart(slice full_address) inline {
|
|
187
|
+
(int wc, int hp) = parseStdAddress(full_address);
|
|
188
|
+
return hp;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
slice hashpartToBasechainAddressStd(int hashpart) inline {
|
|
192
|
+
return begin_cell()
|
|
193
|
+
.store_uint(4, 3) ;; 0b100
|
|
194
|
+
.store_int(BASECHAIN, 8)
|
|
195
|
+
.store_uint(hashpart, 256)
|
|
196
|
+
.as_slice();
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
int getContractAddress() impure inline {
|
|
200
|
+
return my_address().preload_bits_offset(11, 256).preload_uint(256);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
() setContractStorage(cell $obj) impure inline {
|
|
204
|
+
set_data($obj);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
cell getContractStorage() impure inline method_id {
|
|
208
|
+
return get_data();
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
int computeContractAddress(cell $storage, cell code) impure inline {
|
|
212
|
+
return begin_cell()
|
|
213
|
+
.store_uint(6, 5)
|
|
214
|
+
.store_ref(code)
|
|
215
|
+
.store_ref($storage)
|
|
216
|
+
.end_cell()
|
|
217
|
+
.cell_hash();
|
|
218
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
;; Send flow
|
|
2
|
+
const int Layerzero::OP::CHANNEL_SEND_CALLBACK = "Layerzero::OP::CHANNEL_SEND_CALLBACK"c;
|
|
3
|
+
|
|
4
|
+
;; Receive flow
|
|
5
|
+
const int Layerzero::OP::LZ_RECEIVE_PREPARE = "Layerzero::OP::LZ_RECEIVE_PREPARE"c;
|
|
6
|
+
const int Layerzero::OP::LZ_RECEIVE_EXECUTE = "Layerzero::OP::LZ_RECEIVE_EXECUTE"c;
|
|
7
|
+
|
|
8
|
+
;; Receive flow management
|
|
9
|
+
const int Layerzero::OP::BURN_CALLBACK = "Layerzero::OP::BURN_CALLBACK"c;
|
|
10
|
+
const int Layerzero::OP::NILIFY_CALLBACK = "Layerzero::OP::NILIFY_CALLBACK"c;
|