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] },

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 May 8 '18 at 23:24
  • just for curious, would app.balanceOf be encoded as a call in the EVM bytecode? – lllllllllllll Aug 8 '19 at 11:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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