0

I deployed a smart contract to sepolia network https://sepolia.etherscan.io/tx/0x8b309fd585d6f0196dddc5754038e06ef9693f4fd852ec27b02c320a1bc725f5

From the dashboard there are two price, Transaction fee 0.00321046266632646 ETH ($0.00) and Gas price 1.102386156 Gwei . The value of them are very different. The transaction fee is a thousand times more than gas price. I wonder if it is the total cost to deploy the smart contract? Where can I find the gas?

enter image description here

1 Answer 1

0

Gas price is the price for one gas unit. Means, in the above screenshot, every unit of gas consumed in the transaction costed 1.102386156 wei.

Transaction fees is the amount of ether spent in the transaction, which is obviously the product of gas price and gas used. Means 1.102386156 * gas used = Transaction fees.

Remember the transaction fees are given in ethers and 1 ether = 10**9 Gwei.

Here is the calculation for your contract:

First look at the details given in the transaction-

enter image description here

The gas price = 1.102386156 Gwei(means 1 unit of gas costs this much of Gwei)

The gas used in this transaction = 2,912,285.

Then, total amount for this much gas = 1.102386156 * 2,912,285 = 32,10,462.66632646 Gwei

Now 1 Gwei = 10 ** -9 so 32,10,462.66632646 Gwei = 32,10,462.66632646 * 10 ** -9 = 0.0032104626663265 Ethers

We can also write : 32,10,462.66632646 / 10 ** 9 = 0.0032104626663265 Ethers

Now talking about the price, here is the conversion:

enter image description here

Remember the gas fees on mainnet are quite high as compared to sepolia, there will be a significant difference between the costs.

2
  • If I use transaciton fee / gas price, it is equal to 0.003 eth. The current eth price is $3500, that means deploying a smart contract would cost $1.2? Is it how I should calculate the cost? Commented Mar 19 at 8:23
  • I have added more clarification in the answer @JoeyYiZhao Commented Mar 19 at 10:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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