Underestimation of fee #3018
Unanswered
Carryme1899
asked this question in
Q&A
Replies: 1 comment 2 replies
-
The provider tries with For polygon mumbai: > await p.getFeeData()
{
maxFeePerGas: BigNumber { value: "1500000014", hex: "0x59682f0e" }, // 1.500000014
maxPriorityFeePerGas: BigNumber { value: "1500000000", hex: "0x59682f00" }, // 1.5
gasPrice: BigNumber { value: "38817777780", hex: "0x0909b84874" } // 38.81777778
} By default, ethers will use EIP1559, and hence use await wallet.populateTransaction({...tx, type: 0}); // does not use EIP1559 |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Ethers Version
5.6.6
Describe the Problem
I'm trying to send a transaction on Polygon Mumbai testnet.
It seems that Ethers had a wrong estimate(too low) in
maxPriorityFeePerGas
andmaxFeePerGas
, so my transaction stuck in mempool and finally got dropped.When I use metamask and same RPC endpoint to transfer, the transaction was successfully confirmed.
Code Snippet
Update
So I tried to set gas fee by myself but the transaction still failed.
Did I do something wrong?
Update 2
I found that the error might be caused by an incorrect nonce.
Ethers use
getTransactionCount("pending")
as the transaction nonce, but that is not the correct number for my account.So I change the code:
and it works as expected!
Beta Was this translation helpful? Give feedback.
All reactions