This was no sting operation as you have described it. It was possession for distribution.
Cops cannot do that and the city cannot authorize it. Only doctors and pharmasists with authorization by way of a federal authorization can distribute controlled substances. I will bet that all your cops could have told them that.
What is it when an undercover officer sells crack to an unsuspecting buyer? Possession with intent to distribute. He possesses it, he intends to distribute it - he must be guilty of a crime, right?
No, because the law permits public officials immunity for such acts in furtherance of the state's classic right to ensure the health, safety, and welfare of its citizens. Just like Rosenthal.