The Messenger of Allah ﷺ forbade the sale by pebble-throwing and the sale involving uncertainty.
أخبرنا عبيد الله بن سعيد قال حدثنا يحيى عن عبيد الله قال أخبرني أبو الزناد عن الأعرج
نهى رسول الله ﷺ عن بيع الحصاة وعن بيع الغرر
Muslim narrated it in the chapter on Business Transactions, in the section on the invalidity of the sale by touching a stone, etc., hadith no. 1513, from the hadith of Yahya bin Saeed Qattan, with this wording, and it is also found in Sunan al-Kubra, hadith no. 6109.