Farmers often face the problems of crop damage because of natural causes like floods or droughts. The farmers that are insured face difficulties to get their coverage amounts from the insurance companies. Moreover, the insurance companies act as a middleman in all this process.
To remove the middleman and immediately settle insurance claims by the user, I got the inspiration to develop this Decentralized Platform.
What it does
Agrinsure is a DApp that gives the power to rightfully claim the insurance back to the farmers.
Users can create their own policy by specifying the type of crop, area and location of their field. They can choose to opt for insurance against Flood or Drought. They pay the required premium fee to the smart contract.
In case of the specified disaster, users can go to the claim page, enter their policy id along with disaster's date and initiate the transaction from the same Ethereum Address with which the policy was created. If the claim is correct, payout equal to the coverage amount is initiated to their address. All this is handled by the smart contract that verifies whether the claim is true or not by analyzing the precipitation levels on that date via API provided through Honeycomb marketplace and the oracle nodes which are hosted by the Chainlink network.
In order to calculate the coverage amount, some parameters have been defined in the contract. According to water levels in the region, 50% or 100% payout is made based on the scale of damage that occurred. Payout and premium fees also vary with the type of crop selected and increase linearly with the area of field.
Users can view the status of the policies along with the time till when it is valid.
How I built it
Wrote and Deployed the contract in the Remix IDE. Built the frontend by using Web3.js library to interact with the blockchain.
Challenges I ran into
Great learning experience working first time with chainlink as well as honeycomb. Haven't used React for interacting with blockchain, so it didn't work and had to resort to using pure html and js.
Accomplishments that I'm proud of
Developed a working prototype with fully functional UI as well as backend (smart contract).
What I learned
Using Honeycomb marketplace and getting outside world data into the blockchain.
What's next for Agrinsure
For demo purposes, I have commented out the ability for people to claim insurance before the policy was created. Added functionalities in UI to view policies by user.