contract AirDrop
{
    address public owner;
    address public executor;
    
    event eTransferExecutor(address newOwner);
    event eMultiTransfer(address _tokenAddr, address[] dests, uint256[] values);
    event eMultiTransferETH(address[] dests, uint256[] values);
    
    function () public payable {
    }
    
    // Constructor
    function AirDrop() public {
        owner = msg.sender;
        executor = msg.sender;
    }
    
    // Functions with this modifier can only be executed by the owner
    modifier onlyOwner() {
        require(msg.sender == owner);
        _;
    }
    
    function transferExecutor(address newOwner) public onlyOwner {
        require(newOwner != address(0));
        executor = newOwner;
        eTransferExecutor(newOwner);
    }
    
    // Functions with this modifier can only be executed by the owner
    modifier onlyExecutor() {
        require(msg.sender == executor || msg.sender == owner);
        _;
    }
    
    function MultiTransfer(address _tokenAddr, address[] dests, uint256[] values) public onlyExecutor
    {
        uint256 i = 0;
        ERC20Interface T = ERC20Interface(_tokenAddr);
        
        require(dests.length > 0 && (dests.length == values.length || values.length == 1));
        
        if (values.length > 1)
        {
            while (i < dests.length) {
                T.transfer(dests[i], values[i]);
                i += 1;
            }
        }
        else    
        {
            while (i < dests.length) {
                T.transfer(dests[i], values[0]);
                i += 1;
            }
        }
        eMultiTransfer(_tokenAddr, dests, values);
    }
    
    function MultiTransferETH(address[] dests, uint256[] values) public onlyExecutor
    {
        uint256 i = 0;
        require(dests.length > 0 && (dests.length == values.length || values.length == 1));
        
        
        if (values.length > 1)
        {
            while (i < dests.length) {
                dests[i].transfer(values[i]);
                i += 1;
            }
        }
        else    
        {
            while (i < dests.length) {
                dests[i].transfer(values[0]);
                i += 1;
            }
        }
        eMultiTransferETH(dests, values);
    }
}
function AirDrop() public {
        owner = msg.sender;
        executor = msg.sender;
    }
// Constructor