The draft legislation has been published in light of a bitter general election campaign that has seen many parties accused of deceit.