Skip to content

Instantly share code, notes, and snippets.

@fvictorio
Created November 27, 2018 20:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fvictorio/04a659551479aa92df7e1133177396e0 to your computer and use it in GitHub Desktop.
Save fvictorio/04a659551479aa92df7e1133177396e0 to your computer and use it in GitHub Desktop.

Protofire DApp Test

This is a simple exercise for those considering joining our DApps team. Thanks for your time!

Problem description

A weather based insurance prototype has to be created.

Attack the need of indemnifying for rain on a certain day and place.

As a user, I'd like to visit a web page, type in my name, city, email and day I'd like to register a rain insurance for. After paying the transaction for the insurance (parameterizable cost to be set upon smart contract deployment - default: 0.01 ETH), registration of the insured day and personal data should take place.

As the owner of the contract, I'd like to visit the same web page but see a different view that lets me send a transaction indicating if a given day was rainy or not. If the day was rainy, all users that registered an insurance should receive a payment.

Required features

  • User view:
    • Create a web page with the required inputs.
    • Handle insurance registration transaction payment.
    • Notify user confirming policy purchase, besides blockchain transaction link.
    • Validations in both client and contract side.
  • Admin view:
    • Detect that the connected user is the owner and show the proper view.
    • Create a web page with the required inputs.

Stack

Use javascript (transpiled ecma features are ok, but don't use typescript) and react. Any other choice of components or libraries is up to you.

Submitting solution

  • After reading and analyzing this, please provide an estimation of how many days you will think it will take you to do this.
  • Create a Github repo, give Profotire team access and commit new code as usually, this is part of the evaluation process.
  • Let Protofire know once work is completed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment