Why can't deployed contract be found?

My node:

  protocols: {
    eth: {
      difficulty: 36521801351,
      genesis: "...",
      head: "...",
      network: 3

network 3 from truffle networks:

Network: development (id: 3)
  Migrations: 0xfa79df82dce04e1a894df648f4f20af5a59f42f8
  WhaleNetworkV2: 0x93e21793323f9d3053b6a2bd2ab4234948aec210

in compiled contracts json file:

"networks": {
    "3": {
      "events": {},
      "links": {},
      "address": "0x93e21793323f9d3053b6a2bd2ab4234948aec210"

The code from which this error comes from:

if (typeof web3 !== 'undefined') {
    web3 = new Web3(web3.currentProvider);
} else {
    // set the provider you want from Web3.providers
    web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));

console.log("provider", web3.currentProvider);

whaleNetworkV2 = contract(WhaleNetwork);

whaleRewardsV2 = contract(WhaleRewards);

let whaleNetworkContract;
let whaleRewardContract;

web3.eth.getAccounts((err, accounts) => {
    if (err != null) {
        console.log("There was an error fetching your accounts.");

    if (accounts.length == 0) {
        console.log("Couldn't get any accounts! Make sure your Ethereum client is configured correctly.");

    whaleRewardsV2.deployed().then((result) => {
    }).catch((error) => {
        console.log("whaleRewardsV2", error);

The above code outputs:

provider HttpProvider {host: "http://localhost:8545", timeout: 0, connected: false} contracts.js:38 whaleRewardsV2 Error: WhaleRewardsV2 has not been deployed to detected network (network/artifact mismatch) at modules.js?hash=d495843d4bdb24e9ee23d52d143d36f9c62487b7:14057 at meteor.js?hash=cbcc712d51de4298c275e8dcf25c66c29914f19a:1167 at

Happens on both server and client.


I found my problem was that the metamask was on the wrong network

| improve this answer | |
  • Same as me. Good answer! – theTechRebel Jun 2 '19 at 10:53
  • haha yeah pretty obvious one but i had the same issue time and time again too :) Also another common issue is, you see mismatching info when testing from two clients, this is due to the time it takes for blocks to mine so both clients can see the same data, that one was confusing initially too. – serdarsenay Jun 27 at 13:21

I was missing the from key in my truffle.js which then resulted in getting this message even though looking like they were correctly deployed.

| improve this answer | |

In my case by local ports were blocked. I found out by trying to ping my local Ethereum server using:

ping: cannot resolve Unknown host

After changing the port to an approved local port it worked!

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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