opportunity cost-wise, iran could have poured all the money they did in nuclear enrichment instead into missiles, air defense, etc, and they would not be having as much problems as they do now.
nuclear enrichment is extraordinarily expensive and really not all that great of a deterrent when you have them. just look at fairly recent tussels between india, pakistan and china. Russia was invaded and didnt nuke ukraine.
I thought Ukraine surrendered her nukes?