sherlock-audit / 2024-08-cork-protocol-judging

2 stars 2 forks source link

Mammoth Laurel Nightingale - [GAS-9] Use != 0 instead of > 0 for unsigned integer comparison #282

Closed sherlock-admin4 closed 2 months ago

sherlock-admin4 commented 2 months ago

Mammoth Laurel Nightingale

Low/Info

[GAS-9] Use != 0 instead of > 0 for unsigned integer comparison

Summary

Vulnerability Detail

Impact

Code Snippet

Instances (4):

File: libraries/uni-v2/UniswapV2Library.sol

67:         require(amountIn > 0, "UniswapV2Library: INSUFFICIENT_INPUT_AMOUNT");

68:         require(reserveIn > 0 && reserveOut > 0, "UniswapV2Library: INSUFFICIENT_LIQUIDITY");

82:         require(amountOut > 0, "UniswapV2Library: INSUFFICIENT_OUTPUT_AMOUNT");

83:         require(reserveIn > 0 && reserveOut > 0, "UniswapV2Library: INSUFFICIENT_LIQUIDITY");

Tool used

Manual Review

Recommendation

sherlock-admin2 commented 1 month ago

The protocol team fixed this issue in the following PRs/commits: https://github.com/Cork-Technology/Depeg-swap/pull/93