Without delving into the specifics of any particular legislative district, this is effectively the domain of zoning codes and other legislative tools of urban planning.
While not a literal contract, certainly a layer of legally encoded social contracts with a long history.
Yes, that's what zoning regulations are for. You don't have a contract stating that your neighbor won't open a manure factory next door, it's implicit that your neighbors will abide by the zoning laws.