Hello Konzaih,
Checking the github link you provided, if that is the current code you are using, that means you have the latter version of the game code in this course which removes the minting of the token and focuses on the marketplace (ERC1155 token integration). Either you take a previous version or you add the token minting code in eth.js and the function call in index.html.
Similar to this:
async function mintAfterGame(nrOfTokens) {
// ethereum.request({ method: 'eth_accounts' }) // imho, more appropriate for Metamask usage, returns an array, first index = selected address
web3.eth.getAccounts().then(listOfAddress => {
// 'mint' is the function call in the Token contract
contractTokenErc20.methods.mint(listOfAddress[0], nrOfTokens).send({from: listOfAddress[0]})
.on('receipt', receipt => {
alert("Transaction Complete");
});
});
}
...
function updateTimeLeft() {
if(gameOver) {
if(!coinsMinted) {
mintAfterGame(score);
coinsMinted = true;
}
return;
}
...
With kind regards