Using ERC721::_mint()
can mint ERC721 tokens to addresses which don't support ERC721 tokens. Use _safeMint()
instead of _mint()
for ERC721.
The use of ERC721::_mint()
poses a risk because it can inadvertently mint ERC721 tokens to addresses that cannot handle them, potentially leading to lost tokens. To mitigate this risk, it's recommended to use _safeMint()
instead. This function includes a check to ensure the recipient address can handle ERC721 tokens, preventing tokens from being locked in unsuitable contracts or addresses. This safeguard ensures that tokens are only minted to capable recipients, avoiding the loss of assets and ensuring the intended functionality of the smart contract.
Using ERC721::_mint()
can lead to a significant impact on the usability and functionality of a smart contract, especially if tokens are minted to addresses that do not support ERC721 tokens. This issue arises because the _mint()
function does not perform any checks to ensure that the recipient address can handle ERC721 tokens. Consequently, tokens can be locked in contracts that do not implement the necessary logic to manage ERC721 tokens, making them inaccessible and potentially lost. This situation can lead to a loss of assets for users, disrupting the intended functionality of the smart contract, and potentially affecting the contract's reputation and trust among its users.
Aderyn was used.
Prefer _safeMint()
Over _mint()
: For all scenarios where tokens are minted to addresses that might not be capable of handling ERC721 tokens
, use the _safeMint()
function. This ensures that tokens are only minted to addresses that can handle them, preventing tokens from being locked in incompatible contracts.
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.