I'm trying to test a custom ERC-20 token using Metamask and Hardhat.
After deploying my ERC-20 coin and minting some to one of the HardHat default accounts I try to add the token to Metamask. It is correctly able to fetch both the decimals of the token and the symbol, however it shows a balance of 0. (I've verified using Hardhat scripts that the balance of the given account is in fact NOT 0 (balanceOf
returns 10))
Implementation of custom coin:
pragma solidity ^0.8.7;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
contract BobCoin is ERC20 {
constructor() ERC20("BobCoin", "BOB") {
}
function mint(address to, uint256 amount) public {
_mint(to, amount);
}
}