0

When i run truffle migrate --network ropsten i don't see the contract deployment but just

Compiling your contracts...
===========================
> Everything is up to date, there is nothing to compile.

i don't know why but also deleting ./build i can't see the deploying of my migrations files but only

Compiling your contracts...
===========================
> Compiling ./contracts/A.sol
> Compiling ./contracts/B.sol
> Artifacts written to /Users/........./build/contracts
> Compiled successfully using:
   - solc: 0.5.0+commit.1d4f565a.Emscripten.clang

A lot of guides show a code like this:

Running migration: 1_initial_migration.js
Deploying Migrations…
… 0xd01dd7...
Migrations: 0xf741...
Saving successful migration to network…
… 0x78ed...
Saving artifacts…
Running migration: 2_deploy_contracts.js
Deploying HelloWorld…
… 0x0aa9...
HelloWorld: [SAVE THIS ADDRESS!!]
Saving successful migration to network…
… 0xee95...
Saving artifacts…

And here my truffle.js code:

var HDWalletProvider = require("truffle-hdwallet-provider");
const MNEMONIC = 'my mnemonic words from metamask'

module.exports = {
  // See <http://truffleframework.com/docs/advanced/configuration>
  // for more about customizing your Truffle configuration!
  networks: {
    development: {
      host: "127.0.0.1",
      port: 7545,
      network_id: "*" // Match any network id
    },

    ropsten: {
      provider: function() {
        return new HDWalletProvider(MNEMONIC, "ropsten.infura.io/v3/my-key")
      },
      network_id: 3,
      gas: 4000000      //make sure this gas allocation isn't over 4M, which is the max
    }
  }
};

So how can i solve this problem?

  • Hi there. Can you include the contents of your truffle-config.js file in your question? – Richard Horrocks Mar 25 at 17:13
  • @RichardHorrocks done, i updated the request with my truffle.js file – Simone R.C. Mar 25 at 17:23
  • Same problem here, did you find the solution? – Hải Nguyễn Apr 24 at 6:57
  • Can u also show us the your migration file? – haxerl May 19 at 1:48
0

In truffle.js (or truffle-config.js) under the ropsten provider, try passing the Infura API URL with https://. So it should look like this:

// Inside truffle.js
  ...

module.exports = {
  networks: {

      ...

    ropsten: {
      provider: function() {
        return new HDWalletProvider(MNEMONIC, "https://ropsten.infura.io/v3/my-key")
      },
      network_id: 3,
      gas: 4000000      //make sure this gas allocation isn't over 4M, which is the max
    }
  }
};
0

I had the same issue, in my case the problem was that I was using a wrong API key. In you Infura dashboard check if you are using the correct one, the one for the Ropsten network.

And as jfviray said pass the Infura API url with https.

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.