Could slavery have been ended by buying out all the slave contracts?
No. Lincoln tried it. You may forget that Maryland, Delaware never left the union and were slave states. Lincoln implemented a slave by back program and then shipped them off to the new state of Liberia in West Africa. In the contested states like Tenn. and Kentucky it was a non starter. Slavery was the linchpin of most of the cash crop agriculture in the south. Cotton, sugar and other labor intensive crops depended on it. So how do you compensate a business owner for the loss of relatively free labor? He did not have the overhead of a paid labor concern. He had a higher profit margin, although his labor issues could be sticky at times. The actual outlawing of international slave trade increased the value of slaves tremendously over night. The slave holders in the US went into business breeding their own slaves since they could not import any more. This produced a black market in slaves, no pun intended. So presented with those problems there is no way the southern slave owners could have been compensated, nor would the average non-slave holder gone along with seeing millions of his tax dollars going to compensate a rich southern planter when he lived a subsistence existence on the family farm. So the political cost would have been too great. The actual cost of the war was not known until much later. Recall that everyone thought the issue would be settled in under three months and with little bloodshed. Everyone but the soldiers who eventually won it. W.T. Sherman was called crazy in the press and it stuck, simply for stating it would take over 300,000 troops just to win the Western Theater. Grant also knew that cost would be high in blood and treasure. Makes you wonder how self serving a lot of Southern and Northern officers were that they did not council greater restraint and reliance on political options before letting the politicians draw swords.