fix: git submodules and strict equality check in v4 executor
This commit is contained in:
3
.gitmodules
vendored
3
.gitmodules
vendored
@@ -16,3 +16,6 @@
|
||||
[submodule "foundry/lib/v4-core"]
|
||||
path = foundry/lib/v4-core
|
||||
url = https://github.com/Uniswap/v4-core
|
||||
[submodule "foundry/lib/v4-periphery"]
|
||||
path = foundry/lib/v4-periphery
|
||||
url = https://github.com/Uniswap/v4-periphery
|
||||
|
||||
@@ -47,13 +47,19 @@ contract UniswapV4Executor is IExecutor, V4Router {
|
||||
|
||||
this.executeActions(data);
|
||||
|
||||
uint256 balanceAfter = IERC20(tokenOut).balanceOf(receiver);
|
||||
|
||||
if (isExactInput) {
|
||||
amountOut = IERC20(tokenOut).balanceOf(receiver) - balanceBefore;
|
||||
amountOut = balanceAfter - balanceBefore;
|
||||
} else {
|
||||
amountOut = amount;
|
||||
}
|
||||
|
||||
if (amountOut == 0) revert UniswapV4Executor__SwapFailed();
|
||||
// Checks if the amountOut is not 0.
|
||||
// Slither does not allow strict equality checks.
|
||||
if (amountOut < 1) {
|
||||
revert UniswapV4Executor__SwapFailed();
|
||||
}
|
||||
return amountOut;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user