The WeatherNft::fulfillMintRequest
function mints an NFT based on weather conditions at a specified location.
It calls the low-level _mint
function directly instead of the safer _safeMint
variant. This approach is discouraged because _mint
does not verify whether the recipient address can properly handle ERC721 tokens. If the recipient is a smart contract that does not implement the IERC721Receiver
interface, the NFT may become permanently locked within that contract.
Likelihood:
The problem arises when the token is minted by a contract that does not handle its transfer correctly.
Impact:
Potential for NFTs to be irretrievably locked if minted to a contract that does not properly handle ERC721 transfers.
Use the _safeMint
function instead of _mint
to ensure that the recipient address can safely handle ERC721 tokens.
The _safeMint
function performs an additional check by calling onERC721Received
on the recipient contract to confirm that it can handle ERC721 tokens.
The `fulfillMintRequest` function is external and anyone can call it. If the protocol uses `_safeMint` instead of `_mint`, this introduces a reentrancy risk. It is better to use `_mint` and the caller is responsible for being able to obtain the token.
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.