the Messenger of Allah (ﷺ) entered into a contract with the people of Khaibar for one half of the fruits or crops yielded.
Sunan Ibn Majah Book 16, Hadith 32