Code Monkey home page Code Monkey logo

dex's Introduction

Project Information

This is a dEX (Decentralized Exchange) Platform for trading in a custom ERC-20 complient token

This token is named BRF which can be traded with 2 mock tokens when are also created using the ERC-20 complient token which is created using Token contract. These mock tokens are: mETH & mDAI

This Project is created using:

-React JS (for Frontend)
-Solidity (for Smart Contracts)
-Etherjs (for Blockchain Interaction)
-Hardhat (Ethereum Development Environment)


To start the project follow these commands:

Note: Following above steps will start the project

  • Add Hardhat account 0 and Hardhat account 1 to your Metamask using the private key generated on execution of npx hardhat node
  • In case of any unexpected behaviour occurance, check the address of tokens and exchange from 2nd commands output match the ones in utils/addressConfig.json. They should be same for the deploy to work correctly when using hardhat as network

First Command: (To execute hardhat node)

npx hardhat node

Second Command: (To run Deploy script)

npx hardhat run --network localhost scripts/1_deploy.js

Third Command: (To run seeding script so that we have filled Order Book at start)

npx hardhat run --network localhost scripts/2_seed-exchange.js

Fourth Command: (To run local server to view the dEX platform)

npm run dev

Follow above commands to see project in action


Below if how the app looks in several states:


Home Page (When account not connected)

Image

Home Page (When account is connected)

Image

Home Page (When Transaction is Successful)

Image

To run scripts only of deployment follow these steps:

First Command:

npx hardhat node

Second Command:

npx hardhat run --network localhost scripts/1_deploy.js

Third Command:

npx hardhat run --network localhost scripts/2_seed-exchange.js

To run tests only follow these steps:

To run all tests together:

npx hardhat test

To run Test for Token only:

npx hardhat test test/Token.js

To run Test for Exchange:

npx hardhat test test/Exchange.js

dex's People

Contributors

avin4sh avatar

Stargazers

Antoine Crosetti avatar

Watchers

 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.