The present paper develops variants of a system of social targets departing from principal-agent models incorporating different possibilities of renegotiation across time periods, as well as the presence of shocks. This system acts as a way for the federal government to increase efficiency in the use of its social budget transferred to municipalities.We demonstrate in a dynamic context with complete contracts that the best way to increase allocative efficiency in funds transfers would be to create institutional mechanisms denying the possibility of bilateral renegotiations. This optimum contract reproduces sequence targets and transfers found in the solution of the static model for various periods. However, this result disappears when we incorporate incomplete contracts. In this case, ex-ante inefficiencies created by the possibility of renegotiation must be weighted against ex-post inefficiencies created by not using the disclosed new information along of process.In the second part of the paper we incorporate the incidence of random shocks. We show that, when the social results do not depend only on the investments carried through by the municipality, but also random factors, the contract established between federal government and municipalities, must stipulate higher social targets to compensate the occurrence of bad states of the nature. Moreover, in this kind of situation, linear contracts are pro-cyclical, reducing governmental transfers exactly when the municipality suffers a negative shock. To avoid this type of situation, we show that the establishment of contracts that use mechanisms of comparison of performance between the municipalities eliminates the pro-cyclical effect.