I have a function in a contract to retrieve ETH balance for a given address, which is:
function getEthBalance(address _addr) constant public returns(uint) {
return _addr.balance;
}
Is there a way to retrieve token balance of the contract for a given address, just like the function above?
EDIT: Let's suppose the contract issues a token named TKN, and I have 10 TKN in my ETH address, is there a way to retrieve the balance of those 10 TKN in my address with a function? Something like:
function getTKNBalance(address _addr) constant public returns(uint) {
return _addr.TKN.balance;
}