I made NFT's, following a tutorial. I created 5 jpeg images in MS Paint, and 5 corresponding JSON files to match for the metadata. I uploaded the 5 images to pinata and then took that CID and put it in the metadata for the JSON files. I then uploaded the JSON files, and took that CID and put it in my smart contract. An example of my JSON file is here: Metadata uploaded to Pinata
I deployed the smart contract via Remix to my Metamask on the Rinkeby Testnet. OpenSea detected the assets in my wallet after they were minted, but the pictures and metadata in the json files was not there. Here is my smart contract:
// SPDX-License-Identifier: MIT
pragma solidity ^ 0.8.10;
//import Open Zepplin contracts
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC721/ERC721.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Strings.sol";
contract NFT is ERC721 {
uint256 private _tokenIds;
constructor() ERC721("EGM NFT", "DEC25_01") {}
//use the mint function to create an NFT
function mint() public returns (uint256) {
_tokenIds += 1;
_safeMint(msg.sender, _tokenIds);
return _tokenIds;
}
//in the function below include the CID of the JSON folder on IPFS
function tokenURI(uint256 _tokenId) override public pure returns(string memory) {
return string(
abi.encodePacked(
"ipfs://QmSiTHvaSRpg41RMCPQudyExVHG8bMQqmdZu6J4HJkDaxq/",
Strings.toString(_tokenId),
".json"
)
);
}
}
Can anybody please tell me why image and description won't show on OpenSea test net? PLEASE help, I am busting my butt trying to learn this.