[H-3] Winner Can Never Be Declared Due to Incorrect require Grace Period Logic
The declareWinner() function cannot be called unless block.timestamp > lastClaimTime + gracePeriod.
This logic creates a flawed dependency on lastClaimTime, which results in the grace period constantly extending if users keep calling claimThrone() close to the grace period boundary. This directly
contradicts the documentation and comments which state:
"Can call declareWinner() once the gracePeriod has expired."
However, by resetting lastClaimTime every time someone calls claimThrone(), the grace period effectively never expires unless no one calls claimThrone() for gracePeriod seconds straight.
Impact:
1.High severity: The protocol fails to finalize and declare a winner.
2.Breaks the core functionality of the contract (declaring winner).
3.Misleading documentation: only mentions gracePeriod, but lastClaimTime dependency makes logic behavior differ from expectations.
4.Funds or rewards tied to declaring the winner may become permanently locked.
5.Opens potential griefing vector where malicious users can block the game from ending indefinitely with minimal gas.
Update the condition for declaring a winner to compare block.timestamp with Only gracePeriod or
Updated Graceperiod By Owner:
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.