FAD binding oxidoreductase; part of the gene cluster that mediates the biosynthesis of fumiclavanine C, a fungal ergot alkaloid (PubMed:15933009, PubMed:23435153, PubMed:26972831). DmaW catalyzes the first step of ergot alkaloid biosynthesis by condensing dimethylallyl diphosphate (DMAP) and tryptophan to form 4-dimethylallyl-L-tryptophan (PubMed:15870460). 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 (By similarity). 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:20039019, PubMed:20526482, PubMed:21409592, PubMed:23435153). EasA reduces chanoclavine-I aldehyde to dihydrochanoclavine-I aldehyde that spontaneously dehydrates to form 6,8-dimethyl-6,7-didehydroergoline (PubMed:20526482). EasG then catalyzes the reduction of 6,8-dimethyl-6,7-didehydroergoline to form festuclavine (PubMed:20526482). Hydrolysis of festuclavine by easM then leads to the formation of fumigaclavine B which is in turn acetylated by easN to fumigaclavine A (PubMed:26972831). Finally, easL catalyzes the conversion of fumigaclavine A into fumigaclavine C by attaching a dimethylallyl moiety to C-2 of the indole nucleus (PubMed:19672909). Alkaloid biosynthesis; ergot alkaloid biosynthesis. The expression of the ergot alkaloid synthesis cluster which leads to the synthesis of fumigaclavines is positively regulated by the brlA and stuA transcription factors (PubMed:19028996). Ergot alkaloids are known for their toxic effects on humans who consume contaminated grains or livestock that graze on grasses harboring ergot alkaloid-producing fungi (PubMed:19523108). Due to their strong affinity for monoamine neurotransmitter receptors they may also have clinical uses such as treatment of migraines, Parkinson's disease and cerebrovascular insufficiency (PubMed:19523108). Belongs to the oxygen-dependent FAD-linked oxidoreductase family.