contract WizzleInfinityHelper is Mortal {
    
    mapping (address => bool) public whitelisted;
    ERC20 public token;

    function WizzleInfinityHelper(address _token) public {
        token = ERC20(_token);
    }

    /// @dev Whitelist a single address
    /// @param addr Address to be whitelisted
    function whitelist(address addr) public onlyOwner {
        require(!whitelisted[addr]);
        whitelisted[addr] = true;
    }

    /// @dev Remove an address from whitelist
    /// @param addr Address to be removed from whitelist
    function unwhitelist(address addr) public onlyOwner {
        require(whitelisted[addr]);
        whitelisted[addr] = false;
    }

    /// @dev Whitelist array of addresses
    /// @param arr Array of addresses to be whitelisted
    function bulkWhitelist(address[] arr) public onlyOwner {
        for (uint i = 0; i < arr.length; i++) {
            whitelisted[arr[i]] = true;
        }
    }

    /// @dev Check if address is whitelisted
    /// @param addr Address to be checked if it is whitelisted
    /// @return Is address whitelisted?
    function isWhitelisted(address addr) public constant returns (bool) {
        return whitelisted[addr];
    }   

    /// @dev Transfer tokens to addresses registered for airdrop
    /// @param dests Array of addresses that have registered for airdrop
    /// @param values Array of token amount for each address that have registered for airdrop
    /// @return Number of transfers
    function airdrop(address[] dests, uint256[] values) public onlyOwner returns (uint256) {
        uint256 i = 0;
        while (i < dests.length) {
           token.transfer(dests[i], values[i]);
           whitelisted[dests[i]] = true;
           i += 1;
        }
        return (i); 
    }

}
/// @title WizzleInfinityHelper contract
function bulkWhitelist(address[] arr) public onlyOwner {
    for (uint i = 0; i < arr.length; i++) {
        whitelisted[arr[i]] = true;
    }
}

/// @dev Whitelist array of addresses
/// @param arr Array of addresses to be whitelisted