[ '0x5aad8308d0c45d2b9fc1c465316ba071d2eb6f9c',
  '0xa51850dcd65e4ab4696923162ca8c8d352b12a8a' ]

I got all my accounts

In Truffle i have deployed my contract as app

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

When i typed


Can anyone explain what is going inside deploying and why we can't see when typing app.accounts and why can we see when using web3.eth.accounts

i didn't find any documention can any one elobrate it and explain

i am trying everything in the console

  • Did you call deployer.deploy before that? – ivicaa Oct 8 '18 at 6:28
  • I have done succefuly deployed using deploye.deploy() – Venkatesh Muthyala Oct 8 '18 at 6:32
  • Why are you expecting to see app.accounts? Do you have a field in your contract with this name? You can only call functions on contracts. – ivicaa Oct 8 '18 at 6:38
  • NO but i am thinking why can we see accounts web3.eth.accounts when we have no accounts specified – Venkatesh Muthyala Oct 8 '18 at 6:44
  • If you see a result returned by web3.eth.accounts, you’re connected to a node which manages these accounts. – ivicaa Oct 8 '18 at 6:49

why we can't see when typing app.accounts

You see nothing by calling this, because basically you can only call functions of the contract via contract's instance (and few other things like the address of the contract, etc.)

why can we see when using web3.eth.accounts

Because your node is managing these accounts.

Please check the Ethereum tutorial, truffle documentation and web3 api specification.

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.