Beginner FriendlyFoundryNFT
100 EXP
View results
Submission Details
Severity: medium
Valid

Reentrancy in `mintRapper()`

Summary

mintRapper() function in OneShot contract uses _safemint() to mint new NFTs to msg.sender

Vulnerability Details

There is no reentrancy preventing mechanism in the function.

Impact

The impact is low the logic of the contract already allows everyone to mint as much NFTs as they want. The only effect of this vulnerability is to mint 2 NFTs calling mintRapper() function once.

contract Reentrant {
OneShot oneShot = OneShot(0x5615dEB798BB3E4dFa0139dFa1b3D433Cc23b72f);
IOneShot.RapperStats stats;
bool complete;
function onERC721Received(address, address, uint256, bytes calldata) external returns (bytes4) {
if (!complete) {
complete = true;
oneShot.mintRapper();
}
return IERC721Receiver.onERC721Received.selector;
}
receive() external payable {}
}

Tools Used

manual review

Recommendations

Reentrancy preventing modifier can be used.

Updates

Lead Judging Commences

inallhonesty Lead Judge
over 1 year ago
inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

mintRapper reentrancy leads to fighting having better chances of winning.

Support

FAQs

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