DEX Swap is a decentralized exchange platform designed to facilitate the swapping of tokens in a trustless and permissionless manner. Leveraging the power of Ethereum and automated market maker (AMM) technology, DEX Swap enables users to trade ERC-20 tokens directly from their wallets without the need for intermediaries.
- Trustless Trading: Conduct trades directly from your wallet without the need for a centralized exchange.
- Automated Market Maker: Utilizes an AMM model for efficient and decentralized liquidity provision.
- Token Swaps: Swap between two tokens using a simple and intuitive interface.
- Liquidity Pools: Provide liquidity to earn fees from token swaps.
- Secure and Transparent: Built on the Ethereum blockchain, ensuring security and transparency.
- User-Friendly Interface: Clean and modern UI with easy navigation.
- TypeScript: Provides type safety and improved development experience for the project.
- Solidity: Smart contract language used to implement the decentralized exchange logic on the Ethereum blockchain.
- Ethereum: Blockchain platform used to deploy and interact with smart contracts. -Hardhat: Hardhat framework used for deployment of smart contracts.
- Thirdweb: Simplifies the integration of Web3 functionality in the application.
- CSS: Used for styling the application, ensuring a responsive and visually appealing interface.
- Node.js: Ensure you have Node.js installed. You can download it from here.
- MetaMask: A crypto wallet and gateway to blockchain apps. Install it from here.
-
Clone the repository:
git clone https://github.com/your-username/dex-swap.git cd dex-swap
-
Install dependencies:
npm install
-
Set up environment variables: Create a
.env
file in the root directory and add the following:NEXT_PUBLIC_TEMPLATE_CLIENT_ID=your_thirdweb_client_id
-
Start the development server:
npm run dev
-
Open your browser and navigate to
http://localhost:3000
to view the application.
To deploy the smart contracts on Ethereum:
- Configure your deployment script (e.g., using Hardhat or Truffle).
- Deploy the contracts to the Ethereum network.
- Update the contract addresses in your frontend application.
The core smart contracts of DEX Swap are written in Solidity and deployed on the Ethereum blockchain. They manage the liquidity pools, token swaps, and fee distribution.
-
DEX.sol: Manages the overall functionality of the decentralized exchange.
-
Manages the liquidity pools and the automated market maker logic.
-
Token.sol: Represents the ERC-20 tokens used within the platform.
- Connect Wallet: Use MetaMask to connect your Ethereum wallet to the DEX Swap platform.
- Swap Tokens: Select the tokens you want to swap and execute the trade.
- Provide Liquidity: Add liquidity to the pool to earn a share of the trading fees.
- Withdraw Liquidity: Remove your liquidity from the pool at any time.
Contributions are welcome! Please follow these steps to contribute:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Make your changes and commit them (
git commit -m 'Add some feature'
). - Push to the branch (
git push origin feature-branch
). - Open a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.