Skip to content

Commit

Permalink
simplify function naming
Browse files Browse the repository at this point in the history
  • Loading branch information
ConjunctiveNormalForm committed Dec 18, 2023
1 parent 433f4d5 commit e095318
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions contracts/V4Router.sol
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ abstract contract V4Router is IV4Router, ILockCallback {
}

function _swapExactInputSingle(IV4Router.ExactInputSingleParams memory params, address msgSender) private {
_swapExactPrivate(
_swap(
params.poolKey,
params.zeroForOne,
int256(int128(params.amountIn)),
Expand All @@ -78,7 +78,7 @@ abstract contract V4Router is IV4Router, ILockCallback {
for (uint256 i = 0; i < pathLength; i++) {
(PoolKey memory poolKey, bool zeroForOne) = _getPoolAndSwapDirection(params.path[i], params.currencyIn);
amountOut = uint128(
-_swapExactPrivate(
-_swap(
poolKey,
zeroForOne,
int256(int128(params.amountIn)),
Expand All @@ -99,7 +99,7 @@ abstract contract V4Router is IV4Router, ILockCallback {
}

function _swapExactOutputSingle(IV4Router.ExactOutputSingleParams memory params, address msgSender) private {
_swapExactPrivate(
_swap(
params.poolKey,
params.zeroForOne,
-int256(int128(params.amountOut)),
Expand All @@ -120,7 +120,7 @@ abstract contract V4Router is IV4Router, ILockCallback {
(PoolKey memory poolKey, bool oneForZero) =
_getPoolAndSwapDirection(params.path[i - 1], params.currencyOut);
amountIn = uint128(
_swapExactPrivate(
_swap(
poolKey,
!oneForZero,
-int256(int128(params.amountOut)),
Expand All @@ -139,7 +139,7 @@ abstract contract V4Router is IV4Router, ILockCallback {
}
}

function _swapExactPrivate(
function _swap(
PoolKey memory poolKey,
bool zeroForOne,
int256 amountSpecified,
Expand Down

0 comments on commit e095318

Please sign in to comment.