Is code the new law? Regulation, Legality and Smart Contracts