Eggstravaganza

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

Not emitting the Threshold when changing it in `EggHuntGame.sol#L58`

Summary

In the file : EggHuntGame.sol#L26

uint256 public eggFindThreshold = 20; // Default is a 20% chance

In the file : EggHuntGame.sol#L58

/// @notice Allows the owner to adjust the egg-finding chance.
function setEggFindThreshold(uint256 newThreshold) external onlyOwner {
require(newThreshold <= 100, "Threshold must be <= 100");
eggFindThreshold = newThreshold;
}

function does not emit an event when the threshold is updated.

Vulnerability Details

The absence of an event in setEggFindThreshold makes it difficult for off-chain services, dApps, or users monitoring contract activity to track changes to the egg-finding probability. This reduces transparency and could allow the owner to change the rules of the game without clear visibility to participants.

Impact

Without emitting an event, users and monitoring tools may miss critical changes to game parameters, leading to trust and transparency issues. In a game setting, this could result in perceived unfairness or manipulation.

Tools Used

Manual Review

Recommendations

Emit the threshold When it is updated from 20 to new threshold

Updates

Lead Judging Commences

m3dython Lead Judge 5 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

Event Emission

Standard practice for clarifying important contract behaviors

Support

FAQs

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