Code Monkey home page Code Monkey logo

etomic-swap's Introduction

Etomic Swap Smart Contracts for BarterDex platform.

Build Status
Etomic swap Smart Contract is implemented to support ETH and ERC20 atomic swaps on BarterDex platform. Please note that this project is not production ready yet!

Swap workflow

Smart Contracts follow standard symmetric Atomic swap protocol.
Despite example shows swap of ETH/ERC20 this approach will work also for ETH/ERC20 swaps to any currency supporting HTLC (https://en.bitcoin.it/wiki/Hashed_Timelock_Contracts).

  1. Bob wants to change his 1 ETH to Alice 1 ERC20 token.
  2. Alice sends dexfee (handled externally by client side).
  3. Bob sends payment locked with hash of the Secret. He can refund the payment in 4 hours.
  4. Alice sends payment locked with Bob Secret hash. She can refund her payment in 2 hours.
  5. Bob spends Alice payment by revealing the secret.
  6. Alice spends Bob payment using revealed secret.

Project structure

  1. contracts - Smart Contracts source code.
  2. test - Smart contracts unit tests.

How to setup dev environment?

  1. Install docker.
  2. Run docker-compose build.
  3. cp .env.empty .env.
  4. Start containers docker-compose up -d.
  5. Install project dependencies: docker-compose exec workspace yarn.
  6. To run tests: docker-compose exec workspace truffle test.

Related links

  1. Komodo platform - https://www.komodoplatform.com

Useful links for smart contracts development

  1. Truffle suite - https://github.com/trufflesuite/truffle
  2. Ganache-cli (EthereumJS Testrpc) - https://github.com/trufflesuite/ganache-cli
  3. Zeppelin Solidity - https://github.com/OpenZeppelin/zeppelin-solidity

etomic-swap's People

Contributors

artemii235 avatar dependabot[bot] avatar caglaryucekaya 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.