"I heard Ibn 'Abbas say: 'When the Prophet came (to al-Madinah), they used to pay in advance for dates, two or three years in advance. He forbade them that and said: 'whoever pays in advance for dates, let him pay for a known amount or a known weight, to be delivered at a known time''' (Using translation from Nasāʾī 4616)
سَمِعْتُ ابْنَ عَبَّاسٍ يَقُولُ قَدِمَ رَسُولُ اللهِ ﷺ الْمَدِينَةَ وَهُمْ يُسْلِفُونَ فِي التَّمْرِ السَّنَتَيْنِ وَالثَّلَاثَ فَنَهَاهُمْ وَقَالَ «مَنْ أَسْلَفَ سَلَفًا فَلْيُسْلِفْ فِي كَيْلٍ مَعْلُومٍ وَوَزْنٍ مَعْلُومٍ إِلَى أَجَلٍ مَعْلُومٍ»