diff --git a/contracts/WooPPV3/WooRouterV3.sol b/contracts/WooPPV3/WooRouterV3.sol index eabb005..9d8ca07 100644 --- a/contracts/WooPPV3/WooRouterV3.sol +++ b/contracts/WooPPV3/WooRouterV3.sol @@ -129,10 +129,11 @@ contract WooRouterV3 is IWooRouterV3, Ownable, ReentrancyGuard { // Step 1: transfer the source tokens to WooRouterV3 if (isFromETH) { - require(fromAmount <= msg.value, "WooRouterV3: fromAmount_INVALID"); + require(fromAmount == msg.value, "WooRouterV3: !msg.value"); IWETH(WETH).deposit{value: msg.value}(); TransferHelper.safeTransfer(WETH, address(wooPP), fromAmount); } else { + require(0 == msg.value, "WooRouterV3: !msg.value"); TransferHelper.safeTransferFrom(fromToken, msg.sender, address(wooPP), fromAmount); } diff --git a/contracts/WooRouterV2.sol b/contracts/WooRouterV2.sol index c7774fc..89961d9 100644 --- a/contracts/WooRouterV2.sol +++ b/contracts/WooRouterV2.sol @@ -129,10 +129,11 @@ contract WooRouterV2 is IWooRouterV2, Ownable, ReentrancyGuard { // Step 1: transfer the source tokens to WooRouter if (isFromETH) { - require(fromAmount <= msg.value, "WooRouter: fromAmount_INVALID"); + require(fromAmount == msg.value, "WooRouter: !msg.value"); IWETH(WETH).deposit{value: msg.value}(); TransferHelper.safeTransfer(WETH, address(wooPool), fromAmount); } else { + require(0 == msg.value, "WooRouter: !msg.value"); TransferHelper.safeTransferFrom(fromToken, msg.sender, address(wooPool), fromAmount); }