It's a wonderful gift of a thing to consider doing for your friend.
My DS was born via donor egg IVF. I will never know our donor (anonymously done abroad) but she is revered in our family and DS knows that a kind lady gave me an egg so that I could have him - as he grows so will the details in the story.
The advice above is very good. DS is utterly, utterly, mine. I regret that he won't have the option of making contact with his donor when he's older, and I wish I could write to her and tell her how amazing DS is, but if she was someone we saw regularly I think I'd feel the need to seek her approval for my parenting decisions, and we'd have to be certain of not giving him confusing messages.
It's a terribly fraught time and it's important that you and your friend can really talk through how you'd manage if she had a child born with your egg. Once you've got over the love and grief and closeness and horror and all the other emotions that infertility brings, how would you and she feel about all the mundane little things that come up in families.
A dear friend offered me an egg donation, when I was at the point that your friend is. Despite my love and gratitude for her, I felt that a child born from that arrangement wouldn't feel truly mine (to me) and I knew her fierce protection for her own children would extend to this child too, so we didn't go ahead. My sister offered me the same thing and then withdrew because she and her husband couldn't have coped with it.
Another option that most UK clinics offer is that you donate to one of their patients, and your friend receives a donation from one of their donors. That way you've helped her by donating, but you can avoid the complications of a child that's genetically yours being her child (if you want to).
You're a wonderful friend to think of doing this.