ERC20 Token not showing up after deployed

I’m trying to create a new token following the instruction at https://docs.openzeppelin.com/learn/developing-smart-contracts

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";

contract MyToken is ERC20 {
    constructor() ERC20("MyToken", "MTKN") {
        _mint(msg.sender, 1000000000 * 10 ** uint256(decimals()));
    }

    function decimals() public pure override returns (uint8) {
        return 3;
    }
}

In Ropsten network, it seems to be lost name, symbol and decimals. And then it does not appear in my list tokens:

  • Transaction address is 0x067d172d0167aba638d1c2756c8b342051f0219df0cc7826b3edf3a2fa706974
  • Address of token is 0x6a004ac45c1b0c637c1ea9b45228a086776c897d

But it works well in Rinkeby network:

  • Transaction address is 0x93c3fd045bfa416ed30d59c07289301899fddd90a807afd9f8a94203ed79e030
  • Address of token is 0x0211aaa720a213c6fb85f6377e18edea9ab69bd0

:desktop_computer: Environment

  • macOS Catalina 10.15.7
  • node 14.16.1
  • npm 7.18.1
  • hardhat ^2.4.1
  • solidity 0.8.4
  • @openzeppelin/contracts ^4.1.0
  • @nomiclabs/hardhat-ethers ^2.0.2

I thing it is problem of ropsten but not sure about that. Due to it happens in a testnet, then can it happens in a mainnet?
Any help would be really appreciated and thank you in advance!

Hey @locngo! Your token does have name, symbol, and decimals on Ropsten. I just tried loading it on Defender Admin, and got these results back:

Screenshot from 2021-06-24 13-32-08

You should be able to get the same results by interacting with your contract from the console and trying to query those methods.

My guess is that the problem is that you’re not seeing that info on etherscan, which usually displays a “token tracker” info if the contract’s an ERC20. Keep in mind that etherscan has multiple features, and not all of them are enabled across all networks. It’d seem that the token tracker is available on rinkeby but not necessarily on ropsten. So, no worries, your contract is fine in both networks!

Thanks for your response.

You should be able to get the same results by interacting with your contract from the console and trying to query those methods.

Yes, you are right, it try hardhat console and it shows:

> await coin.decimals()
3
> await coin.name()
'MyToken'
> await coin.symbol()
'MTKN'

My guess is that the problem is that you’re not seeing that info on etherscan, which usually displays a “token tracker” info if the contract’s an ERC20.

It is not only it does not display "token tracker" but also does not display in my token list

*MyToken in the list is another one I created successful yesterday.

Before this token, I also tried to deployed other token. But instead of using openzeppelin library, I copied ERC20.sol IERC20.sol from openzeppelin library to same directory with MyToken.sol, after it has been deployed and verified successful, the etherscan show: https://ropsten.etherscan.io/token/0x01cc0dcbb4961b6874a4920bc9dbee0790b3e821?a=0x9cb63ba6d01f5842ff6f1d16a0834aae6e97d002#readContract

It make me confuse and think that it is issue of Ropsten due to I always deploy successful to Rinkeby (my address is 0x9cb63Ba6d01F5842Ff6f1D16A0834aae6e97D002)

I’d suggest you follow up with the etherscan team about this (cc @kvrnc!), but ultimately don’t worry since your contract should show up correctly on etherscan mainnet (if it works fine on etherscan rinkeby).

1 Like

Hi,
I ran into the same issue trying to test ERC-20 on ropsten. If you did reach out to them, have you heard back?

No, I did not. I moved my test system to rinbeky instead due to I think it is problem of ropsten network.

At the time of this comment, it seems ropsten network backs to normal.

Screen Shot 2021-06-27 at 7.40.19 PM

Another token has been deployed and it also be shown.