How can I find out the token balance of some address using Solidity?
For example, I have the address of another person, and I need to know the number of tokens on his account.
soliditytokens
How can I find out the token balance of some address using Solidity?
For example, I have the address of another person, and I need to know the number of tokens on his account.
Best Answer
There are 2 ways using https://etherscan.io/ :
Update Responding To The More Specific Question On Getting The Balance Using Solidity
Here is an example using GNT, where I got the ABI from the GNT contract details at 0xa74476443119A942dE498590Fe1f2454d7D4aC0d:
Update With Script To Find GNT Balances For Multiple Accounts
The
getGNTBalances
script from https://github.com/bokkypoobah/TokenTrader/tree/master/scripts will produce the following type of output:Just change the address in the script to any ERC20 compliant token to view the balances for that token.