Skip to content
Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
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 (

  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 -
  2. AtomicDEX -

Useful links for smart contracts development

  1. Truffle suite -
  2. Ganache-cli (EthereumJS Testrpc) -
  3. Zeppelin Solidity -


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




No packages published