Eggstravaganza

First Flight #37
Beginner FriendlySolidity
100 EXP
View results
Submission Details
Severity: low
Invalid

Owner Can End Game Early Without Warning

Summary

The owner can stop the game at any time before it's supposed to end, which is unfair to players who are still trying to find eggs.

Vulnerability Details

The current implementation of the endGame function allows the contract owner to end the game at any moment without any warning or consideration for active players. This function only checks if the game is active and then immediately stops it:

function endGame() external onlyOwner {
require(gameActive, "Game not active");
gameActive = false;
emit GameEnded(block.timestamp);
}

When a player starts participating in the game, they expect it to run for the full duration set in startGame. However, the owner can cut this short at any time, discouraging players because they cannot rely on the promised duration of the game.

Impact

LOW risk because it's an owner action, but still can hurt players trust or game fairness.

Tools Used

Manual code review

Recommendations

Add another requirement, fo example:

function endGame() external onlyOwner {
require(gameActive, "Game not active");
require(block.timestamp >= endTime, "Game is not over"); // Example
gameActive = false;
emit GameEnded(block.timestamp);
}
Updates

Lead Judging Commences

m3dython Lead Judge 4 months ago
Submission Judgement Published
Invalidated
Reason: Design choice
Assigned finding tags:

Trusted Owner

Owner is trusted and is not expected to interact in ways that would compromise security

Support

FAQs

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