You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Very trivial question for some, but I am still interested in hearing your opinion.
When using ethers.js and initiation transactions with await contract.functionName(), should I be specifying gasLimit there as well from my dapp or do you think metamask can detect it always well.
The reason I am asking is that sometimes, it's pretty difficult to come up with a good gasLimit number. If that happens, one solution is to just pass gasLimit pretty high from dapp and problem is solved, but this way, users see hugely increased gas limit on their metamask because I got it hardcoded.
I am wondering if I should be removing gasLimit from dapp and make metamask detect it, but my fear is that metamask might be wrong, user confirms the transaction and imagine, where user paid for 300,000 GAS(detected by metamask) and it was still not enough and tx got failed and user lost 300,000 GAS.
NOTE: I know that Metamask uses eth_getEstimate and where it could go wrong(refunds, if code contains branches and depending on when the tx gets mined, it might result in different branch and so on).
Question 1 : is eth_getEstimate trully wrong even with EIP1559 ? Does one need updated metamask in order for metamask to assess it correctly ?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi @ricmoo
Very trivial question for some, but I am still interested in hearing your opinion.
When using
ethers.js
and initiation transactions withawait contract.functionName()
, should I be specifyinggasLimit
there as well from mydapp
or do you thinkmetamask
can detect it always well.The reason I am asking is that sometimes, it's pretty difficult to come up with a good
gasLimit
number. If that happens, one solution is to just passgasLimit
pretty high fromdapp
and problem is solved, but this way, users see hugely increased gas limit on their metamask because I got it hardcoded.I am wondering if I should be removing
gasLimit
fromdapp
and make metamask detect it, but my fear is that metamask might be wrong, user confirms the transaction and imagine, where user paid for 300,000 GAS(detected by metamask) and it was still not enough and tx got failed and user lost 300,000 GAS.NOTE: I know that
Metamask
useseth_getEstimate
and where it could go wrong(refunds, if code contains branches and depending on when the tx gets mined, it might result in different branch and so on).Question 1 : is
eth_getEstimate
trully wrong even with EIP1559 ? Does one need updated metamask in order for metamask to assess it correctly ?Beta Was this translation helpful? Give feedback.
All reactions