When I get questions like this I always smile as I do not understand why people want to come to a 3rd world country and do things that are obviously illegal even if you only do these things for recreational purposes at home. So, yes having any narcotics such as marijuana, opioids, heroin, cocaine which a number of dealers sell in bars and clubs especially in recent years. Even the betel chew nut which is available almost everywhere in Sri Lanka can land you in serious trouble, as the police do raids on the bars etc. I have also seen the police stop tuk-tuks and search the vehicle for prohibited narcotics. The government introduced the death penalty for dealers by hanging, I suspect that a foreigner caught dealing will get a life sentence instead, but why take the risk.
So, you still want to take a chance and run the risk of getting caught the lesser drug is betel the link below explains the effects and what it is in more detail:
Alcohol and Drug Foundation (ADF)