I'm new to web 3 and I'm trying to interact with a contract deployed with ganache and I get an error here is a screenshot: the error that i get`

  • Hi dev! Welcome to Ethereum Stackexchange! Please include the contract code and the code calling the contract as text, so it is easier to debug.
    – Ismael
    May 20, 2022 at 1:17

2 Answers 2


There could be multiple reasons for that. But: Have you checked if the abi of the contract object contains the function you are trying to use? Happens to me all the time that I add a function in the contract and forget to update the abi for web3.js.

Or: Are you sure it's not balanceOfContractFunc() instead of balanceOfContractfunc() ?

  • your are right the abi that the compiler was giving wasn t the good one so i manage to find the good one and it works thank you.
    – dev
    May 20, 2022 at 6:54

Check your ABI as swisstackle mentioned above, if you call it through remix and it works then it should work also through web3 js if the ABI is up to date.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.