2
votes

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?

3
Share your contract, truffle.js, Truffle version you use and the command you just ran. - Zulhilmi Zainudin
I'll check your migrations scripts, are you using async/await or promises? There's an open issue about it github.com/trufflesuite/truffle/issues/501 - Ismael
Hey guys, thanks, have answered my own question - amlwwalker

3 Answers

3
votes

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!

1
votes

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
    },
    ...
  }
}
0
votes

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