while totalSupply
of TempleGoldStaking
is zero, reward tokens are not distributed to stakers.
This undistributed reward tokens are never swept and are locked forever.
TempleGoldStaking.sol#updateReward
modifier is the following.
In the above, _lastTimeRewardApplicable(rewardData.periodFinish)
is equal to Math.min(rewardData.periodFinish, block.timestamp)
.
And TempleGoldStaking.sol#_rewardPerToken
function is the following.
As can be seen, if totalSupply
is zero, the rewardData.rewardPerTokenStored
is not updated.
However, the rewardData.lastUpdateTime
is updated in L593
.
So the rewards for the corresponding period [rewardData.lastUpdateTime, _lastTimeRewardApplicable(rewardData.periodFinish)]
of L593
are not distributed to the stakers and are locked forever.
Reward tokens of TempleGoldStaking
may be not distributed to stakers and locked forever if totalSupply
is zero during reward distribution period.
Manual Review
Modify the TempleGoldStaking.sol#updateReward
modifier as follows.
That is, refund the undistributed rewards to the nextRewardAmount
.
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.