[Ethereum] the actual gasPrice used in a Truffle + Ganache environment

gasgas-pricetruffleweb3js

It doesn't seem to match the Ganache UI, nor web3 gas price.

Best Answer

The price of gas seems to be quite elusive in the ethereum world for a variety of reasons. In this context, it's because the supposed gasPrice isn't correct. The UI in Ganache and the value reported via web3 (and the value you set as the default on a contract in truffle tests for example) are all wrong. You have two options in the currently released versions: use the empirical value I've reported in this issue = 100000000000 OR manually set the gasPrice on each transaction.

I'm using Ganache 1.0.1 and Truffle 4.0.5