All 50 U.S. states have agreed to the OxyContin maker Purdue Pharma ’s latest plan to settle thousands of lawsuits over the toll of opioids.

A judge on Wednesday is being asked to clear the way for local governments and individual victims to vote on it.

Government entities, emergency room doctors, insurers, families of children born into withdrawal from the powerful prescription painkiller, individual victims and their families and others would have until Sept. 30 to vote on whether to accept the deal, which calls for members of the Sackler family who own the company to pay up to $7 billion over 15 years.

If approved, the settlement would be among the largest in a wave of lawsuits over the past decade as governments and others sought to hold drugmakers, wholesalers and pharmacies accountable for the opioid epidemic that started rising in the years after OxyContin hit the market in 1996. The other settlements together are worth about $50 billion, and most of the money is to be used to combat the crisis.

In the early 2000s, most opioid deaths were linked to prescription drugs, including OxyContin. Since then, heroin and then illicitly produced fentanyl became the biggest killers. In some years, the class of drugs was linked to more than 80,000 deaths, but that number dropped sharply last year.

The request of U.S. Bankruptcy Court Judge Sean Lane comes about a year after the U.S. Supreme Court rejected a previous version of Purdue’s proposed settlement. The court found it was improper that the earlier iteration would have protected members of the Sackler family from lawsuits over opioids, even though they themselves were not filing for bankruptcy protection.

Under the reworked plan hammered out with lawyers for state and local governments and others, groups that don’t opt in to the settlement would still have the right to sue members of the wealthy family whose name once adorned museum galleries around the world and programs at several prestigious U.S. universities.

Under the plan, the Sackler family members would give up ownership of Purdue. They resigned from the company’s board and stopped receiving distributions from its funds before the company’s initial bankruptcy filing in 2019. The remaining entity would get a new name and its profits would be dedicated to battling the epidemic.

Most of the money would go to state and local governments to address the nation’s addiction and overdose crisis, but potentially more than $850 million would go directly to individual victims. That makes it different from the other major settlements.

The payouts would not begin until after a hearing scheduled for Nov. 10, during which Lane is to be asked to approve the entire plan if enough of the affected parties agree.