2

Summary: Using truffle to deploy to rinkeby via infura.

I just deployed my crowdsale and that seems to succeed. However truffle is not showing me a contract address which is worrying. I notice Migrations dry-run (simulation) at the top, which makes me wonder if its not being deployed, its just testing it... is this a thing? How do i get it to actually deploy?

amlwwalker
  • 3,161
  • 4
  • 26
  • 47

3 Answers3

3

OK as this was hard to debug, I have an answer that may help others.

  1. Using the latest bleeding edge truffle, I was informed through a warning, to use the 1.0.0-web3one.0 version of truffle-hdwallet-provider
  2. Once I installed that, I could get past the simulation. When migrating for the rinkeby/live networks, a simulation will be attempted before actual deployment. This didn't seem documented anywhere and as truffle hung after simulation completed, this was a real brainer....
  3. Although it seems obvious now, if there is any time related code (such as a start time for a crowdsale) this needs to be minutes into the future for deployment. Not something obvious when using ganache - I had mine 20 seconds into the future, but by the time that would have been deployed, that was now in the past, causing a revert on my contracts

I'm making quite good progress with the new 1.0 version of ethereum tools, and beta of truffle, so shout if I an be of assistance!

amlwwalker
  • 3,161
  • 4
  • 26
  • 47
  • How did you get the warning? I was having the same problem with `truffle-hdwallet-provider ^1.0.5` and after changing the version to `1.0.0-web3one.0` it started to work. – Kise Apr 24 '19 at 07:22
1

Please try put it in the networks section, the option skipDryRun: true

module.exports = {

  networks: {
    ...

    ropsten:{
     provider: () => new HDWalletProvider(mnemonics, endpoint),
     network_id: 3,
     gas: 5000000,
     confirmation: 2, 
     timeoutBlocks: 200,
     skipDryRun: true
    },
    ...
  }
}
Saurabh Bhandari
  • 2,438
  • 4
  • 26
  • 33
Alberto
  • 11
  • 1
0

You can use Etherlime for deployment of smart contracts. Actually you can use it for everything instead of truffle. It is simpler and with more information. In my opinion is the better tool. It is based on ethersjs which is a lot better than web3js. Here is a link to the documentation

maptuhec
  • 102
  • 8
  • Suggesting someone use another tool isn't really helping them to fix the problem. – Gareth Oates Sep 18 '18 at 20:18
  • Why not? Have you tried deploying contracts to the mainnet using Truffle? My suggestion will fix their problem and make their life a lot easier. – maptuhec Sep 26 '18 at 16:06
  • Because you don't know the reasons why they have chosen to use the tool, there may be business reasons or other technical reasons why they've chosen to use the tool that they have. Suggesting they just change instead of trying to fix the problem isn't a help. – Gareth Oates Sep 28 '18 at 19:03