Dria

Swan
NFTHardhat
21,000 USDC
View results
Submission Details
Severity: low
Invalid

Use `_safeMint` instead of `_mint` in SwanAsset.sol

Vulnerability Details

In SwanAsset.sol _mint is used instead of _safeMint().

SwanAsset.sol inherits openzeppelin's ERC721.sol which provides both _mint() and _safeMint(). _mint() is**** discourage in favor of _safeMint() which ensures that the recipient is either an EOA or implements IERC721Receiver.

https://github.com/Cyfrin/2024-10-swan-dria/blob/c8686b199daadcef3161980022e12b66a5304f8e/contracts/swan/SwanAsset.sol#L38

Impact

Current _mint() might cause user to lose their NFT position if the caller is a contract but has no means to manage ERC721 tokens.

Tools Used

Manual Review

Recommendations

Use _safeMint() instead.

Updates

Lead Judging Commences

inallhonesty Lead Judge 12 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.