We in this paper provide an analytical structure to endogenize the optimal gestational surrogacy contract in terms of a simple moral hazard framework. We show that altruistic surrogacy is optimal only if the surrogate has lower outside option and is sufficiently altruistic. Otherwise commercial surrogacy is optimal. We also show that for lower outside option greater social ignominy makes the surrogacy contract relatively more altruistic but the reverse happens when the surrogate has higher outside option. We also point to alternative model specifications and find situations where commercial surrogacy is always optimal irrespective of altruism, outside option and social ignominy.