Skip to content

ERC-20 token and a decentralized exchange (DEX) written in Solidity, with a JavaScript front-end application.

Notifications You must be signed in to change notification settings

Mykhailo-Sichkaruk/DEX

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@authors: Mykhailo Sichkaruk / Vadym Tilihuzov

ERC-20 Token and Decentralized Exchange

This repository contains the source code for an ERC-20 token and a decentralized exchange (DEX) implemented in Solidity, along with a JavaScript front-end application for visualizing the contract and providing a user interface.

Features

  • ERC-20 Token: The project includes an implementation of an ERC-20 token contract, which adheres to the standard interface for fungible tokens on the Ethereum blockchain. Users can transfer and manage balances of this token.
  • Decentralized Exchange: The DEX contract allows users to exchange the ERC-20 token with Ether (ETH) and vice versa. The exchange functionality is decentralized, meaning it operates directly on the blockchain without relying on centralized intermediaries.
  • Fee Structure: The exchange charges a small fee for each transaction, providing a cost-efficient alternative to regular centralized exchanges. Users can save on fees while securely exchanging tokens and ETH.
  • Liquidity Provision: Users have the option to provide liquidity to the DEX by depositing both the ERC-20 token and ETH into the liquidity pool. In return, they receive a share of the transaction fees generated by the exchange. This incentivizes liquidity providers and enables them to earn profits.

Repository Structure

  • contracts/intercases: Contains the Solidity smart contract files.
  • token.sol: Implements the ERC-20 token functionality.
  • exchange.sol: Implements the DEX functionality, including token and ETH exchange, fee calculation, and liquidity provision.
  • web_app/: Includes the JavaScript front-end application for interacting with the smart contracts and visualizing the DEX contract.

Prerequisite

  • Node.js / NPM

Getting Started

To run and test the project locally, follow these steps:

  • Clone the repository: git clone https://github.com/Mykhailo-Sichkaruk/DEX
  • Chamge directory cd DEX
  • Run npx hardhat node to create a local node. If the node starts successfully, you should see the following message in your terminal: "Started HTTP and WebSocket JSON-RPC server at https://localhost:8545."
  • Run in new terminal npx hardhat run --network localhost scripts/deploy_token.js to compile and deploy your token contract. Upon success, you should see the message: "Finished writing token contract address: ...".
  • Run npx hardhat run --network localhost scripts/deploy_exchange.js to deploy the exchange contract. Upon success, you should see the message: "Finished writing exchange contract address: ...".
  • Open webapp/index.html in you favorite browser.l free to modify and distribute the code according to the terms of the license.

About

ERC-20 token and a decentralized exchange (DEX) written in Solidity, with a JavaScript front-end application.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published