# 💧 DexTor – A Modern Uniswap V2 Clone with OpenZeppelin
**DexTor** is a smart contract project that lets you create a decentralized exchange (DEX) just like **Uniswap V2**, but written from scratch using the **latest version of Solidity**.
It’s clean, simple, secure — and ready to grow.
---
## 🌟 What Is This?
- A simplified version of Uniswap V2 (the most famous DEX on Ethereum).
- Built using modern Solidity (`^0.8.x`) — no old-school code.
- Includes **OpenZeppelin** for safer contracts.
---
## 🧠 Who Is It For?
- Developers learning how DEXs like Uniswap work.
- Teams building their own token swap system.
- Projects needing a reliable base to create a custom AMM.
- Anyone who wants to learn about how DeFi works, step-by-step.
---
## 🔧 Main Features
✅ Fully rewritten AMM (Uniswap V2-style)
✅ Uses latest Solidity version (`0.8.x`)
✅ Safer code with [OpenZeppelin](https://docs.openzeppelin.com/contracts)
✅ Easy to extend or customize
---
## 🧱 How It Works
1. Factory creates Pairs
2. Pair holds liquidity (tokenA + tokenB)
3. LP tokens are given to liquidity providers
4. Swaps use the formula: tokenA \* tokenB = constant (k)- You add liquidity: ETH + DAI
- Someone wants to swap DAI for ETH
- The contract uses math to adjust balances and charge a small fee
| Contract | What It Does |
|---|---|
DexTorFactory |
Deploys and tracks all trading pairs |
DexTorPair |
Handles swaps and holds token balances |
DexTorERC20 |
Issues LP tokens for liquidity |
- Solidity
^0.8.20– latest features and safety - OpenZeppelin – trusted building blocks (ERC20, security)
- Add Router for easy swapping
- LP token
permit()support (gasless approvals) - Governance and fee options
- Frontend demo (React + Wagmi + Ethers.js)
Build your own token exchange
Let’s say you launch a token called $COFFEE.
You pair it with ETH on DexTor.
Now, users can trade $COFFEE/ETH directly .
Built with ❤️ by [Mohamed-lahrach]
Twitter: [@kings5layer]
MIT — free to use, modify, and share.