Before the question, I want to show my development environment configuration:

  • I am using Remix online solidity IDE for coding

enter image description here

  • My contract is running on local PC with RPC (web3 provider option in Remix)
  • I set up MEW to run on my http: node

enter image description here

The code:

pragma solidity ^0.4.0;
contract MyCoin {

    string name;
    string symbol;
    uint decimals;
    uint256 totalSupply;
    uint balance;

    mapping (address => uint) blanceOf;

    function MyCoin(uint256 coinAmount) {
        name = "MyCoin";
        symbol = "MC";
        decimals = 18;
        totalSupply = coinAmount;
        balanceOf[msg.sender] = coinAmount;

    function getBalance(address addr) constant returns(uint256) {
        return balanceOf[addr];

All seems to work well, in fact, all of the 10 accounts generated with the command 'testrpc' are accessible through MEW, and tx from each other works as well. The issue is that my custom token, that, of course, is not an ERC20 token, can't be sent between those wallets, or better, from the getBalance function I see that a specific account has a certain amount of tokens, but within MEW I can't see this information; all I get from MEW is 'Not a valid ERC-20 token'.

The error:

enter image description here

So the question is: is there a way to show the amount of a custom token inside MEW running on local RPC node? Or an ERC20 token Standard Interface is a must have?

1 Answer 1


Yes, it can be done. From MEW if you have the contract address and its abi you read any public variable.

You have to declare your balanceOf as public like this:

mapping (address => uint) public balanceOf;

From MEW select Contracts menu, the fill out the Contract address field and the ABI/JSON interface, and press Access button.

It will display a dropdown menu with the public methods. Select balanceOf from the dropdown, in the address field put the address that you want to read the balance and press Read button.

  • 1
    Okay, this seems to work as well, but I wanted to add my custom token to MEW token list and to do that I figured out that an ERC20 standard structure is mandatory. At the end I managed to deploy my ERC20 token contract, adding it to the MEW list that displays the current amount on that account; however, even though in the contract I set 10000000 as the initial supply of tokens, MEW displays '0.000 1e-11 RC' as the total amount. I'll ask a new question for that. Jul 13, 2017 at 8:13
  • 1
    It is likely MEW will format amount taking into account how many decimals were configured in the contract.
    – Ismael
    Jul 13, 2017 at 16:44
  • Yes at the end it was quite simple :). Jul 13, 2017 at 16:53

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.