A molecular dynamics simulation model for an electroactive interface in which a metallic electrode is maintained at a preset electrical potential is described. The model, based on earlier work of Siepmann and Sprik [J. Chem. Phys. 102, 511 (1995)], uses variable charges whose magnitudes are adjusted on-the-fly according to a variational procedure to maintain the constant potential condition. As such, the model also allows for the polarization of the electrode by the electrolyte, sometimes described by the introduction of image charges. The model has been implemented in a description of an electrochemical cell as a pair of parallel planar electrodes separated by the electrolyte using a two-dimensional Ewald summation method. The method has been applied to examine the interfacial structure in two ionic liquids, consisting of binary mixtures of molten salts, chosen to exemplify the influences of dissimilar cation size and charge. The stronger coordination of the smaller and more highly charged cations by the anions prevents them from approaching even the negatively charged electrode closely. This has consequences for the capacitance of the electrode and will also have an impact on the rates of electron transfer processes. The calculated capacitances exhibit qualitatively the same dependence on the applied potential as has been observed in experimental studies.