The depositEggToVault function assumes the player has approved the game contract to transfer their NFT, but doesn’t verify this.
If a user calls depositEggToVault without prior approval, the transferFrom call will revert, wasting gas.
No explicit error message guides users to approve first.
Poor UX and potential confusion, though no direct financial loss.
Manual review of ERC721 interaction patterns.
Add a require(nft.isApprovedForAll(msg.sender, address(this)) || nft.getApproved(tokenId) == address(this)) check.
Emit an event to inform users of required approvals.
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.