1

I've seen on a question that the gas fee of mainnet and testnet is the same while deploying a block on chain ethereumstackexchange. But, I'm facing some mismatch with this info.

The issue is that, when I want to create an NFT on testnet, the maximum gas fee is $5. But, when I use mainnet, the gas fee turns to $293. well, that's a huge difference, isn't it? How can I reduce this fee? Moreover, why the difference is that much high?

I've attached a reference photo.

mainnet testnet

2 Answers 2

0

The gas fee displayed in metamask is calculated by multiplying the gasLimit (the gas sent along with the transaction to execute it) and the gasPrice (the amount the transaction sender pay per gas used).

The gasPrice depends very highly on the network that you use. E.g. test networks often have a fixed gas price, L2 networks have gas prices that are derived from the L1 networks, and side-chains might have a completely different gas price policy.

The article you linked talked about the gasLimit. In most cases the gasLimit is very similar between different network. But this is not always the case, as also some networks define different gas costs or they might depend on contracts that might not be available (or are different).

So if any of these two is now higher, the fee displayed in MetaMask will also be higher.

0

I believe you need to understand the concept of ethereum gas fees first.

All actions you do on ethereum, e.g. an ETH transfer or the deployment of a smart contract, require a certain amount of gas units. This amount is the same across all networks (mainnet, rinkeby, goerli,...).

However, the gas price for each network is different. With increasing demand for block space, i.e. how many people want their transactions to be included in the blockchain, the gas price will rise. People are willing to pay more in order to have their transactions included faster. Therefore, the gas price on mainnet is much higher than on the testnets since there is much more demand.

It is possible to reduce the gas fee but there are limitations. You can reduce the gas price for your transactions and the gas fee will go down. However, if the gas price you are willing to pay is too low, miners will not include your transaction into a block and it will be pending until the gas price drops.

1
  • Thanks, Can you please refer me to some resources from which I can learn about the actions that will charge the same amount of gas and actions that won't.
    – Maruf
    Jan 6, 2022 at 3:18

Your Answer

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

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