Skip to content

Commit

Permalink
fix: zero check
Browse files Browse the repository at this point in the history
  • Loading branch information
fp-crypto committed Jan 3, 2025
1 parent f707353 commit 4485a74
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/swappers/UniswapV3Swapper.sol
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ contract UniswapV3Swapper {
uint256 _amountIn,
uint256 _minAmountOut
) internal virtual returns (uint256 _amountOut) {
if (_amountIn >= minAmountToSell) {
if (_amountIn != 0 && _amountIn >= minAmountToSell) {
_checkAllowance(router, _from, _amountIn);
if (_from == base || _to == base) {
ISwapRouter.ExactInputSingleParams memory params = ISwapRouter
Expand Down Expand Up @@ -138,7 +138,7 @@ contract UniswapV3Swapper {
uint256 _amountTo,
uint256 _maxAmountFrom
) internal virtual returns (uint256 _amountIn) {
if (_maxAmountFrom >= minAmountToSell) {
if (_maxAmountFrom != 0 && _maxAmountFrom >= minAmountToSell) {
_checkAllowance(router, _from, _maxAmountFrom);
if (_from == base || _to == base) {
ISwapRouter.ExactOutputSingleParams memory params = ISwapRouter
Expand Down

0 comments on commit 4485a74

Please sign in to comment.