Evidence of slavery predates written records, and has existed in many cultures. Slavery is rare among hunter–gatherer populations, as slavery is a system of social stratification. Mass slavery also requires economic surpluses and a high population density to be viable. Due to these factors, the practice of slavery would have only proliferated after the invention of agriculture during the Neolithic revolution about 11,000 years ago. The earliest records of slavery can be traced to the Code of Hammurabi (ca. 1760 BC), and the Bible refers to it as an established institution.