@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
|
@@ -56,13 +56,19 @@
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
;; Derive the channel address for a given path
|
|
59
|
-
int _getChannelAddress(cell $path) inline method_id {
|
|
60
|
-
cell $storage = getContractStorage();
|
|
59
|
+
int _getChannelAddress(cell $storage, cell $path) inline method_id {
|
|
61
60
|
return computeContractAddress(
|
|
62
61
|
$storage
|
|
63
|
-
.
|
|
64
|
-
.
|
|
65
|
-
$storage.
|
|
62
|
+
.Endpoint::getChannelStorageInit()
|
|
63
|
+
.Channel::setPath($path),
|
|
64
|
+
$storage.Endpoint::getChannelCode()
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
int _getChannelAddressUnpacked(cell $channelStorage, cell channelCode, cell $path) impure inline {
|
|
69
|
+
return computeContractAddress(
|
|
70
|
+
$channelStorage.Channel::setPath($path),
|
|
71
|
+
channelCode
|
|
66
72
|
);
|
|
67
73
|
}
|
|
68
74
|
|
|
@@ -94,6 +100,7 @@ cell _getEpConfigFromManagerAddresses(cell $setEpConfigMd, cell $path) inline me
|
|
|
94
100
|
|
|
95
101
|
return lz::EpConfig::NewWithConnection(
|
|
96
102
|
$setEpConfigMd.cl::get<bool>(md::SetEpConfig::useDefaults),
|
|
103
|
+
sendMsglibManager,
|
|
97
104
|
sendMsglib,
|
|
98
105
|
sendMsglibConnection,
|
|
99
106
|
receiveMsglib,
|
|
@@ -104,32 +111,42 @@ cell _getEpConfigFromManagerAddresses(cell $setEpConfigMd, cell $path) inline me
|
|
|
104
111
|
);
|
|
105
112
|
}
|
|
106
113
|
|
|
107
|
-
(int, int) _getMsglibAndConnectionDefaults(
|
|
108
|
-
cell $msglibInfo = getContractStorage().cl::get<objRef>(key);
|
|
114
|
+
(int, int) _getMsglibAndConnectionDefaults(cell $msglibInfo, cell $path) impure inline method_id {
|
|
109
115
|
if (cl::isNullObject($msglibInfo)) {
|
|
110
116
|
return (NULLADDRESS, NULLADDRESS);
|
|
111
117
|
}
|
|
118
|
+
|
|
112
119
|
return (
|
|
113
|
-
|
|
120
|
+
lz::MsglibInfo::getMsglibAddress($msglibInfo),
|
|
114
121
|
lz::MsglibInfo::getMsglibConnectionAddress($msglibInfo, $path)
|
|
115
122
|
);
|
|
116
123
|
}
|
|
117
124
|
|
|
118
|
-
(int, int)
|
|
119
|
-
return _getMsglibAndConnectionDefaults(
|
|
125
|
+
(int, int) getSendMsglibAndConnectionDefaults(cell $storage, cell $path) inline method_id {
|
|
126
|
+
return _getMsglibAndConnectionDefaults(
|
|
127
|
+
$storage.Endpoint::getDefaultSendLibInfo(),
|
|
128
|
+
$path
|
|
129
|
+
);
|
|
120
130
|
}
|
|
121
131
|
|
|
122
|
-
(int, int) getReceiveMsglibAndConnectionDefaults(cell $path) inline method_id {
|
|
123
|
-
return _getMsglibAndConnectionDefaults(
|
|
132
|
+
(int, int) getReceiveMsglibAndConnectionDefaults(cell $storage, cell $path) inline method_id {
|
|
133
|
+
return _getMsglibAndConnectionDefaults(
|
|
134
|
+
$storage.Endpoint::getDefaultReceiveLibInfo(),
|
|
135
|
+
$path
|
|
136
|
+
);
|
|
124
137
|
}
|
|
125
138
|
|
|
126
|
-
(int, int) getTimeoutReceiveMsglibAndConnectionDefaults(cell $path) inline method_id {
|
|
127
|
-
return _getMsglibAndConnectionDefaults(
|
|
139
|
+
(int, int) getTimeoutReceiveMsglibAndConnectionDefaults(cell $storage, cell $path) inline method_id {
|
|
140
|
+
return _getMsglibAndConnectionDefaults(
|
|
141
|
+
$storage.Endpoint::getDefaultTimeoutReceiveLibInfo(),
|
|
142
|
+
$path
|
|
143
|
+
);
|
|
128
144
|
}
|
|
129
145
|
|
|
130
146
|
() _assertAuthorizedMsglib() impure inline method_id {
|
|
131
147
|
(_, int exists) = getContractStorage()
|
|
132
|
-
.
|
|
148
|
+
.Endpoint::getMsglibs()
|
|
149
|
+
.cl::dict256::get<cellRef>(getCaller());
|
|
133
150
|
|
|
134
151
|
throw_unless(Endpoint::ERROR::unauthorizedMsglib, exists);
|
|
135
152
|
}
|
|
@@ -161,20 +178,18 @@ cell _getEpConfigFromManagerAddresses(cell $setEpConfigMd, cell $path) inline me
|
|
|
161
178
|
|
|
162
179
|
int _getEventSink() impure inline {
|
|
163
180
|
return getContractStorage()
|
|
164
|
-
.
|
|
165
|
-
.
|
|
181
|
+
.Endpoint::getBaseStorage()
|
|
182
|
+
.BaseStorage::getOwner();
|
|
166
183
|
}
|
|
167
184
|
|
|
168
|
-
|
|
169
185
|
;;; ================PERMISSION FUNCTIONS=====================
|
|
170
186
|
|
|
171
187
|
() _checkPermissions(int op, cell $md) impure inline {
|
|
172
188
|
if (op == Endpoint::OP::ENDPOINT_SEND) {
|
|
173
189
|
throw_unless(Endpoint::ERROR::notOApp,
|
|
174
190
|
getCaller() == $md
|
|
175
|
-
.
|
|
176
|
-
.
|
|
177
|
-
.cl::get<address>(lz::Path::srcOApp)
|
|
191
|
+
.md::LzSend::getPath()
|
|
192
|
+
.lz::Path::getSrcOApp()
|
|
178
193
|
);
|
|
179
194
|
} elseif (op == Endpoint::OP::ENDPOINT_COMMIT_PACKET) {
|
|
180
195
|
;; open and public calls
|
|
@@ -203,18 +218,20 @@ int _getEventSink() impure inline {
|
|
|
203
218
|
tuple setEpConfigDefaults(cell $setEpConfigMd) impure inline method_id {
|
|
204
219
|
(cell $storage, tuple actions) = preamble();
|
|
205
220
|
|
|
221
|
+
cell $sanitizedSetEpConfig = $setEpConfigMd.md::SetEpConfig::sanitize();
|
|
222
|
+
|
|
206
223
|
cell $path = lz::Path::endpointPath(
|
|
207
224
|
$storage.cl::get<uint32>(Endpoint::eid),
|
|
208
225
|
$storage.cl::get<uint32>(Endpoint::dstEid)
|
|
209
226
|
);
|
|
210
227
|
|
|
211
|
-
int sendLibManager = $
|
|
228
|
+
int sendLibManager = $sanitizedSetEpConfig
|
|
212
229
|
.cl::get<address>(md::SetEpConfig::sendMsglibManager);
|
|
213
230
|
|
|
214
|
-
int receiveLibManager = $
|
|
231
|
+
int receiveLibManager = $sanitizedSetEpConfig
|
|
215
232
|
.cl::get<address>(md::SetEpConfig::receiveMsglibManager);
|
|
216
233
|
|
|
217
|
-
int timeoutReceiveLibManager = $
|
|
234
|
+
int timeoutReceiveLibManager = $sanitizedSetEpConfig
|
|
218
235
|
.cl::get<address>(md::SetEpConfig::timeoutReceiveMsglibManager);
|
|
219
236
|
|
|
220
237
|
(cell $sendLibInfo, int sendLibExists) = getContractStorage()
|
|
@@ -226,7 +243,7 @@ tuple setEpConfigDefaults(cell $setEpConfigMd) impure inline method_id {
|
|
|
226
243
|
(cell $timeoutReceiveLibInfo, int timeoutReceiveLibExists) = getContractStorage()
|
|
227
244
|
.cl::nestedDict256::get<cellRef>(Endpoint::msglibs, timeoutReceiveLibManager);
|
|
228
245
|
|
|
229
|
-
int expiry = $
|
|
246
|
+
int expiry = $sanitizedSetEpConfig.cl::get<uint64>(md::SetEpConfig::timeoutReceiveMsglibExpiry);
|
|
230
247
|
throw_unless(
|
|
231
248
|
Endpoint::ERROR::unauthorizedMsglib,
|
|
232
249
|
(sendLibExists | (sendLibManager == NULLADDRESS))
|
|
@@ -244,7 +261,7 @@ tuple setEpConfigDefaults(cell $setEpConfigMd) impure inline method_id {
|
|
|
244
261
|
);
|
|
245
262
|
|
|
246
263
|
;; make sure the manager addresses can be resolved
|
|
247
|
-
int validity = _getEpConfigFromManagerAddresses($
|
|
264
|
+
int validity = _getEpConfigFromManagerAddresses($sanitizedSetEpConfig, $path).lz::EpConfig::isValid();
|
|
248
265
|
;; The above block validates *all* the inputs, meaning this throw_if will actually never
|
|
249
266
|
;; throw. We leave it in because it doesn't hurt, might as well keep it.
|
|
250
267
|
;; The extra gas cost is inconsequential because this is a configuration flow.
|
|
@@ -262,6 +279,7 @@ tuple setEpConfigDefaults(cell $setEpConfigMd) impure inline method_id {
|
|
|
262
279
|
|
|
263
280
|
setContractStorage(
|
|
264
281
|
$storage
|
|
282
|
+
.cl::set(Endpoint::defaultSendMsglibManager, sendLibManager)
|
|
265
283
|
.cl::set(Endpoint::defaultSendLibInfo, $sendLibInfo)
|
|
266
284
|
.cl::set(Endpoint::defaultReceiveLibInfo, $receiveLibInfo)
|
|
267
285
|
.cl::set(Endpoint::defaultTimeoutReceiveLibInfo, $timeoutReceiveLibInfo)
|
|
@@ -269,7 +287,7 @@ tuple setEpConfigDefaults(cell $setEpConfigMd) impure inline method_id {
|
|
|
269
287
|
);
|
|
270
288
|
|
|
271
289
|
;; push the event
|
|
272
|
-
actions~pushAction<event>(Endpoint::event::EP_CONFIG_DEFAULTS_SET, $
|
|
290
|
+
actions~pushAction<event>(Endpoint::event::EP_CONFIG_DEFAULTS_SET, $sanitizedSetEpConfig);
|
|
273
291
|
|
|
274
292
|
return actions;
|
|
275
293
|
}
|
|
@@ -280,16 +298,16 @@ tuple setEpConfigDefaults(cell $setEpConfigMd) impure inline method_id {
|
|
|
280
298
|
;; @out_md ExtendedMd(defaultEpConfig, setEpConfig)
|
|
281
299
|
;; @permissions owner
|
|
282
300
|
tuple setEpConfigOApp(cell $mdObj) impure inline method_id {
|
|
283
|
-
(
|
|
301
|
+
(cell $storage, tuple actions) = preamble();
|
|
284
302
|
|
|
285
303
|
;; extract the md params
|
|
286
|
-
cell $
|
|
287
|
-
cell $
|
|
288
|
-
cell $resolvedEpConfigOApp = _getEpConfigFromManagerAddresses($
|
|
304
|
+
cell $sanitizedSetEpConfigOApp = $mdObj.cl::get<objRef>(md::MdObj::md).md::SetEpConfig::sanitize();
|
|
305
|
+
cell $sanitizedPath = $mdObj.cl::get<objRef>(md::MdObj::obj).lz::Path::sanitize();
|
|
306
|
+
cell $resolvedEpConfigOApp = _getEpConfigFromManagerAddresses($sanitizedSetEpConfigOApp, $sanitizedPath);
|
|
289
307
|
|
|
290
308
|
;; send message to channel and forward the ep config defaults
|
|
291
309
|
actions~pushAction<call>(
|
|
292
|
-
_getChannelAddress($
|
|
310
|
+
_getChannelAddress($storage, $sanitizedPath),
|
|
293
311
|
Channel::OP::SET_EP_CONFIG_OAPP,
|
|
294
312
|
$resolvedEpConfigOApp
|
|
295
313
|
);
|
|
@@ -303,20 +321,33 @@ tuple setEpConfigOApp(cell $mdObj) impure inline method_id {
|
|
|
303
321
|
;; @out_md MdObj(lzSend, defaultSendConfig)
|
|
304
322
|
;; @permissions OApp
|
|
305
323
|
tuple endpointSend(cell $lzSend) impure inline method_id {
|
|
306
|
-
(
|
|
324
|
+
(cell $storage, tuple actions) = preamble();
|
|
307
325
|
;; already asserted caller identity matches the request contents in checkPermissions()
|
|
308
|
-
cell $
|
|
309
|
-
|
|
326
|
+
cell $path = $lzSend.md::LzSend::getPath();
|
|
327
|
+
|
|
328
|
+
(
|
|
329
|
+
cell $channelStorageInit,
|
|
330
|
+
cell channelCode,
|
|
331
|
+
int defaultSendMsglibManager,
|
|
332
|
+
cell $defaultSendLibInfo
|
|
333
|
+
) = $storage.Endpoint::getSendConfiguration();
|
|
310
334
|
|
|
311
335
|
;; Invariant: if a msglib is set as a default msglib, it must be resolved
|
|
312
|
-
;; thus,
|
|
313
|
-
(
|
|
336
|
+
;; thus, getSendMsglibAndConnectionDefaults should never revert
|
|
337
|
+
(
|
|
338
|
+
int sendMsglib,
|
|
339
|
+
int sendMsglibConnection
|
|
340
|
+
) = _getMsglibAndConnectionDefaults($defaultSendLibInfo, $path);
|
|
314
341
|
|
|
315
342
|
actions~pushAction<call>(
|
|
316
|
-
|
|
343
|
+
_getChannelAddressUnpacked($channelStorageInit, channelCode, $path),
|
|
317
344
|
Channel::OP::CHANNEL_SEND,
|
|
318
|
-
md::MdObj::
|
|
345
|
+
md::MdObj::build(
|
|
346
|
+
$lzSend,
|
|
347
|
+
lz::SendEpConfig::build(defaultSendMsglibManager, sendMsglib, sendMsglibConnection)
|
|
348
|
+
)
|
|
319
349
|
);
|
|
350
|
+
|
|
320
351
|
return actions;
|
|
321
352
|
}
|
|
322
353
|
|
|
@@ -327,38 +358,45 @@ tuple endpointSend(cell $lzSend) impure inline method_id {
|
|
|
327
358
|
tuple endpointCommitPacket(cell $packet) impure inline method_id {
|
|
328
359
|
(cell $storage, tuple actions) = preamble();
|
|
329
360
|
|
|
330
|
-
cell $receivePath = $packet.
|
|
361
|
+
cell $receivePath = $packet.lz::Packet::getPath();
|
|
362
|
+
(int recvPathSrcEid, int recvPathDstEid) = $receivePath.lz::Path::getEidAndDstEid();
|
|
363
|
+
(
|
|
364
|
+
int storageEid,
|
|
365
|
+
int storageDstEid,
|
|
366
|
+
int defaultExpiry,
|
|
367
|
+
cell $defaultReceiveLibInfo,
|
|
368
|
+
cell $timeoutReceiveLibInfo
|
|
369
|
+
) = $storage.Endpoint::getCommitPacketInformation();
|
|
331
370
|
|
|
332
371
|
;; Assert we are the correct endpoint for this commit request
|
|
333
372
|
;; the srcEid of the packet should match the dstEid of the endpoint contract
|
|
334
373
|
throw_if(
|
|
335
374
|
Endpoint::ERROR::wrongPath,
|
|
336
|
-
(
|
|
337
|
-
| ($receivePath.cl::get<uint32>(lz::Path::dstEid) != $storage.cl::get<uint32>(Endpoint::eid))
|
|
375
|
+
(recvPathSrcEid != storageDstEid) | (recvPathDstEid != storageEid)
|
|
338
376
|
);
|
|
339
377
|
|
|
340
378
|
cell $sendPath = $receivePath.lz::Path::optimizedReverse();
|
|
341
|
-
int channelAddress =
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
$
|
|
379
|
+
int channelAddress = _getChannelAddress($storage, $sendPath);
|
|
380
|
+
|
|
381
|
+
(_, int receiveMsglibConnection) = _getMsglibAndConnectionDefaults(
|
|
382
|
+
$defaultReceiveLibInfo,
|
|
383
|
+
$sendPath
|
|
346
384
|
);
|
|
347
385
|
|
|
348
|
-
(_, int
|
|
349
|
-
|
|
386
|
+
(_, int timeoutReceiveMsglibConnection) = _getMsglibAndConnectionDefaults(
|
|
387
|
+
$timeoutReceiveLibInfo,
|
|
350
388
|
$sendPath
|
|
351
389
|
);
|
|
352
390
|
|
|
353
391
|
actions~pushAction<call>(
|
|
354
392
|
channelAddress,
|
|
355
393
|
Channel::OP::CHANNEL_COMMIT_PACKET,
|
|
356
|
-
md::ExtendedMd::
|
|
394
|
+
md::ExtendedMd::build(
|
|
357
395
|
$packet,
|
|
358
|
-
lz::ReceiveEpConfig::
|
|
396
|
+
lz::ReceiveEpConfig::build(
|
|
359
397
|
receiveMsglibConnection,
|
|
360
398
|
timeoutReceiveMsglibConnection,
|
|
361
|
-
|
|
399
|
+
defaultExpiry
|
|
362
400
|
),
|
|
363
401
|
getCaller()
|
|
364
402
|
)
|
|
@@ -375,10 +413,12 @@ tuple endpointCommitPacket(cell $packet) impure inline method_id {
|
|
|
375
413
|
tuple addMsglib(cell $addMsglib) impure inline method_id {
|
|
376
414
|
(cell $storage, tuple actions) = preamble();
|
|
377
415
|
|
|
416
|
+
cell $sanitizedAddMsglibMd = $addMsglib.md::AddMsglib::sanitize();
|
|
417
|
+
|
|
378
418
|
;; Not necessary to check dstEid in $addMsglib is correct, because
|
|
379
419
|
;; the controller derives our address based on dstEid, so it cannot be wrong.
|
|
380
420
|
|
|
381
|
-
int msglibManagerAddress = $
|
|
421
|
+
int msglibManagerAddress = $sanitizedAddMsglibMd.cl::get<address>(md::AddMsglib::msglibManagerAddress);
|
|
382
422
|
(cell $msglibInfo, int exists) = $storage.cl::nestedDict256::get<cellRef>(
|
|
383
423
|
Endpoint::msglibs,
|
|
384
424
|
msglibManagerAddress
|
|
@@ -404,15 +444,15 @@ tuple addMsglib(cell $addMsglib) impure inline method_id {
|
|
|
404
444
|
actions~pushAction<call>(
|
|
405
445
|
msglibManagerAddress,
|
|
406
446
|
MsglibManager::OP::GET_MSGLIB_INFO,
|
|
407
|
-
$
|
|
447
|
+
$sanitizedAddMsglibMd
|
|
408
448
|
);
|
|
409
449
|
} else {
|
|
410
|
-
|
|
450
|
+
;; if the previous addMsglib ran out of gas, it can be retried
|
|
411
451
|
if (cl::isNullObject($msglibInfo)) {
|
|
412
452
|
actions~pushAction<call>(
|
|
413
453
|
msglibManagerAddress,
|
|
414
454
|
MsglibManager::OP::GET_MSGLIB_INFO,
|
|
415
|
-
$
|
|
455
|
+
$sanitizedAddMsglibMd
|
|
416
456
|
);
|
|
417
457
|
}
|
|
418
458
|
}
|
|
@@ -426,6 +466,8 @@ tuple addMsglib(cell $addMsglib) impure inline method_id {
|
|
|
426
466
|
tuple getMsglibInfoCallback(cell $msglibInfo) impure inline method_id {
|
|
427
467
|
(cell $storage, tuple actions) = preamble();
|
|
428
468
|
|
|
469
|
+
cell $sanitizedMsglibInfo = $msglibInfo.lz::MsglibInfo::sanitize();
|
|
470
|
+
|
|
429
471
|
;; the storedMsglibInfo is asserted to exist in checkPermissions
|
|
430
472
|
(cell $storedMsglibInfo, _) = $storage.cl::nestedDict256::get<cellRef>(
|
|
431
473
|
Endpoint::msglibs,
|
|
@@ -435,7 +477,7 @@ tuple getMsglibInfoCallback(cell $msglibInfo) impure inline method_id {
|
|
|
435
477
|
throw_unless(Endpoint::ERROR::msglibInfoExists, cl::isNullObject($storedMsglibInfo));
|
|
436
478
|
|
|
437
479
|
setContractStorage(
|
|
438
|
-
$storage.cl::nestedDict256::setRef(Endpoint::msglibs, getCaller(), $
|
|
480
|
+
$storage.cl::nestedDict256::setRef(Endpoint::msglibs, getCaller(), $sanitizedMsglibInfo)
|
|
439
481
|
);
|
|
440
482
|
|
|
441
483
|
return actions;
|
|
@@ -11,13 +11,14 @@ const int Endpoint::msglibs = 3;
|
|
|
11
11
|
const int Endpoint::numMsglibs = 4;
|
|
12
12
|
const int Endpoint::channelCode = 5;
|
|
13
13
|
const int Endpoint::channelStorageInit = 6;
|
|
14
|
-
const int Endpoint::
|
|
15
|
-
const int Endpoint::
|
|
16
|
-
const int Endpoint::
|
|
17
|
-
const int Endpoint::
|
|
14
|
+
const int Endpoint::defaultSendMsglibManager = 7;
|
|
15
|
+
const int Endpoint::defaultSendLibInfo = 8;
|
|
16
|
+
const int Endpoint::defaultReceiveLibInfo = 9;
|
|
17
|
+
const int Endpoint::defaultTimeoutReceiveLibInfo = 10;
|
|
18
|
+
const int Endpoint::defaultExpiry = 11;
|
|
18
19
|
|
|
19
20
|
;; @owner manager
|
|
20
|
-
cell Endpoint::New(int eid, int dstEid, int owner) inline method_id {
|
|
21
|
+
cell Endpoint::New(int eid, int dstEid, int owner) impure inline method_id {
|
|
21
22
|
return cl::declare(
|
|
22
23
|
Endpoint::NAME,
|
|
23
24
|
unsafeTuple([
|
|
@@ -28,10 +29,73 @@ cell Endpoint::New(int eid, int dstEid, int owner) inline method_id {
|
|
|
28
29
|
[cl::t::uint8, 0], ;; Endpoint::numMsglibs
|
|
29
30
|
[cl::t::cellRef, empty_cell()], ;; Endpoint::channelCode
|
|
30
31
|
[cl::t::objRef, cl::nullObject()], ;; Endpoint::channelStorageInit
|
|
32
|
+
[cl::t::address, NULLADDRESS], ;; Endpoint::defaultSendMsglibManager
|
|
31
33
|
[cl::t::objRef, cl::nullObject()], ;; Endpoint::defaultSendLibInfo
|
|
32
34
|
[cl::t::objRef, cl::nullObject()], ;; Endpoint::defaultReceiveLibInfo
|
|
33
35
|
[cl::t::objRef, cl::nullObject()], ;; Endpoint::defaultTimeoutReceiveLibInfo
|
|
34
36
|
[cl::t::uint64, 0] ;; Endpoint::defaultExpiry
|
|
35
37
|
])
|
|
36
38
|
);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
;; ====================== Storage Accessors =====================
|
|
42
|
+
|
|
43
|
+
const int Endpoint::_eidOffset = _HEADER_WIDTH;
|
|
44
|
+
const int Endpoint::_dstEidOffset = Endpoint::_eidOffset + 32;
|
|
45
|
+
const int Endpoint::_numMsglibsOffset = Endpoint::_dstEidOffset + 32;
|
|
46
|
+
const int Endpoint::_defaultSendMsglibManagerOffset = Endpoint::_numMsglibsOffset + 8;
|
|
47
|
+
const int Endpoint::_defaultExpiryOffset = Endpoint::_defaultSendMsglibManagerOffset + 256;
|
|
48
|
+
|
|
49
|
+
cell Endpoint::getBaseStorage(cell $self) impure inline {
|
|
50
|
+
return $self.cellPreloadRefAt(0);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
cell Endpoint::getMsglibs(cell $self) impure inline {
|
|
54
|
+
return $self.cellPreloadRefAt(1);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
cell Endpoint::getChannelCode(cell $self) impure inline {
|
|
58
|
+
return $self.cellPreloadRefAt(2).cellPreloadRefAt(0);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
cell Endpoint::getChannelStorageInit(cell $self) impure inline {
|
|
62
|
+
return $self.cellPreloadRefAt(2).cellPreloadRefAt(1);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
cell Endpoint::getDefaultSendLibInfo(cell $self) impure inline {
|
|
66
|
+
return $self.cellPreloadRefAt(2).cellPreloadRefAt(2);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
cell Endpoint::getDefaultReceiveLibInfo(cell $self) impure inline {
|
|
70
|
+
return $self.cellPreloadRefAt(2).cellPreloadRefAt(3);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
cell Endpoint::getDefaultTimeoutReceiveLibInfo(cell $self) impure inline {
|
|
74
|
+
return $self.cellPreloadRefAt(3).cellPreloadRefAt(0);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
;; ====================== Composite Storage Accessors =====================
|
|
78
|
+
|
|
79
|
+
;; (channelStorageInit, channelCode, defaultSendMsglibManager, defaultSendLibInfo)
|
|
80
|
+
(cell, cell, int, cell) Endpoint::getSendConfiguration(cell $self) impure inline {
|
|
81
|
+
slice selfSlice = $self.begin_parse();
|
|
82
|
+
slice ref2Slice = selfSlice.preloadRefSliceAt(2);
|
|
83
|
+
return (
|
|
84
|
+
ref2Slice.preloadRefAt(1),
|
|
85
|
+
ref2Slice.preloadRefAt(0),
|
|
86
|
+
selfSlice.preloadAddressAt(Endpoint::_defaultSendMsglibManagerOffset),
|
|
87
|
+
ref2Slice.preloadRefAt(2)
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
;; (eid, dstEid, defaultExpiry, defaultReceiveLibInfo, timeoutReceiveLibInfo)
|
|
92
|
+
(int, int, int, cell, cell) Endpoint::getCommitPacketInformation(cell $self) impure inline {
|
|
93
|
+
slice selfSlice = $self.begin_parse();
|
|
94
|
+
return (
|
|
95
|
+
selfSlice.preloadUint32At(Endpoint::_eidOffset),
|
|
96
|
+
selfSlice.preloadUint32At(Endpoint::_dstEidOffset),
|
|
97
|
+
selfSlice.preloadUint64At(Endpoint::_defaultExpiryOffset),
|
|
98
|
+
selfSlice.preloadRefAt(2).cellPreloadRefAt(3),
|
|
99
|
+
selfSlice.preloadRefAt(3).cellPreloadRefAt(0)
|
|
100
|
+
);
|
|
37
101
|
}
|
|
@@ -18,7 +18,7 @@ tuple BytesEncoder::New() inline {
|
|
|
18
18
|
tuple BytesEncoder::feed(tuple self, slice data) impure inline {
|
|
19
19
|
while (~ data.is_null()) {
|
|
20
20
|
;; verifies it is a linked list and only has one reference
|
|
21
|
-
throw_if(BytesEncoder::ERROR::malformed_subtree,data.slice_refs() > 1);
|
|
21
|
+
throw_if(BytesEncoder::ERROR::malformed_subtree, data.slice_refs() > 1);
|
|
22
22
|
|
|
23
23
|
;; grabs the last builder on the tuple stack
|
|
24
24
|
int curBuilderIdx = self.tlen() - 1;
|
|
@@ -133,18 +133,19 @@ tuple BytesEncoder::feed<cellRef>(tuple self, cell data) inline {
|
|
|
133
133
|
return self.BytesEncoder::feed(data.begin_parse());
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
tuple BytesEncoder::build<PacketV1>(cell $packet) inline {
|
|
137
|
-
cell $path = $packet.
|
|
136
|
+
tuple BytesEncoder::build<PacketV1>(cell $packet) impure inline {
|
|
137
|
+
(cell $path, cell $message, int nonce, int guid) = $packet.lz::Packet::deserialize();
|
|
138
|
+
(int srcEid, int srcOApp, int dstEid, int dstOApp) = $path.lz::Path::deserialize();
|
|
138
139
|
return unsafeTuple([
|
|
139
140
|
begin_cell() ;; 113 bytes of the 127
|
|
140
141
|
.store_uint8(1) ;; packetVersion uint8
|
|
141
|
-
.store_uint64(
|
|
142
|
-
.store_uint32(
|
|
143
|
-
.store_uint256(
|
|
144
|
-
.store_uint32(
|
|
145
|
-
.store_uint256(
|
|
146
|
-
.store_uint256(
|
|
142
|
+
.store_uint64(nonce) ;; nonce uint64
|
|
143
|
+
.store_uint32(srcEid) ;; srcEid uint32
|
|
144
|
+
.store_uint256(srcOApp) ;; sender bytes32
|
|
145
|
+
.store_uint32(dstEid) ;; dstEid uint32
|
|
146
|
+
.store_uint256(dstOApp) ;; receiver bytes32
|
|
147
|
+
.store_uint256(guid) ;; guid bytes32
|
|
147
148
|
]).BytesEncoder::feed<cellRef>(
|
|
148
|
-
$
|
|
149
|
+
$message ;; message []bytes
|
|
149
150
|
);
|
|
150
151
|
}
|
|
@@ -188,10 +188,7 @@ tuple smlManagerSend(cell $extendedMd) impure inline method_id {
|
|
|
188
188
|
actions~pushAction<call>(
|
|
189
189
|
$extendedMd.cl::get<address>(md::ExtendedMd::forwardingAddress), ;; channelAddress
|
|
190
190
|
Channel::OP::MSGLIB_SEND_CALLBACK,
|
|
191
|
-
|
|
192
|
-
$msglibSendCallbackMd,
|
|
193
|
-
getContractAddress()
|
|
194
|
-
)
|
|
191
|
+
$msglibSendCallbackMd
|
|
195
192
|
);
|
|
196
193
|
|
|
197
194
|
return actions;
|
|
@@ -8,3 +8,4 @@ const int UlnWorkerInterface::setConfig = 95983; ;; ulnWorker::setConfig
|
|
|
8
8
|
|
|
9
9
|
const int UlnWorkerInterface::ERROR::UNKNOWN_OPTIONS = 2100;
|
|
10
10
|
const int UlnWorkerInterface::ERROR::ZERO_LZ_COMPOSE_GAS_PROVIDED = 2101;
|
|
11
|
+
const int UlnWorkerInterface::ERROR::INVALID_OPTIONS = 2102;
|
|
@@ -35,15 +35,14 @@ cell lz::Attestation::New(int hash, int confirmations) inline method_id {
|
|
|
35
35
|
);
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
int lz::Attestation::
|
|
39
|
-
|
|
40
|
-
slice selfSlice = $self.begin_parse().sdskipfirst(_HEADER_WIDTH);
|
|
41
|
-
|
|
42
|
-
;; Equivalent to the below
|
|
43
|
-
;; ($self.cl::get<uint256>(lz::Attestation::hash) == hash)
|
|
44
|
-
;; & ($self.cl::get<uint64>(lz::Attestation::confirmations) <= confirmations);
|
|
38
|
+
const int lz::Attestation::_hashOffset = _HEADER_WIDTH;
|
|
39
|
+
const int lz::Attestation::_confirmationsOffset = lz::Attestation::_hashOffset + 256;
|
|
45
40
|
|
|
41
|
+
;; (hash, confirmations)
|
|
42
|
+
(int, int) lz::Attestation::deserialize(cell $self) impure inline {
|
|
43
|
+
slice selfSlice = $self.begin_parse();
|
|
46
44
|
return (
|
|
47
|
-
|
|
45
|
+
selfSlice.preloadUint256At(lz::Attestation::_hashOffset),
|
|
46
|
+
selfSlice.preloadUint64At(lz::Attestation::_confirmationsOffset)
|
|
48
47
|
);
|
|
49
48
|
}
|
|
@@ -23,4 +23,24 @@ cell DvnFeesPaidEvent::New(
|
|
|
23
23
|
[cl::t::objRef, serializedPayees] ;; DvnFeesPaidEvent::serializedPayees
|
|
24
24
|
])
|
|
25
25
|
);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
;; ========================= Object Builders =========================
|
|
29
|
+
|
|
30
|
+
const int DvnFeesPaidEvent::_headerInfoBits = _BASIC_HEADER_WIDTH + (_FIELD_INFO_WIDTH * 3);
|
|
31
|
+
const int DvnFeesPaidEvent::_headerFillerBits = _HEADER_WIDTH - DvnFeesPaidEvent::_headerInfoBits;
|
|
32
|
+
const int DvnFeesPaidEvent::_headerInfo = 5824155608645736562295029517863768977404;
|
|
33
|
+
|
|
34
|
+
cell DvnFeesPaidEvent::build(cell requiredDVNs, cell optionalDVNs, cell serializedPayees) impure inline {
|
|
35
|
+
return begin_cell()
|
|
36
|
+
.store_uint(DvnFeesPaidEvent::_headerInfo, DvnFeesPaidEvent::_headerInfoBits) ;; header info
|
|
37
|
+
.store_ones(DvnFeesPaidEvent::_headerFillerBits) ;; header filler
|
|
38
|
+
.store_ref(requiredDVNs) ;; refs[0]
|
|
39
|
+
.store_ref(optionalDVNs) ;; refs[1]
|
|
40
|
+
.store_ref(
|
|
41
|
+
begin_cell()
|
|
42
|
+
.store_ref(serializedPayees) ;; refs[2]
|
|
43
|
+
.end_cell()
|
|
44
|
+
)
|
|
45
|
+
.end_cell();
|
|
26
46
|
}
|
|
@@ -20,4 +20,19 @@ cell ExecutorFeePaidEvent::New(
|
|
|
20
20
|
[cl::t::coins, feePaid] ;; ExecutorFeePaidEvent::feePaid
|
|
21
21
|
])
|
|
22
22
|
);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
;; ========================= Object Builders =========================
|
|
26
|
+
|
|
27
|
+
const int ExecutorFeePaidEvent::_headerInfoBits = _BASIC_HEADER_WIDTH + (_FIELD_INFO_WIDTH * 2);
|
|
28
|
+
const int ExecutorFeePaidEvent::_headerFillerBits = _HEADER_WIDTH - ExecutorFeePaidEvent::_headerInfoBits;
|
|
29
|
+
const int ExecutorFeePaidEvent::_headerInfo = 22544389860372553502354985441937787;
|
|
30
|
+
|
|
31
|
+
cell ExecutorFeePaidEvent::build(int executorAddress, int feePaid) impure inline {
|
|
32
|
+
return begin_cell()
|
|
33
|
+
.store_uint(ExecutorFeePaidEvent::_headerInfo, ExecutorFeePaidEvent::_headerInfoBits) ;; header info
|
|
34
|
+
.store_ones(ExecutorFeePaidEvent::_headerFillerBits) ;; header filler
|
|
35
|
+
.store_uint256(executorAddress)
|
|
36
|
+
.store_uint128(feePaid)
|
|
37
|
+
.end_cell();
|
|
23
38
|
}
|
|
@@ -43,7 +43,7 @@ cell md::InitUlnConnection::NewOnlyConfig(
|
|
|
43
43
|
|
|
44
44
|
;; Ensure the Uln receive config does not contain garbage bits etc. that would cause
|
|
45
45
|
;; undefined behaviors in the protocol
|
|
46
|
-
cell InitUlnConnection::sanitize(cell $initUlnConnection) impure {
|
|
46
|
+
cell md::InitUlnConnection::sanitize(cell $initUlnConnection) impure {
|
|
47
47
|
cell $ulnSendConfigOApp = $initUlnConnection
|
|
48
48
|
.cl::get<objRef>(md::InitUlnConnection::ulnSendConfigOApp);
|
|
49
49
|
cell $ulnReceiveConfigOApp = $initUlnConnection
|
|
@@ -16,3 +16,9 @@ cell md::SetAdminWorkerAddresses::New(cell adminWorkers) inline method_id {
|
|
|
16
16
|
])
|
|
17
17
|
);
|
|
18
18
|
}
|
|
19
|
+
|
|
20
|
+
cell md::SetAdminWorkerAddresses::sanitize(cell $setAdminWorkerAddresses) impure inline_ref {
|
|
21
|
+
cell adminWorkers = $setAdminWorkerAddresses.cl::get<cellRef>(md::SetAdminWorkerAddresses::adminWorkers);
|
|
22
|
+
|
|
23
|
+
return md::SetAdminWorkerAddresses::New(adminWorkers);
|
|
24
|
+
}
|
|
@@ -23,4 +23,24 @@ cell UlnEvents::New(
|
|
|
23
23
|
[cl::t::objRef, executorFeePaidEvent] ;; UlnEvents::executorFeePaidEvent
|
|
24
24
|
])
|
|
25
25
|
);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
;; ========================= Object Builders =========================
|
|
29
|
+
|
|
30
|
+
const int UlnEvents::_headerInfoBits = _BASIC_HEADER_WIDTH + (_FIELD_INFO_WIDTH * 3);
|
|
31
|
+
const int UlnEvents::_headerFillerBits = _HEADER_WIDTH - UlnEvents::_headerInfoBits;
|
|
32
|
+
const int UlnEvents::_headerInfo = 28386846067720270005963581604331155452;
|
|
33
|
+
|
|
34
|
+
cell UlnEvents::build(cell workerEvents, cell dvnFeesPaidEvent, cell executorFeePaidEvent) impure inline {
|
|
35
|
+
return begin_cell()
|
|
36
|
+
.store_uint(UlnEvents::_headerInfo, UlnEvents::_headerInfoBits) ;; header info
|
|
37
|
+
.store_ones(UlnEvents::_headerFillerBits) ;; header filler
|
|
38
|
+
.store_ref(workerEvents) ;; refs[0]
|
|
39
|
+
.store_ref(dvnFeesPaidEvent) ;; refs[1]
|
|
40
|
+
.store_ref(
|
|
41
|
+
begin_cell()
|
|
42
|
+
.store_ref(executorFeePaidEvent) ;; refs[2]
|
|
43
|
+
.end_cell()
|
|
44
|
+
)
|
|
45
|
+
.end_cell();
|
|
26
46
|
}
|