From 9256bf87425edbd00371923b0154c3dd32f45496 Mon Sep 17 00:00:00 2001 From: die-herdplatte <173669014+die-herdplatte@users.noreply.github.com> Date: Tue, 1 Apr 2025 14:00:48 +0700 Subject: [PATCH] Remove Ekubo executor support for partial swaps Partial swaps would likely run out-of-gas anyway and removing the support saves a bit more gas --- foundry/src/executors/EkuboExecutor.sol | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/foundry/src/executors/EkuboExecutor.sol b/foundry/src/executors/EkuboExecutor.sol index d4175a3..ade58c1 100644 --- a/foundry/src/executors/EkuboExecutor.sol +++ b/foundry/src/executors/EkuboExecutor.sol @@ -120,10 +120,8 @@ contract EkuboExecutor is IExecutor, ICallback, ILocker, IPayer { } function _locked(bytes calldata swapData) internal { - // For partial swaps this is not equivalent to the given input amount - uint128 tokenInDebtAmount = 0; - int128 nextAmountIn = int128(uint128(bytes16(swapData[0:16]))); + uint128 tokenInDebtAmount = uint128(nextAmountIn); address receiver = address(bytes20(swapData[16:36])); address tokenIn = address(bytes20(swapData[36:POOL_DATA_OFFSET])); @@ -153,10 +151,6 @@ contract EkuboExecutor is IExecutor, ICallback, ILocker, IPayer { 0 ); - if (tokenInDebtAmount == 0) { - tokenInDebtAmount = uint128(isToken1 ? delta1 : delta0); - } - nextTokenIn = nextTokenOut; nextAmountIn = -(isToken1 ? delta0 : delta1);