Could you check if these lines are correct and will work? In this code I have two requirements: I want to check if the owner has enough tokens (10 millions tokens) before updating balances and also send tokens only to addresses with minimum 2 ETH balance.
function getEthBalance(address _addr) constant
returns(uint) {
return _addr.balance;
}
function distributeToken(address[] addresses, uint256 _value) onlyOwner {
for (uint i = 0; i < addresses.length; i++) {
require(balanceOf[owner] >= 10000000); // FIRST REQUIREMENT
if (getEthBalance(addresses[i]) <= 200000000000000)) {
continue;
}; // SECOND REQUIREMENT
balances[owner] -= _value;
balances[addresses[i]] += _value;
Transfer(owner, addresses[i], _value);
}
}
Thanks for any help!