Open code423n4 opened 2 years ago
ye0lde
Transfer amount can be checked for > 0 before making the external call to safeTransfer or transfer. This can save gas by avoiding the external call.
safeTransfer
transfer
The transfers are here: https://github.com/pooltogether/v4-periphery/blob/b520faea26bcf60371012f6cb246aa149abd3c7d/contracts/TwabRewards.sol#L133 https://github.com/pooltogether/v4-periphery/blob/b520faea26bcf60371012f6cb246aa149abd3c7d/contracts/TwabRewards.sol#L186
Visual Studio Code, Remix
Check that transfer amount != 0
Most transfers will be made with an amount superior to 0, so it will actually be less gas efficient for these transfers. For this reason, I've acknowledged the issue but we won't make any change.
0
Handle
ye0lde
Vulnerability details
Impact
Transfer amount can be checked for > 0 before making the external call to
safeTransfer
ortransfer
. This can save gas by avoiding the external call.Proof of Concept
The transfers are here: https://github.com/pooltogether/v4-periphery/blob/b520faea26bcf60371012f6cb246aa149abd3c7d/contracts/TwabRewards.sol#L133 https://github.com/pooltogether/v4-periphery/blob/b520faea26bcf60371012f6cb246aa149abd3c7d/contracts/TwabRewards.sol#L186
Tools Used
Visual Studio Code, Remix
Recommended Mitigation Steps
Check that transfer amount != 0