I am not able to see the name, symbol, and supply on the smart contract at ropsten.

pragma solidity ^0.8.0;

contract MyToken{
address public minter;
mapping(address => uint) public balance;
string public name;
string public symbol;
uint256 public totalSupply;
uint8 public decimals;
event Sent( address from, address to,  uint amount);

constructor () {
minter = msg.sender; 
name = "COOP";
symbol= "COP";
totalSupply= 100 * 1000;
decimals= 18;


function mint(address recieve, uint amount) public {
    require(msg.sender == minter);
    balance[recieve] += amount;

function send(address reciever, uint amount) public {
    require(amount <= balance [msg.sender], "insuffient funds");
    balance[msg.sender] -= amount;
    balance[reciever] += amount;
    emit Sent(msg.sender, reciever,amount);


  • What do you mean with I am not able to see the name, symbol, and supply? They are public so you should be able to query them.
    – Ismael
    Commented Oct 28, 2021 at 0:12

1 Answer 1


This is because strings have to be read from the memory storage;

Declared like this

string  public symbol;
string  public name;

in a function or constructor as well

function setMyString(string memory myString) public {
   symbol = myString;

However, If your creating a token you should look at the ERC20 Standard to make sure you follow it and your token can be recognise by wallet and other contract.

To make an ERC20 you Must follow the standard. Look at Open Zeppelin Library that will provide you with a pre-made contract that you can reuse and customize.

  • When I declare the string it give me error. Commented Oct 26, 2021 at 20:11
  • I added the public statement. Try if this was your error. Giving error is meaningless unless you have an actual error message. Commented Oct 26, 2021 at 20:14
  • If you get an error it's probably not from that declaration. Commented Oct 26, 2021 at 20:15
  • the declaration is an error. Commented Oct 26, 2021 at 20:54
  • What is the error? Commented Oct 26, 2021 at 21:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.