There is no Constitutional provision or Federal law that requires electors to vote according to the results of the popular vote in their States. Some States, however, require electors to cast their votes according to the popular vote.
Hopefully that helped.