Ibn ʿAbbas said, "In the verse: To every one We have appointed ' (Muwaliya Muwaliya means one's) heirs (4.33).' (And regarding the verse) 'And those with whom your right hands have made a pledge.' Ibn ʿAbbas said, "When the emigrants came to the Prophet ﷺ in Medina, the emigrant would inherit the Ansari while the latter's relatives would not inherit him because of the bond of brotherhood which the Prophet established between them (i.e. the emigrants and the Ansar). When the verse: 'And to everyone We have appointed heirs' (4.33) was revealed, it canceled (the bond (the pledge) of brotherhood regarding inheritance)." Then he said, "The verse: To those also to whom your right hands have pledged, remained valid regarding cooperation and mutual advice, while the matter of inheritance was excluded and it became permissible to assign something in one's testament to the person who had the right of inheriting before.
كَانَ الْمُهَاجِرُونَ لَمَّا قَدِمُوا الْمَدِينَةَ يَرِثُ الْمُهَاجِرُ الأَنْصَارِيَّ دُونَ ذَوِي رَحِمِهِ لِلأُخُوَّةِ الَّتِي آخَى النَّبِيُّ ﷺ بَيْنَهُمْ فَلَمَّا نَزَلَتْ {وَلِكُلٍّ جَعَلْنَا مَوَالِيَ} نَسَخَتْ ثُمَّ قَالَ {وَالَّذِينَ عَقَدَتْ أَيْمَانُكُمْ } إِلاَّ النَّصْرَ وَالرِّفَادَةَ وَالنَّصِيحَةَ وَقَدْ ذَهَبَ الْمِيرَاثُ وَيُوصِي لَهُ