code-423n4 / 2021-12-pooltogether-findings

0 stars 0 forks source link

For uint `> 0` can be replaced with ` != 0` for gas optimization #128

Closed code423n4 closed 2 years ago

code423n4 commented 2 years ago

Handle

0x0x0x

Vulnerability details

Impact

!= 0 is a cheaper operation compared to > 0, when dealing with uint.

Occurrences


./TwabRewards.sol:239:        if (data.length > 0) {
./TwabRewards.sol:255:            _promotionEndTimestamp > 0 && _promotionEndTimestamp >= block.timestamp,
./TwabRewards.sol:319:        if (_averageTotalSupplies[0] > 0) {
PierrickGT commented 2 years ago

Duplicate of https://github.com/code-423n4/2021-12-pooltogether-findings/issues/33