Skip to main content
added 392 characters in body
Source Link

UnderIn truffle.js (or truffle-config.js) under the Ropstenropsten provider function, try passing the infuraInfura API endpointURL with "https://" before it. Worked for mehttps://. 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
    }
  }
};

Under the Ropsten provider function try passing the infura API endpoint with "https://" before it. Worked for me.

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
    }
  }
};
Source Link

Under the Ropsten provider function try passing the infura API endpoint with "https://" before it. Worked for me.