We propose an efficient single-molecule rectifier based on a derivative of opioid. Electron transport properties are investigated within the non-equilibrium Green's function formalism combined with density functional theory. The analysis of the current-voltage characteristics indicates obvious diode-like behavior. While heroin presents rectification coefficient R>1, indicating preferential electronic current from electron-donating to electron-withdrawing, 3 and 6-acetylmorphine and morphine exhibit contrary behavior, R<1. Our calculations indicate that the simple inclusion of acetyl groups modulate a range of devices, which varies from simple rectifying to resonant-tunneling diodes. In particular, the rectification rations for heroin diodes show microampere electron current with a maximum of rectification (R=9.1) at very low bias voltage of ∼0.6 V and (R=14.3)∼1.8 V with resistance varying between 0.4 and 1.5 M Ω. Once most of the current single-molecule diodes usually rectifies in nanoampere, are not stable over 1.0 V and present electrical resistance around 10 M. Molecular devices based on opioid derivatives are promising in molecular electronics.