In TempleGoldStaking
, if distributionStarter == address(0)
, anyone can call the function distributeRewards
to distribute TempleGold
rewards to stakers. In some cases, a user could intentionally postpone the reward to the next epoch and make others wait another rewardDistributionCoolDown
by front-running the notifyDistribution
from the TempleGold
.
If distributionStarter == address(0)
, anyone can call the function distributeRewards
to distribute TempleGold
rewards to stakers.
When the TempleGold
contract calls TempleGoldStaking::notifyDistribution
to add nextRewardAmount
with large amount of token minted, a user could intentionally postpone the reward to the next epoch.
Others will have to wait additionally rewardDistributionCoolDown
to be able to distribute
again. During this interval, the user could stake by himself to enjoy the high reward rate for the following epoch.
A user could purposely postpone the large reward to the next epoch and stake during the rewardDistributionCoolDown
to get himself prepared for the high reward.
Manual
To mitigate this issue:
remove the setup of rewardDistributionCoolDown
or make it as 0
.
Add access control to distributeRewards
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.