Prior to 1798, the Swiss Confederacy was a confederation of independent states, not a federal state, and as such was based on treaties rather than a constitution. The Helvetic Republic of 1798–1803 had a constitution largely drawn up by Peter Ochs, in 1803 replaced by the Act of Mediation, which was in turn replaced by the Federal Treaty of 1815, which restored the Confederacy, while the individual cantons drew up cantonal constitutions, in most respects based on the "Ancien Régime "