Skip to content

Commit

Permalink
Update SwapAdapter
Browse files Browse the repository at this point in the history
  • Loading branch information
viatrix committed Dec 6, 2024
1 parent 3b60441 commit 17b0168
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions contracts/SwapAdapter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ contract SwapAdapter is AccessControl {
_permit2 = permit2;
_nativeTokenAdapter = nativeTokenAdapter;
_nativeResourceID = nativeTokenAdapter._resourceID();
IERC20(_weth).approve(address(_permit2), type(uint256).max);
_grantRole(DEFAULT_ADMIN_ROLE, msg.sender);
}

Expand Down Expand Up @@ -425,7 +424,7 @@ contract SwapAdapter is AccessControl {
tokenIn,
tokenOut
);
IERC20(tokenIn).forceApprove(address(_permit2), type(uint256).max);
IERC20(tokenIn).forceApprove(address(_permit2), amountInMaximum);
IPermit2(_permit2).approve(tokenIn, address(_swapRouter), uint160(amountInMaximum), uint48(block.timestamp));
bytes memory commands = abi.encodePacked(V3_SWAP_EXACT_OUT); // V3_SWAP_EXACT_OUT
bytes[] memory inputs = new bytes[](1);
Expand Down

0 comments on commit 17b0168

Please sign in to comment.