Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Etomic Swap Smart Contracts for AtomicDEX platform.

Build Status
Etomic swap Smart Contract is implemented to support ETH and ERC20 atomic swaps on AtomicDex 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. Start containers docker-compose up -d.
  4. Install project dependencies: docker-compose exec workspace yarn.
  5. To run tests: docker-compose exec workspace truffle test.

Additional commands

  1. To merge contract to single file: docker-compose exec workspace yarn merge.
  2. To clean merged contract: docker-compose exec workspace yarn clean.

Related links

  1. Komodo platform - https://www.komodoplatform.com
  2. AtomicDEX - https://atomicdex.io

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

About

Etomic Swap Smart Contract allowing ETH and ERC20 atomic swaps on AtomicDex platform.

Topics

Resources

Packages

No packages published