I have a React app that is connecting to metamask and able to get accounts and account balances. Able to deploy the contract. All this is in Ganache. The code snippet below is creating the token instance per web3 but I keep getting "methods" is undefined.

Nov 22, 2022, 6:45 AM
const web3 = window.web3;
let _fungeInstance = new web3.eth.Contract(FungeAbi, "0xea1Aa5ec484D4a43e174047b7E0F18436da71735");
let bal = await _fungeInstance.methods.balances(currentAccount).call();
web3 version is 1.8.1
what am I missing when trying to call balances method but getting "methods undefined".
Nov 22, 2022, 6:46 AM

© 2024 Draquery.com All rights reserved.