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/2022-01-yield/blob/main/contracts/ConvexStakingWrapper.sol#L165 https://github.com/code-423n4/2022-01-yield/blob/main/contracts/ConvexStakingWrapper.sol#L182 https://github.com/code-423n4/2022-01-yield/blob/main/contracts/ConvexYieldWrapper.sol#L128 https://github.com/code-423n4/2022-01-yield/blob/main/contracts/ConvexYieldWrapper.sol#L142
Code Review
Use "!=0" instead of ">0" for the gas optimization.
Duplicate of #57
Handle
defsec
Vulnerability details
Impact
!= 0
is a cheaper operation compared to> 0
, when dealing with uint.Proof of Concept
Tools Used
Code Review
Recommended Mitigation Steps
Use "!=0" instead of ">0" for the gas optimization.