Beginner FriendlyFoundry
100 EXP
View results
Submission Details
Severity: medium
Invalid

`_safeMint` is vulnerable to reentrancy attacks

Summary

Using _safeMint function can lead to reentrancy attacks.

Vulnerability Details

Implementation of _safeMint check _checkOnERC721Received this external call allows smart contract to implement invoked function so it can reentrant minting;

Impact

Scenario:
Attacker can create smart contract that reenter the mint function when checking if contract can receive ERC721 tokens.
This can lead to draining funds.

Tools Used

Manual Review

Recommendations

Import OpenZeppelin's ReentrancyGuard.sol and use nonReentrant modifier to protect functions that use _mintAndIncrement.

-function buyPresent(address presentReceiver) external {
+function buyPresent(address presentReceiver) external nonReentrant{
Updates

Lead Judging Commences

inallhonesty Lead Judge
over 1 year ago
inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Too generic

Support

FAQs

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