Messenger of Allah ﷺ came to Medina and the people used to pay in advance the price of fruits to be delivered within one or two years. (The sub-narrator is in doubt whether it was one to two years or two to three years.) The Prophet ﷺ said, "Whoever pays money in advance for dates (to be delivered later) should pay it for known specified weight and measure (of the dates).
قَدِمَ رَسُولُ اللَّهِ ﷺ الْمَدِينَةَ وَالنَّاسُ يُسْلِفُونَ فِي الثَّمَرِ الْعَامَ وَالْعَامَيْنِ أَوْ قَالَ عَامَيْنِ أَوْ ثَلاَثَةً شَكَّ إِسْمَاعِيلُ فَقَالَ مَنْ سَلَّفَ فِي تَمْرٍ فَلْيُسْلِفْ فِي كَيْلٍ مَعْلُومٍ وَوَزْنٍ مَعْلُومٍ