Smart contracts in energy systems