Web3-core-helpers error: Uncaught (in promise) Error: Provided address "undefined" is invalid,

by Alioune Badara DIAKHATE   Last Updated September 11, 2019 17:28 PM

I'm getting this error when I launch the app with with react.. this error occur when my exchange contract is loaded.. Here is the code i wrote to talk to the blockchain:

export const loadExchange = async (web3, networkId, dispatch) => {
  try {
    const exchange = web3.eth.Contract(Exchange.abi, Exchange.networks[networkId].address)
    return exchange
  } catch (error) {
    console.log('Contract not deployed to the current network. Please select another network with Metamask.')
    return null

Related Questions

Keep getting bad instruction

Updated September 25, 2017 12:28 PM

Where can I get some Kovan Ethers?

Updated September 14, 2017 08:28 AM