The goal of the _mint
function within the donate
function is to reward donors with a unique ERC721 (NFT) token for their contribution.
Using ERC721::_mint()
can mint ERC721 tokens to addresses which don't support ERC721 tokens.
In function donate
is function _mint
.
The _mint
function can mint tokens to addresses that do not support ERC721 tokens, such as contracts without ERC721 receivers.
This could result in tokens being locked in addresses where they cannot be transferred or interacted with.
If the _mint
function is called within a function vulnerable to reentrancy, it could be exploited to mint multiple tokens unfairly. This can lead to an unfair distribution of tokens and potential financial loss.
aderyn
Use _safeMint()
instead of _mint()
for ERC721, or
ERC721 Receiver Check:
Ensure that the recipient address can handle ERC721 tokens by implementing a check using the ERC721Receiver interface:
solidity
Reentrancy Guard:
Use a reentrancy guard to protect against reentrancy attacks, such as OpenZeppelin’s ReentrancyGuard
:
solidity
Access Control:
Implement access control to ensure that only authorized accounts can mint tokens:
solidity
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.