Git Product home page Git Product logo

tezchange's Introduction

TezChange

A Crypto Exchange for Tezos, convert XTZ to ETH and vice-versa seamlessly. No servers are required to be exposed, all interactions happen through the Tezos and Ethereum Smart Contracts.

How it works?

TezChange Diagram

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

Getting the project.

$ git clone https://github.com/gdsoumya/TezChange
or 
Download and extract the Zip-File

Install Dependencies

$ cd TezChange
$ npm i

Setting up the Config files

There are 2 config files that needs to be updated before we can run TezChange. The two files are located at config/eth-config.json and config/tez-config.json. There are some sensitive parameters like :

  1. config/eth-config.json
  "walletAddress": "<ETH_WALLET_ADDR>",
  "walletPK": "<PRIVATE_KEY>",
  "RPC": "https://goerli.infura.io/v3/<ACCESS_TOKEN>",
   "contractAddr": "<CONTRACT_ADDR>"
  1. config/tez-config.json
  "RPC": "https://carthagenet.smartpy.io/",
  "walletAddress": "<TEZOS_ADDR>",
  "walletPK": "<PRIVATE_KEY>",
  "contractAddr": "<CONTRACT_ADDR>"

These fields need to be filled with you specific details. contractAddr can be filled in later after deploying each contract.

Deploying Contracts

After setting the configs, we need to deploy the precompiled tezos and ethereum contracts, to deploy the contracts run:

$ node ethereum/scripts/deploy-contract.js
$ node tezos/scripts/deploy-contract.js 

You will recieve the contract addresses for both the Ethereum and Tezos contracts, these addresses need to inserted in the appropriate config files.

Starting the Exchange Bot

To start the botv

$ node index.js

The bot will start and keep watching for pending transfers on both the networks every 5mins.

Test TezChange

Currently TezChange doesn't have a frontend for interaction all interactions need to be done by directly communicating with the contracts. These scripts can be used to test the whole system :

$ node ethereum/scripts/add-transfer.js
$ node tezos/scripts/add-transfer.j

These 2 scripts will add crypto conversion requests to each of the networks, which should be caught by the bot. Before using the scripts ensure to change the Public Addresses to which you want to convert and transfer crypto to. These have to be changed directly in the script code it self.

Note

The current setup uses static Conversion Rates and Conversion Fees these can be changed in the config/global-config.json. The convertion rate is approximately specified in terms of 1XTZ->GWEI

Author

  • Soumya Ghosh Dastidar

tezchange's People

Contributors

dependabot[bot] avatar gdsoumya avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

cryptodevving

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.