Skip to content

Commit

Permalink
Remove helpers. Update Readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
artemii235 committed Dec 28, 2018
1 parent 42a3b6b commit 3befedf
Show file tree
Hide file tree
Showing 20 changed files with 8 additions and 778 deletions.
22 changes: 8 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,22 @@
# Etomic Swap Smart Contracts for BarterDex platform.
[![Build Status](https://travis-ci.org/artemii235/etomic-swap.svg?branch=master)](https://travis-ci.org/artemii235/etomic-swap)
Etomic swap Smart Contracts are implemented to support ETH and ERC20 atomic swaps on BarterDex platform.
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 BarterDex Atomic swap protocol https://github.com/SuperNETorg/komodo/wiki/barterDEX-Whitepaper-v2#atomic-swaps
Despite example shows swap of ETH/ERC20 this approach will work also for ETH/ERC20 swaps to any currency supporting HTLC and multisigs.
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.
1. Alice and Bob generate temporary Private/Public key pairs required to execute the swap.
1. Alice sends dexfee (handled externally by client side)
1. Bob sends deposit locked with his hash of BsecretN. He will need to reveal BsecretN to claim it back. Alice can claim deposit without knowing a secret after 4 hours.
1. Alice sends payment locked with 2 hashes: AsecretM and BsecretN.
1. Bob sends payment locked with hash of AsecretM. Bob can claim payment back after 2 hours without knowing AsecretM.
1. Alice claims Bob payment revealing AsecretM.
1. Bob claims Alice payment using AsecretM.
1. Bob claims his deposit back.
1. Alice sends dexfee (handled externally by client side).
1. Bob sends payment locked with hash of the Secret. He can refund the payment in 4 hours.
1. Alice sends payment locked with Bob Secret hash. She can refund her payment in 2 hours.
1. Bob spends Alice payment by revealing the secret.
1. Alice spends Bob payment using revealed secret.

## Project structure

1. `contracts` - Smart Contracts source code.
1. `helpers` - NodeJS command line scripts helping to deploy/interact with Smart Contracts.
1. `test` - Smart contracts unit tests.

## How to setup dev environment?
Expand All @@ -31,12 +27,10 @@ Despite example shows swap of ETH/ERC20 this approach will work also for ETH/ERC
1. Start containers `docker-compose up -d`.
1. Install project dependencies: `docker-compose exec workspace yarn`.
1. To run tests: `docker-compose exec workspace truffle test`.
1. To run helper scripts set `ALICE_PK`, `BOB_PK` in .env file. These variables should contain valid Ethereum private keys - these keys stay at your local machine, however it's not recommended to put keys having access to real money.

## Related links

1. Komodo platform - https://www.komodoplatform.com
1. BarterDex - https://www.komodoplatform.com/en/technology/barterdex

## Useful links for smart contracts development

Expand Down
45 changes: 0 additions & 45 deletions helpers/alice/aliceClaimsPayment.js

This file was deleted.

36 changes: 0 additions & 36 deletions helpers/alice/approveToken.js

This file was deleted.

45 changes: 0 additions & 45 deletions helpers/alice/bobClaimsPayment.js

This file was deleted.

42 changes: 0 additions & 42 deletions helpers/alice/deploy.js

This file was deleted.

44 changes: 0 additions & 44 deletions helpers/alice/initErc20Deal.js

This file was deleted.

41 changes: 0 additions & 41 deletions helpers/alice/initEthDeal.js

This file was deleted.

44 changes: 0 additions & 44 deletions helpers/bob/aliceClaimsDeposit.js

This file was deleted.

44 changes: 0 additions & 44 deletions helpers/bob/aliceClaimsPayment.js

This file was deleted.

Loading

0 comments on commit 3befedf

Please sign in to comment.