The _notifyReward
function in the TempleGoldStaking contract incorrectly extends the reward period every time new rewards are added. Due to frequent calls to distributeRewards
, this causes continuous period extension and progressive dilution of the reward rate, severely impacting the staking mechanism's effectiveness.
In the _notifyReward
function:
The function always extends periodFinish
, and for ongoing periods, it recalculates the reward rate based on the extended duration. With distributeRewards
callable every 10 seconds to 1 minute (as per test configurations), this leads to:
Continuous extension of the reward period.
Constant recalculation and dilution of the reward rate.
Discrepancy between intended and actual reward distribution timeframes.
Note: The current implementation also blocks calls to setVestingPeriod
and setRewardDuration
functions due to their checks if (rewardData.periodFinish >= block.timestamp) { revert InvalidOperation(); }
. As the period finish time is constantly extended, these critical configuration functions become unusable, further compromising the contract's adaptability and management.
Severe Reward Rate Dilution: As the period is continuously extended and the reward rate recalculated, the effective reward rate for stakers dramatically decreases over time. This results in stakers receiving significantly fewer rewards than intended, potentially approaching zero as the period extends indefinitely.
Modify the _notifyReward
function to maintain fixed-duration reward periods:
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.