Many of the specific arguments and examples that [Adam] Smith uses appear to trace back directly to economic tracts written in Medieval Persia. For instance, not only does his argument that exchange is a natural outgrowth of human rationality and speech already appear both in Ghazali (1058-1111AD), and Tusi (1201-1274 AD); both use exactly the same illustration: that no one has ever observed two dogs exchanging bones. Even more dramatically, Smith's most famous example of division of labor, the pin factory, where it takes eighteen separate operations to produce one pin, already appears in Ghazali's Ihya, in which he describes a needle factory, where it takes twenty-five different operations to produce a needle."
--David Graeber, Debt: The First 5,000 Years, p. 279
For more on these topics see: Hosseini, Hamid: [you'll likely need a library or university login to access these:]
1995, "Understanding the market mechanism before Adam Smith: economic thought in Medieval Islam." History of Political Economy 27 (3)
1998, "Seeking the roots of Adam Smith's division of labor in medieval Persia." History of Political Economy 30 (4)
2003, "Contributions of Medieval Muslim Scholars to the History of Economics and their Impact: A refutation of the Schumpeterian Great Gap" in The Blackwell Companion to Contemporary Economics III: A Companion to the History of Economic Thought.