There are reported cases that users' transactions stuck on pending in MetaMask, and the “Cancel” button isn’t working. If you come across such issue, you may use this guidance to help.
Enable Customized Transaction Nonce
Open your MetaMask wallet, then go to 'Settings' from the colorful circle icon on the top-right:
click the colorful circle on the top right
go to 'Settings'
In the 'Settings' menu, go to 'Advanced', scroll down and turn on 'Advanced gas controls':
scroll down on this page
toggle on 'Advanced gas controls'
After turn on the 'Advanced gas controls', keep scrolling down to turn on the 'Customize transaction nonce':
Find the Stuck Transaction
Go back to the top page of MetaMask. In the 'Assets' tab, find the token type of your stuck transaction (in this case, ECO).
In the token page, find your 'Pending' transaction. Click on the transaction for more details.
Find the 'Nonce' entry, and take note of this number.
Overwrite the Stuck Transaction
Now make a new transaction to overwrite the stuck one. To overwrite it, customize the new transaction Nonce number to the stuck transaction's (which you take note on last step).
Increase the transaction fee for new transaction to increase its likelihood to be added to a block. (increased to 20 Gwei is recommended).
On the confirmation page, make sure your Gas Price is higher.
Find the 'CUSTOM NONCE' entry and replace the nonce with the number you wrote down. Then click 'Confirm'.
Open MetaMask and click the 'Activity tab' to check if the new transaction has been accepted into a block.
Once your transaction is completed, it will be recorded on your 'Activity' list. If it still says 'Pending' in orange you’ll need to wait a little longer, or try the process again with higher transaction fee (gas price).
Once the replacement transaction goes through, your stuck transaction will be canceled.