The Social Contract Theory is one of the most dominant and influential political theories in the history of the modern West. Thomas Hobbes, John Locke and Jean-Jacques Rousseau are three best known proponents of this important theory, each with a slightly different approach to it from one another. Put in simple words, according to the social contact theory people give up or surrender some of their personal freedom, and give the government authority to enforce laws upon them whereby everyone lives in peace and happiness without fear of being harmed by others. It is a sort of deal or understanding between two parties, i.e. the rulers and the ruled. As a result of this deal or understanding, the ruled give the rulers the authority to rule while the rulers vow to assure peace and prosperity to the ruled. This unwritten social contract is the basis of most of the modern democracies in the world.
A similar sort of contract (although not exactly identical) is indeed mentioned in the Quran between Allah and the Believers . According to this contract or covenant, anyone who becomes a Believer promises to spend his/her life and property according to Allah’s Will/Laws in return of a promise by Allah for a paradisiacal life (in this world and the hereafter). Such a contract or covenant is administered by Allah’s Messenger on Allah’s behalf,, who is always the first one to establish an Islamic Republic on earth according to Allah’s Laws. Hence, the basis of an Islamic Republic is also a covenant or social contract whereby people give up or surrender some of their personal freedom, and give the Islamic government authority to enforce Islamic laws upon them whereby everyone lives in peace and happiness without fear of being harmed by others. Allah’s covenant has been mentioned in several Verses of the Quran.
 Al-Quran Surah 9 : Verse 111
 Al-Quran Surah 48: Verse 10
 Al-Quran Surah 60: Verse 12
 Al-Quran Surah 2: Verse 27, Surah 3: Verse 77, Surah 6: Verse 152, Surah 9: Verse 75, Surah 13: Verse 20, Surah 13: Verse 25, Surah 16: Verse 91, Surah 16: Verse 95; Surah 33: Verse 15; Surah 33: Verse 23