The EggstravaganzaNFT
contract uses the unsafe _mint()
function instead of _safeMint()
when creating new NFT tokens. The _mint()
function lacks the necessary checks to verify that contract recipients are capable of handling ERC721 tokens. This creates a significant vulnerability where NFT tokens can be permanently locked if minted to a contract address that doesn't implement the onERC721Received()
interface.
A user participates in the egg hunt game and successfully finds an egg
The user's address happens to be a smart contract that doesn't implement the onERC721Received()
interface
The EggHuntGame
contract calls eggNFT.mintEgg(msg.sender, eggCounter)
The mintEgg
function uses _mint()
to create the token and assign it to the contract address
The transaction succeeds, but the token is now permanently locked in the recipient contract with no way to access or transfer it
Permanent loss of NFT assets for users who are smart contracts without ERC721 receiving capability
Inconsistent game state as tokens are counted as "minted" but are effectively inaccessible
Replace _mint()
with _safeMint()
in the mintEgg()
function to ensure proper verification of the recipient:
Protocol doesn't check if recipient contracts can handle ERC721 tokens
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.