The Messenger of Allah ﷺ said, "Gold for gold, whether in raw form or coined, and silver for silver, whether in raw form or coined, and wheat for wheat, measure for measure, and barley for barley, measure for measure, and dates for dates, measure for measure, and salt for salt, measure for measure. Whoever gives more or takes more has engaged in usury. There is no harm in selling gold for silver with the silver being the greater of the two, hand to hand, but on credit, no. And there is no harm in selling wheat for barley with the barley being the greater of the two, hand to hand, but on credit, no."
حدثنا الحسن بن علي حدثنا بشر بن عمر حدثنا همام عن قتادة عن أبي الخليل عن مسلم المكي عن أبي الأشعث الصنعاني
أن رسول الله ﷺ قال الذهب بالذهب تبرها وعينها والفضة بالفضة تبرها وعينها والبر بالبر مدي بمدي والشعير بالشعير مدي بمدي والتمر بالتمر مدي بمدي والملح بالملح مدي بمدي فمن زاد أو ازداد فقد أربى ولا بأس ببيع الذهب بالفضة والفضة أكثرهما يدا بيد وأما نسيئة فلا ولا بأس ببيع البر بالشعير والشعير أكثرهما يدا بيد وأما نسيئة فلا
[Sahih]. Nasai transmitted it, Chapter on Sales, the sale of barley for barley, hadith no. 4568, from the hadith of Hammam, through this route. See also the hadith that follows.