The AI Leviathan: From Social Contracts to Smart Contracts