-
How do you estimate the and set the gasPrice / gasLimit in a method? I've got the following, but the method fails because of gas issues.. Using
Also.. Is the |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
Heya! First note is to never use JavaScript numbers when working with Ethereum (see here why), so you should probably replace your The gas price is always in wei, there isn't really a unit for gasLimit, it is simply the number of units of gas you are permitting your call to take up to. Otherwise, your code looks like it should work. What is the error? Keep in mind there are plenty of reasons the contract may not work, it may have a Is your contract mined? Or is it failing before that? |
Beta Was this translation helpful? Give feedback.
-
(I'm moving this issue to discussions. :)) |
Beta Was this translation helpful? Give feedback.
-
The call to The The current gas price is around I must be doing something wrong between
|
Beta Was this translation helpful? Give feedback.
-
That is the Kovan testnet in your Metamask image. The gas price is around 188 on Mainnet right now. Each network has wildly different pas prices at any given time. :) |
Beta Was this translation helpful? Give feedback.
-
Yup. That was it. Switched nets, and it's coming back around 188. 🤙🏻 |
Beta Was this translation helpful? Give feedback.
That is the Kovan testnet in your Metamask image. The gas price is around 188 on Mainnet right now.
Each network has wildly different pas prices at any given time. :)