The varistor is possibly the least of your worries at present. I assume from your previous comments that 240V was connected to the 24V output.
The device should normally operate with the varistor removed.
I will recommend a replacement varistor when I'm not using my phone
, however there are some tests you need to run before you get to that stage.
The first thing you need to discover is whether the transformer survived. To do this you will need to disconnect the secondary ( or at least one connection to it) from the board. Next, get a multimeter and, on the ohms range, measure the resistance of the secondary. A good reading will be quite low, probably under 10 ohms. If this checks out OK, connect the meter leads to the secondary on an AC voltage range and apply power to the device CAREFULLY. If anything odd happens, remove the power immediately. If all is OK note the reading on the multimeter. Then turn off the power, discontent the mains, and finally the meter. Also note if the transformer is at all warm. This ts a fail if the voltage is outside the range of 22 to 27 VAC, or if the transformer gets warm (or obviously if anything odd happens)
The next step is to test the electronics. Let me warn you that even if the transformer is OK, it is possible that you will need to replace almost every component on the board. I'll talk more about that later...
The first test is to measure the resistance across each of the rectifier diodes in both directions. Any reading under 1000 ohms, or one which does not slowly increase to over 1000 ohms indicates a fault.
If this is OK, then reconnect the transformer to the board, connect the multimeter across the main filter capacitor on a DC voltage range and CAREFULY apply power. If nothing bad happens, read the voltage on the multimeter and remove power, disconnect mains, then remove the meter. Finally check the diodes and the regulator to see if they have gotten at all warm.
Report all of your findings but remember to go no further if any step fails.