I wonder if this sort of thing can be generalised a bit for alt coins, so the assumption of 8 decimal places isn't so hard coded.