Last Man Standing

First Flight #45
Beginner FriendlyFoundrySolidity
100 EXP
View results
Submission Details
Severity: low
Valid

Incorrect Update of lastClaimTime in resetGame()

Root + Impact

Description

  • lastClaimTime tracks the timestamp when someone last claimed the throne.

  • In the resetGame() function, lastClaimTime is updated even though no one is claiming the throne. This breaks the logic of tracking when the throne was actually claimed.

function resetGame() external onlyOwner gameEndedOnly {
currentKing = address(0);
@> lastClaimTime = block.timestamp; // ❌ this should only update during throne claims
...
}

Risk

Likelihood:

  • Happens every time the game is reset, even when no claim occurs.

Impact:

  • Misleads the system about when the last claim actually happened.

  • Can affect grace period logic or any time-based condition that depends on lastClaimTime.

Proof of Concept

Recommended Mitigation

This proves that lastClaimTime was updated outside a claim action, which violates its intended meaning.

function resetGame() external onlyOwner gameEndedOnly {
currentKing = address(0);
- lastClaimTime = block.timestamp;
+ lastClaimTime = 0; // reset to zero or leave unchanged until next claim
...
}
Updates

Appeal created

inallhonesty Lead Judge about 2 months ago
Submission Judgement Published
Validated
Assigned finding tags:

Game gets stuck if no one claims

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.