A constitution of 1848 , subsequently modified in 1874 , replaced the confederation with a centralized federal government .