Al-Kāfi - Volume 7 > One who Dies without Leaving Behind any Heirs
Hadith #2

2- عِدَّةٌ مِنْ أَصْحَابِنَا عَنْ سَهْلِ بْنِ زِيَادٍ وَمُحَمَّدُ بْنُ يَحْيَى عَنْ أَحْمَدَ بْنِ مُحَمَّدٍ جَمِيعاً عَنِ ابْنِ مَحْبُوبٍ عَنِ الْعَلاءِ عَنْ مُحَمَّدِ بْنِ مُسْلِمٍ عَنْ أَبِي جَعْفَرٍ (عَلَيْهِ السَّلام) قَالَ مَنْ مَاتَ وَلَيْسَ لَهُ وَارِثٌ مِنْ قَرَابَتِهِ وَلا مَوْلَى عَتَاقِهِ قَدْ ضَمِنَ جَرِيرَتَهُ فَمَالُهُ مِنَ الأنْفَالِ.

2. A number of our people have narrated from Sahl ibn Ziyad and Muhammad ibn Yahya has narrated from Ahmad ibn Muhammad all from ibn Mahbub from al-‘ Ala’ from Muhammad ibn Muslim who has narrated the following: “Abu Ja‘far, ‘Alayhi al-Salam, has said, ‘If one dies without leaving behind any heirs from his relatives or freeing master who has taken responsibiliy for his crimes, his legacy becomes part of the public welfare funds (state treasury).”’