GivingThanks

First Flight #28
Beginner FriendlyFoundry
100 EXP
View results
Submission Details
Severity: low
Invalid

Use _safeMint instead of _mint

Description

The contract uses _mint instead of _safeMint in GivingThanks::donate for NFT minting operations. This bypasses checks for whether the recipient can handle ERC721 tokens.

Impact

Tokens could be minted to contracts that don't support ERC721, leading to permanent loss of NFTs
Violates ERC721 safety best practices

Recommended mitigation

function donate(address charity) public payable {
require(registry.isVerified(charity), "Charity not verified");
(bool sent,) = charity.call{value: msg.value}("");
require(sent, "Failed to send Ether");
_safeMint(msg.sender, tokenCounter); // Use safeMint instead
string memory uri = _createTokenURI(msg.sender, block.timestamp, msg.value);
_setTokenURI(tokenCounter, uri);
tokenCounter += 1;
}
Updates

Lead Judging Commences

n0kto Lead Judge 7 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.