We present a double moral hazard model to study the impact of building
codes on the safety/quality level chosen by the builder and the level
of care expended by the buyer. We show that codes can be a mechanism
to implement the first-best solution provided: (1) The code prescribes
the optimum safely level, (2) The code uses the efficient technology
to achieve the optimum safety level, and (3) The courts use Negligence
Rule as the liability rule. We argue, however, thal codes in general
do not use the efficient technology. We provide an alternative mechani
sm to implement the first-best solution. This mechanism is a contract
between the builder and the buyer that specifies the level of safety/q
uality to be expended by the builder. We prove that the contract is a
more effective and more efficient mechanism than are the building code
s.