This repo contains coursework project from LearnWeb3 completed by 0xsenzel for LearnWeb3DAO-Sophomore lesson.
Simulates Uniswap. Collects 1% fee for each swap. DEX also allows users to add liquidity of token minted from our ICO Dapp and ETH. Users will be given Crypto Dev LP tokens (Liquidity Provider Tokens).
Fig.1 - Home Page
Fig.2 - After Adding Liquidity
Fig.3 - Swap Tab
Head to hardhat-tutorial folder:
Install dependencies
npm install
Compile smart contract
npx hardhat compile
To deploy smart contracts:
Head to hardhat.config.js file, change the value of:
ALCHEMY_HTTP_URLwith your own Ethereum Network APIPRIVATE_KEYwith your Ethereum wallet's private keyAPI_KEYwith your Etherscan's API Key
Then run the following command.
npx hardhat run scripts/deploy.js --network goerli
npx hardhat verify --network goerli YOUR_SMARTCONTRACT_ADDRESS "CONSTRUCTOR ARG1" "CONSTRUCTOR ARG2"
Head to my-app folder:
npm install
Replace the variable inside this folder:
TOKEN_CONTRACT_ADDRESSwith compiled ABI of ICO contract.TOKEN_CONTRACT_ABIwith deployed contract of ICO contract.EXCHANGE_CONTRACT_ADDRESSwith deployed contract of this contractEXCHANGE_CONTRACT_ABIwith compiled ABI of this contract
To run the app locally:
npm run dev