This article aims to evaluate the impact of the Brazilian General Social Security Regime (RGPS) on social welfare. To this end, an overlapping generation model calibrated to reproduce empirical facts of the country's economy is numerically simulated. The artificial economy considers the fact that the agent's life span and per period employment condition are uncertain and also includes the hypothesis of credit restriction. The results show that a pay-as-you-go social security scheme may present a welfare gain compared to a fully saving-funded system. This conclusion depends on the value attributed to the intertemporal discount factor.