Peace be upon you. According to Grand Ayatollah Sayyid Sistani, you must make up any prayers you are certain you performed while in a state of ritual impurity without a proper purification. As for fasting, if you engaged in actions that invalidate fasting while being unaware that they do so, and your ignorance was genuine and not due to negligence, your fast is valid. For the days following your ignorance, you do not need to make up the fast if you were excused for your lack of knowledge. Similarly, Grand Ayatollah Sayyid Khamenei states that you must make up any prayers performed in a state of impurity. If you engaged in actions that invalidate fasting while unaware, you only need to make up the fast. For subsequent days, if you were ignorant of the rules regarding ritual impurity, your fast is considered valid and does not require making up. May you be successful in all good deeds.