A variety of unsaturated N,N-diallyl compounds, capable of undergoing cyclopolymerization, are prepared from 1,6-hexanediamine. Selective monoformylation followed by allylation of the diamine afforded N,N-Niallyl-N'-formyl-1,6-hexanediamine (DFH). The DFH was converted into quaternary ammonium monomers N,N-diallyl-N-carboethoxymethyl-N'-formyl-1,6-hexanediamine (DCFH) and N,N-diallyl-N-benzyl-N'-formyl-1,6-hexanediamine (DBFH)by reacting with ethyl chloroacetate and benzyl chloride, respectively. The monomer DCFH on homo- and co-polymerization (with SO2) afforded the polyelectrolytes poly(DFCH) and poly(DFCH-SO2), which on acidic hydrolysis of the amide and ester groups gave the corresponding polyampholytes. The monomer DBFH, likewise, on polymerization followed by acidic hydrolysis gave the corresponding polyelectrolytes. All the synthesized materials (precursor to the monomers, monomers and the polymers containing quaternary, amide and trivalent nitrogens) and the starting 1,6-hexanediamine were used to study the corrosion inhibition of mild steel in 1 M HCl at 60 degreesC for 6 h. The percent inhibition was found to be in the range 40-93%. There is a dramatic increase in the percent inhibition by the synthesized materials in comparison to the starting diamine. (C) 2001 Elsevier Science Ltd. All rights reserved.