Messenger of Allah ﷺ said to us while we were in a gathering, "Give me the oath (Pledge of allegiance for: (1) Not to join anything in worship along with Allah, (2) Not to steal, (3) Not to commit illegal sexual intercourse, (4) Not to kill your children, (5) Not to accuse an innocent person (to spread such an accusation among people), (6) Not to be disobedient (when ordered) to do good deeds. The Prophet ﷺ added: Whoever amongst you fulfill his pledge, his reward will be with Allah, and whoever commits any of those sins and receives the legal punishment in this world for that sin, then that punishment will be an expiation for that sin, and whoever commits any of those sins and Allah does not expose him, then it is up to Allah if He wishes He will punish him or if He wishes, He will forgive him." So we gave the Pledge for that. (See Hadith No. 17, Vol. 1)
لَنَا رَسُولُ اللَّهِ ﷺ وَنَحْنُ فِي مَجْلِسٍ تُبَايِعُونِي عَلَى أَنْ لاَ تُشْرِكُوا بِاللَّهِ شَيْئًا وَلاَ تَسْرِقُوا وَلاَ تَزْنُوا وَلاَ تَقْتُلُوا أَوْلاَدَكُمْ وَلاَ تَأْتُوا بِبُهْتَانٍ تَفْتَرُونَهُ بَيْنَ أَيْدِيكُمْ وَأَرْجُلِكُمْ وَلاَ تَعْصُوا فِي مَعْرُوفٍ فَمَنْ وَفَى مِنْكُمْ فَأَجْرُهُ عَلَى اللَّهِ وَمَنْ أَصَابَ مِنْ ذَلِكَ شَيْئًا فَعُوقِبَ فِي الدُّنْيَا فَهْوَ كَفَّارَةٌ لَهُ وَمَنْ أَصَابَ مِنْ ذَلِكَ شَيْئًا فَسَتَرَهُ اللَّهُ فَأَمْرُهُ إِلَى اللَّهِ إِنْ شَاءَ عَاقَبَهُ وَإِنْ شَاءَ عَفَا عَنْهُ فَبَايَعْنَاهُ عَلَى ذَلِكَ