The TempleGoldStaking contract implements a centralized reward distribution mechanism that relies on a single distributionStarter
address or allows unrestricted access if set to zero. This design introduces a significant centralization risk that could potentially disrupt the reward distribution process, affecting all stakers in the system.
The distributeRewards()
function, which is crucial for distributing rewards to stakers, is gated by the distributionStarter
address:
The distributionStarter
can be set by an elevated access role:
This creates two problematic scenarios:
If distributionStarter
is a non-zero address, only that address can distribute rewards.
If distributionStarter
is set to address(0), anyone can call distributeRewards()
.
Additionally, the rewardDistributionCoolDown
adds another layer of centralized control over the frequency of distributions.
The centralization in the reward distribution mechanism could lead to several high-impact issues:
Single Point of Failure: If the distributionStarter
becomes unavailable or compromised, reward distribution could be halted indefinitely.
Manipulation: A malicious distributionStarter
could manipulate distribution timing for personal gain.
Inconsistent Rewards: In the case where anyone can distribute (address(0)), uncoordinated or malicious distributions could lead to unfair reward allocation.
These issues could potentially affect all stakers in the system, disrupting the core functionality of the staking contract.
Manual review
Implement a decentralized governance mechanism for reward distribution, such as a multi-signature wallet or DAO.
Add a fallback mechanism that allows anyone to trigger distribution if it hasn't occurred within a set timeframe.
Implement time-locks on critical functions like setDistributionStarter
to provide transparency and allow users to react to changes.
If maintaining a distributionStarter
role, implement a 2-of-3 multisig or similar setup to reduce single point of failure risks.
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.