Hello I've been trying to deploy an nft on opensea testnet using oppenzeppelin and pinata. The nft is getting deployed, but the image doesnt show. Can someone please point out what I am doing wrong?
CONTRACT :
// SPDX-License-Identifier: MIT
// Compatible with OpenZeppelin Contracts ^5.0.0
pragma solidity ^0.8.20;
import "@openzeppelin/[email protected]/token/ERC721/ERC721.sol";
import "@openzeppelin/[email protected]/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/[email protected]/access/Ownable.sol";
contract SAHIL is ERC721, ERC721URIStorage, Ownable {
uint256 private _nextTokenId;
constructor(address initialOwner)
ERC721("SAHIL", "SAHIL")
Ownable(initialOwner)
{}
function safeMint(address to, string memory uri) public onlyOwner {
uint256 tokenId = _nextTokenId++;
_safeMint(to, tokenId);
_setTokenURI(tokenId, uri);
}
// The following functions are overrides required by Solidity.
function tokenURI(uint256 tokenId)
public
view
override(ERC721, ERC721URIStorage)
returns (string memory)
{
return super.tokenURI(tokenId);
}
function supportsInterface(bytes4 interfaceId)
public
view
override(ERC721, ERC721URIStorage)
returns (bool)
{
return super.supportsInterface(interfaceId);
}
}
my input in my safeMint is "https://ipfs.io/ipfs/QmUwcCBEe88iA8ToyVcs766TRLjxn1PiKATrrTVc3AGUC1/"
my metadata :
{
"name": "Dave Starbelly",
"description": "TIDYMOUSE's leauge stats for year 2023",
"external_url": "https://yearin.lol/profile/euw/TIDYMOUSE-2477",
"image": "ipfs://QmXzwNm2PonYdGnZs2qjdsiwpcTk4QVQDKSMWEvFtdNsZY",
}
- My image is bigger than 3000x3000
- I've tried using ipfs://CIDofMETADATAinsteadofFOLDER