How to Cancel a Pending Ethereum Transaction (MetaMask)

Ethereum transactions are processed by miners. Depending on the density of the network, the transaction fee to be paid to the miners is constantly changing. There are 3 keywords that are important at this point, gas cost, gas price, and gas limit.

Gas cost is a value required by the desired operation. This value is determined according to the complexity of the operation to be performed. Gas price is the fee to be paid for one unit of gas cost, and the gas limit is the amount you are willing to pay for this transaction.

These values can be set by you before the transaction is started. If these values ​​are set to low or the traffic on the network increases before your transaction is complete, your transaction may be stuck. If a transaction gets stuck in your wallet, the Ethereum network will not allow you to initiate a new transaction. Therefore, you can cancel your pending transaction by following the steps below.

Why don’t we use the cancel button? Because I do not recommend it.

  1. Open the popup by clicking on the MetaMask icon.

Note: If there is more than one pending transaction, start with the oldest one first.

Find your stuck transaction’s nonce

3. Then go to MetaMask settings and click “advanced”.

Go to your MetaMask advanced settings

4. Scroll down and enable the “Customize transaction nonce” setting.

Make it on to customize the nonce

5. Return to the main screen and copy your wallet address by clicking on it.

Copy your wallet address

6. Now initiate a new transaction to send zero Eth to your own wallet address and enter the nonce value you noted in “step 2” to the “custom nonce field” and confirm the transaction.

Confirm solver transaction :)

When the transaction you confirmed is successful, it will be replaced with your pending transaction and you can now do your transactions as you wish 🎉

Notes:

  • To avoid accidents, make sure to toggle the “Customize transaction nonce” option back to OFF.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store