You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: contracts/contracts/ccip/fee_quoter/contract.tolk
+14-7Lines changed: 14 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -217,10 +217,17 @@ get fun validatedFee(msg: Router_CCIPSend): coins {
217
217
218
218
val it = (msg.data as SnakedCell<uint8>).iter();
219
219
val (msgDataLen, errorCode) = it.countBytesSafe();
220
-
if (errorCode == ERROR_INVALID_DATA) {
221
-
throw FeeQuoter_Error.InvalidMsgData;
222
-
} else if (errorCode == 8) {
223
-
throw FeeQuoter_Error.MsgDataTooLarge;
220
+
match (errorCode) {
221
+
0 => { /* continue */ }
222
+
8 => {
223
+
throw FeeQuoter_Error.MsgDataTooLarge;
224
+
}
225
+
ERROR_INVALID_DATA => {
226
+
throw FeeQuoter_Error.InvalidMsgData;
227
+
}
228
+
else => {
229
+
throw errorCode;
230
+
}
224
231
}
225
232
226
233
var gasLimit = validateMessageAndResolveGasLimitForDestination(msg.extraArgs, destChainConfig.config, msg, msgDataLen);
@@ -283,13 +290,13 @@ fun _dataAvailabilityCost(
283
290
// dest_data_availability_overhead_gas is a separate config value for flexibility to be updated
284
291
// independently of message codestChainConfig. Its value is determined by CCIP lane implementation, e.g.
285
292
// the overhead data posted for OCR.
286
-
val daLengthCost = mustProd(dataAvailabilityLengthBytes, destChainConfig.config.destGasPerDataAvailabilityByte as uint256, FeeQuoter_Error.DataAvailabilityCostOverflow as int);
287
-
val dataAvailabilityGas = mustAdd(daLengthCost, destChainConfig.config.destDataAvailabilityOverheadGas as uint256, FeeQuoter_Error.DataAvailabilityCostOverflow as int);
293
+
val daLengthCost = mustProd(dataAvailabilityLengthBytes, destChainConfig.config.destGasPerDataAvailabilityByte, FeeQuoter_Error.DataAvailabilityCostOverflow as int);
294
+
val dataAvailabilityGas = mustAdd(daLengthCost, destChainConfig.config.destDataAvailabilityOverheadGas, FeeQuoter_Error.DataAvailabilityCostOverflow as int);
288
295
289
296
// data_availability_gas_price is in 18 decimals, dest_data_availability_multiplier_bps is in 4 decimals
290
297
// We pad 14 decimals to bring the result to 36 decimals, in line with token bps and execution fee.
291
298
val daPrice = mustProd(dataAvailabilityGasPrice, dataAvailabilityGas, FeeQuoter_Error.DataAvailabilityCostOverflow as int);
292
-
val daWithMultiplier = mustProd(daPrice, destChainConfig.config.destDataAvailabilityMultiplierBps as uint256, FeeQuoter_Error.DataAvailabilityCostOverflow as int);
299
+
val daWithMultiplier = mustProd(daPrice, destChainConfig.config.destDataAvailabilityMultiplierBps, FeeQuoter_Error.DataAvailabilityCostOverflow as int);
293
300
return mustProd(daWithMultiplier, VAL_1E14, FeeQuoter_Error.DataAvailabilityCostOverflow as int);
0 commit comments