EXCLUSIVE:Warner Bros is closing a $50 million deal to score film rights to In the Heights, the Tony-winning musical from Lin-Manuel Miranda and Quiara Alegría Hudes. The property been the subject of a hot auction after it was extracted from the The Weinstein Company ahead of its bankruptcy.

Bidders for the project — pitched directly by Jon M. Chu who is directing the movie and also helmed Warners upcoming Crazy Rich Asians, the musicals book writer and screenwriter Quiara Alegría Hudes, and with Miranda joining by phone — included Fox, Paramount, Sony, Disney, Netflix and Apple. Warner Bros winning bid includes giving first-dollar gross for the filmmaking team.

Endeavor Content repped the property and brokered the deal.

In the auction that went down the first week of May, studios got an early look at Hudes script, and they involved their marketing departments in these pitch meetings to describe how they will market the film. Several studios dressed up backlots to resemble scenes in the movie.

The pitch process was made possible because Mirandas and Hudes reps smartly extricated the rights from the Weinstein Co months after its creators demanded back the property following Harvey Weinstein sexual assault scandal broke. They publicly demanded the project be free of association with Weinstein — right after the scandal broke, Hudes was outspoken on social media, and Miranda backed her up.

Miranda starred a decade ago when In the Heights opened on Broadway. He played a bodega owner in Washington Heights who strikes it rich and plans to leave, until the pull of the neighborhood and the people in it give him pause. The musical won four Tonys, and Miranda followed that up by creating Hamilton.

Miranda is repped by WME, Liebman Entertainment and attorney Nancy Rose of Schreck Rose; Chu is repped by UTA and Artists First; Hudes is with WME and Objective Entertainment.