During the days of ignorance, he had freed one hundred slaves and donated one hundred camels for riding. After embracing Islam, he again donated one hundred camels and freed one hundred slaves.He said, "I asked the Messenger of Allah ﷺ, 'Messenger of Allah, what do you say about deeds I used to perform during the days of ignorance, seeking through them to draw near to Allah?'"The Messenger of Allah ﷺ replied, "You have entered Islam with all the good you did before."
أنه أعتق في الجاهلية مائة رقبة، وحمل على مائة بعير فلما أسلم حمل على مائة بعير، وأعتق مائة رقبة. قال: فسألت رسول الله ﷺ، فقلت: يا رسول الله أرأيت أشياء كنت أصنعها في الجاهلية كنت أتحنث بها، يعني أتبرر بها. قال: فقال رسول الله ﷺ: أسلمت على ما سلف لك من خير.
Bukhari narrated it in the Book of Emancipation (2538), and Muslim narrated it in the Book of Faith (123: 195), both through the route of Hisham bin Urwa, from his father, from Hakeem bin Hizam, who related it, and the wording given here is Bukhari's. Muslim's narration made clear that the one who said, "meaning, do I seek righteousness through them" was Hisham bin Urwa.