Skip to content

0xSenzel/dex-tutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Build your own Decentralized Exchange like Uniswap

This repo contains coursework project from LearnWeb3 completed by 0xsenzel for LearnWeb3DAO-Sophomore lesson.

Project Info

Simulates Uniswap. Collects 1% fee for each swap. DEX also allows users to add liquidity of token minted from our ICO Dapp and ETH. Users will be given Crypto Dev LP tokens (Liquidity Provider Tokens).

Project Demo

demo1

Fig.1 - Home Page


demo1

Fig.2 - After Adding Liquidity


demo1

Fig.3 - Swap Tab

Project Setup

Hardhat

Head to hardhat-tutorial folder:

Install dependencies

npm install

Compile smart contract

npx hardhat compile

To deploy smart contracts:
Head to hardhat.config.js file, change the value of:

  • ALCHEMY_HTTP_URL with your own Ethereum Network API
  • PRIVATE_KEY with your Ethereum wallet's private key
  • API_KEY with your Etherscan's API Key

Then run the following command.

npx hardhat run scripts/deploy.js --network goerli
npx hardhat verify --network goerli YOUR_SMARTCONTRACT_ADDRESS "CONSTRUCTOR ARG1" "CONSTRUCTOR ARG2"

React & Next Js

Head to my-app folder:

npm install

Replace the variable inside this folder:

  • TOKEN_CONTRACT_ADDRESS with compiled ABI of ICO contract.
  • TOKEN_CONTRACT_ABI with deployed contract of ICO contract.
  • EXCHANGE_CONTRACT_ADDRESS with deployed contract of this contract
  • EXCHANGE_CONTRACT_ABI with compiled ABI of this contract

To run the app locally:

npm run dev

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors