Just re-introducing myself, and will try to keep it succinct.
I was here a few years ago when my daughter was raising thorns, disrupting our lives and making horrible decisions (drugs, alcohol, prostitution, no job, abusive relationship). Then I detached a bit, was working, and started to peel my life away from hers. She was still leeching money from my parents and shacked up with the boyfriend that gave her black eyes - but she told everyone how hard she was working on becoming an "independent woman" and a "survivor" that they ate it up like cats on cream, and my parents kept doling money out to her for rent so she could break away.]
Thank God, I did not have to deal with this, but my sister did. At first she had to fight for grandparents rights, then the baby daddy got thrown in jail for drugs and the other grandparents lost all their rights because he was not supposed to be around the grandbaby and they broke the rules. My niece spiraled downhill, has lived off and on the streets for years now with intermittent trips back to live with my sister. The good news is that my niece did give custody of her daughter over to my sister. The bad news, my great-niece hates her bio-mom. The good news, my great-niece is in college.
I agree with everyone who has said they would get legal advice. There is no telling what's around the corner. If your daughter straightens up, then she can play a role in her child's life, but first, she has to earn your trust. That said, she may never get her act together, my daughter sure hasn't been able to, and now she is dying. I guess what I am trying to say, is go in with eyes wide open. It is very possible, you will be raising your grandchild. No judgement here, whatever your decision.