The EggHuntGame.depositEggToVault()
performs an NFT transfer followed by a call to vault.depositEgg()
. This 2-step process introduces a non-atomic flow that can be front-run or interrupted.
Since transferFrom()
is executed before calling the vault's deposit function, an attacker could detect the transfer and quickly call depositEgg()
themselves, stealing the depositor slot. This is particularly relevant in a public mempool environment.
Race condition between NFT transfer and deposit registration.
Users could lose access to their own NFTs.
Manual code inspection
Mempool frontrunning logic reasoning
Use safeTransferFrom()
instead.
Let the vault handle depositor registration via onERC721Received()
.
This ensures atomic deposit + state update in one transaction.
NFTs are transferred to contracts without onERC721Received implementation.
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.