Closed code423n4 closed 2 years ago
gzeon
> 0 is less gas efficient than != 0 for uint
> 0
!= 0
$ grep -Rn -F "> 0" ./contracts/ ./contracts/L1/gateway/L1LPTGateway.sol:152: if (escrowBalance > 0) { ./contracts/L2/gateway/L2Migrator.sol:182: if (_params.fees > 0) { ./contracts/L2/gateway/L2Migrator.sol:296: if (_fees > 0) {
Duplicate of https://github.com/code-423n4/2022-01-livepeer-findings/issues/37
Handle
gzeon
Vulnerability details
Impact
> 0
is less gas efficient than!= 0
for uintProof of Concept
$ grep -Rn -F "> 0" ./contracts/ ./contracts/L1/gateway/L1LPTGateway.sol:152: if (escrowBalance > 0) { ./contracts/L2/gateway/L2Migrator.sol:182: if (_params.fees > 0) { ./contracts/L2/gateway/L2Migrator.sol:296: if (_fees > 0) {