FlightSurety is a sample blockchain application that allows airlines to fund flight cancellation insurance and also allows passengers to retrieve those funds if a flight is indeed late. Below are more details:
Node: 14.17.4 Solidity: 0.4.24 Truffle: v5.4.23 Web3.js: 1.5.3
This repository contains Smart Contract code in Solidity (using Truffle), tests (also using Truffle), dApp scaffolding (using HTML, CSS and JS) and server app scaffolding.
To install, download or clone the repo, then:
npm install
truffle compile
truffle test ./test/flightSurety.js
truffle test ./test/oracles.js
To use the dapp:
truffle migrate
npm run dapp
To view dapp:
http://localhost:8000
npm run server
This FlightSurety smart contract performs the following tasks:
- Add airlines
- Add flights
- Add passengers
- Airlines must contribute to the insurance pool
- Passengers pay for insurance and receive 1.5 x if flight is late
- After first 4 airlines are added, additional airlines must be voted upon by the first 4