function assessVoter () public view returns(uint) {
uint weight = (msg.sender).balance;
return (weight);
}
edit: I figured out the issue re: identifier. I had started a struct above and forgot to delete the incomplete struct. But assistance regarding the identification of balance would still be super appreciated!
I created a function to return the balance of a user's wallet address... Not sure if this is even how its properly done, just made intuitive sense to me ^ . ^
I got this error. Part of the issue is that I am very new and don't know what an identifier is. Additionally, as a side question, how would one query for the balance of a specific ERC-20 within a wallet?
ParserError: Expected identifier but got 'function' function assessVoter () public view returns(uint)
Welcome to Stack Overflow. Please look at community guidelines for posts. Include well formatted thoughts, clear and decise problems you are encountering and what you have tried compared with how it differs from what you are expecting.
ERC20 is a smart contract just like any other. Here is an example of how to call a method of another contract of the network. In this case - you would be calling the balance method of the token contract.
var contractABI = [{"constant":true,"inputs":....}];
var contractAddress = "0xa74476443119A942dE498590Fe1f24500000000";
var lookupAddress = "0xa74476443119A942dE498590Fe1f245000000000";
var contract = eth.contract(contractABI).at(contactAddress);
var balance = contract.balanceOf(lookupAddress);