The series I search is the story of a young boy who was a slave and was sold to some cultists to be sacrificed but he escaped (he killed the man who entered his cell stole his hooded mantle and left their base like this. After that he entered a village and a demon/devil told him he was interesting, and make him an offer, apparently the boy has affinity with all magic including darkness, he call that foundation, he proposed to take his foundations for all except darkness in exchange of a full tower for this element, the mc had no choice but to take the deal since he was going to die if cultists found him, the devil told him how to leave the city (join a caravan about to leave) and where he can find a book to learn dark magic and obtain another trial from this devil. Later he found the book in a museum and the trial was to enter a sort of simulation and kill someone of the nature faction, for that he became a bodyguard of a woman who was a priestess of this faction. That's all I remember, does someone have an idea of what novel it is please?