In the current implementation of createPromotion(), _tokensPerEpoch is allowed to be 0, and it's not changeable after creation. As a result, the promotion will never be claimable.
Thus, adding a promotion with _tokensPerEpoch = 0 is totally a waste of gas, for the creator and users who try to claim it.
We suggest adding a requirement of _tokensPerEpoch > 0 to avoid wasting gas for adding and claiming promotions with 0 rewards.
Handle
WatchPug
Vulnerability details
https://github.com/pooltogether/v4-periphery/blob/0e94c54774a6fce29daf9cb23353208f80de63eb/contracts/TwabRewards.sol#L88-L116
In the current implementation of
createPromotion()
,_tokensPerEpoch
is allowed to be0
, and it's not changeable after creation. As a result, the promotion will never be claimable.Thus, adding a promotion with
_tokensPerEpoch = 0
is totally a waste of gas, for the creator and users who try to claim it.We suggest adding a requirement of
_tokensPerEpoch > 0
to avoid wasting gas for adding and claiming promotions with 0 rewards.