In ancient times, anything could function as money
Within a community—a town, a city, a guild or religious society—pretty much anything could function as money, provided everyone knew there was someone willing to accept it to cancel out a debt.
To offer one particularly striking example, in certain cities in nineteenth-century Siam, small change consisted entirely of porcelain Chinese gaming counters—basically, the equivalent of poker chips—issued by local casinos.
If one of these casinos went out of business or lost its license, its owners would have to send a crier through the streets banging a gong and announcing that anyone holding such chits had three days to redeem them.
For major transactions, of course, currency that was also acceptable outside the community (usually silver or gold again) was ordinarily employed.
In a similar way, English shops, for many centuries, would issue their own wood or lead or leather token money. The practice was often technically illegal, but it continued until relatively recent times.