https://github.com/dappcoderr/uniswap_v1
Uniswap v1: Effortlessly swap tokens with Ethereum using its liquidity-rich smart contract. Simplifying decentralized finance with ease and efficiency.
https://github.com/dappcoderr/uniswap_v1
blockchain defi ethereum hardhat solidity-contracts uniswap-exchange uniswap-v1
Last synced: 2 days ago
JSON representation
Uniswap v1: Effortlessly swap tokens with Ethereum using its liquidity-rich smart contract. Simplifying decentralized finance with ease and efficiency.
- Host: GitHub
- URL: https://github.com/dappcoderr/uniswap_v1
- Owner: DappCoderr
- Created: 2024-01-10T14:18:16.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-04-04T17:07:05.000Z (about 1 year ago)
- Last Synced: 2025-06-10T19:22:53.462Z (16 days ago)
- Topics: blockchain, defi, ethereum, hardhat, solidity-contracts, uniswap-exchange, uniswap-v1
- Language: JavaScript
- Homepage:
- Size: 288 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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.