Open sujithsomraaj opened 5 months ago
Hi @sujithsomraaj ,
good point. I would add it but prefer to have all conditions in the if clause (so that the same error InformationMismatch is thrown). Like this:
function _validateDestinationCallFlag(
ILiFi.BridgeData memory _bridgeData,
StargateData calldata _stargateData
) private pure {
if (
(_stargateData.sendParams.composeMsg.length > 0 != _bridgeData.hasDestinationCall) ||
(_bridgeData.hasDestinationCall && _stargateData.sendParams.oftCmd.length != 0)
) {
revert InformationMismatch();
}
}
Should be the same logic. Could you please confirm?
yea they look good to me @0xDEnYO
New solution accepted - issue closed.
Context: StargateFacetV2.sol#L144
Description: The stargate
SendParam
used instartBridgeTokensViaStargate
andswapAndStartBridgeTokensViaStargate
will have an optional parameter calledoftCmd
that determines whether to usetaxi
orbus
in Stargate.The issue here is that if the length of
oftCmd
is not zero, then no message will be composed at the destination for dst swaps, resulting in unexpected behavior. As funds could be recovered from theReceiverStargateV2
contract, considering this alow
severity issue.Recommendation: Validate if the
_bridgeData.hasDestinationCall
is enabled then the oftCmd length should be zero.LI.FI:
Researcher: