0

Trying to deploy a dapp to the live network. Got this insufficient funds for gas * price + value:

enter image description here

My wallet currently has 0.05 ether... How do I calculate the required funds?

  • I'd use ganache it has a block explorer where you can inspect transactions and gas used, then the formula is using the formula indicated in the error message. The gas price used by default is the median from the most recent blocks, you can use ethgasstation.info to choose a different value. – Ismael Feb 24 '18 at 20:28
  • so the gas used that i see in ganache for every transaction is a static figure that will be identical when i deploy the same code to the live network? – shaharsol Feb 25 '18 at 12:56
  • 1
    Yes, if you repeat deployment with exactly the same contrats the gas used should be identical for every network. – Ismael Feb 25 '18 at 15:08
  • dude you can add this as an answer and I'll mark it correct. – shaharsol Feb 25 '18 at 18:59
1

I'd recommend to use ganache, it has a block explorer where you can inspect transactions and gas used. The gas used is independent of the network used, gas used for deployment should be the same in mainnet than in a testnet.

Then you can use the formula indicated in the error message.

gas * price + value

The gas price used by default is the median from the most recent blocks, you can use web3.eth.gasPrice to obtain the mosts recent price.

This is dynamic value so it will change frequently. You can use a service like http://ethgasstation.info to obtain fixed value and use that value in your truffle.js file.

From the Truffle documentation

networks: {
  // ..
  live: {
    network_id: 1,        // Ethereum public network
    // optional config values:
    // gas
    // gasPrice
  }
}

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.