The Messenger of Allah ﷺ forbade the sale involving uncertainty and the sale by pebble-throwing.
حدثنا محمد بن عبيد حدثنا عبيد الله عن الزهري عن أبي سلمة
أن رسول الله ﷺ نهى عن بيع الغرر وعن بيع الحصاة
Its isnad is sahih, and it is mutawatir, as stated in Al-Azhar Al-Mutanathirah. Muslim narrated it, 3/1153, no. 1513, in the chapter on business transactions, on the invalidity of the pebble sale. Abu Dawud narrated it, no. 3376, in the chapter on business transactions, on the sale involving gharar. Tirmidhi narrated it, 3/523, no. 1230, in the chapter on business transactions, on the dislike of the sale involving gharar, and he said, hasan sahih. Ibn Majah narrated it, 2/739, no. 2194, in the chapter on commercial transactions, on the prohibition of the pebble sale. Malik narrated it, 664, in the chapter on business transactions, on the sale involving gharar.This hadith has occurred many times before, see 1/116 and 302, and 2/154–155, 250, 376, 436, 439, and 496.