The Eggstravaganza NFT contract currently uses _mint
instead of _safeMint
when minting NFTs. This can lead to NFTs being permanently locked if minted to a contract that cannot handle NFTs properly and does not implement onERC721Received
. The issue affects the EggHuntGame contract, which mints NFTs to players who successfully find eggs.
Affected code:
The mintEgg
function in EggstravaganzaNFT
is implemented as follows:
This function uses _mint
, which does not check whether the to
address is capable of handling ERC721 tokens. If to
is a smart contract that does not implement onERC721Received
, the NFT will be stuck in the contract with no way to transfer or burn it if the contract lacks such functionality.
If an NFT is minted to a contract that cannot handle it properly, it will be locked permanently.
Manual review
Use _safeMint
Instead of _mint
:
This ensures that smart contracts receiving NFTs can handle them, preventing asset loss.
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.