cancelPromotion()
Unable to cancel unstarted promotions
#101
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
sponsor confirmed
Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
Handle
WatchPug
Vulnerability details
For unstarted promotions,
cancelPromotion()
will revert atblock.timestamp - _promotion.startTimestamp
in_getCurrentEpochId()
.Call stack:
cancelPromotion()
->_getRemainingRewards()
->_getCurrentEpochId()
.https://github.com/pooltogether/v4-periphery/blob/0e94c54774a6fce29daf9cb23353208f80de63eb/contracts/TwabRewards.sol#L331-L336
https://github.com/pooltogether/v4-periphery/blob/0e94c54774a6fce29daf9cb23353208f80de63eb/contracts/TwabRewards.sol#L276-L279
Recommendation
Consider checking if
_promotion.startTimestamp > block.timestamp
and refund_promotion.tokensPerEpoch * _promotion.numberOfEpochs
incancelPromotion()
.The text was updated successfully, but these errors were encountered: