Genesis 47:14-17

47:14 Joseph collected all the money that could be found in the land of Egypt and in the land of Canaan as payment for the grain they were buying. Then Joseph brought the money into Pharaoh’s palace. 47:15 When the money from the lands of Egypt and Canaan was used up, all the Egyptians came to Joseph and said, “Give us food! Why should we die before your very eyes because our money has run out?”

47:16 Then Joseph said, “If your money is gone, bring your livestock, and I will give you food in exchange for your livestock.” 47:17 So they brought their livestock to Joseph, and Joseph gave them food in exchange for their horses, the livestock of their flocks and herds, and their donkeys. He got them through that year by giving them food in exchange for livestock.