4-dimethylallyltryptophan N-methyltransferase; part of the gene cluster that mediates the biosynthesis of fungal ergot alkaloid (PubMed:22403186). DmaW catalyzes the first step of ergot alkaloid biosynthesis by condensing dimethylallyl diphosphate (DMAP) and tryptophan to form 4-dimethylallyl-L-tryptophan (PubMed:22403186). The second step is catalyzed by the methyltransferase easF that methylates 4-dimethylallyl-L-tryptophan in the presence of S-adenosyl-L-methionine, resulting in the formation of 4-dimethylallyl-L-abrine (PubMed:22403186). The catalase easC and the FAD-dependent oxidoreductase easE then transform 4-dimethylallyl-L-abrine to chanoclavine-I which is further oxidized by easD in the presence of NAD(+), resulting in the formation of chanoclavine-I aldehyde (PubMed:22403186). Chanoclavine-I aldehyde is the precursor of ergoamides and ergopeptines in Clavicipitaceae, and clavine-type alcaloids such as fumiclavine in Trichocomaceae (PubMed:22403186). However, the metabolites downstream of chanoclavine-I aldehyde in Arthrodermataceae have not been identified yet (PubMed:22403186). 4-(3-methylbut-2-enyl)-L-tryptophan + S-adenosyl-L-methionine = 4-(3-methylbut-2-enyl)-L-abrine + H(+) + S-adenosyl-L-homocysteine Alkaloid biosynthesis; ergot alkaloid biosynthesis. Homodimer. Belongs to the methyltransferase superfamily.