The Standard

The Standard
DeFiHardhat
20,000 USDC
View results
Submission Details
Severity: low
Invalid

Use != 0 instead of > 0 for unsigned integer comparison()

Summary

Using != 0 instead of > 0 for unsigned integers comparison is less gas cost.

Vulnerability Details

File: contracts/LiquidationPool.sol
88: if (_position.TST > 0) _position.EUROs += IERC20(EUROs).balanceOf(manager) * _position.TST / getTstTotal();
135: require(_tstVal > 0 || _eurosVal > 0);
138: if (_tstVal > 0) IERC20(TST).safeTransferFrom(msg.sender, address(this), _tstVal);
139: if (_eurosVal > 0) IERC20(EUROs).safeTransferFrom(msg.sender, address(this), _eurosVal);
153: if (_tstVal > 0) {
157: if (_eurosVal > 0) {
169: if (_rewardAmount > 0) {
184: if (tstTotal > 0) {
214: if (_positionStake > 0) {
217: if (asset.amount > 0) {
239: if (burnEuros > 0) IEUROs(EUROs).burn(address(this), burnEuros);
File: contracts/LiquidationPoolManager.sol
36: if (_feesForPool > 0) {
48: if (balance > 0) {
54: if (balance > 0) IERC20(_token.addr).transfer(protocol, balance);
70: if (ethBalance > 0) assets[i] = ILiquidationPoolManager.Asset(token, ethBalance);
74: if (erc20balance > 0) {
File: contracts/SmartVaultV3.sol
203: if (wethBalance > 0) weth.withdraw(wethBalance);

Impact

Gas

Tools Used

Manual review

Recommendations

Use != 0 instead of > 0 for unsigned integer comparison()

Updates

Lead Judging Commences

hrishibhat Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

informational/invalid

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.