Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

feat: swap adapter #281

Draft
wants to merge 28 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion contracts/adapters/SwapAdapter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ contract SwapAdapter is AccessControl {

using SafeERC20 for IERC20;

uint8 V3_SWAP_EXACT_OUT = 1;

IBridge public immutable _bridge;
address public immutable _weth;
IUniversalRouter public immutable _swapRouter;
Expand Down Expand Up @@ -425,7 +427,7 @@ contract SwapAdapter is AccessControl {
tokenOut
);
IPermit2(_permit2).approve(tokenIn, address(_swapRouter), uint160(amountInMaximum), uint48(block.timestamp));
bytes memory commands = abi.encodePacked(uint8(0x01)); // V3_SWAP_EXACT_OUT
bytes memory commands = abi.encodePacked(V3_SWAP_EXACT_OUT); // V3_SWAP_EXACT_OUT
bytes[] memory inputs = new bytes[](1);
inputs[0] = abi.encode(
address(this), // The recipient of the output of the trade
Expand Down
Loading