Nft deployment issue

I cannot get the deployment to work when I add the {id}.json to the URI. If I used the 64 digit hex in the address, then it works, but when I add the {id} it does not work. thoughts?
constructor() ERC1155(“https://xxxxxxxxx.usemoralis.com/{id}.json”)

If i have the hex it does work, but I can only do it for 1 nft
constructor() ERC1155(“https://xxxxxxxx.usemoralis.com/00000000x64.json”)

What you mean by you cannot get the deployment work?

Sorry. It will deply but none of the metadata shows on opensea. If it helps im using mumbai testnet on polygon.
It worked and all of the metadata showed on opensea when I changed it to the 64 digit hex, but will not work with the {id}

Here is the code i used from the moralis tutorial:
pragma solidity ^0.8.0;

import “https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC1155/ERC1155.sol”;
import “https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol”;

contract NFTContract is ERC1155, Ownable {

uint256 public constant CAR = 0;
uint256 public constant moto = 1;

constructor() ERC1155("https://xxxxxxxxx.usemoralis.com/{id}.json") {
    _mint(msg.sender, CAR, 1, "");
    _mint(msg.sender, moto, 1, "");
}

function mint(address account, uint256 id, uint256 amount) public onlyOwner {
    _mint(account, id, amount, "");
}

function burn(address account, uint256 id, uint256 amount) public {
    require(msg.sender == account);
   _burn(account, id, amount);
}

}

ok, it should work on opensea with that {id}.json syntax, you need to have those files prepared before you do the mint, the numbers will be in hex (but for first 9 nfts it should not matter).

you may have to wait a little until open sea does its sync (10-20 minutes maybe sometimes)

what is the url to .json files that you used when you were trying {id}.json?

https://8igyfokb3qyg.usemoralis.com/0000000000000000000000000000000000000000000000000000000000000000.json
and
https://8igyfokb3qyg.usemoralis.com/0000000000000000000000000000000000000000000000000000000000000001.json

On opensea it has been several hours, and still the same. When I used the direct link it was instant with the metadata

This looks ok, what is your smart contract address?

scan on mumbai


contract add
0x6ca19b9c94ca44a6e8b2a0dd2aae26d4f2750517

I don’t know why it doesn’t work, the contract looks ok.
From what I see the problem is that opensea doesn’t load the images for those two items.

If you deploy the contract again and mint 2 items again, you still get same result?

Yes. Same result. No metadata or image show up.

Ok, it has to be a problem somewhere, but I don’t know where. It looks like you did all the steps right.
for example:

options = {address: "0x6ca19b9c94ca44a6e8b2a0dd2aae26d4f2750517", token_id: "1", chain: "mumbai"};
x = await Moralis.Web3API.token.getTokenIdMetadata(options)

looks to have the right data

Yeah, I’m not sure what the problem is. has to be something with the {id}, maybe not calling it out somewhere?

that {id} looks fine, Moralis was able to extract the final url
you could also try to do some minting after the contract was deployed to see if that works

Will try to do some additional minting. Thanks