Skip to content

Commit

Permalink
dont require execution fee to be greater than zero
Browse files Browse the repository at this point in the history
  • Loading branch information
thal0x committed Nov 12, 2024
1 parent 3f93725 commit d593473
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 36 deletions.
1 change: 0 additions & 1 deletion AxelarHandler/src/GoFastHandler.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
35 changes: 0 additions & 35 deletions AxelarHandler/test/GoFastHandler.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit d593473

Please sign in to comment.