Anodic dissolution of metals in ionic liquids