All you have to do to prevent 90%+ of election fraud is to require that before any counting is commenced, that the total number of ballots cast is declared. No further ballots can be accepted after the cutoff. That way, the situation in which pallet loads of "magic" ballots are "found" in the middle of the night becomes impossible. The total number of ballots in any district could easily and quickly be checked against the total number of eligible voters, taking into account historic voter turnout rates, to provide a quick indication of whether there could be any possible shenanigans.
Then the votes would be counted, the total must not exceed the pre-specified total ballots and all ballots retained for subsequent auditing/inspection if required.
Random spot audits of all vote counting should be performed as the official vote count is being conducted with severe penalties for anyone found to be incorrectly counting votes (even if this is due to incompetence, if you're a dumb nigger you shouldn't be doing anything important).
There are obviously other fraudulent voting practices that would need to be tackled by other means, but this would put a big dent in it.