The Messenger of Allah ﷺ, with a group of his companions gathered around him, said, "Pledge allegiance to me that you will not associate anything with Allah, that you will not steal, that you will not commit fornication, that you will not kill your children, that you will not bring forth a slander you have fabricated between your hands and feet, and that you will not disobey in what is right. Whoever among you fulfills this, his reward is with Allah. Whoever commits any of these offenses and is punished for it in this world, that punishment is an expiation for him. And whoever commits any of these offenses and Allah conceals it, his affair is with Allah. If He wills, He will pardon him, and if He wills, He will punish him."
عن عبادة بن الصامت- وكان شهد بدرا،
-، أن رسول الله ﷺ قال- وحوله عصابة من أصحابه-: بايعوني على أن لا تشركوا بالله شيئا، ولا تسرقوا، ولا تزنوا، ولا تقتلوا أولادكم ولا تأتوا ببهتان تفترونه بين أيديكم وأرجلكم، ولا تعصوا في معروف. فمن وفى منكم فأجره على الله، ومن أصاب من ذلك شيئا فعوقب في الدنيا فهو كفارة له، ومن أصاب من ذلك شيئا ثم ستره الله فهو إلى الله، إن شاء عفا عنه، وإن شاء عاقبه.
Bukhari narrated it in the book of faith (18), and Muslim in the book of legal punishments (1709), both from the hadith of Zuhri, from Abu Idris Aidhullah bin Abdullah, that Ubada bin Samit said (then he mentioned the hadith), and the wording is Bukhari's. They both also narrated it, Bukhari (3893), through another route from Sanabihi, from Ubada bin Samit, with this wording, "and we shall not plunder, and we shall not disobey, and paradise is ours if we do that, but if we fall into any of it, then its judgment rests with Allah."