TIP - How to reset Metamask account cache

Terms definition:

  • local dapp: your smart contract frontend deployed locally in your machine (through webservers like python or react webserver…or any other).
  • local blockchain: any local node in your machine (ganache, truffle, hardhat…)

The intention of this guide is to show how to reset your metamask account cache(transaction history), which drives some issues when you have deployed a local dapp with your local blockchain.

If for any reason, you tried your dapp and do some actions on it (like clicking a button to deposit funds in the contract and check the balance), once you finished, your local blockchain and dapp instances must be closed.

Then initialize all again and calling some functions from the dapp, will likely to fail without any reason.

Common Metamask Errors

Transaction fail, nonce too high

The nonce stored in metamask is different from the new local blockchain instance.

Solution: Reset your transaction history.

Step 1: Select the account you want to reset and go into “settings”.

Step 2: Go into “Advanced” options and “Reset Account” button.

Advanced option

Reset Account (I assume you read the description of what it does)

NOTE: For multiple accounts, you must do the same process for each.

Carlos Z

1 Like