The depositEggToVault function in the EggHuntGame contract fails to verify approval status before attempting to transfer NFTs, potentially leading to failed transactions and user experience issues.
The current depositEggToVault function does not check if the game contract has permission to transfer the player's NFT:
The comment mentions that players must first approve the transfer, but the code does not verify this. If players haven't approved beforehand, the transferFrom call will fail with an unclear error message.
User experience issues - transactions may fail due to missing approvals
Unclear error messages leading to user confusion
Increased user support and education costs
Manual code review
ERC721 standard compliance analysis
Add explicit approval checks before attempting to transfer the NFT:
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.