Skip to content

Commit 1a88584

Browse files
committed
remove unused imports, and use named struct construtor
1 parent 3629ea7 commit 1a88584

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/router.sol

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@ import { IRouter } from "@async-swap/interfaces/IRouter.sol";
66
import { AsyncOrder } from "@async-swap/types/AsyncOrder.sol";
77
import { CurrencySettler } from "@uniswap/v4-core/test/utils/CurrencySettler.sol";
88
import { IPoolManager } from "v4-core/interfaces/IPoolManager.sol";
9-
import { IERC20Minimal } from "v4-core/interfaces/external/IERC20Minimal.sol";
109
import { SafeCast } from "v4-core/libraries/SafeCast.sol";
1110
import { Currency, CurrencyLibrary } from "v4-core/types/Currency.sol";
12-
import { PoolId } from "v4-core/types/PoolId.sol";
1311
import { PoolKey } from "v4-core/types/PoolKey.sol";
1412

1513
/// @title Router Contract
@@ -62,7 +60,7 @@ contract Router is IRouter {
6260
tstore(ASYNC_FILLER_LOCATION, onBehalf)
6361
}
6462

65-
POOLMANAGER.unlock(abi.encode(SwapCallback(ActionType.Swap, order)));
63+
POOLMANAGER.unlock(abi.encode(SwapCallback({ action: ActionType.Swap, order: order })));
6664
}
6765

6866
/// @inheritdoc IRouter
@@ -74,7 +72,7 @@ contract Router is IRouter {
7472
tstore(ASYNC_FILLER_LOCATION, onBehalf)
7573
}
7674

77-
POOLMANAGER.unlock(abi.encode(SwapCallback(ActionType.FillOrder, order)));
75+
POOLMANAGER.unlock(abi.encode(SwapCallback({ action: ActionType.FillOrder, order: order })));
7876
}
7977

8078
function withdraw(PoolKey memory key, bool zeroForOne, uint256 amount) external {
@@ -84,7 +82,13 @@ contract Router is IRouter {
8482
tstore(ASYNC_FILLER_LOCATION, onBehalf)
8583
}
8684

87-
POOLMANAGER.unlock(abi.encode(WithdrawCallback(ActionType.Withdrawal, key, zeroForOne, amount, msg.sender)));
85+
POOLMANAGER.unlock(
86+
abi.encode(
87+
WithdrawCallback({
88+
action: ActionType.Withdrawal, key: key, zeroForOne: zeroForOne, amount: amount, user: msg.sender
89+
})
90+
)
91+
);
8892
}
8993

9094
/// Callback handler to unlock the PoolManager after a swap or fill order.

0 commit comments

Comments
 (0)