Ethereum smart contract programmed with Solidity, for the AngelHack Paris Hackathon 2018. This project was awarded the AngelHack jury's prize.
Use case: more and more electric cars are being charged between 5-7pm, the peak of energy consumption. In order to incentivize car owners to be flexible with the charging hours, they can agree with the grid operator on a 'flexible charge' for a given time, outside of peak time, and receive a bonus in exchange (tokens) from the grid operator.
In the following smart contract, it is possible to create new users and new charge agreements in the blockchain, and to retrieve these pieces of information from the blockchain as well.
This contract can be tested here: https://remix.ethereum.org
Additional resources I found useful:
- https://learnxinyminutes.com/docs/solidity/
- https://github.com/manojpramesh/solidity-cheatsheet
- https://hackernoon.com/ethereum-smart-contracts-lifecycle-multiple-contracts-message-sender-e9195ceff3ec
For further testing with web3.js framework: http://faucet.ropsten.be:3001/