3

I am using testrpc to deploy my contracts. Contract deployment is successful and it also displays the contract address in console when it is deployed. deployed successful But when I try to query from truffle console it throws this error: Contract has no network configuration for its current network id (5777).

Error

I am clueless. Any help would be much appreciated. I am using Truffle v4.1.0-beta.0 (core: 4.1.0). Solidity v0.4.19 (solc-js)

ToniyaSundaram
  • 191
  • 3
  • 12

1 Answers1

4

You need to return the the deployed contract from the Promise to have the contract object be injected by Truffle. Example:

var Caller = artifacts.require("Caller");
var Callee = artifacts.require("Callee");

module.exports = function(deployer) {
  deployer.deploy(Callee).then(function() {
    return deployer.deploy(Caller, Callee.address);
  });
};
Adam Kipnis
  • 10,175
  • 10
  • 35
  • 48