From my base address I created a contract standard ERC20 token but I forgot add the distribute function so I made a new more contract like this:
pragma solidity ^0.4.16;
contract Owned {
address public owner;
function owned() {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function transferOwnership(address newOwner) onlyOwner {
owner = newOwner;
}
}
contract BatchToken is Owned {
mapping (address => uint256) public balanceOf;
event Transfer(address indexed from, address indexed to, uint256 value);
function distributeToken(address[] addresses, uint256 _value) onlyOwner {
for (uint i = 0; i < addresses.length; i++) {
balanceOf[owner] -= _value;
balanceOf[addresses[i]] += _value;
Transfer(owner, addresses[i], _value);
}
}
function Destroy() onlyOwner() {
selfdestruct(owner);
}
}
Then I send the token from Token contract to this contract and run distribute, it's working ok. But the problem is: token receive show as no name. Please check this out