Using KittyConnect::transferFrom
(a function KittyConnect
inherits from ERC721.sol), users can bypass
KittyConnect:.safeTransferFrom` and transfer Kitty NFTs themselves.
Transfer of Kitty NFTs is supposed to require the facilitation of the partner shops, users are not supposed to be able to transfer Kitty NFTs themselves. This is signified by the onylShopOwner
modifier in KittyConnect::safeTransferFrom
:
However, users can bypass KittyConnect:safeTransferFrom
and transfer Kitty NFTs themselves if they call KittyConnect::transferFrom
(a function KittyConnect
inherits from `ERC721.sol).
Internal ownership accounting in KittyConnect
will be messed up and not reflect true ownership status. For those NFTs that are transferred via KittyConnect::transferFrom
, the following variables will have incorrect values:
s_ownerToCatsTokenId
s_catInfo
.
Note that this data can become even more entangled and cause more problems.
The idx
within the CatInfo
structure is used as an index to track the position of each NFT within an owner's array of token IDs (s_ownerToCatsTokenId[owner]
). This design aims to facilitate efficient management and lookup of NFTs owned by a particular user, especially for operations that involve modifying the ownership or characteristics of these NFTs.
idx
is relied on in KittyConnect::bridgeNftToAnotherChain
as follows:
However, after calling KittyConnect::safeTransferFrom
, idx
will be incorrect and unreliable.
Manual review, Foundry.
Enforce that transfers can be made only via KittyConnect:safeTransferFrom
by overwriting ERC721::transferFrom
in KittyConnect
as follows:
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.