Abdullah bin Abbas reported,

Regarding "And for everyone We have appointed heirs" [Nisa 4:33], he explained that this means inheritors. As for "and those with whom you have made a pact", when the Emigrants first came to Madinah, an Emigrant would inherit from an Ansari to the exclusion of the Ansari's own blood relatives, because of the brotherhood the Prophet ﷺ had established between them. Then when "And for everyone We have appointed heirs" was revealed, that practice was abrogated.He then said, "and those with whom you have made a pact" refers to support, assistance, and sincere counsel. The inheritance no longer applies, though a bequest may be made in his favor.

Azami 6070

Sahih

عن ابن عباس

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

الأعظمي 6070صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Obligatory duties
Section
Abrogation of inheritance by contract and alliance through inheritance by kinship
Numbering
Jami al-Kamil 6070 (2nd edition)
Azami 6070