Simple answer: pills do not contain heroin or cocaine. The name "Ecstasy" ideally refers to a single chemical, MDMA, and ideally all pills should contain only MDMA as their active ingredient. There are no "bases", and the colors of pills come from food coloring, not from their contents. There's not even a "color-coding" system that pill pressers use -- it's entirely random.
Notice that I said "ideally" earlier. Yes, ideally, pills should contain only MDMA (or its relatives MDA, MDEA, etc.), but the reality of the situation is that pills often contain other active ingredients in order to make less MDMA go farther. Common "cuts" (i.e. other active ingredients) are caffeine, ephedrine, and amphetamine. Less common is methamphetamine, ketamine (which usually can't be felt at the doses they put in pills), and DXM. Very rarely you may find a pill with a 2cx-family chemical in it which people often mistake for LSD. You will never find heroin or cocaine in a pill (unless as a joke), because both have poor oral bioavailability (i.e. they require large doses if you eat them) and are pretty expensive. People who talk about "smacky rolls" are likely talking about unusually pure pills that contain just MDMA, since taking only MDMA can feel extremely relaxing (as opposed to "speedy pills" which contain caffeine, amphetamine, etc.)
Some pills contain hardly any MDMA at all if any...for instance, piperazines (amphetamine-like compounds, some of which are slightly psychedelic) have become a common and poor substitute for real MDMA. This is why it's important to test your pills with a testing kit, or least look up a recent report on them via pillreports.com. You can't know for sure what other substances are in your pill, even with a testing kit, but you can at least be sure it contains MDMA.
Summary:
- Pills should only contain MDMA. There's no need for them to be "based" on anything.
- In the real world, pills are cut with other substances to make up for having less MDMA.
- Pills are never cut with heroin or coke due to the cost and pointlessness of doing so.
- Color and print tell you *nothing* about a pill, aside from perhaps indicating that two pills came from the same batch and thus might have the same contents. You *cannot* tell the contents of a pill by its color, stamp, etc.
I hope that helps; stay safe and take care.
