setBaseUri in erc721, metadata not showing on opensea

hello, I am trying to set the a base uri in an erc721 contract but then the metadata is not showing on open sea. this is my contract 0x1C194A0f0B954BD17e8fdaE947f7589EE2Ae52bE on the rinkeby chain, i have uploaded the metadata folder through moralis and also pinned it on pinata. I set the baseURI as https://ipfs.io/ipfs/{metadataCID}/ but still, nothing is showing on testnet.opensea.
is there anything I am doing wrong?

Your contract and its metadata seem to be working now.

@CryptoWorld @frangio

I have had a few tries at this that did not work out. I need two clarifications.

Can I use https://ipfs.io/ipfs/{hash}.1mp4 to setBaseuri? Is that a valid format?

In the process I was using a hash to mint a few NFTs and getting "content not available yet" on Opensea. I understood there was a problem so corrected things. I minted a new contract and used the hash again. I got content not available this time but not for the same reason as the last time. Is it wrong to use the hash in a second smart contract at this point?

Do I need to edit the object files in the metadata to get a new CID?

I keep making the mistake of not using the testnet. I have a deployed contract on Opensea currently but the SeaDrop is unpublished yet. I can I still use the testnet to see if this contract works? Just using MetaMask use a testnet? Or is it too late to test now?

TIA

No, not unless you made any changes to the code. The setBaseURI refers to an ipfs "directory", which gets appended before the item uri..

so your base url would be something

https://ipfs.io/ipfs/{your_ipfs_hash}/

Where {your_ipfs_hash} is your ipfs hash.

Now if OpenSea wants to get your token information it will call ```

    function tokenURI(uint256 _tokenId) external view returns (string);

and will get something back like:

https://ipfs.io/ipfs/{your_ipfs_hash}/{_tokenId}

where _tokenId is replace with the id of the nft, for example: 1
And this url should return the metadata json information on where what the image uri is, what the rarity and other traits

1 Like

Hello

Let me try this in more practical terms so I can use it.

I am using the SeaDrop cloned ERC721A contract I do not need to touch the actual contract.

I need information on the metadata files.

1 The object url in the json files should be ipfs://hash/1.mp4?

1a After numbers 1.mp4 to 20.mp4 I can go to 101.mp4 to 120.mp4 then 201.mp4 to 220.mp4 etc etc? Or does the json file 21.json have to have 21.mp4 for the 101.mp4? Is that a conflict?

2 I should only use one object in the json files meaning I need animation_url but I need to skip the second object images? I think there is a conflict in having two objects.

3 I used my animation_url once with a contract and minted from it (unsuccessfully getting content not available yet on Opensea). Do I need to change the data and get a new CID to mint again with a different second contract? This seems to be another conflict I need clarification.

4 The changes in the metadata/json file will throw a difference new CID. Is this important in setting a new base uri in a new different contract? I used the prior CID/hash/uri in the first contract to mint. It was an unsuccessful mint, I got content not available. This seems like another conflict if I do not edit and get a new CID.

5 I have the next second contract in Eth scan but have not published my SeaDrop yet at Opensea. Can I deploys the contract on a test net to see if it works even though the contract is on the Ethereum blockchain? In the process of learning all this stuff I am more comfortable with the overall process but that is late in the day.

The idea of these questions is to overcome the conflicts and to have the right syntax going forward. The information online elsewhere is hodge podge.

Thanks in advance

Initially you where asking about the setBaseURI, i tried to explain how that should be used.
Inside the json file which is returned by the tokenURI function you will have to set the animation_url to the url of your video. Etherscan and some others don't always render video's. So its advisable to also use an preview image and use that for the "image" value. However i'm not an expect on how OpenSea handles that, its just my assumption to use both.

more information on the schema information you can find here: https://docs.opensea.io/docs/metadata-standards

The SeaDrop contract always increments the token id. So in that case you would have Token ID: 21 should return the json file: ipfs://hash/21 and in that json you set the animation_url to the location where 101.mp4 is stored.

I would have to see the contract / response from the tokenURI to see why its wrong. You can't change the contents of the ipfs file after it is created. You would have to create a new json file and use those.

IPFS files are stored on the blockchain so that data can not be changed once it is uploaded. If you want to make a change you actually upload a new file, which has a new CID.

yes and this is advisable, this allows you to test everything to make it "perfect" :slight_smile:
OpenSea has an Testnet, https://testnets.opensea.io/ however the ethereum testnet uses Goerli which is being deprecated as testnet by ethereum, not sure if OpenSea has an Sepolia testnet. However you should be able to use the BNB testnet without problems or one of the other ones.

1 Like

The idea behind the SeaDrop is for Opensea to make this easier for artists. Some of it is just load and go.

The setBaseuri is https://{my pnata gateway}/ipfs/{json folder hash}/

animations for animation_url in json files https://{my pnata gateway}/ipfs/{hash}/x.mp4

Look correct?

I watched carefully an animation on Opensea to see what they were doing. There was no cover image. Just an animation that looped. I wont use the image url.