The withdrawEgg()
function is responsible for safely transferring an NFT back to the original depositor and clearing its record from the vault. However, it uses the delete
keyword to reset the depositor mapping, which has unintended side effects. Specifically, it resets the address to the zero address (0x000...000
), which could lead to misleading data, unexpected behavior, or even subtle bugs in the game’s logic.
The withdrawEgg
function looks like this:
Using delete
in Solidity sets the mapping value back to the default — in this case, address(0)
. While it seems like the right way to clean up storage, it can give a false impression that the token was never deposited or that the zero address was the depositor.
Players might think the egg was never deposited or was deposited by 0x0
.
Game admins or analytics can’t trace who originally deposited an egg.
Manual inspection
Instead of deleting the address entirely, store a special status or mark that it's withdrawn.
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.