In this repo, you can interact with the Uniswap protocol v2. I'm show an example simple swap between ETH -> WETH -> DAI. Can you find the address exchange for any other token you want to swap.Uniswap v2 Router 02 and using Uniswap v2 Factory Can you find the address exchange for any other token you want to swap.
Will you work with Hardhat like development enviroment and the library Ethers.js that allow you to interact with remote ethereum node in this case the Kovan test network.
Get Faucet Ether for Kovan Testnet
Please install or have installed the following:
- nodejs (v16.13.2) and npm (8.1.2).
- Clone this repo
git clone https://github.com/pinajmr/swap-uniswapV2-Hardhat-Ethersjs.git Swap-with-UniswapV2
- Then,
cd Swap-with-UniswapV2
. - Install dependencies using
npm install
. - update .env_example file for .env and change the information.
- Update Public_Key in script files.
truffle exec scripts/swap-eth-dai.js --network kovan
You can contact to me in discord like pinajmr#4347 glad to help you.
Remember: Only your work on Kovan testnet.