From e4d6cf34139f27fdc38ae6d55e6cd61fbf2052cf Mon Sep 17 00:00:00 2001 From: viatrix Date: Tue, 3 Dec 2024 16:06:09 +0200 Subject: [PATCH] Update approve --- contracts/adapters/SwapAdapter.sol | 1 + 1 file changed, 1 insertion(+) diff --git a/contracts/adapters/SwapAdapter.sol b/contracts/adapters/SwapAdapter.sol index 42783951..0c182caf 100644 --- a/contracts/adapters/SwapAdapter.sol +++ b/contracts/adapters/SwapAdapter.sol @@ -437,6 +437,7 @@ contract SwapAdapter is AccessControl { true // A flag for whether the input tokens should come from the msg.sender ); _swapRouter.execute(commands, inputs, block.timestamp); + IERC20(tokenIn).approve(address(_permit2), 0); uint256 balanceAfter = IERC20(tokenIn).balanceOf(address(this)); amountIn = balanceBefore - balanceAfter; emit TokensSwapped(tokenIn, tokenOut, amountIn, amountOut);