Unsafe ERC721::_mint()
Usage
The EggstravaganzaNFT
contract uses ERC721::_mint()
to mint NFTs, which does not check if the recipient address can safely receive ERC721 tokens. This can lead to tokens being minted to incompatible addresses, such as contracts that do not implement the ERC721 receiver interface (IERC721Receiver
), potentially locking the tokens.
If an NFT is minted to an address (e.g., a smart contract) that does not support ERC721 tokens, the token could become permanently inaccessible, as the recipient cannot interact with it. This could result in lost assets for players in the EggHuntGame.
Deploy EggstravaganzaNFT
and set a valid gameContract.
Call mintEgg
with to set to a contract address that does not implement IERC721Receiver.onERC721Received.
The NFT is minted and transferred, but the recipient contract cannot manage it, effectively locking the token.
Manual review
Aderyn static analyzer
Replace _mint(to, tokenId)
with _safeMint(to, tokenId)
from OpenZeppelin’s ERC721 implementation. _safeMint
ensures the recipient is either an externally owned account (EOA) or a contract that implements IERC721Receiver
, preventing tokens from being sent to incompatible addresses.
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.