I am not talking about a complete moral code. I am saying that enslaving another sapient being is an evil act. To do that is to commit evil. Does that make the person doing it evil? That's a bigger question about that person. But the act is evil, yes.
I will assert that if slavery wasn't evil for 99% of human history, it isn't evil now. And those of us who are a product of a western liberal society are flat out wrong in our judgement. So, either slavery has always been an evil act, or I am wrong for believing that it is now.
You're imposing your modernist view as a universal absolute.
Good and evil are not universal absolutes in the world we live in.
Every culture and every nation has changed over time what is considered good and what is evil.
In the last 100 years, homosexuality has gone from being considered a mental illness, a moral flaw (and one of the most serious sins), and homosexual sexual acts a crime, to it being a protected class in most of the English speaking world.
In the last 100 years, mixed ethnicity couples have gone from being unlawful and considered evil by many in a significant portion of the English speaking world to being not uncommon.
Good and Evil are intellectual constructs. You may consider certain things to be Universal Evils, but it doesn't make them so.
There are certain fairly common beliefs; most religions do specify a few things: killing coreligionists without good reason is wrong, taking things from coreligionists without permission is wrong, bearing false witness against coreligionists is wrong, Some extend those past coreligionists. Most do not directly condemn slavery, but often restrict it to non-correligionists as slaves.
But there is no universality to those past correligionists. And the level of justification for killings (The division between justified and not) varies incredibly widely. Many allowed human sacrifice... Most now do not, As recently 150 years ago, the syncretic Samurai Taoist/Buddhist/Shinto hybrid allowed killing for uninvited touch...
The only true universal seems to be that most primitive (iron age and earlier) cultures believe in supernatural beings.