The law in Canada allows undercover police officers to offer you the opportunity to commit the offence of drug trafficking if they reasonably suspect that you are involved in selling drugs or if they reasonably suspect that drugs are being sold at a specific location, phone number, or online forum.
However, the police must comply with specific legal requirements, or their conduct could be considered entrapment. A finding of entrapment by the court would result in a stay of the legal proceedings against you.