When I use the code I got this error âUncaught (in promise) TypeError: Cannot read properties of undefined (reading âContractâ) at flipâ .
How can I solve it ? I new to coding. Can you please explain the answer for a newbie
async function flip(side){
let sideNumber;
if(side == âheadsâ)
sideNumber = 0;
else
sideNumber = 1;
let amount = document.getElementById("amount").value;
window.web3 = await Moralis.enableWeb3();
let contractInstance = new web3.eth.Contract(window.abi, "0xCDC5Dd9176A9D23eAE6d199E0ddDd77C4602B30B")
contractInstance.methods.flip(sideNumber).send({value: amount, from: ethereum.selectedAddress})
.on('receipt', function(receipt){
console.log(receipt);
})