The GivingThanks contract uses "_mint()" in the donate() function when creating a donor's token NFT. Since it does not use_ "__safeMint()", this can result in the tokens being sent to addresses that do not support ERC721 tokens which would cause them to not be retrievable. Utilizing "_safeMint()" from the Openzeppelin library will be able to prevent this.
"_mint()" is used in the donate() function within the GivingThanks contract:
The use of "_mint()" sends the token NFT to the donor address without verifying whether the donor can receive ERC721 tokens. If the donor is a contract that does not implement the IERC721Receiver interface, the NFT will be locked in that contract, leading to asset loss for donors.
Utilizing "_safeMint()" guarantees that the recipient address can receive the token NFT without running into this issue.
Permanent loss of token NFT if the receiving address is a contract that does not have a proper implementation of the IERC721Receiver interface.
Aversion to using the contract as users may be nervous they may not receive their donation token NFT if they donate.
Manual analysis and Foundry
Replace "_mint()" with Openzeppelin's "_safeMint()" to ensure donors are able to receive their token NFT:
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.