I deployed a simple NFT contract based on the nibbstack ERC721 implementation
For testing purposes I hardcoded the ipfs link into the contract. The mint function looks like this, for testing purposes everyone who send 100 Wei can get an NFT
function mint() public payable {
require(msg.value == 100, "Send 100 Wei");
super._mint(msg.sender, tokenId);
super._setTokenUri(tokenId, nfts[0]);
tokenId++;
}
The ipfs are hardcoded like this:
string[] nfts = ["https://ipfs.io/ipfs/QmUFbUjAifv9GwJo7ufTB5sccnrNqELhDMafoEmZdPPng7"];
the ipfs link points to a json file that looks like this (I picked it from the ipfs documentation):
{
"name": "NFT Art",
"description": "This image shows the true nature of NFT.",
"image": "https://ipfs.io/ipfs/QmQEVVLJUR1WLN15S49rzDJsSP7za9DxeqpUzWuG4aondg",
}
However, format must be wrong, I can never view the image. Here is the opensea site for an example deployment on the Goerli testnet: