Contract Suddenly Stopped Minting

I noticed a sudden stop in minting from a contract deployed on chain. Things we’re working fine and then suddenly it does not mint and returns a contract logic error.

This is a recent transaction hash of a failed transaction from the same Contract.

b8e787d781aea41e15a57f7f9a3d65e06fa393cf7893f80ac3cf35c8fb276076, index 9423

What could be the possible cause of this.

The reject reason is -1 in the transaction which often means that the smart contract cannot parse your input parameter (assuming that the parseError is the first variant of your Error enum in the smart contract).

Prior to this happening, all mints went through using this data below

{
    "token_id": "0124",
    "metadata_url": {
        "url": "https://ipfs.io/ipf...",
        "hash": {
            "None": []
        }
    },
    "owner": {
        "Account": [
            "3WKvBF8xYZoP7TdPc33rmJ3brqW..."
        ]
    },
    "amount": "01"
}

what could be the possible reason that it just stopped.

your txHash interacts with a different smart contract than you linked in your questions. Can you please clarify this.

Sorry the right contract is 9473

You can use the read box to debug your input parameter:
https://sctools.mainnet.concordium.software/
e.g. I used an old input parameter from a previous transaction and it passes in the readbox. Meaning the only error is that it cannot deserialize/decode the “returnParameter” .

You should be able to use the input parameter in the writeBox now.

{
  "amount": "1",
  "metadata_url": {
    "hash": {
      "None": []
    },
    "url": "https://ipfs.io/ipfs/QmdtQFSLeJH6ErZF5gdfb89FjnsgmDLXaV9B5tA8cuh77o"
  },
  "owner": {
    "Account": [
      "4itdW1pYu5g6daZboptr8R2qcapLE3ucmaAMSprqw5yaC2zqzn"
    ]
  },
  "token_id": "91"
}

What you shared works, but works perfectly with numbers below 99, I noticed from 100 and above doesn’t mint. If you see the previous metadata I provided, I appended a zero to the number. so basically numbers above 100 should have a way of minting them. Could you please give me a suggestion of what to do with 100 and above?

you might use a small type e.g. tokenIdU8 in your smart contract (meaning only one byte for the tokenId)? Can you look up the type that you use for the token_id in your smart contract.

pub type ContractTokenId = TokenIdU8;

We will have numbers even above 1000.

You can use a bigger tokenId type in the smart contract e.g. TokenIdU16/TokenIdU32.