Closed code423n4 closed 2 years ago
ye0lde
Gas savings
"> 0" is used in the following locations: https://github.com/pooltogether/v4-periphery/blob/b520faea26bcf60371012f6cb246aa149abd3c7d/contracts/TwabRewards.sol#L239 https://github.com/pooltogether/v4-periphery/blob/b520faea26bcf60371012f6cb246aa149abd3c7d/contracts/TwabRewards.sol#L255 https://github.com/pooltogether/v4-periphery/blob/b520faea26bcf60371012f6cb246aa149abd3c7d/contracts/TwabRewards.sol#L319
Visual Studio Code, Remix
Change "> 0" to "!=0" for small gas savings.
Duplicate of https://github.com/code-423n4/2021-12-pooltogether-findings/issues/33
Handle
ye0lde
Vulnerability details
Impact
Gas savings
Proof of Concept
"> 0" is used in the following locations: https://github.com/pooltogether/v4-periphery/blob/b520faea26bcf60371012f6cb246aa149abd3c7d/contracts/TwabRewards.sol#L239 https://github.com/pooltogether/v4-periphery/blob/b520faea26bcf60371012f6cb246aa149abd3c7d/contracts/TwabRewards.sol#L255 https://github.com/pooltogether/v4-periphery/blob/b520faea26bcf60371012f6cb246aa149abd3c7d/contracts/TwabRewards.sol#L319
Tools Used
Visual Studio Code, Remix
Recommended Mitigation Steps
Change "> 0" to "!=0" for small gas savings.