Abdullah bin Abbas reported,

Regarding the words of Allah the Most High, "And to those with whom you have made a pact, give them their share" [Nisa 4:33], he explained that when the Emigrants first came to Madinah, a man would inherit from his Ansari brother rather than from his own blood relatives, because of the bond of brotherhood that the Messenger of Allah ﷺ had established between them. Then, when the verse "And to everyone We have appointed heirs of what he leaves behind" [Nisa 4:33] was revealed, it abrogated that practice. So "And to those with whom you have made a pact, give them their share" [Nisa 4:33] now means a share of support, sincere counsel, and assistance, and one may make a bequest in his favor, but the inheritance itself no longer applies.

Abu Dawud 2922

Sahih

حدثنا هارون بن عبد الله حدثنا أبو أسامة حدثني إدريس بن يزيد حدثنا طلحة بن مصرف عن سعيد بن جبير

عن ابن عباس في قوله

تعالى {والذين عاقدت أيمانكم فآتوهم نصيبهم} قال كان المهاجرون حين قدموا المدينة تورث الأنصار دون ذوي رحمه للأخوة التي آخى رسول الله ﷺ بينهم فلما نزلت هذه الآية {ولكل جعلنا موالي مما ترك} قال نسختها {والذين عقدت أيمانكم فآتوهم نصيبهم} من النصر والنصيحة والرفادة ويوصي له وقد ذهب الميراث

أبو داود 2922صحيح
Contents
Reference
Commentary
Ayat
Collection
Sunan Abu Dawud
Book
Obligatory duties
Chapter
Abrogation of inheritance by contract through inheritance by blood relations
Numbering
Darussalam 2922
Abu Dawud 2922