feat: Support Euler low balance single swaps (univ4)

Took 1 hour 34 minutes


Took 4 minutes
This commit is contained in:
Diana Carvalho
2025-10-09 10:26:28 +02:00
parent eb05dbcf27
commit f82ae3b92a
3 changed files with 77 additions and 20 deletions

View File

@@ -275,17 +275,12 @@ contract UniswapV4Executor is
address receiver,
bytes calldata hookData
) external returns (uint128) {
Currency currencyIn = zeroForOne ? poolKey.currency0 : poolKey.currency1;
_settle(currencyIn, amountIn, transferType);
uint128 amountOut = _swap(
poolKey, zeroForOne, -int256(uint256(amountIn)), hookData
).toUint128();
Currency currencyIn = zeroForOne ? poolKey.currency0 : poolKey.currency1;
uint256 amount = _getFullDebt(currencyIn);
if (amount > amountIn) {
revert UniswapV4Executor__V4TooMuchRequested(amountIn, amount);
}
_settle(currencyIn, amount, transferType);
Currency currencyOut =
zeroForOne ? poolKey.currency1 : poolKey.currency0;
_take(currencyOut, receiver, _mapTakeAmount(amountOut, currencyOut));