Normal behavior:
getRemainingTime()
should return 0 or a special value when no king exists, since there's no grace period to count down.
Specific issue:
The function calculates and returns a countdown based on lastClaimTime
even when currentKing == address(0)
, misleading users about the actual game state.
Likelihood:
This occurs every time getRemainingTime()
is called when no king exists.
Impact:
Front-end applications display incorrect countdown timers.
Users receive misleading information about game state.
Analytics and monitoring systems show wrong data.
The following test demonstrates that getRemainingTime()
returns a countdown even when no king exists:
Add a check for when no king exists to return 0 instead of calculating a meaningless countdown:
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.