meetup-token
Version:
An Ethereum ERC20 compatible token for members of a meetup.com group
18 lines (15 loc) • 642 B
JavaScript
function checkBalance(x) {
var acct = eth.accounts[x];
var acctBal = web3.fromWei(eth.getBalance(acct), "ether");
console.log(" eth.accounts[" + x + "]: \t" + acct + " \tbalance: " + acctBal + " ether");
}
function checkAllBalances() {
var totalBal = 0;
for (var acctNum in eth.accounts) {
var acct = eth.accounts[acctNum];
var acctBal = web3.fromWei(eth.getBalance(acct), "ether");
totalBal += parseFloat(acctBal);
console.log(" eth.accounts[" + acctNum + "]: \t" + acct + " \tbalance: " + acctBal + " ether");
}
console.log(" Total balance: " + totalBal + " ether");
};