Did money evolve the way that economics textbooks say that it did? No.
Almost all non-monetary economies have "invisible" accounts of traded favors and gifts assigned intangible relative values long before any medium of exchange to reify those accountings was developed. Informal exchange rates between highly salient trade or ration goods in early bread and circus bureaucracies and international trade where there was no "double coincidence of wants" problem arose next. Spot barter is very rare in non-monetary societies and was largely unrelated to the development of money.
A related notion is that the legal concept of unjust enrichment whereby someone is obligated to another because he receives a benefit without having provided something in exchange when a "true gift" is not intended far precedes the legal concept of a contract as we conceive of one in private law today.