Until air conditioning, the states where slavery had been legal were generally less prosperous than the states where slavery wasn’t legal, so no, slavery didn’t cause America’s prosperity.
Thank goodness for Willis Carrier who invented the first modern air-conditioning system in 1902. Far too late to prevent the Civil War but a major factor in making the deep south a more hospitable place to live and work. It’s hard to imagine living in Florida without A/C.