TAGDEX

Build an ETH & ERC20 Tokens Exchange App With Uniswap
Introduction Blockchain technology introduced a public ledger that everybody can use and nobody owns for the first time in the history of humankind. And yet, we have a bunch of centralized exchanges that control hashing power and private keys. Although centralized exchanges are necessary to exchange fiat money with cryptocurrencies, it goes against the original philosophy of bitcoin. The technology was supposed to transfer the power from institutions like the government and corporations to individuals.   How can we bring the control back to people? People have been building decentralized protocols to empower individuals. Among them is the decentralized exchange protocols. Each implementation has a different degree of decentralization, but I’m bullish on the Uniswap exchange protocol because they have a high degree of decentralization without compromising the user experience.   The only way to replace existing systems is to provide a better service that people want to use. As a developer, this means writing code and building things. We will do just that in this post. We will build a simple application that exchange Ether and ERC20 tokens using the Uniswap. If you follow along, you will be able to allow your dapp or wallet users to exchange Ether and ERC20 tokens easily.   I briefly talk about how the Uniswap works and then start building our application. Uniswap in a Nutshell Uniswap is a decentralized exchange protocol for Ether and ERC20 tokens. The whole process takes place on-chain and there are no gatekeepers. There is a separate exchange smart contract for each ERC20 token. These exchange contracts hold reserves of both Ether and their associated ERC20. Traders can make trades against the reserves at any time. They send Ether to the contract and get the ERC20 token out and vice versa. These reserves are deposited by liquidity providers…