I'm trying to create an ERC1155 NFT but when I deploy the contract and try to see it on Opensea testnet, it always show "Unidentified contract" whereas I didn't have any problem with ERC721.
Here is the difference : When you create an ERC721 you can add the name of the ERC721 token with its symbol like this :
contract MyNFT is ERC721URIStorage {
using Counters for Counters.Counter;
Counters.Counter private _tokenIds;
constructor() ERC721 ("NAME", "SYMBOL") {
}
However, this is completely different for ERC1155 tokens, this is my code :
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract MyNFT is ERC1155, Ownable {
constructor() ERC1155("JSON FILE WITH METADATA") {
_mint(msg.sender,1,1,"");
}
And this is what I have on my json file metadatas
{
"name":"Sword",
"description":"Sword from GameItems",
"image":"link_picture"
}
By looking at this https://eips.ethereum.org/EIPS/eip-1155#rationale It seems that in order to put a name for the collection I have to insert it on the metadata itself, but I don't know which designation I have to use. I tried this:
{
"title":"GameItems",
"name":"Sword",
"description":"Sword from GameItems",
"image":"link_picture"
}
But it's not working. Did anyone succed in applying a name for the collection on Opensea ? It would be very helpful to have some advice
Thanks