ccip icon indicating copy to clipboard operation
ccip copied to clipboard

[DEVEL] Add supplementary check in MockCCIPRouter

Open rya-sge opened this issue 1 year ago • 2 comments

Hello, Congratulations for all your work ! The code is very clear to understand. A quick remark:

Description The function ccipSend in MockCCIPRouter doesn't check if:

  • msg.value is enough to pay the fees in the case of using native tokens.
  • if msg.value == 0 if non native tokens are used

I think it could be a great improvement for automatic tests to add these checks in order to be closer to the true behavior of the router.

Basic Information Example:

function ccipSend( uint64 destinationChainSelector, Client.EVM2AnyMessage calldata message ) external payable returns (bytes32) { uint256 feeTokenAmount = getFee(destinationChainSelector, message); if (message.feeToken == address(0)) { if (msg.value < feeTokenAmount) revert InsufficientFeeTokenAmount(); } else{ if (msg.value > 0) revert InvalidMsgValue(); }

rya-sge avatar Apr 25 '24 12:04 rya-sge

Thank you for the request. You can track progress on the issue at the following PR

https://github.com/smartcontractkit/ccip/pull/896

jhweintraub avatar May 08 '24 15:05 jhweintraub

Great, thank you very much !

rya-sge avatar May 13 '24 14:05 rya-sge

https://github.com/smartcontractkit/ccip/pull/896

RensR avatar May 27 '24 14:05 RensR