When the Messenger of Allah ﷺ came to Medina, they were paying one, two and three years in advance for fruits, so he said: Those who pay in advance for anything, must do for a specified measure and weight with a specified time fixed.
قَدِمَ رَسُولُ اللَّهِ ﷺ وَهُمْ يُسْلِفُونَ فِي التَّمْرِ السَّنَةَ وَالسَّنَتَيْنِ وَالثَّلاَثَةَ فَقَالَ رَسُولُ اللَّهِ ﷺ مَنْ أَسْلَفَ فِي تَمْرٍ فَلْيُسْلِفْ فِي كَيْلٍ مَعْلُومٍ وَوَزْنٍ مَعْلُومٍ إِلَى أَجَلٍ مَعْلُومٍ