The EggstravaganzaNFT
contract lacks an implementation of the standard tokenURI
function from the ERC721 metadata extension. This function is crucial because it defines how each token's metadata (image, name, attributes, etc.) is accessed. Without it, external platforms like OpenSea, LooksRare, wallets, or block explorers cannot retrieve or render metadata for these NFTs.
The absence of tokenURI
makes the tokens non-functional in any environment that depends on metadata, effectively rendering them invisible or "blank" in NFT marketplaces. This breaks the visual and collectible value proposition of the NFTs, especially in a context like EggHuntGame, where collectible eggs likely have visual or rarity traits that players care about.
Severity: Medium
Unusable NFTs: Without metadata, the NFTs are not visually represented on most platforms. This directly harms user experience, as collectors typically expect their NFTs to show unique images or properties.
Marketplace Integration Failure: Platforms like OpenSea rely on tokenURI
populating NFT listings. Without it, NFTs appear as "unidentified" or are excluded entirely from search and discovery.
Game Immersion Broken: If EggHuntGame relies on metadata for in-game visuals or mechanics (e.g., different egg types, rarity, attributes), those systems cannot work as intended.
Lack of Verifiability: Players cannot verify that their egg has the right image or traits, which may cause trust issues, particularly in competitive or reward-driven environments.
Manual Review
Implement tokenURI(uint256 tokenId)
: Use OpenZeppelin's ERC721URIStorage or override tokenURI
manually to return a URI pointing to your metadata storage (IPFS, centralized, or dynamic).
Example:
Integrate Metadata Hosting: Host metadata JSON files (either statically or dynamically via an API) that define each token’s name, description, image, and attributes.
Testing & Marketplace Validation: After deployment, mint a test NFT and validate its appearance on OpenSea, Zora, and wallets like MetaMask to ensure metadata is loading correctly.
Step-by-step example demonstrating the issue:
Mint an NFT: The EggHuntGame calls mintEgg(player, tokenId)
→ an NFT is minted to the player.
User Opens OpenSea or Wallet: The user checks their wallet or connected marketplace.
No Metadata Appears: The NFT shows up as a generic placeholder or isn't visible at all. There is no image, name, or description.
Marketplace Logs Reveal: The platform attempts to call tokenURI(tokenId)
but receives a revert or default fallback because the function is not defined.
User Confusion Ensues: The player cannot view or interact with their NFT, which negatively impacts the perception of the product and may reduce retention.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.