Eggstravaganza

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

Lack of Minting Controls in mintEgg Function

Summary

The mintEgg function allows the assigned game contract to mint NFTs without any limitations. There is no restriction on the number of NFTs that can be minted, nor is there a check to ensure that a token ID has not already been used.

Vulnerability Details

function mintEgg(address to, uint256 tokenId) external returns (bool) {
require(msg.sender == gameContract, "Unauthorized minter");
_mint(to, tokenId);
totalSupply += 1;
return true;
}

Impact

  • The assigned gameContract can mint an unlimited number of NFTs, leading to inflation.

  • If gameContract is compromised, an attacker can mass-mint NFTs.

  • No check ensures tokenId is unique, leading to possible overwriting or failed transactions.

Tools Used

Maual review

Recommendations

Ensure token uniqueness before minting

Updates

Lead Judging Commences

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

Support

FAQs

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