A bill that could eventually allow Oregon to import and export cannabis across state lines—and give the state’s pot industry a head start when national cannabis laws change in the future—passed a vote in the Oregon Senate Wednesday. It will now move on to the House floor.

Currently, Oregon’s legal weed market is a closed system: no pot is supposed to cross state lines, even into other states where it is legal. Senate Bill 582 would change that by giving Oregon’s government the go-ahead to work with other states to determine policies and regulations for cross-state cannabis imports and exports—that is, after federal laws governing cannabis catch up to state laws.

The bill, which passed the Senate 19-9 in a mostly party-line vote, has been touted as a potential solution to Oregon’s oversaturated pot market, and as a way to prevent growers from turning to the black market in order to make a profit.

“We have quite a supply of cannabis in the state right now,” said State Rep. Ken Helm (D), one of the bill’s chief sponsors, at a Senate Judiciary Committee hearing. “It’s in our state’s interest to prevent the diversion of our product into the illegal market that is traded nationally and internationally.”

But the bill won’t be a quick fix. Because the US Drug Enforcement Agency (DEA) classifies cannabis as a Schedule 1 substance, it’s currently illegal to cross state lines with it. In fact, SB 582 includes the provision that it won’t go into effect until one of two things happen: Either federal law is changed to allow interstate cannabis trading, or the US Department of Justice issues a guidance allowing it.

Still, passing the bill this year would help ensure Oregon’s cannabis industry and regulatory agencies (like the OLCC) are ready to begin cross-state trading as soon as the federal government grant permission.

“We’re not trying to export before the feds do something about it,” said Michael Getlin, a cannabis farm owner and industry advocate who supports the bill, in an interview with the Mercury last month. “But we’re going to be ready with the trucks on day one if we can. ... Two years from now, when we go back into session, it’s going to be too late to fix some of these things.”

SB 582’s first reading on the house floor is scheduled for Thursday.