Eggstravaganza

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

eggFindThreshold should be be able to be set to zero

Summary

eggFindThreshold can be set to zero even if the game is active which would break the purpose.

Vulnerability Details

add a minimun threshold so there is always a chance of minting an NFT, as this game could be active and having a zero probability of finding a new egg.

https://github.com/CodeHawks-Contests/2025-04-eggstravaganza/blob/main/src/EggHuntGame.sol#L57-L61

/// @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;
}

Impact

the default number is 20% but it is possible to be set to zero wathever the reason.

Tools Used

manual

Recommendations

add a min threshold so there is always a chance of the user finding the egg, as the game can be active but the probability of finding can be zero.

Updates

Lead Judging Commences

m3dython Lead Judge 5 months ago
Submission Judgement Published
Invalidated
Reason: Design choice

Support

FAQs

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