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
This commit is contained in:
die-herdplatte
2025-04-01 14:00:48 +07:00
parent 62b882496d
commit 9256bf8742

View File

@@ -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);