While social contract theory is most commonly associated with European enlightenment-era philosophers such as Rousseau, Hobbes, and Locke, one can find its central premises expressed in embryonic form in classical Greek works centuries earlier. Socrates' defense of his choice to accept a death sentence handed to him by Athenian courts in "Crito" is the most notable example of this. In the work, Socrates' student Plato purportedly relates a jail-cell conversation between Socrates and his friend Crito. Crito offers Socrates a chance at escape, which Socrates refuses.
Socrates has a number of reasons for obeying the laws of Athens, even to this extreme. One of the most persuasive is his belief that having been a citizen of the city of Athens for so long, having received from Athens the benefits of citizenship, he therefore owes the city and its laws a debt of gratitude and service. Imagining a conversation between himself and the laws of Athens, Socrates asks himself, “So decisively did you choose us and agree to be a citizen under us... will you then not now stick to our agreements?”
This reasoning closely resembles social contract theory articulated by later European thinkers. The central logic is similar. Socrates voluntarily forfeits a degree of his freedom in order to enjoy the bounty of Athenian citizenship, this city which has “given you birth, nurtured you, educated you, we have given you and all other citizens a share of all the good things we could…”
That's not to say that social contract theory as espoused by Hobbes, Rousseau, and Locke were simply regurgitations of Classical thought. For example, Socrates refutes the (very convincing) argument that the city has broken the “agreement,” as he calls it, by wrongfully convicting him. He explains, again in the voice of an imaginary personification of the laws, that he has been “...wronged not by us, the laws, but by men...” It is the stewards of the laws that have gone astray, not the laws themselves, and thus Socrates still owes deference to the laws of Athens.
In contrast, John Locke, a 17th-century English philosopher who helped articulate the modern version of social contract theory, would likely disagree with Socrates’ rationale. Locke’s views, as found in his "Two Treatises on Government", eloquently express the cynic’s objections to Socrates’ arguments. Locke felt that the state was conferred power through the discretion of the citizens, which it is therefore bound to serve. When government fails to meet its end of the contract, the citizens have a moral right to defy and even overthrow the government.
Nevertheless, Locke and his contemporaries owe much of their ideology to their classical peers. While Socrates' philosophy may have been unfairly one-sided and inequitably placed the onus entirely upon the citizen, in his work we clearly see the foundations upon which social contract theory was built.