A complex $26 billion global deal is forging ahead after months of negotiations that will distribute money this year to thousands of cities, counties and states struggling with the nation's opioid crisis. But the process of doling out the deal's nearly $2.3 billion in attorney fees and costs has just begun.

Settlement documents totaling 800 pages outline a complicated mix of attorney compensation that include a common benefit fund, contingency fees and payments to states with outside counsel. The total amount for lawyers had a ceiling; the deal's provisions required that no less than 85% of the funds go toward opioid remediation.

U.S. District Judge Dan Polster of the Northern District of Ohio, who is overseeing more than 3,000 lawsuits in the opioid multidistrict litigation, has taken an active role in the fees. On Aug. 6, he capped all contingency fees at 15%—a move to contain what he said would be "enormous" compensation to lawyers. Some contingency fee contracts signed by cities and counties promised attorneys as much as 40% of recoveries. Days later, Polster signed off on a detailed distribution plan for a $1.6 billion attorney fee fund. On Tuesday, he approved the trusts for that fund.

"One of the concerns that came from Judge Polster is they didn't want the money to go to the lawyers," said Richard Ausness, a professor at the University of Kentucky's Rosenberg College of Law. "They wanted the money to go for treating the problem, and the more the lawyers got, the less would be available to do something about the opioid problem. So I think it was good that he did that, and it's not like the lawyers are going to be impoverished."