Closed code423n4 closed 2 years ago
defsec
!= 0 is a cheaper operation compared to > 0, when dealing with uint.
!= 0
> 0
https://github.com/code-423n4/2021-12-yetifinance/blob/main/packages/contracts/contracts/BorrowerOperations.sol#L165 https://github.com/code-423n4/2021-12-yetifinance/blob/main/packages/contracts/contracts/BorrowerOperations.sol#L290 https://github.com/code-423n4/2021-12-yetifinance/blob/main/packages/contracts/contracts/BorrowerOperations.sol#L566 https://github.com/code-423n4/2021-12-yetifinance/blob/main/packages/contracts/contracts/BorrowerOperations.sol#L572 https://github.com/code-423n4/2021-12-yetifinance/blob/main/packages/contracts/contracts/BorrowerOperations.sol#L913 https://github.com/code-423n4/2021-12-yetifinance/blob/main/packages/contracts/contracts/StabilityPool.sol#L656 https://github.com/code-423n4/2021-12-yetifinance/blob/main/packages/contracts/contracts/StabilityPool.sol#L1090 https://github.com/code-423n4/2021-12-yetifinance/blob/main/packages/contracts/contracts/StabilityPool.sol#L1099
None
Consider to replace > 0 with != 0 for gas optimization.
Duplicate of #173
Handle
defsec
Vulnerability details
Impact
!= 0
is a cheaper operation compared to> 0
, when dealing with uint.Proof of Concept
Tools Used
None
Recommended Mitigation Steps
Consider to replace
> 0
with!= 0
for gas optimization.