I am playing around with my ERC20 token. I created token on Rinkeby test network. I can't understand where I did a mistake. I am interacting with my token in truffle console.

After command

Token.deployed().then(function(instance){app = instance;})

I check my balance with command:


And it works fine, I am getting the right answer.

Then I am trying to check my balance with commands:

app.balanceOf.call(accounts[0], {from: accounts[0]})


app.balanceOf.call(app.accounts[0], {from: app.accounts[0]})



Where I did a mistake? How to call a function balanceOf ?

Information after command app:

  { [Function: bound ]
    request: [Function: bound ],
    call: [Function: bound ],
    sendTransaction: [Function: bound ],
    estimateGas: [Function: bound ],
    getData: [Function: bound ],
    address: [Circular] },


  { [Function]
    call: [Function],
    sendTransaction: [Function],
    request: [Function: bound ],
    estimateGas: [Function] },
  • What is the error your getting... ? Update your qus. Commented May 7, 2018 at 6:12

1 Answer 1


You can do:


if you use call the function is evaluated locally (in the node you are connected) and the transaction is not sent to the network, therefore no need for {from: accounts[0]}.

  • Comments are not for extended discussion; this conversation has been moved to chat.
    – eth
    Commented May 8, 2018 at 23:24
  • just for curious, would app.balanceOf be encoded as a call in the EVM bytecode? Commented Aug 8, 2019 at 11: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.