Here is an article based on your issue:
Metamask not showing custom ERC20 token balance (Hardhat)
I am trying to test a custom ERC-20 token using Metamask and Hardhat. After deploying my ERC-20 coin and minting some on one of the default HardHat accounts, I try to add the token to Metamask. However, when I try to view or manage my token balance in Metamask, it doesn’t show any value.
This issue has been bugging me for a while now, and I’m hoping someone can help me figure out what’s going on. Here are some steps I’ve taken so far:
- Deployed the token
: I deployed my custom ERC-20 coin to Hardhat using the
solidity
contract deployment script.
- Minded tokens: I minted a few thousand tokens on one of the default accounts, which is also being used by Metamask.
- Added to Metamask: I tried adding these tokens to my Metamask wallet, but they are not showing up.
Here are some potential issues that could be causing this issue:
- Token balance mismatch: Are you sure the token was successfully deployed and minted? Double-check your contract’s deployment script and make sure the token is being transferred correctly.
- Metamask account configuration: Is your Metamask wallet configured to use the default accounts for testing purposes? Make sure your MetaMask account is connected to the same Ethereum network as the Hardhat contracts.
- Token configuration
: Are you using the correct settings for the custom ERC-20 token in your Metamask wallet and Hardhat? Make sure your token name, symbol, and decimals are set correctly.
To troubleshoot this issue further, I would like to ask:
- Can you provide more information about your contract deployment script and the tokens being minted?
- Have you tested your Metamask account setup and token setup on a separate Ethereum network or a different MetaMask wallet?
If you are still having issues after these steps, please let me know and I will do my best to assist you further.