From d59347338311a6fc0f6ee6284f78343a74135760 Mon Sep 17 00:00:00 2001 From: thal0x Date: Mon, 11 Nov 2024 18:50:01 -0600 Subject: [PATCH] dont require execution fee to be greater than zero --- AxelarHandler/src/GoFastHandler.sol | 1 - AxelarHandler/test/GoFastHandler.t.sol | 35 -------------------------- 2 files changed, 36 deletions(-) diff --git a/AxelarHandler/src/GoFastHandler.sol b/AxelarHandler/src/GoFastHandler.sol index b93deee..f837845 100644 --- a/AxelarHandler/src/GoFastHandler.sol +++ b/AxelarHandler/src/GoFastHandler.sol @@ -39,7 +39,6 @@ contract GoFastHandler is Ownable { uint64 timeoutTimestamp, bytes calldata destinationCalldata ) public payable returns (bytes32) { - require(executionFeeAmount != 0, "execution fee cannot be zero"); require(solverFeeBPS != 0, "solver fee cannot be zero"); uint256 swapAmountOut; diff --git a/AxelarHandler/test/GoFastHandler.t.sol b/AxelarHandler/test/GoFastHandler.t.sol index 9959d73..d4cfa8e 100644 --- a/AxelarHandler/test/GoFastHandler.t.sol +++ b/AxelarHandler/test/GoFastHandler.t.sol @@ -258,41 +258,6 @@ contract GoFastHandlerTest is Test { vm.stopPrank(); } - function testSwapAndSubmitOrderRevertsIfFeeAmountIsZero() public { - address tokenIn = 0x82aF49447D8a07e3bd95BD0d56f35241523fBab1; // WETH - uint256 amountIn = 1 ether; - uint256 fastTransferFee = 0; - uint256 solverFeeBPS = 10; // 0.1% - uint32 destinationDomain = 10; - uint64 timeoutTimestamp = uint64(block.timestamp + 100); - bytes32 sender = keccak256("sender"); - bytes32 recipient = keccak256("recipient"); - - bytes memory swapCalldata = _encodeSwapExactInputCalldata(tokenIn, usdc, 500, address(handler), amountIn, 0, 0); - - deal(tokenIn, alice, amountIn); - - vm.mockCall(fastTransferGateway, abi.encodeWithSelector(IFastTransferGateway.token.selector), abi.encode(usdc)); - - vm.startPrank(alice); - IERC20(tokenIn).approve(address(handler), amountIn); - - vm.expectRevert("execution fee cannot be zero"); - handler.swapAndSubmitOrder( - tokenIn, - amountIn, - swapCalldata, - fastTransferFee, - solverFeeBPS, - sender, - recipient, - destinationDomain, - timeoutTimestamp, - "" - ); - vm.stopPrank(); - } - function testSwapAndSubmitOrderRevertsIfSolverFeeIsZero() public { address tokenIn = 0x82aF49447D8a07e3bd95BD0d56f35241523fBab1; // WETH uint256 amountIn = 1 ether;