The tokens' indices are not updated when transferred to other chains.
Upon transferring a token to another chain, adjustments are made in the KittyConnect.sol::s_ownerToCatsTokenId
variable to remove the transferred item. If the transferred token does not occupy the last position in the array, it is replaced by the last item. However, the code fails to update the new index according to the movement of the item in the list. Subsequently, if this item is later transferred and there are elements to its right, the last element will be removed instead of the corresponding token.
Using the getter function KittyConnect.sol::getCatsTokenIdOwnedBy()
to query the tokens owned by the caller will yield incorrect token IDs due to the misalignment of indices caused by the flawed update mechanism.
Manual review.
Add the following to the current test suite:
Update the idx accordingly:
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.