Closed code423n4 closed 2 years ago
pedroais
!= 0 is cheaper than >0 for uint
https://github.com/code-423n4/2022-01-trader-joe/blob/a1579f6453bc4bf9fb0db9c627beaa41135438ed/contracts/LaunchEvent.sol#L338
checking if a unit != 0 is cheaper and equivalent to checking if it's greater than 0 Mitigation Steps
Duplicate of #240
Handle
pedroais
Vulnerability details
Impact
!= 0 is cheaper than >0 for uint
Proof of Concept
https://github.com/code-423n4/2022-01-trader-joe/blob/a1579f6453bc4bf9fb0db9c627beaa41135438ed/contracts/LaunchEvent.sol#L338
checking if a unit != 0 is cheaper and equivalent to checking if it's greater than 0 Mitigation Steps