Coder Social home page Coder Social logo

dcarpintero / dapp-flight-insurance Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 0.0 1.28 MB

Decentralized Application for Flight Insurance w/ Smart Contracts

Home Page: https://github.com/dcarpintero/dapp-flight-insurance

License: MIT License

JavaScript 69.16% CSS 0.85% HTML 1.41% Solidity 28.58%
ethereum solidity decentralized-application web3js truffle-framework

dapp-flight-insurance's Introduction

Decentralized Flight Insurance

Project Description

Decentralized application aimed at providing flight passengers' insurance. A consortium of airlines fund an insurance deposit and guarantee premiums. Insurance premiums are credited to insurees upon oracle consensus on flight status. Unreedemable insurance deposits are credited to the shared consortium account.

Security

Design and Upgradability

  • ConsortiumAlliance contract module aims at providing a generic insurance data model as well as fine operations for implementing affiliate registrations, voting rights, custody and management of insurance deposits.

  • ConsortiumSettings defines the project roles, consensus criteria and administrative fees of the project.

  • FlightInsuranceHandler is concerned with the specific business logic of airlines', flights' and insurances registration. As a trusted delegate of the ConsortiumAlliance, it triggers the credit of insurance deposits and premiums upon Oracle consensus on flight status.

  • A Express.js server application provides a REST API to interact with the contracts. It allows withdraw of insurance premiums and registration of airlines, flights, oracles and insurances.

Unit and system tests

  • TestConsortiumWorkflow.js

  • TestConsortiumConsensus.js

  • TestConsortiumRequires.js

  • TestconsortiumReentrancy.js

  • TestFlightInsuranceHandler.js

Dependencies

  • Solidity v0.6.2 (solc-js)

  • Node v12.17.0

  • Web3.js v1.2.1

  • Truffle v5.1.30 (core: 5.1.30) - Development framework

  • @truffle/hdwallet-provider v1.0.36 - HD Wallet-enabled Web3 provider

  • truffle-assertions v0.9.2 - Additional assertions for Truffle tests

  • chai v4.2.0 - Assertion library

Getting Started

Install dependencies

npm install

Define mnemonic in .secret file

.secret
truffle-config.js

Launch Ganache with the same mnemonic and define 50 accounts with 100 ETH each

ganache-cli -m <mnemonic> -a 50 -e 100

Compile, test and migrate

truffle compile
truffle test
truffle migrate --reset

Launch the Server (it registers founding airlines, flights and oracles)

npm run server

Launch the DApp

npm run dapp
http://localhost:8000

Frontend

dapp-flight-insurance's People

Contributors

dcarpintero avatar dependabot[bot] avatar

Stargazers

alperen bekçi avatar

Watchers

J.Ru avatar  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.