Polypeptide-functionalized macromonomers are very fascinating candidates for the modification of various surfaces of different sizes as well as geometry, and have attracted considerable attention for biomolecule stabilization, biomedical device fabrication and bioanalytical applications. In the present work, synthesis and characterization of a novel poly-L-phenylalanine-bearing electroactive macromonomer (EDOT-BTDA-PPhe) were carried out. In the following steps, a glassy carbon electrode was covered with this material, and then cocaine aptamer was immobilized to obtain a biofunctional surface for the biosensing of ` Abused Drug' model. Aptamers attached to polypeptide side chains on the macromonomer with good orientation are induced for conformational change into three-way junction form as a result of selective binding of cocaine or its metabolite. This aptamer folding-based conformational response provides detectable signals due to formation of a compact interface which restricts electron transfer of redox probe. The stepwise modification of the surface was confirmed by electrochemical techniques. At the final step, the aptasensor was applied for the electrochemical detection of cocaine and its major metabolite, benzoylecgonine (BE), which exhibited a linear correlation between 1.0 and 10 nM and between 0.5 and 10 mu M respectively. The proposed methods were successfully employed for the analysis of synthetic biological fluids.