Giter VIP home page Giter VIP logo

vengeanceescrow's Introduction

VengeanceEscrow

A dapp to offer escrow for buyer and seller.

Frontend: HTML + Javascript + webpack5
Contract: Solidity + truffle

This project utilizes the game theory to introduce the punishment mechanism in order to force both parties to reach the same goal.

Parties:

  1. Buyer: who wants to buy products and willing to pay.
  2. Seller: who wants to sell products for money.
  3. The agent: who deploys this contract, and will later receive 10% of services fee. Buyer can also be the agent.

Procedure:

  1. Buyer and seller want to make a deal.
  2. Agent deploys this contract with factory and tell the address to buyer and seller.
  3. Buyer send 1.5 * PRICE to the contract and part of it as collateral.
  4. Seller send 1 * PRICE to the contract as collateral.
  5. Buyer receives the goods in real world.
  6. If buyer get the good, the buyer call the 'confirmDeliver' function, and then all parties get the money they desierves.
  7. If the buyer didn't receive the goods, the buyer just does nothing untill the buyer receives. So both buyer and seller can not collateral money back.

In the step 7 scenario, the buyer has to options, call 'confirmDeliver' without goods received, or not call. If the buyer calls, the buyer may forever loss the chance to get the goods and the oppotunity to punish the seller, but instead the buyer will get 0.5 * PRICE back. However, if the buyer waits, he may lose nothing, because the money is still holding in the contract. To optimize the utilities, the buyer may wait forever, and the seller knows this. So the seller has no incentive to cheat.

Installation

Use the package manager npm to install packages.

npm install

cd ./web
npm install

Usage

config the truffle-config.js and run

truffle compile
truffle deploy

Run the Frontend

For development server

cd ./web
npm strat

For production version

cd ./web
npm run build-prod

And put the bundles in web/dist to whatever server.

License

MIT

vengeanceescrow's People

Contributors

b69liu avatar

Watchers

 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.