0

Not the tokens created in a contract but the balance which I allocate in the genesis.

  • you are using web3.js ? or what framework for the communication with the blockchain? And if you can put some code. – Gawey Jun 9 '17 at 8:16
  • currently using the command line interface of geth. – anonymous Jun 9 '17 at 11:20
1

If you want to check the balance of an account within a contract then use <address>.balance.

| improve this answer | |
  • when I use this with my default account eth.accounts[0] it gives me a very high value and does not match the return value of eth.getBalance(). I think it is because of the datatype. How can I solve this? – anonymous Jun 9 '17 at 8:00
  • 1
    It's hard to say without seeing the code, but perhaps it's a unit issue? I know in solidity, <address>.balance returns the amount of ether in wei, where 1 ether = 10^8 wei – user9402 Jun 9 '17 at 12:09

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.