contract CIMCoinAirdrop is Ownable{
  using SafeMath for uint256;

  // The token being sold
  ERC20 public token;

  event BatchTransfer(address from, address indexed to, uint256 value);
  /**
  * @dev Constructor 
  */
  constructor(ERC20 _cim) public {
      token = _cim;
  }

  /**
  * @dev send token to mulitple user
  * @param _from token provider
  * @param _users user address list
  * @param _values the token amount list that want to deliver
  * @return A bool the operation was successful.
  */
  function batchTransfer(address _from, address[] _users, uint256[] _values) onlyOwner public returns (bool){
    address to;
    uint256 value;
    require(_users.length > 0 && _values.length > 0 && _users.length == _values.length, "list error");
    for(uint i = 0; i < _users.length; i++) {
      to = _users[i];
      value = _values[i];

      bool isUserAddress = false;
      // solium-disable-next-line security/no-inline-assembly
      assembly {
        isUserAddress := iszero(extcodesize(to))
      }

      require(isUserAddress, 'try to send token to smart contract');

      token.transferFrom(_from, to, value);
      emit BatchTransfer(_from, to, value);
    }
    return true;
  }
}
function batchTransfer(address _from, address[] _users, uint256[] _values) onlyOwner public returns (bool){
  address to;
  uint256 value;
  require(_users.length > 0 && _values.length > 0 && _users.length == _values.length, "list error");
  for(uint i = 0; i < _users.length; i++) {
    to = _users[i];
    value = _values[i];

    bool isUserAddress = false;
    // solium-disable-next-line security/no-inline-assembly
    assembly {
      isUserAddress := iszero(extcodesize(to))
    }

    require(isUserAddress, 'try to send token to smart contract');

    token.transferFrom(_from, to, value);
    emit BatchTransfer(_from, to, value);
  }
  return true;
}

/**
 * @dev send token to mulitple user
 * @param _from token provider
 * @param _users user address list
 * @param _values the token amount list that want to deliver
 * @return A bool the operation was successful.
 */