Giter Club home page Giter Club logo

uniswap_v1's Introduction

Decentralized Exchange (DEX) like Uniswap v1

Introduction

This project aims to guide developers in building a decentralized exchange (DEX) reminiscent of Uniswap v1. The DEX facilitates the exchange of Ethereum (ETH) with a custom ERC-20 token. The implementation includes key features such as token swapping, liquidity provision, a fee on swaps, and the ability for Liquidity Providers (LPs) to redeem their tokens for ETH and the custom token.

Build Process

1. Hardhat Setup:

  • Created a new project folder and configured a Hardhat environment.
  • Installed necessary dependencies, including Hardhat, Hardhat Toolbox, OpenZeppelin contracts.

2. ERC-20 Token Contract:

  • Developed an ERC-20 Token contract (Token.sol) representing the custom token for swapping.
  • The ERC-20 contract includes basic functionalities, such as minting initial tokens to the contract creator.

3. Exchange Contract:

  • Implemented an Exchange contract (Exchange.sol) responsible for managing token swaps, liquidity provision, and LP token handling.
  • Features of the Exchange contract include:
    • ETH <> TOKEN swapping with a 1% fee on transactions.
    • LP token issuance to users providing liquidity.
    • LP token redemption, allowing users to burn tokens and receive back ETH and TOKEN.

4. Deployment:

  • Developed a deployment script (deploy.js) to deploy both the ERC-20 Token and Exchange contracts using the Hardhat framework.
  • Verified the deployed contracts on Etherscan to ensure transparency and reliability.

5. Testing on Etherscan:

  • Interacted with the deployed contracts on the Sepolia Testnet through Etherscan.
  • Conducted various tests, including adding liquidity, swapping ETH to TOKEN, TOKEN to ETH, and LP token redemption.
  • Verified that the contracts functioned as expected and provided the intended decentralized exchange experience.

uniswap_v1's People

Contributors

dappcoderr 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.