Both the safeTransferFrom
and transferFrom
methods can transfer NFTs in the ERC721 token standard. In KittyConnect
, while kittyConnect::safeTransferFrom
restricts the transfer process to shop partners, normal users can still transfer through kittyConnect::transferFrom
. However, certain crucial values may not be updated via kittyConnect::_updateOwnershipInfo
.
In the ERC-721 OpenZeppelin implementation, users can transfer NFTs using the transferFrom
and safeTransferFrom
methods. In the kittyConnect::safeTransferFrom
method, the update of s_catInfo
and s_ownerToCatsTokenId
is processed by kittyConnect::_updateOwnershipInfo
. However, when users execute kittyConnect::transferFrom
, the core information may not be updated.
This scenario could lead to confusion for both users and developers interacting with getCatInfo
and getCatsTokenIdOwnedBy
, as it may return incorrect data.
For instance, let's consider two users, Alice and Bob, who have never minted an NFT before. Alice mints an NFT and transfers it to Bob through kittyConnect::transferFrom
, making Bob the new owner of the NFT.
However, when Bob attempts to transfer the NFT from the current chain to another chain via bridgeNftToAnotherChain
, issues may arise. This could occur if the userTokenIds
array is empty, and an attempt is made to access userTokenIds[userTokenIds.length - 1]
, which would involve accessing a negative array index.
This situation highlights the importance of ensuring that the transfer and ownership update mechanisms are properly implemented to avoid such confusion and errors.
Manual Review
Developer should add onlyShopPartner
modifier to transferFrom
method, in order to restrict the access to the token transfer operation.
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.