The Messenger of Allah ﷺ arrived in Medina at a time when the people were paying in advance for dates to be delivered two or three years later. He forbade them from doing this and said, "Whoever pays in advance must do so for a specified measure, a specified weight, and a specified term."
أخبرنا قتيبة بن سعيد قال حدثنا سفيان عن ابن أبي نجيح عن عبد الله بن كثير عن أبي المنهال قال سمعت
قدم رسول الله ﷺ المدينة وهم يسلفون في التمر السنتين والثلاث فنهاهم وقال من أسلف سلفا فليسلف في كيل معلوم ووزن معلوم إلى أجل معلوم
Bukhari narrated it in Salam, chapter, "Salam in a Known Weight," hadith 2241, from Qutayba, and Muslim in Musaqat, chapter on salam, hadith 1604, from the hadith of Sufyan bin Uyayna through the same route. It is also in Kubra, hadith 6209.