The EggstravaganzaNFT
contract exposes a critical vulnerability in its mintEgg
function where it fails to verify the uniqueness of the tokenId
being minted. This flaw can lead to token ID collisions, potentially causing unintended overwrites, mint failures, or denial of service depending on the underlying ERC721 implementation.
The contract does not check whether the tokenId
has already been minted. ERC721 tokens are required to have unique token IDs. Attempting to mint an already existing tokenId
will revert under OpenZeppelin’s ERC721
implementation. However, without an explicit check, there is:
No user-friendly error messaging.
No pre-check to prevent unnecessary gas usage.
Increased risk of logic bugs if mintEgg
is called with duplicate tokenId
due to faulty eggCounter
tracking or replayed external calls.
Denial of Service (DoS): Reverting transactions if a duplicate tokenId
is passed, halting minting operations.
Manual code inspection
Solidity best practice checklist (ERC721 minting patterns)
OpenZeppelin ERC721 behavior reference
Add a check using _exists(tokenId)
(provided by OpenZeppelin's ERC721 base contract):
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.