Transaction Underpriced Error In MetaMask - My Lesson
Image: Metamask support
Decided to post this as I almost thought of giving my test wallet as transactions kept failing in MetaMask and I thought it was blacklisted for doing some stupid errors (creating an endless loop) when deploying my test smart contract.
Short story of transaction underpriced error: If you encounter a "Transaction Underpriced" error in MetaMask when trying to send a transaction on the network, it means that the gas fee (or gas price) you set for the transaction is too low.
To resolve the "Transaction Underpriced" error, you can take the following steps:
-
Increase Gas Price: In MetaMask, you have the option to set the gas price for your transaction. To increase the gas price, you can do the following:
a. Open your MetaMask wallet and click on the "Send" or "Swap" function to create a transaction.
b. Look for the "Gas Fee" or "Gas Price" setting. Increase the gas price drastically to a level else you might end up doing it again and again wasting more gas. You can check websites like Etherscan or GasNow for real-time gas price information.
c. Make sure you're comfortable with the higher gas fee, as it will affect the cost of your transaction.
-
Resubmit the Transaction: Once you've adjusted the gas price, resubmit the transaction. This time, it should go through successfully if the gas price is now competitive with network conditions.
-
Patience: Sometimes, network congestion can be temporary. If you're not in a hurry, you can wait and try the transaction again later when network activity decreases.
Keep in mind that gas prices can fluctuate significantly on the network, especially during periods of high demand or network congestion. It's essential to monitor gas prices and adjust your transaction accordingly to ensure it gets processed in a reasonable time frame.
Image: Metamask Support. I did a similar amount as it was test network to fix my problem
Storytime: While testing on the Polygon Mumbai network (this can happen in the Ethereum network too since they worked the same), I was prepared to deploy their smart contract as usual but it kept failing due to timeout. It somehow worked when I tried another test account. I even tried deploying in the Ethereum Sepolia network and it failed too.
I also wasted so much time testing with the different gas limits and maxGasPrice in the Truffle JSON (was using Visual Code) to deploy the smart contract as it just timeout without any error.
I almost suspected the wallet was blacklisted until I realized an error in MetaMask stating the transaction error "Transaction <your transaction # here> failed! Error: [ethjs-query] while formatting outputs from RPC '{"value": {"code":-32000, "message": "transaction underpriced"}}'"
Given my past experience of replacement transaction underpriced errors, I tried to find the pending transactions in the wallet, and to my surprise, there seemed to be none in MetaMask. I was out of my wit's end and decided to just up the gas to a crazy amount and it worked somehow.
The relief and sense of accomplishment were palpable. I went from thinking nodes will blacklist wallets to understanding that it was merely a matter of setting the correct gas price for their transactions. I couldn't help but smile at the lack of proper error messages and the still nascent stage of developer tools in Cryptoland.
Unlock the secrets of Ethereum's inner workings and delve deep into its internal transactions. Ever wondered how smart contracts interact or the hidden mechanics behind your favorite decentralized apps? Explore real-life examples that demystify Ethereum's core functions in this insightful article. Click here to journey into the heart of Ethereum: Discover Ethereum's Internal Transactions.
Sky Hoon. Read Full Bio
Website Owner, Twitter-er
He has been trading since 2008. He started this blog to share the journey about option trading. He dabbled in stocks, bitcoin, ethereum (in Celsius Network), ETF (lazy Dollar Cost Averaging) and also built websites for fun. He used this as a platform to share my experiences and mistakes in trading, especially options which I just picked up.