Tryptophan dimethylallyltransferase; part of the gene cluster that mediates the biosynthesis of fungal ergot alkaloid. DmaW catalyzes the first step of ergot alkaloid biosynthesis by condensing dimethylallyl diphosphate (DMAP) and tryptophan to form 4-dimethylallyl-L-tryptophan. 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. 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. Chanoclavine-I aldehyde is the precursor of ergoamides and ergopeptines in Clavicipitaceae, and clavine-type alcaloids such as fumiclavine in Trichocomaceae. However, the metabolites downstream of chanoclavine-I aldehyde in Arthrodermataceae have not been identified yet