HomeContact
Web3
How to solve TX doesn't have the correct nonce when using Ganache and Metamask
April 28, 2022
1 min

You just started your local Ganache blockchain and deployed some smart contracts. Everything worked a week ago, and now when you want to try your freshly developed and deployed smart contract, you encounter this error: TX doesn’t have the correct nonce.

Good news! It’s not that hard to solve. It was a pain before, but not anymore since Metamask v3.14.1.

To solve this error, you have to reset your Metamask account so that it can re-sync with your local blockchain. To do that, go to Settings > Advanced > Reset Account.

Reset Metamask Account History
Reset Metamask Account History

Retry what you were doing, and the bug should be gone!

What happens under the hood: Metamask is caching the Tx of your local Ganache blockchain. The problem that can arise is that you restart your local Ganache multiple times and lose the Tx history so that it will resume at 1 on Ganache. However, Metamask is caching this info and will send a specific Tx number that will not match your local blockchain. The call from Metamask will drop out because there is a mismatch.


Tags

blockchainweb3

Related Posts

How to find work in Web3 and get paid
June 09, 2022
2 min
© 2022, All Rights Reserved.

Quick Links

Contact Us

Social Media