Git Product home page Git Product logo

ca_final_project's Introduction

CA_final_project

  • Create a contract that manages the administration of the scooter-renting scheme : people rent a bike in a list, give it back and are charged accordingly
    • Create a fault-less contract on Remix
    • [] Create a mapping, avoiding the constructor to loop and gas overflow
    • [] Allow usage of non-integer (division purposes)
    • [] The deposit can only be redeemed 2 days later (2 days are sufficient for another one to make a claim)
  • Create a contract that allows insurance mechanism
  • Implement a token-based reward system, which allows for the insurer to handle the deficiency issue
User bought insurance User didn't buy insurance
No claim Token rewarded to user Nothing happens
Claim by last user No token rewarded to user The insurer pays 80%, the user 20% User must redeem the deposit
Claim by other user Token count is forced to 0 (dishonesty) The insurer pays 20%, the user 80% User must redeem the deposit

What can an insurance contract do ?

  • Record keeping for the token
  • Keep a balance of premia and claim fees for auditability
  • Receives the subscription money

Workflow :

  • Buy insurance.
    • The client buys insurance (pays a premium upfront)
    • Then, will pay small premium every time they rent a bike
  • Rent bike.
    • The client rents a bike
    • The admin checks on public insurance record if the guy is insured.
      • The premium is paid according to past accident count if insured
    • The deposit will be the same for everyone.
  • At end of ride, the renter :
    • Can file a claim if the scooter is not in good shape any more.
    • Communicates with insurer to have the guy gain extra points.
    • If there is an accident :
      • The bike sharing contract can modify the count of accident.
      • The insurance contract will automate payment of one bike

======================================================== Ideas ========================================================

  • Customer can reduce their accident count by redeeming a token --> TO IMPLEMENT IN INSURANCE CONTRACT
  • Ban client (last resort, after fake declaration) --> TO IMPLEMENT
  • A Proof-of-Existence contract where you must prove the bike still looks good.
  • Send to repair shop the broken ones if it falls below a certain threshold ?
  • Add IPFS geolocation ?

======================================================== Things to clean ========================================================

  • The Bike Struct (with enum, no need for currentlyInUse !)

===========

  • Initialize a number of deployed.

  • When it is used for the first time, push it into the array !

  • IF THE BIKE IS BROKEN, DEACTIVATE IT

===========

Possible tests :

  • How much does the insured pay ?
  • 5 tokens = -1 accidentCount

===========

  • Security issue : what if the guy rents another one ? OK --> added enums

===========

  • THE PEOPLE WHO HAVE INSURANCE MUST HAVE A PUBLIC VIEWABLE RECORD, COMMON TO INSURANCE COMPANY AND BIKE COMPANY
  • TOKENCOUNT MUST BE PUBLIC AS WELL

ca_final_project's People

Contributors

hyqiu avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.