Description:
The searchForEgg() function in the EggHuntGame contract calls eggNFT.mintEgg() without checking its return value. This could lead to logical inconsistencies if the minting process fails silently.
Impact:
If mintEgg() fails but does not revert, the contract will assume the minting was successful, leading to incorrect state updates.
The EggFound event will be emitted even if minting fails, creating false positives and potential abuse scenarios.
Silent failures could result in undetected issues, compromising the integrity of the contract.
Proof of Concept:
Recommended Mitigation:
Check the return value of mintEgg() and ensure it succeeds before proceeding with state updates or emitting events. For example:
This ensures that the contract handles minting failures gracefully and maintains a consistent state.
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.