President Donald Trump and his Canadian counterpart, Prime Minister Justin Trudeau, have more in common than a Mad Men-level iron grip. Both world leaders have proven willing to buck the international order and be North American mavericks: Trump, on climate change; Trudeau, on legalizing weed.

On June 1, Trump announced the United States’ impending exit from the Paris Climate Agreement, a move the New York Times called a “remarkable rebuke” to the rest of the world, as well as an exercise in pure denial. (Meanwhile, on Monday, as a record-setting deadly heatwave descended on most of the western United States, Energy Secretary Rick Perry went on CNBC to deny any link between carbon emissions and an undeniable, drastic shift in temperatures.)

Sometime between now and July 1, 2018—a year before his country plans to legalize recreational marijuana use for all adults—Trudeau will have to figure out how Canada will depart from not one, but three treaties declaring cannabis a dangerous narcotic drug, as the Canadian Press has reported.

Canada is a signatory to three United Nations treaties that outlaw marijuana and other drugs—the 1961 Single Convention on Narcotic Drugs, the 1971 Convention on Psychotropic Substances and the 1988 Convention against Illicit Traffic in Narcotic Drugs and Psychotropic Substances. As it happens, the chief international policeman enforcing these treaties has been the United States: When Canada was first considering decriminalizing small amounts of marijuana more than a decade ago, pressure from the Bush administration convinced then-Prime Minister Stephen Harper to drop the proposal.

These days, with voters in eight states legalizing marijuana at home, Americans lack the moral authority to crack down on cannabis legalization abroad.

That’s one reason why Uruguay—which announced a plan to legalize cannabis in 2012 and marked its first legal cannabis harvest last year—has been able to violate international drug treaties without any perceptible ramifications. Uruguay may also have paved the way for Canada’s exit from the drug-control treaties.

In an interview with Global News, Martin Vidal, Uruguay’s ambassador to Canada, suggested that his country put its “international credibility on the line” by legalizing cannabis.

But so far, not only has Uruguay emerged with its reputation intact, the small South American nation looks like a prescient seer, and has forced other, larger countries to at least talk about drug-policy reform—even though few other countries are following suit.

“We see not that the tide is turning, but the international community’s allowing this issue to be part of the discussion,” he told Global News. “

Uruguay became the first country on earth to end marijuana prohibition on the national level, after Jose Mujica, a former leftist guerrilla and the country’s then-socialist president, announced a plan to legalize the drug in 2012. Marijuana cultivation became legal, and the country is in the process of setting up a system where the drug can be bought in pharmacies.

Arguably, Canada is only a step or two behind.

The country’s health ministry licenses dozens of companies that cultivate and distribute marijuana. Israel is also moving quickly on a national cannabis distribution system, but Canada is furthest along with a regulated federal market.

While Canada has been consulting Uruguay on how to best legalize cannabis, just how Trudeau will go about the country’s “Weedexit” from the UN treaties is an open question.

So far, Canadian diplomats insist, the country is fully compliant with its obligations under those agreements, but that won’t be the case once Canadians are openly buying and selling recreational weed next summer.

So when will the UN give up the lie and cancel the treaties?

Vidal believes the international treaties may remain in place “for decades,” even as countries go forward with implementing policies that flagrantly violate them. It wouldn’t be the first time a “rogue national” flouted the United Nations.