Those are two quite different scenarios.
a state passes a law which automatically allocates all electoral votes
This is not constitutional. States do not have the power to allocate votes. The U.S. Constitution requires them to make the law stating how Presidential Electors are chosen, but it itself says what those Electors' job is and distinctly gives the vote to the Electors. See the 12th Amendment:
The electors shall meet in their respective states and vote by ballot for President and Vice-President […]; they shall name in their ballots the person voted for as President, and in distinct ballots the person voted for as Vice-President, and they shall make distinct lists of all persons voted for as President, and of all persons voted for as Vice-President, and of the number of votes for each, which lists they shall sign and certify, and transmit sealed to the seat of the government of the United States, directed to the President of the Senate; […]
future elections for President are canceled
This is theoretically constitutional. States do have the power to determine how Presidential Electors are chosen, and that method is not required to be itself an election. Indeed, the U.S. Constitution says "appoint".
Each state shall appoint, in such manner as the Legislature thereof may direct, a number of electors, […]
In practice, it has always been an election; the framers of the Constitution argued long and hard that it should be an election and that that was their intention; and it would be politically repugnant in a society that views itself as a democracy to replace a popular vote with something else.
But there's a wrinkle in what the results of the election mean.
a state passes a law which chooses a biased set of electors
This is how states use your second scenario to avoid the unconstitutionality of your first scenario, and what several states do today. Ironically, they do it in order to be more democratic than the system that the framers of the Constitution envisioned, which gave the vote (as aforementioned) to just a few hundred people rather than to the population at large.
Candidates to be a Presidential Elector are chosen by party primary, and are required in that primary to pledge themselves to the party's Presidential and Vice-Presidential candidates for office. Each party thus gets itself a set of Elector candidates. The state's chosen method of appointing Electors is to appoint all of the electors elected, in the primaries, by the party that won the popular vote in the state.
In Alabama, for example, one may think that one is voting for President and for Vice-President directly. But in fact (Alabama Code § 17–14–32) one is voting for the entire block of Electors from the party of the particular President and Vice-President candidates. The popular vote is among each party's entire blocks of Electors.
A vote for a candidate for President or Vice President shall be counted as a vote for the electors of the political party or independent body by which such candidates were named, as listed on the certificate of nomination or nominating petition.
The electors are required (Alabama Code § 17–14–31) to promise to support the party line. They are elected party agents. The General Election chooses which party's agents get to be the voters in the Electoral College.
Thus, by this roundabout subterfuge, a system that the U.S. Constitution's framers intended not to be a direct popular vote, but an indirect popular vote for people who were in turn supposed to know better than the average voter in the street whom to choose for President and Vice-President, is shoe-horned into being a direct popular vote.
Of course, the way that this square peg is hammered into a round hole does result in some unfortunate arthmetical byproducts relating to how the proportions in the popular vote are not accurately represented by the proportions in the Electoral College vote.