Social Security, Medicare, and Medicaid all cite the Constitution's General Welfare Clause as their legal foundation, according to Supreme Court precedent interpreting Congress's spending power. The clause appears twice: the Preamble lists "promote the general Welfare" as a goal, while Article I Section 8 authorizes Congress to "lay and collect Taxes...to...provide for the common Defence and general Welfare." Alexander Hamilton argued this gave Congress broad power to spend on anything benefiting Americans, while James Madison claimed it only allowed spending on powers elsewhere in Article I. The Supreme Court adopted Hamilton's view in 1937, substantially deferring to Congress's judgment about what promotes general welfare and never striking down spending legislation for failing this test, enabling the modern federal safety net.