Hello. I am trying to deploy a very simple ERC20 contract onto the Cronos Testnet.
Token name: Commander
Symbol: COMM
I can get Mint, Burn, and Transfer to work, which is great. But the token shows up in people's wallets as
Unknown Token (?)
Screenshot below
This is the OpenZeppelin code. Unchanged when I import into Remix, compile and Deploy
pragma solidity ^0.8.20;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Permit.sol";
contract Commander is ERC20, ERC20Burnable, Ownable, ERC20Permit {
constructor(address initialOwner)
ERC20("Commander", "COMM")
Ownable(initialOwner)
ERC20Permit("Commander")
{
_mint(msg.sender, 123456 * 10 ** decimals());
}
function mint(address to, uint256 amount) public onlyOwner {
_mint(to, amount);
}
}
Would I have to verify the contract for it's name to show up?
Any help would be appreciated, thanks.
edit: I've tried setting the name, as well as symbol as Public rather then private. Did not work
abstract contract ERC20 is Context, IERC20, IERC20Metadata, IERC20Errors {
mapping(address account => uint256) private _balances;
mapping(address account => mapping(address spender => uint256)) private _allowances;
uint256 private _totalSupply;
string public _name;
string public _symbol;
/**
* @dev Sets the values for {name} and {symbol}.
*
* All two of these values are immutable: they can only be set once during
* construction.
*/
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}