I have the following migration files with 50 contracts' deployment and their setup (calling each other functions like privileges, access and so on):

enter image description here

On the development network everything works fine. When I change network to ropsten it cancels migration at totally random time. Once it's at "2", once at "13". It's totally randomness. To be clear: it's not the contracts' problem, because thair gas limit is below 4867350 limit. The message that comes with cancel is:

Returned values aren't valid, did it run Out of Gas?

If I continue migration it throws errors like contract not deployed or it won't call functions. It's weird, I know, but that happened to me moment ago. The only way is to perform migration over again with --reset param or deleted build folder. It's really lucky for me to finish the migration with success. I have already lost a lot of ropsten's ether (fortunately free), but I'm really afraid I could lose ether on mainnet, because the whole migration costs over 2 ether.

Here is my truffle config for ropsten:

gas: 4867350,
gasPrice: 10000000000,
confirmations: 2,
timeoutBlocks: 200,
skipDryRun: true

What can I do to make ropsten working correctly?

  • What's your development network? Does it happen to be localhost with a port on which Ganache is listening? How are you handling private keys in your migration scripts when you run them on Ropsten? – goodvibration Sep 24 '19 at 19:41
  • As I said in the problem description, I'm trying to migrate to Ropsten Test Network. Sometimes it migrates with success, more often it throws out of gas at random contract. Today I was very lucky, because I was able to migrate the whole project on the ropsten test network. My local network is Ganache. No, it doesn't happen with Ganache, houndreds of local migrations ended with success. I'm using hdwallet with mnemonic in the truffle config. – Radeg90 Sep 24 '19 at 20:46
  • You didn't answer any of my questions. How are you handling private keys in your migration scripts? There's nothing special that needs to be done when running them on Ganache, but this is obviously not the case for Ropsten, so there must be some sort of reference to that in your migration scripts. Please share: 1. Your Truffle configuration file (truffle-config.js or truffle.js). 2. At least one or two of your migration scripts (if they're not too long, then even all of them). – goodvibration Sep 25 '19 at 4:29

Your Answer

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

Browse other questions tagged or ask your own question.