Optimal smart contracts for controlling the environment in electric vehicles based on an Internet of Things network | Synapse