Ipfs cors issue since 16 april

hello thanks for support.!
Since 16 april i cant see the metadata of the nfts created
https://songbird-explorer.flare.network/token/0xFdfDab3Df0fFE67b735b7B78acf3356913bbcEe7/inventory

the smart contract:
function createItem() public payable nonReentrant returns (uint256) {
require(msg.value >= price, “Not enough funds sent”);

    require(switchSale == true, "Closed");

    payable(owner()).transfer(msg.value);

    _tokenIds.increment();
    uint256 newItemId = _tokenIds.current();

    uint256 tokenId = nextToken();

    address tokenAddress = address(this);
    string memory url;

    string memory metadataUrl;
    if (tokenId <= 500) {
        url = "QmbVjnEPgTS93QCBqyUfUmGnK7gDVuWgJEvstohypbyCAa"; //
    }
    if (tokenId > 500 && tokenId <= 1000) {
        url = "QmQgpGTkiwp5ZJAv7txaXGQXJFC181PMqQMXsXcPZmVQ5G"; //
    }
    if (tokenId > 1000 && tokenId <= 1500) {
        url = "QmUsjw26h9JmQNu1fKB3nLxxXncqPKcEGC1Y4FTPpGrLsD"; //
    }
    if (tokenId > 1500 && tokenId <= 2000) {
        url = "Qma9WwaGwetppZMJsU28tqzJJewfroUPQkPAfGHcaPgenK"; //
    }
    if (tokenId > 2000 && tokenId <= 2500) {
        url = "QmZ3eRjE9ckxXCHLAkpQePA8DTtHLqD7HdFwPQj1hvvPeP"; //
    }
    if (tokenId > 2500 && tokenId <= 3000) {
        url = "QmbLSfnAxuMTPoC5U8eDL3utT32qM24sBCSU14q5DJktbY"; //
    }
    if (tokenId > 3000 && tokenId <= 3500) {
        url = "QmYKU1f2n2qNAnGPNFTPq227awCXdVhqHdbQute2UQ1zst"; //
    }
    if (tokenId > 3500 && tokenId <= 4000) {
        url = "QmSVDQFWLnkZaeCyyQf4d6L9ysm54RMCi8iH3gnAmCfDpB"; //
    }
    if (tokenId > 4000 && tokenId <= 4444) {
        url = "QmSXHDkRDZuHeneGPhoEUQ5AHmEzfG5y6Jz4RvD4jKuPt7"; //
    }
    metadataUrl = string(
        abi.encodePacked(
            "https://ipfs.moralis.io:2053/ipfs/",
            url,
            "/metadata/",
            uint2str(tokenId),
            ".json"
        )
    );

    Items[newItemId] = Item(newItemId, tokenId, msg.sender, metadataUrl);

    _safeMint(msg.sender, newItemId);
    emit itemAdded(newItemId, tokenId, tokenAddress);
    if (newItemId == last) {
        price = price + ((price * 1) / 5);
        last = last + 200;
    }
    return newItemId;
}

How i can solve this the smart contract is already deployed in production i cant change
it:/

The solution until today was to use this prefix https://gateway.moralisipfs.com/ipfs/ in front end for the url instead of https://ipfs.moralis.io:2053/ipfs/. Now you can try both of them to see what works best for you.

but that solution will work for my frotend but not for make it appear in the blockchain scan or others marketplaces

you can not change the contract now, it depends on how other marketplaces will try to get the metadata from that token_uri

there is not way that moralis leave the things the way they was… seems like some update was made

That url still works, if you open it in the browser it should work fine.

image but when i try fetch that tokenUri im getting this and i think that same is happening in block explorer
they did not appear here https://songbird-explorer.flare.network/token/0xFdfDab3Df0fFE67b735b7B78acf3356913bbcEe7/inventory

Hello Cryptokid im also with this project. So there was about 13 NFTs that got minted that show zero metadata on our block explorer due what ever was updated recently on moralis end.
To we need to figure out how we can get those to display the metadata in the block explorer and for all future mints.

for future contracts you can use generic IPFS url, for this contract it depends on how that explorer extracts metadata, fetch for example it looks like it doesn’t work with redirects

everything was working like a charm until some days ago :frowning: 1600 nfts minted without problem

can you try now to see if you get that error? we did some updates today

1 Like

Ok, so we can just change the ipfs url for the future nfts no problem. The explorer we use is
https://songbird-explorer.flare.network/ which uses block scout.

yeah works better now! but you should work around this issue still metadata is not showing on block explorer but no more error over cors policy

the problem with block explorer could also be on when it tries to resync the metadata, in case that it tries to do that

1 Like

just double checking: the moralis web3api v2 is still returning the ‘old’ url format, shouldn’t that be changed for consistency?
I’m using https://gateway.moralisipfs.com/ipfs/ for my baseUri now everywhere, but saw the old url still in my db, coming from the web3api v2 call:
https://deep-index.moralis.io/api/v2/nft/<address>/<id>?chain=<chain>

at this moment ipfs.moralis.io:2053 is what we return for all the new ipfs urls