How to view NFT (deployed and minted on Mumbai Testnet) on OpenSea Testnet?

I am unsure how to view my NFT on Opensea testnet. Really Confusing :sweat_smile:

I created an NFT using Solidity with Hardhard for testing and deployed it on the Polygon Mumbai Testnet.

I am able to deploy my NFT and then mint it with the URI which is metadata coming in from an IPFS Pinata pin address.

I am also able to add the token to my Metamask wallet and it shows.

But how can I view it on Opensea testnet?
I would like to test it on Opensea testnet to see how the image looks.

Opensea does not complain about it being an invalid address so the address is valid but for some reason it states:

We couldn't find this contract. Please ensure that this is a valid ERC721 or ERC1155 contract deployed on Mumbai and that you have already minted items on the contract.

Here is the error Opensea testnet gives me:

Do I have to somehow add it to the Matic mainnet?

If so then can someone point me in the right direction :slight_smile:

I've seen some articles about using a sort of bridge but am still unclear on if that's the right path to solve my issue. None the less I will eventually have to post it upon the Matic Mainnet as well.

Below is the code and the outputs. I changed some things around for privacy issues (URI, Wallet address, Contract address)

:1234: Code

Here is my NFT.sol

pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

contract ScoreCoin is ERC721, Ownable {
    using Counters for Counters.Counter;
    using Strings for uint256;
    Counters.Counter private _tokenIds;
    mapping(uint256 => string) private _tokenURIs;

    constructor() ERC721("ScoreCoin", "SC") {


    }

    function _setTokenURI(uint256 tokenId, string memory _tokenURI)
        internal
        virtual
    {
        _tokenURIs[tokenId] = _tokenURI;
    }

    function tokenURI(uint256 tokenId)
        public
        view
        virtual
        override
        returns (string memory)
    {
        require(
            _exists(tokenId),
            "ERC721Metadata: URI query for nonexistent token"
        );
        string memory _tokenURI = _tokenURIs[tokenId];
        return _tokenURI;
    }

    function mint(address recipient, string memory uri)
        public
        returns (uint256)
    {
        _tokenIds.increment();
        uint256 newItemId = _tokenIds.current();
        _mint(recipient, newItemId);
        _setTokenURI(newItemId, uri);
        return newItemId;
    }
}

:computer: Environment

I am using Hardhat version 2.3.0 to deploy my scripts.

Here is my deploy script

const hre = require("hardhat");
async function main() {
  const NFT = await hre.ethers.getContractFactory("ScoreCoin");
  const nft = await NFT.deploy();
  await nft.deployed();
  console.log("NFT deployed to:", nft.address);
}
main()
  .then(() => process.exit(0))
  .catch((error) => {
    console.error(error);
    process.exit(1);
  });  

Deploy Script Output:
NFT deployed to: 0xB57e1kA6kknknkbEEfe913Eb9E658Ak93cd4f

Here is my Mint script:

const hre = require("hardhat");
async function main() {
  const NFT = await hre.ethers.getContractFactory("ScoreCoin");
  const URI = "ipfs://QmUbUyEFbdjg7i4DjVFznza9CQSUbeWWnQarmiCpCjt2tKiPdC";
  const WALLET_ADDRESS = "MY_WALLET_ADDRESS";
  const CONTRACT_ADDRESS = "0xB57e1kA6kknknkbEEfe913Eb9E658Ak93cd4f";
  const contract = NFT.attach(CONTRACT_ADDRESS);
  await contract.mint(WALLET_ADDRESS, URI);
  console.log("NFT minted:", contract);
}
main()
  .then(() => process.exit(0))
  .catch((error) => {
    console.error(error);
    process.exit(1);
  });

Mint Script Output:

NFT minted: Contract {
interface: Interface {
    fragments: [

I cut out the rest of the output above because I printed out the contract which showcases the events, interfaces, and functions.

ANSWERED:

Okay for those having the same issue - for some reason I got on today and all my tokens are showing. It seems you have to wait 24 hours for it to show on opensea. I guess it makes sense.

However, OpenSea is not showing the meta data I attached to it using IPFS

1 Like

hello, i have the same issue i have waited 24-25 hours but its still now showing on opensea, on https://mumbai.polygonscan.com/ its written Overview ERC-721 and i was able to import it on metamask

1 Like

Hi DoubleHelixX,

do you set metaURI following opensea's doc? I am having the same issue that my NFT will not be recognized on OpenSea but can be viewed on metamusk.

Thanks

  1. Make sure to follow the docs of how to format the metadata for opensea to read it correctly.
    a. [https://docs.opensea.io/docs/metadata-standards](https://OpenSea Metadata Docs)
  2. Make sure that the metadata is in JSON format and that the opening and closing braces for the json object is lined up. No extra white spaces cause opensea will not count it as a validated json file.

There are a couple reasons OpenSea's ERC721 validation fails for contracts that fully implement ERC721.

One reason is because OpenSea's infrastructure is failing to process newly deployed contracts, or it has a blacklog.

Another reason is because ERC721 support or the supportsInterface function did not exist in the contract when it was deployed but was added in an upgrade after deployment. I wrote a blog post that describes this problem in detail and how to fix it: How to solve OpenSea's "We couldn’t find this contract." error for ERC721 Validation