Well ya, if its melted, good chance thats it. Also, it could be a symptom of a larger problem. Did you know the seller? Someone may disagree, and I welcome the input, but if the charger coil on the stator is bad, and its sending more then the 6volts(or whatever the voltage is, i dont remember) its suppose to, it could slowly harm the CDI. So, if you replaced the CDI, and didnt fix the stator/charger coil, its only a matter of time untill the problem appears again.
Im NO electrician. Hopefully some of the guys with more electrical experience can drop a little more input here??