{"id":21170213,"url":"https://github.com/dcarpintero/dapp-flight-insurance","last_synced_at":"2026-05-06T10:34:38.424Z","repository":{"id":142420730,"uuid":"282055875","full_name":"dcarpintero/dapp-flight-insurance","owner":"dcarpintero","description":"Decentralized Application for Flight Insurance w/ Smart Contracts","archived":false,"fork":false,"pushed_at":"2023-10-30T09:07:08.000Z","size":1308,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-26T20:50:57.484Z","etag":null,"topics":["decentralized-application","ethereum","solidity","truffle-framework","web3js"],"latest_commit_sha":null,"homepage":"https://github.com/dcarpintero/dapp-flight-insurance","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dcarpintero.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-07-23T21:09:24.000Z","updated_at":"2025-09-03T01:51:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"6b817616-a186-4cc8-adca-bbd76976514c","html_url":"https://github.com/dcarpintero/dapp-flight-insurance","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/dcarpintero/dapp-flight-insurance","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcarpintero%2Fdapp-flight-insurance","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcarpintero%2Fdapp-flight-insurance/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcarpintero%2Fdapp-flight-insurance/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcarpintero%2Fdapp-flight-insurance/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dcarpintero","download_url":"https://codeload.github.com/dcarpintero/dapp-flight-insurance/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcarpintero%2Fdapp-flight-insurance/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32689213,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-06T08:33:17.875Z","status":"ssl_error","status_checked_at":"2026-05-06T08:33:17.221Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["decentralized-application","ethereum","solidity","truffle-framework","web3js"],"created_at":"2024-11-20T15:57:10.557Z","updated_at":"2026-05-06T10:34:38.395Z","avatar_url":"https://github.com/dcarpintero.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Decentralized Flight Insurance\n\n## Project Description\n\nDecentralized 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.\n\n### Security\n\n- Access Control to voting rights, agreement on flight status and management of funds is implemented via consensus and trusted roles (affiliate, oracle and delegate roles).\n- Stop-Loss is automatic once a drain of funds is detected, or upon consensus in form of operational status.\n- Reentrancy checks are implemented in credit insurance functions.\n- Escrow accounts and pull payments: the paying contract does not interact directly with the insuree account, which must withdraw the premium payments itself. Insurees can query their due premiums with a payments function, and retrieve them with a withdrawPayments function (see https://docs.openzeppelin.com/contracts/3.x/api/payment#PullPayment and https://consensys.github.io/smart-contract-best-practices/recommendations/#favor-pull-over-push-for-external-calls).\n\n### Design and Upgradability\n\n- 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.\n\n- ConsortiumSettings defines the project roles, consensus criteria and administrative fees of the project.\n\n- 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.\n\n- 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.\n\n### Unit and system tests\n\n- TestConsortiumWorkflow.js\n- TestConsortiumConsensus.js\n- TestConsortiumRequires.js\n- TestconsortiumReentrancy.js\n\n- TestFlightInsuranceHandler.js\n\n### Dependencies\n\n- Solidity v0.6.2 (solc-js)\n- Node v12.17.0\n- Web3.js v1.2.1\n\n- Truffle v5.1.30 (core: 5.1.30) - Development framework\n- @truffle/hdwallet-provider v1.0.36 - HD Wallet-enabled Web3 provider\n- truffle-assertions v0.9.2 - Additional assertions for Truffle tests\n- chai v4.2.0 - Assertion library\n\n## Getting Started\n\nInstall dependencies\n\n```\nnpm install\n```\n\nDefine mnemonic in .secret file\n\n```\n.secret\ntruffle-config.js\n```\n\nLaunch Ganache with the same mnemonic and define 50 accounts with 100 ETH each\n\n```\nganache-cli -m \u003cmnemonic\u003e -a 50 -e 100\n```\n\nCompile, test and migrate\n\n```\ntruffle compile\ntruffle test\ntruffle migrate --reset\n```\n\nLaunch the Server (it registers founding airlines, flights and oracles)\n\n```\nnpm run server\n\n```\n\nLaunch the DApp\n\n```\nnpm run dapp\nhttp://localhost:8000\n\n```\n\n## Frontend\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"/doc/insurance_manager_frontend.png\" /\u003e\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcarpintero%2Fdapp-flight-insurance","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdcarpintero%2Fdapp-flight-insurance","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcarpintero%2Fdapp-flight-insurance/lists"}