The safeTransferFrom
function does not update the data of the current user properly, this can lead to inconsistencies and issues with ownership tracking.
The safeTransferFrom function, which is responsible for transferring NFT ownership from one user to another, does not update the user data correctly. Specifically, it fails to remove the transferred token ID from the s_ownerToCatsTokenId mapping of the previous owner. This can lead to inconsistencies in the ownership tracking data and potential issues with future operations involving those tokens. The token data update happens inside the _updateOwnershipInfo
function which is called inside the safeTransferFrom
. The info of the previous user is not adequately removed.
Ownership Tracking Issues: Failing to update the s_ownerToCatsTokenId mapping accurately can result in incorrect ownership information, making it difficult to track which tokens belong to each user.
Data Integrity Concerns: The inconsistencies between the actual token ownership and the recorded data can lead to data integrity issues, potentially causing problems with future operations involving those tokens.
In the POC below the previous user still has info linking to the transfered nft.
VS Code, Foundry and Manual Review
Modify the safeTransferFrom function to ensure that the s_ownerToCatsTokenId mapping is updated correctly during the transfer process.
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.