Slave codes were eliminated in 1865 along with the ratification of the 13th amendment. They ended with the Civil War but was replced by ¨ black codes¨ in an attempt to control the now free African Americans by limiting them to certain things like voting, having firearms, and serving jury duty.