0

Whenever i run truffle migrate for any contract i get the following error:

Error: Attempting to run transaction which calls a contract function, but recipient address 0xc3041510ef6e2d9f4352c974093dd9f92108067a is not a contract address
    at Object.InvalidResponse (/home/vinayak/.nvm/versions/node/v8.6.0/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/errors.js:38:1)
    at /home/vinayak/.nvm/versions/node/v8.6.0/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/requestmanager.js:86:1
    at /home/vinayak/.nvm/versions/node/v8.6.0/lib/node_modules/truffle/build/webpack:/~/truffle-provider/wrapper.js:134:1
    at XMLHttpRequest.request.onreadystatechange (/home/vinayak/.nvm/versions/node/v8.6.0/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/httpprovider.js:128:1)
    at XMLHttpRequestEventTarget.dispatchEvent (/home/vinayak/.nvm/versions/node/v8.6.0/lib/node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:64:1)
    at XMLHttpRequest._setReadyState (/home/vinayak/.nvm/versions/node/v8.6.0/lib/node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:354:1)
    at XMLHttpRequest._onHttpResponseEnd (/home/vinayak/.nvm/versions/node/v8.6.0/lib/node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:509:1)
    at IncomingMessage.<anonymous> (/home/vinayak/.nvm/versions/node/v8.6.0/lib/node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:469:1)
    at emitNone (events.js:110:20)
    at IncomingMessage.emit (events.js:207:7)
    at endReadableNT (_stream_readable.js:1059:12)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)

Contents of migration file:

1_inital_migration:

var Migrations = artifacts.require("./Migrations.sol");

module.exports = function(deployer) {
  deployer.deploy(Migrations);
};

2_delpoy_contracts:

var DappToken = artifacts.require("./DappToken.sol");

module.exports = function(deployer) {
  deployer.deploy(DappToken,1000000); // passing an arg to constructor
};

I have tried changing ports and even making a contract form scrath.

6
  • what's your migration file?
    – Badr Bellaj
    Jul 11, 2018 at 8:53
  • 1_initial_migration.js and 2_deploy_contracts.js Jul 11, 2018 at 8:55
  • please share the content of both
    – Badr Bellaj
    Jul 11, 2018 at 9:11
  • i have edited the question with the contents Jul 11, 2018 at 9:15
  • try truffle migrate --reset
    – Badr Bellaj
    Jul 11, 2018 at 9:24

1 Answer 1

0

The error behind that might be a previous migration. in truffle, Changing the smart contract or deployment script after migration imply that we re-run truffle migrat --reset to commit changes.

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.