If the to address is a contract, _mint() may invoke:
A malicious contract could reenter and call back into the mintEgg() logic or other vulnerable functions (especially if this contract is later expanded).
The mintEgg() function calls OpenZeppelin’s _mint(), which triggers onERC721Received() if the recipient (to) is a smart contract. This callback occurs before updating the totalSupply, potentially opening up the function to reentrancy-based state inconsistencies if future logic is added after _mint() or if totalSupply is relied on in security-critical contexts.
Use the nonReentrancyGuard from OpenZeppelin and add a nonReentrant modifier
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.