Crypto News

How to cancel pending transactions in Metamask

If you have ever made a transaction on the Ethereum network (either sending tokens or accepting a bid for your NFT), it may have happened to you that, when you made it, it remained in a “pending” status for several days without knowing exactly when was it going to be done? In NFT Collection we are going to teach you how to solve this problem, so let’s get to it!

How Ethereum gas fees and transactions work

First of all, you should know what the gas fees are. We have a blog post exclusively dedicated to talking about it, click here to find out what it is. Anyway, we are going to give you a little explanation if you do not want to waste a lot of time reading.

In Ethereum, you can only make a certain number of transactions per minute due to how its blockchain works. On the other hand, the gas fee that is paid for each transaction works through an auction system in which the highest bidder (the one who pays the most) manages to carry out their transaction more quickly.

In this way, the miners accept bids and carry out pending transactions until the network decongests and, consequently, lowers the price of the gas fee. However, if there are too many pending transactions and users start to raise their bids, the gas fee can reach astronomical prices. In this case, a high gas fee discourages the network from continuing to congest at the cost of stopping its movement.

And that’s why Metamask gives you three different options to make a transaction: slow, standard and fast. This is because you are bidding at the low end, middle end, or high end of the transaction price range. That is why it is recommended to use the standard option so as not to risk so much.

However, there are days when there is a high volume of transactions and you may not be able to make a new transaction if the previous one has not been completed, so if you bid when the gas fee was very low and your transaction stays “in the air”, you will not be able to do anything else. But don’t worry, as you have two options.

Option A: Expedite Transaction

The simplest option of all to solve this situation is the one offered by Metamask by default, speeds up the transaction. What Metamask does is replace the pending transaction, which has a certain number (for example, transaction number 35), with another with the same number but this time with a higher bid.

If you do this and manage to fix it, you’re in luck, you won’t have to do anything else. However, if it’s been a while and it hasn’t been fixed, you still have option B.

Option B: Cancel the transaction

In this option we are going to do something very similar to option A, only this time manually and definitively canceling the transaction.

Step 1: Turn on nonce customization 

The first thing we need to do is enable nonce customization in our Metamask wallet settings. The nonce is the position number that a transaction has in our wallet. Thus, a transaction with a nonce=1 will be the first one we make in the history of the wallet. This is automatically chosen by default, but now we are interested in being able to modify this data.

We go to our Metamask, click on the circle at the top right, and select Settings. Next, we go to Advanced, go down, and activate Customize transaction nonce.

Step 2: Find the pending transaction and its nonce

Now we will have to go to the transaction that we have pending in Metamask under Activity and we will click on it to see the details. What interests us here is to keep the number that you put in the nonce. In our case, it would be 4 . This would mean that it is our 4th transaction in the wallet.

Step 3: Send yourself ETH in a new transaction

Once the nonce customization has been activated and we already know the nonce number of the transaction that we have pending, we will click on the Send button of Metamask in ETH.

What you will do next is copy the address of your own wallet (the one you are using to make the transaction) and send yourself 0 ETH. In this case, we will mark the Fast option.

Then, on the confirmation screen, we will put the nonce number that we have seen in our pending transaction under “ custom nonce ” and confirm.

This will replace one transaction with the other and cancel the one that was left in the “pending” status. And before you ask, in this transaction we will not have to pay the gas fee to cancel the previous one.

Extra: What to do if I can’t find the pending transaction?

There are times when the transaction does not appear in Metamask. But don’t worry, because thanks to the transparency of the blockchain everything can be found.

What we must do is click on the 3 dots at the top right in Metamask and select ” See in Etherscan “, or directly enter the address of our Metamask wallet in Etherscan. Now we can see all the transactions of our wallet ordered chronologically from most recent to oldest.

In our personal case, we do not have any pending transactions, but all we would have to do is look for the one that says “ pending ” under Method and click on the Txn Hash number.

Next, we will click on Click to see More, and finally, we will be able to see the nonce number we are looking for.

And this would be it! We hope that it has served you and that you have been able to solve the problem of your transaction.

Related Articles

Leave a Reply

Your email address will not be published.

Back to top button