chiru-labs / ERC721A

https://ERC721A.org
MIT License
2.51k stars 841 forks source link

NFT image is not viewable in my wallet #355

Open JAI-VINOD-GIT opened 2 years ago

JAI-VINOD-GIT commented 2 years ago

After minting i imported the NFT with my address & token ID into my wallet, its getting imported but i can see only an text on that NFT Screenshot_20220701-151330

JAI-VINOD-GIT commented 2 years ago

This is how my basic test contract look's like:

Screenshot 2022-07-01 150533

JAI-VINOD-GIT commented 2 years ago

Deployment script Screenshot 2022-07-01 150652 :

JAI-VINOD-GIT commented 2 years ago

Goerli test net block explorer ,after successful transaction Screenshot 2022-07-01 150855

kabaluyot commented 2 years ago

Can you share how your metadata looks like?

JAI-VINOD-GIT commented 2 years ago

Screenshot 2022-07-02 202439

kabaluyot commented 2 years ago

What wallet did you used?

JAI-VINOD-GIT commented 2 years ago

Metamask mobile

JegdishInovark commented 2 years ago

I also have the same issue........

DaWe35 commented 2 years ago

@JAI-VINOD-GIT are you able to see it on OpenSea? I have the same issue for non erc-721a NFTs, and it maybe it's not an issue of this implementation.

LS20221 commented 2 years ago

Hi,

you have to override function tokenURI, not _baseURI. This because if _baseURI is set, then tokenURI (which is the function called to check the NFT metadata) will return a concatenation of _baseURI and the tokenID. Also for me it worked passing the https URL like this:

 function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
    if (!_exists(tokenId)) revert URIQueryForNonexistentToken();

    return 'https://gateway.pinata.cloud/ipfs/"the metadata CID"';
}