I made an Uniswap-like decentralized exchange all by myself.
It took me around 3 days.
The Dapp!
Demo in better quality:
https://drive.google.com/file/d/1X9TPcOnJYMeIK0xqGM_7UGHY3bX1Rhz8/view?usp=sharing
Full code:
https://github.com/REGO350/Uniswap-Clone
Feature
Swap ETH to ERC20 token. In this example, the supported ERC20 tokens are COMP, LINK, and DAI. The tokens were minted to the DEX in the migration process. Prices are fetched from CoinGecko API (100% free to use).
In the right-top corner, there is a login button that connects to a wallet (Metamask). Once a wallet is connected to the dapp, it changes the button text to Connected and shows the account address in the right-bottom corner.
I didn’t demonstrate this in the video but if the user change wallet account, the dapp updates the account variable as well.
Every 5 seconds, the dapp checks if the user is logged in or not.
The swap button is not clickable unless the user has sufficient amount of ETH or selected token. The arrow in the middle changes ETH-ERC20 to ERC20-ETH, vice versa.
Development
Just like in the Ethereum dApp Programming course, I used Solidity for smart contract with OpenZeppelin, Truffle for framework, and Ganache for local blockchain. For the frontend, HTML/CSS + Bootstrap for web template/design and Javascript + jQuery for the frontend logic.
Frontend was the hardest. Especially, styling all the elements and making the dropdown to work.
I think this will be the last time to use jQuery. I will move on to React (currently studying it).
→The Key Takeaway
First, a little introduction about me: I’m 20, Japanese, and an undergraduate student living in Tokyo. I am currently taking a gap year for blockchain and crypto. I still have 10 months.
I joined the academy in middle of March this year, just before gap year started. I had some experience in programming (mostly C) but had no knowledge or experience in blockchain/dapp programming. So I started from the very basics: Bitcoin & Blockchain 101, Javascript for blockchain developers, Ethererum 101, Smart Contract Programming 101 & 201, …
Now, after 2 months, I am at this stage of “being comfortable” at creating a simple Dapp by myself. However, the question is:
What’s next?
I am currently taking the Ethereum Smart Contract Security course but I will finish it by this week. After I finish with this I think I am done with the blockchain courses.
Also, I am currently studying React and a little bit of Moralis for backend.
The point I am trying to make here it that what do people do after they finished the courses? This seems like a stupid question for some people, but I am just a student who is very interested in blockchain and have never worked in company or built something for production.
With this skill, what can I do and what should I do? Maybe I could work in a company (but do I have enough skills?) or partner with someone to make a DApp (but what to make)? I still have 10 months.
I would like to hear opinions.
Thank you for reading this ultra-long post.