Hey, im following the NFT marketplace course and im stuck as hell. The problem is that when i press the create kitty the transacion fails, browser prints "from
isnt autorised to send transactions",Im surely using the account[0] of ganache in metamask. I tried everything and dont know what else i can do.
This is my index.js
var web3 = new Web3(Web3.givenProvider);
//la variable abi la tenemos en abi.js
var instance;
var user;
var contractAddress = "0x4FC25B84A848531cA5B35060f42C6Ca583F36dC8";
$(document).ready(async function(){
const accounts = await ethereum.request({ method: 'eth_requestAccounts' });
instance = await new web3.eth.Contract(abi, contractAddress, {from: accounts[0]});
user = accounts[0];
console.log(instance);
});
this is my funcion for the button:
function kittyTransaction(event){
var genes = getDna();
instance.methods.createGenesisKitty(genes).send({},function (err, TxHash){
if(err){
console.log(err);
}else{
console.log(TxHash);
}
} )
}