minty mint throws error: unable to get token id
After deploying the contract locally the mint command will always return this error message
minty mint ~/ticket.txt --name "Ticket" --description "This document serves as proof-of-ownershp for a ticket"
Error: unable to get token id
at Minty.mintToken (/minty/src/minty.js:272:15)
at processTicksAndRejections (node:internal/process/task_queues:94:5)
at async Minty.createNFTFromAssetData (/minty/src/minty.js:126:25)
at async Command.createNFT (/minty/src/index.js:84:17)
at async Promise.all (index 0)
at async main (/minty/src/index.js:65:5)
When I try to inspect the incoming receipt from which the events are being read I see, it has an empty events field:
{
"to": "0x5FbDB2315678afecb367f032d93F642f64180aa3",
"from": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
"contractAddress": null,
"transactionIndex": 0,
"gasUsed": {
"type": "BigNumber",
"hex": "0x59bc"
},
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"blockHash": "0x5eb469a830032125e7d960dfa856e9ab1141283694554d14533f03cc6486aed9",
"transactionHash": "0xd5990cb65b8ae6b1c1da583ae6839929065799cb90dd6c96e98116f168b482cd",
"logs": [],
"blockNumber": 5,
"confirmations": 1,
"cumulativeGasUsed": {
"type": "BigNumber",
"hex": "0x59bc"
},
"status": 1,
"byzantium": true,
"events": []
}
Versions:
Node: v15.14.0 npm: 7.9.0 go-ipfs: v0.9.0-dev
Looks like this could be a versioning issue stemming from go-ipfs. Downgrading from v0.9.0-dev to ipfs 0.8.0 stock, re-initializing and redeploying the contract seems to fix the issue.
Hmm, I downgraded to 0.8.0 but this problem persisted for me.
This is thrown on src/minty.js line 272. It comes when the tx receipt doesn't have a transfer event. Indeed I'm seeing no events in the receipt that is returned here, even though it seems the transaction was mined:
receipt {
to: '0x5FbDB2315678afecb367f032d93F642f64180aa3',
from: '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266',
contractAddress: null,
transactionIndex: 0,
gasUsed: BigNumber { _hex: '0x59bc', _isBigNumber: true },
logsBloom: '0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
blockHash: '0xf1a5fe0cffbd62ec125123c640629b01d5eec0010b4c288f1b06bb4586c53cd5',
transactionHash: '0x6e2d1ed691d652b4a6048d218d69b0648a005136626c069d6aaeafbf3c25d211',
logs: [],
blockNumber: 3,
confirmations: 1,
cumulativeGasUsed: BigNumber { _hex: '0x59bc', _isBigNumber: true },
status: 1,
byzantium: true,
events: []
}
Oh, this seems to have been because I'd needed to run minty deploy again after installing some other things fresh (ipfs?).
May we close this issue?