Metamask Errors | How to Fix Them

KoffeeSwap
5 min readJul 8, 2021

--

Errors like: Out of Gas, error: undefined or Metamask not appearing

Transaction Pending

One of the most common problems people are facing on the KuCoin Community Chain is queueing and pending statuses on orders while using Metamask. This problem can be fixed in a few different ways, some more complicated than others.

First, let us approach how to fix this issue on a per transaction basis.

Customized Transaction Nonce

1. Open your MetaMask plugin.

2. Click on the colorful circle icon on the top-right and click Settings from the dropdown menu.

3. In the Settings menu, select Advanced.

4. Scroll down until you see Advanced gas controls. Turn On.

5. Scroll down until you see Customize transaction nonce. Turn On.

Find Your Stuck Transaction

We’re now going to find the transaction that’s stuck, and make a note of the “nonce”. That’s a kind of identifier, which we’ll re-use later.

  1. Click the stuck transaction. (Anywhere but the buttons)

02. Take note of the “Nonce” on the first line under the transaction details.

03. Now, run the transaction again in Koffeeswap. When the Metamask window appears enter the same number into the “Custom Nonce” field and raise your gas limit by a small amount. If it still does not work try again with the same Nonce Number and a higher gas limit.

Reset Account Method

This method will show you how to clear transactions from Metamask

01. Navigate to the settings menu by clicking the colorful circle icon on the top-right and click Settings from the dropdown menu.

02. In the Settings menu, select Advanced.

03. Click “Reset Account” - This will clear all pending transactions from Metamask without logging you out or changing any balances…Your funds are SAFU!

04. After resetting account submit a new transaction.

Error:Undefined

This error can be caused by many different issues, such as the developer of the token not allowing transactions, or your specific wallet being blacklisted from transacting.

This can also appear for tokens that have transaction limits or transaction timers. If the maximum amount you can sell of a token is set to 100 tokens and you try to sell 150 tokens you will receive an undefined error.

If you have already tried resetting MetaMask, your computer and everything else there is one final trick you can try if you cannot sell any of your tokens even after approving the spend. Switch the network at the top of MetaMask to a different network and switch back, now try the transaction again!

Error:Out of Gas

If you are curious to learn more about gas and what it signifies in Ethereum and other sidechains such as KCC, we recommend reading:
Basic background of blockchain and Ethereum.

In the example below, notice that the transaction with “Status: Fail” used up 100% of the gas.

After reviewing a different transaction for the same smart contract, we discovered that the gas limit of this transaction was set to 200,000 which was enough to complete the transaction. Notice that even though a higher gas limit was used, only 26% of it was used to complete the transaction.

While you are not required to use the same gas limit as the first successful transaction that you find, you can explore more transactions to generate an idea of what is a sufficient gas limit to ensure that your next transaction is successful.

Cause

The “out of gas” error occurs when all the gas you allotted for the transaction is consumed before the transaction could complete. During the transaction mining process, a portion of the gas is consumed for each operation that is executed on the Ethereum Virtual Machine (EVM) until the transaction is completed or until the amount of gas consumed reaches the gas limit.

The gas limit is the maximum amount of gas you are willing to spend. You can relate the gas limit to putting out a fire with water from a hydrant. If you do not have a large enough water supply, you may run out of water before you can extinguish the fire. As such, you will want to ensure that you include a gas limit high enough to complete your transaction.

(This was taken from the Metamask Website and can be viewed HERE)

We hope that this helps you with some of the errors faced on the KuCoin Community Chain when interacting with KoffeeSwap!

--

--

KoffeeSwap
KoffeeSwap

Written by KoffeeSwap

KoffeeSwap is the first Decentralized Exchange on the Kucoin Community Network with Built-in Charting! koffeeswap.exchange

No responses yet