What was the purpose of Hammurabi's code?

The purpose of Hammurabi's Code, one of the earliest and most complete written legal systems, was to establish a set of laws and codes of conduct to govern the society of ancient Babylon. It aimed to maintain order, regulate social behavior, and ensure justice by providing a clear set of rules and punishments for various offenses and disputes. The code was also intended to protect the weak and vulnerable members of society and ensure the fair treatment of all individuals, regardless of their social status.