First Flight #12: Kitty Connect

First Flight #12: Kitty Connect
Beginner FriendlyFoundryNFTGameFi
100 EXP
View results
Submission Details
Severity: low
Invalid

Event emittion after call in `mintCatToNewFunction`

Summary

Event emittion after call in mintCatToNewFunction

Vulnerability Details

In the mintCatToNewFunction function, we emit the CatMinted event after the call to the _safeMint function. This does not follow CEI pattern and it consider a better practice to emit the event before any calls and let these calls be the last thing in the function.

Tools Used

Manual review

Recommendations

Consider changing the order of the code like this:

- _safeMint(catOwner, tokenId);
- emit CatMinted(tokenId, catIpfsHash);
+ emit CatMinted(tokenId, catIpfsHash);
+ _safeMint(catOwner, tokenId);
Updates

Lead Judging Commences

inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Lack of quality

Support

FAQs

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