A vulnerability exists in the Eggstravaganza vault system that prevents users from withdrawing tokens they have previously deposited when the NFT contract reference is updated. After the contract update, tokens from the old NFT contract are no longer recognized by the vault, causing failed withdrawal attempts for users who deposited tokens before the update.
The vulnerability arises when the Egg Vault's NFT contract reference is updated using the setEggNFT() function. If a user has previously deposited an NFT token under the old contract, they are unable to withdraw that token after the contract reference is changed. This occurs because the vault attempts to check ownership using the new NFT contract, which does not recognize the old contract’s tokens, leading to failed withdrawals.
Failed withdrawals: Users who have deposited tokens from the old NFT contract cannot withdraw those tokens after the contract update.
Loss of funds: Deposited tokens remain locked in the vault, and users may mistakenly believe their tokens are lost or inaccessible.
User frustration: Players will experience failed withdrawal transactions, leading to confusion and frustration.
Vault mismanagement: The vault may hold tokens that are no longer retrievable due to the mismatch between contracts.
In the above Proof of Concept (PoC), the test first ensures that Alice deposits token 20 (minted under the original NFT contract) into the vault. After the contract reference is changed, the vault points to the new NFT contract (nft2), and Alice is unable to withdraw her previously deposited token due to the contract mismatch.
Foundry
Manual Review
Nft contracts should be set only once 'during deployment at the constructor level '
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.