Narrated Ibn `Abbas
The Prophet (ﷺ) said, "Give the Fara'id, (the shares prescribed in the Qur'an) to those who are entitled to receive it, and then whatever remains, should be given to the closest male relative of the deceased."
Narrated Ibn `Abbas
The person about whom Allah's Messenger (ﷺ) said, "If I were to take a Khalil from this nation (my followers), then I would have taken him (i.e., Abu Bakr), but the Islamic Brotherhood is better (or said: good)," regarded a grandfather as the father himself (in inheritance).