I am using OpenZeppelin starter kit. I wrote a smart contract that simply contains two integers which can be called. I compiled and deployed the smart contract to my local Ganache blockchain. I have started my React Dapp and it's connected to Ganache through Metamask (I can see my account balance for example).
Please see my repository: https://github.com/Lennardmulder/ozreact
I now want my Dapp to have a button that allows the user to call the count
function and show its results. I suspect I first need to use something like
var myContract = new web3.eth.Contract([...], '0xde0B295669a9FD93d5F28D9Ec85E40f4cb697BAe', {
from: '0x1234567890123456789012345678901234567891', // default from address
gasPrice: '20000000000' // default gas price in wei, 20 gwei in this case
});
With the right ABI and address inserted, to allow Metamask to interact with the smart contract? But where exactly do I define this in my code?