Closed fab153crypto closed 2 years ago
There are ways to do this
So Imho this is not a bug of PCS. It can be feature request in either here or that collection project.
I agree that
A. not showing non-ERC721Enumerable collections in profile is not a bug, but showing then is a feature request.
however
B. This resulting in a chain of exceptions, which leads to other ERC721Enumerable collection NFT not showing is a bug. Pancakeswap has control over which collections are listed. When non-ERC721Enumerable collections are allowed to be listed on the marketplace, the frontend has to handle them.
A possible way to fix this is to filter null elements in tokenIds in https://github.com/pancakeswap/pancake-frontend/blob/4a00fb193b102641cddce81126dc735f6b068718/src/state/nftMarket/helpers.ts#L754
https://deploy-preview-3036--pancakeswap-dev.netlify.app/nfts/profile/0x4688a4d85e274527de4c24bb6cdcff6575c11427 Looks good, thx for the fast fix @memoyil :)
Is there an existing issue for this?
Product
Other
Current Behavior
Users owning NFTs of collections listed on pancake swap, which do not implement ERC721Enumerable face problems with missing NFTs on the profile page. This does also include missing NFTs from other, ERC721Enumerable collections because the code which fetches the NFTs fails.
Expected Behavior
Worst case only the non-ERC721Enumerable should be missing. Best case there are other ways to query all NFTs of a user for non-ERC721Enumerable collections.
Steps To Reproduce
Visit any profile page of users holding a non-ERC721Enumerable (i.e. CatBread 0xc448498ddc536ad6f5d437325725dcf504d2d964)
https://pancakeswap.finance/nfts/profile/0x4688a4d85e274527de4c24bb6cdcff6575c11427
Environment
Anything else?
https://github.com/pancakeswap/pancake-frontend/blob/4a00fb193b102641cddce81126dc735f6b068718/src/state/nftMarket/helpers.ts#L711 this function does assume ERC721Enumerable collections.
The error is propagated because an array of null is returned when the issue arrises, which makes following execution fail.