I am trying to deploy my contract on mainnet. My truffle config says:

   live: {
      provider: function () {
        return new HDWalletProvider(MNEMONIC, API_URL)
      network_id: 1,
      gas: 4000000,
      // gasPrice: 76000000000,
      confirmations: 2


From running truffle migrate dry run, I am getting this info:

 > gas used:            3694829 (0x3860ed)
   > gas price:           2 gwei
   > value sent:          0 ETH
   > total cost:          0.007389658 ETH

   > Total cost:         0.007389658 ETH

> Total deployments:   2
> Final cost:          0.007848258 ETH

The error is:

Error:  *** Deployment Failed ***

"Migrations" could not deploy due to insufficient funds

  * Message:  insufficient funds for gas * price + value
   * Try:
      + Using an adequately funded account
      + If you are using a local Geth node, verify that your node is synced.

Questions... Is the gwei from truffle wrong? Do I have to config gas price? I am not sure if I have to buy more ether or if its a config error. I have way more than the stated cost from Truffle so I am not sure why it is not working. hAppreciate the help!

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.