Skip to content

gjacuna/dexchallenge

Repository files navigation

🏗 Scaffold-ETH, DEX Challenge by Guillermo

everything you need to build on Ethereum! 🚀

🧪 Quickly experiment with Solidity using a frontend that adapts to your smart contract:

image

🏄‍♂️ Quick Start

Prerequisites: Node plus Yarn and Git

clone/fork 🏗 scaffold-eth:

git clone https://github.com/scaffold-eth/scaffold-eth.git

install and start your 👷‍ Hardhat chain:

cd scaffold-eth
yarn install
yarn chain

in a second terminal window, start your 📱 frontend:

cd scaffold-eth
yarn start

in a third terminal window, 🛰 deploy your contract:

cd scaffold-eth
yarn deploy

For this particular challenge, I had to build a DEX (Decentralized Exchange) starting from the Scaffold-eth master branch.

Main inspiration is this article: Minimum Viable Exchange by Austin.

Things to look at in this proposal

🔏 There's 2 smart contracts KoyweToken.sol and Dex.sol in packages/hardhat/contracts. The first one is the ERC20 Token you will be able to swap for ETH, the second one is the AMM (Automated Market Maker). You can deposit or withdraw liquidity from the contract, sharing the fee commissions with it! 🤑

📝 Check out App.jsx in packages/react-app/src to see the changes implemented there. Be sure to check components/DexSwapper out to see the component I built on top of the Swap component parts.

💼 There's also 2 basic deployment scripts in packages/hardhat/deploy, just to get things started for the market. Make sure you change the address in one of them to receive the remaining tokens on your local burner wallet.

NEW:

💎 LPs are here! Deposit ETH-KOY pairs to become an LP partner! Withdraw liquidity to take those commissions home! Be careful with arbitragers though. There's a new component for that: components/DexSwapperLP. Check it out.

🪤 A friend from past challenges has appeared. Added a Vendor to game the markets! Buy and/or sell tokens to the Vendor to arbitrage them tokens. Check its contract in packages/hardhat/contracts and the new deployment file in packages/hardhat/deploy. Now you find 3 files there. Tinker with the initial liquidity of the DEX if you want, or the Vendor price.

📜 Check the trade history, any familiar addresses?

Tinker all you want! Time to manipulate the markets!

📱 Open http://localhost:3000 to see the ap

📚 Documentation

Documentation, tutorials, challenges, and many more resources, visit: docs.scaffoldeth.io

🔭 Learning Solidity

📕 Read the docs: https://docs.soliditylang.org

📚 Go through each topic from solidity by example editing YourContract.sol in 🏗 scaffold-eth

📧 Learn the Solidity globals and units

🛠 Buidl

Check out all the active branches, open issues, and join/fund the 🏰 BuidlGuidl!

💌 P.S.

🌍 You need an RPC key for testnets and production deployments, create an Alchemy account and replace the value of ALCHEMY_KEY = xxx in packages/react-app/src/constants.js with your new key.

🏃💨 Speedrun Ethereum

Register as a builder here and start on some of the challenges and build a portfolio.

💬 Support Chat

Join the telegram support chat 💬 to ask questions and find others building with 🏗 scaffold-eth!


🙏 Please check out our Gitcoin grant too!

Automated with Gitpod

Open in Gitpod

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published