Opioid addiction has been a spectacularly difficult nut to crack as long as there have been opioids, and highly related issues like alcoholism likewise.
There's a lot of inputs to addiction. You rightly point out the input of economic dignity, which probably is top of the list from a policy standpoint. And on a public policy basis there's also culture, media, simple availability of the drug, availability of interventions, and many other inputs.
But the largest input to addiction is family structure and dynamics, and it's not even kind of close.