6

Sorry, I do not understand this very well. But with tokens (let's say those which follow ERC20), can one ethereum address own multiple tokens? How would one determine the names and balances of those tokens using JSON RPC or web3?

5

can one ethereum address own multiple tokens?

Yes, any ethereum can own multiple tokens.

How would one determine the names and balances of those tokens using JSON RPC or web3?

You will need contract ABI and address of each contract to check balances. You can implement something like this:

var contarct1 = web3.eth.contract(contract1_abi).at(contract1_address);
var contarct2 = web3.eth.contract(contract2_abi).at(contract2_address);
var balance1 = contract1.balanceOf(accountAddr).toNumber();
var balance2 = contract2.balanceOf(accountAddr).toNumber(); 

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.