Replies: 3 comments 6 replies
-
These are different idea. There is no longer a concept of gasPrice. The estimateGas returns the gasLimit, which is how many units of gas to allow the transaction to consume. Historically a gasPrice was how much to pay per unit of gas (in Wei); there is a new concept of effectiveGasPrice, which is decided in-protocol based on two new properties, maxFeePerGas and maxPriorityFeePerGas. You generally do not need to worry about these, as the network provides quite suitable values for this. So price is probably not what you are interested in (other than if you have a UI which wishes to show the user an approximate final cost in ether; in which case you multiply this value by the gasLimit). For gasLimit (which is what estimateGas computes), it will vary depending on what a contract does. Every operation in Ethereum has some associated cost so it depends on the operations your transaction performs. Does that make sense? |
Beta Was this translation helpful? Give feedback.
-
Mostly , we use gas fee 21,000 as default. And Also Estimating Gas Lee for transaction is also important. So we can refer this article for estimate gas fee. |
Beta Was this translation helpful? Give feedback.
-
@ricmoo Hey Richard, Thank you |
Beta Was this translation helpful? Give feedback.
-
Hello,
I would like to calculate the amount of gas used before sending multiple transactions. I.e using
My question: does the amount and reicipient parameter matter or is the gas price of a certain contract function always the same? I need to calculate the gas price before I know the amount.
This is probably a general "contract"/"gas price" issue and not related to ether, well maybe it is, but would be thankful for a good answer anyways.
Thank you guys!
Beta Was this translation helpful? Give feedback.
All reactions