Trick or Treat

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

The mintTreat function can be affected by reetrancy attack.

Summary

The mintTreat function is vulnerable to reentrancy attacks due to its failure to adhere to the Checks-Effects-Interactions (CEI) pattern.

Vulnerability Details

In the mintTreat function update of the nextTokenId index is after the

_mint(recipient, tokenId);
_setTokenURI(tokenId, treat.metadataURI);
nextTokenId += 1;
emit Swapped(recipient, treat.name, tokenId);

better is to put this part of code before _mint(recipient, tokenId);````_setTokenURI(tokenId, treat.metadataURI);

Impact

Function can be affected by reetrance attack. But it is internaland probability is low.

Tools Used

manual review

Recommendations

Please check Checks-Effects-Interactions (CEI) pattern.

Updates

Appeal created

bube Lead Judge 9 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.