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)
    dispatch(exchangeLoaded(exchange))
    return exchange
  } catch (error) {
    console.log('Contract not deployed to the current network. Please select another network with Metamask.')
    return null
  }
}


Related Questions


Updated February 23, 2018 17:28 PM

Updated September 24, 2017 02:28 AM

Updated September 25, 2017 12:28 PM

Updated September 14, 2017 08:28 AM

Updated November 13, 2017 00:28 AM