StabilityPool.sol:
1090: require(_initialDeposit > 0, "StabilityPool: User must have a non-zero deposit");
1099: require(_amount > 0, "StabilityPool: Amount must be non-zero");
TroveManagerLiquidations.sol:
657: if (_YUSDInStabPool > 0) {
TroveManagerRedemptions.sol:
497: require(_amount > 0, "TroveManager: Amount must be greater than zero");
520: require(total > 0, "must be non zero redemption amount");
Handle
Dravee
Vulnerability details
Impact
In view and pure functions, != 0 costs less gass compared to > 0 for unsigned integer
Proof of Concept
HintHelpers.sol: 100: while (currentTroveuser != address(0) && remainingYUSD > 0 && _maxIterations-- > 0) {
StabilityPool.sol: 1090: require(_initialDeposit > 0, "StabilityPool: User must have a non-zero deposit"); 1099: require(_amount > 0, "StabilityPool: Amount must be non-zero");
TroveManager.sol: 502: assert(totalStakesSnapshot[token] > 0);
TroveManagerLiquidations.sol: 657: if (_YUSDInStabPool > 0) {
TroveManagerRedemptions.sol: 497: require(_amount > 0, "TroveManager: Amount must be greater than zero"); 520: require(total > 0, "must be non zero redemption amount");
AssetWrappers\WJLP\SafeMath.sol: 196: require(b > 0, errorMessage); 222: require(b > 0, errorMessage);
Dependencies\CheckContract.sol: 17: require(size > 0, "Account code size cannot be zero");
Dependencies\LiquityBase.sol: 159: if (coll.amounts[i] > 0) {
Dependencies\LiquityMath.sol: 83: if (_debt > 0) {
Dependencies\SafeMath.sol: 122: require(b > 0, errorMessage);
Dependencies\TellorCaller.sol: 50: if (_value > 0) return (true, _value, _time);
Dependencies\YetiCustomBase.sol: 38: if (_coll1.amounts[i] > 0) { 46: if (_coll2.amounts[i] > 0) { 60: if (coll3.amounts[i] > 0) { 145: if (_coll1.amounts[i] > 0) { 166: if (coll3.amounts[i] > 0) {
LPRewards\Dependencies\Address.sol: 34: return size > 0; 152: if (returndata.length > 0) {
PriceCurves\ThreePieceWiseLinearPriceCurve.sol: 144: if (decay > 0 && decay < decayTime) {
YETI\sYETIToken.sol: 271: require(b > 0, "BoringMath: Div By 0");