Normal behavior: The claimThrone()
function allows users to become the new king by sending a required claimFee
, and resets the gracePeriod
. Once the gracePeriod
expires without a new claim, anyone can call declareWinner()
to end the round and allocate the pot to the last king.
Issue: A malicious actor or bot can front-run a pending declareWinner()
transaction by calling claimThrone()
with a higher gas price. This resets the gracePeriod
, preventing the winner declaration and potentially allowing the attacker to maintain control of the game indefinitely or until it is most profitable for them.
Likelihood:
This occurs when the gracePeriod
is about to expire and users are incentivized to declare a winner.
It is likely in adversarial environments or when bots monitor the mempool for profitable transactions (e.g., high pot size).
Impact:
Attackers can grief the system, prolonging the game indefinitely and preventing winners from being declared.
Users are discouraged from participating due to unfair behavior, harming trust in the platform.
You may define lockBuffer
as a short duration (e.g., 10 seconds) during which claimThrone()
cannot be called at the end of the grace period, ensuring fair execution of declareWinner()
.
Alternatively, you could adopt a commit-reveal system or minimum block gap enforcement between last claim and winner declaration to neutralize front-running opportunities.
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.