Sahih al-Bukhari, Hadith 6747

Narrated Ibn `Abbas: Regarding the Holy Verse:--'And to everyone, We have appointed heirs..' And:-- (4.33) 'To those also to Whom your right hands have pledged.' (4.33) When the emigrants came to Medina, the Ansar used to be the heir of the emigrants (and vice versa) instead of their own kindred by blood (Dhawl-l-arham), and that was because of the bond of brotherhood which the Prophet had established between them, i.e. the Ansar and the emigrants. But when the Divine Verse:-- 'And to everyone We have appointed heirs,' (4.33) was revealed, it cancelled the other, order i.e. 'To those also, to whom Your right hands have pledged.'

حَدَّثَنِي إِسْحَاقُ بْنُ إِبْرَاهِيمَ، قَالَ قُلْتُ لأَبِي أُسَامَةَ حَدَّثَكُمْ إِدْرِيسُ، حَدَّثَنَا طَلْحَةُ، عَنْ سَعِيدِ بْنِ جُبَيْرٍ، عَنِ ابْنِ عَبَّاسٍ، ‏{‏وَلِكُلٍّ جَعَلْنَا مَوَالِيَ‏}‏ ‏{‏وَالَّذِينَ عَقَدَتْ أَيْمَانُكُمْ‏}‏ قَالَ كَانَ الْمُهَاجِرُونَ حِينَ قَدِمُوا الْمَدِينَةَ يَرِثُ الأَنْصَارِيُّ الْمُهَاجِرِيَّ دُونَ ذَوِي رَحِمِهِ لِلأُخُوَّةِ الَّتِي آخَى النَّبِيُّ صلى الله عليه وسلم بَيْنَهُمْ فَلَمَّا نَزَلَتْ ‏{‏جَعَلْنَا مَوَالِيَ‏}‏ قَالَ نَسَخَتْهَا ‏{‏وَالَّذِينَ عَقَدَتْ أَيْمَانُكُمْ‏}‏

sunnah.com