Open code423n4 opened 2 years ago
Taking as main
Note that the finding is valid only when using the check for a require
In an if statement !=
will cost more gas
@GalloDaSballo Try as I might, I could not confirm any gas difference between !=0 and >0 with if statements :/
Handle
Dravee
Vulnerability details
Impact
!= 0
costs less gas compared to> 0
for unsigned integers inrequire
statements with the optimizer enabled (6 gas)Proof of Concept
> 0
is used in the following location(s):Tools Used
VS Code
Recommended Mitigation Steps
Change
> 0
with!= 0
.