his grandfather came to the Prophet (ﷺ) and he had castrated a slave of his. The Prophet (ﷺ) manumitted the slave in compensation for having been mutilated.
Sunan Ibn Majah Book 21, Hadith 65