Hello, maybe someone can help me.
I create my own js-file with following code:
const nftId1 = await mintNft(nftFileMetadataFilePath1, ownID);
console.log(nftId1);
and here is my mintNFT-function in the same file, which i call.
/*** minten */
mintNft = async (metadataUrl, ownTokenID) => {
const receipt = await tokenContract.methods.createItem(metadataUrl, ownTokenID).send({from: ethereum.selectedAddress});
return receipt.events.Transfer.returnValues.tokenId;
}
from here i call the contract: tokenContract.methods.createItem(metadataUrl, ownTokenID)
Here the code:
//create item function
function createItem(string memory uri, uint256 ownID) public returns (uint256) {
_safeMint(msg.sender, ownID);
Items[ownID] = Item(ownID, msg.sender, uri);
return ownID;
}
this does not work, because the parent âcreateItemâ- I do not know, where it is in all the files!
And it has only one parameter (two are not allowed) and this function is not virtual, so that with âoverrideâ it is not posible to change it by myself.
I only need to set my own ID from my js-file to the .contract- like you can see above.
Thanks for help and maybe for a nice solutionâŚ