Gas price too high – Am I looking at the wrong data

gasgas-estimategas-price

So, I wrote a smart contract to create my own token. I deployed on Ropsten and it's all good. The next step was to deploy to mainnet, I know if it's just for testing it's not worth it but wanted to do it anyway.
My first problem is that there doesn't seem to be a way to know in advance how much gas it will cost? I read in some places that I could look at the details in remix when I deploy using Javascript VM, and I saw this

gas              | 80000000 gas
transaction cost |  1325491 gas 
execution cost   |  1325491 gas 

And here I can see that only the transaction cost seems to be 2610 ETH? Is that an accurate estimation or those numbers don't reflect what it would cost me to deploy on mainnet?

Best Answer

You are mixing gas with Eth. gas is a unit of measuring computational complexity, used in transactions. Eth is the native asset used to pay for gas.

You can read details about gas calculations here: https://ethereum.org/en/developers/docs/gas/#post-london . From the document:

Calculating the total transaction fee works as follows: Gas units (limit) * (Base fee + Tip)

So if your transaction takes 1325491 gas, you multiply that value with the used (base fee + tip). Looking at https://ethgasstation.info/ , the base fee is currently 130 gwei and tip (priority fee) is around 10 gwei. So, if you submitted your transaction now, your gas price would be 130+10=140 gwei and the cost for the transaction is 140gwei * 1325491 = 185568740 gwei = 0,18556874 Eth.

Related Topic