// 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
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!
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!
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
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).