Does simulateContract estimate the contract call gas limit? #862
-
I ran into this issue today trying to send a transaction
The supplied gas is really high making it think I want to send over 13 ETH worth of gas for the transaction. I couldn't find any reference to a gasLimit parameter in the docs but noticed a parameter called gas in my IDE (not specified in the docs). Is this the gas limit and should I call estimateContractGas myself and pass it into the simulateContract? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Yep! Are you using a JSON-RPC account? If so, I wonder why the wallet is calculating the gas so high for you. |
Beta Was this translation helpful? Give feedback.
-
Can gas estimation and contract simulation be combined into a single viem call? Doesn't estimating the gas effectively already simulate the contract call? |
Beta Was this translation helpful? Give feedback.
Yep!
gas
is the gas limit, and you should estimate gas using estimateContractGas.Are you using a JSON-RPC account? If so, I wonder why the wallet is calculating the gas so high for you.