I need to implement Distribute function in ERC20 token code which will send equal amount of the tokens on an array of addresses when executed. Below is the source code that I will use for that. Of course I will change the variables for my token:
https://pastebin.com/wAe9a1EV
Is the Distribute function that I add at the end of the contract suitable and does not interfere with the rest of the source code? Can I execute distributions on a later stage through Myetherwallet or Mist with that function if I deploy the contract with that function on the blockchain?
function distributeToken(address[] addresses, uint256 _value) onlyOwner{
for (uint i = 0; i < addresses.length; i++) {
balances[owner] -= _value;
balances[addresses[i]] += _value;
Transfer(owner, addresses[i], _value);
}
}