Ubada bin Samit reported,

He had witnessed Badr and was one of the leaders on the night of Uqba. 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 adultery, that you will not kill your children, that you will not bring forth any slander you have invented between your hands and feet, and that you will not disobey me 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 will be an atonement for him. And whoever commits any of these offenses and Allah conceals it, his affair rests with Allah. If He wills, He will pardon him, and if He wills, He will punish him."So we pledged allegiance to him on these terms.

Bukhari 18

Sahih

حدثنا أبو اليمان قال أخبرنا شعيب عن الزهري قال أخبرني أبو إدريس عائذ الله بن عبد الله أن

عبادة بن الصامت رضي الله عنه

وكان شهد بدرا وهو أحد النقباء ليلة العقبة أن رسول الله ﷺ قال وحوله عصابة من أصحابه بايعوني على أن لا تشركوا بالله شيئا ولا تسرقوا ولا تزنوا ولا تقتلوا أولادكم ولا تأتوا ببهتان تفترونه بين أيديكم وأرجلكم ولا تعصوا في معروف فمن وفى منكم فأجره على الله ومن أصاب من ذلك شيئا فعوقب في الدنيا فهو كفارة له ومن أصاب من ذلك شيئا ثم ستره الله فهو إلى الله إن شاء عفا عنه وإن شاء عاقبه فبايعناه على ذلك

البخاري 18صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Faith
Chapter
Love of the Ansar as a sign of faith
Numbering
Darussalam 18
Bukhari 18