Ride-hailing companies are common. I built a smart contract that can facilitate transactions between ride-hailing companies, drivers, and their clients.
In this contract, we have clients and drivers who are both participants in the ride-hailing economy.
Both of them can create profiles on the DApp.
The client can book a trip, pay once they reach their destination, and also drop a review.
The driver can also drop a review as well.
As usual, here are some things I learned while building this contract:
I spent a huge chunk of time thinking through how the how process should work. I wrote the process in Google Docs.
Then I began thinking of how to implement it with Solidity. By the way, it is almost a year since I wrote Solidity as I have been playing too much with Node and Python, so I had to refresh a lot of concepts too.
Before, it was more like I crammed how to initialize, update, and delete objects in structs. But now, everything seems a bit natural.
I had to also refresh my knowledge of mapping.
Noticed I debug a bit more easily now. When the compiler throws an error, I can quickly spot what to fix. I think there are some things no one will teach in engineering, and you will only get better at it the more you build.
If you detect security issues or how to make the contract better, be generous to send a PR.
For those who don't know. I am a technical writer and Solidity developer. I am currently Managing the brilliant Web3 technical content creation team at Blockchian Alpha.
You can connect with me on Twitter.