Skip to content

tptacles/usingUniswapSample

Repository files navigation

Sample Hardhat Project working with Uniswap

This project demonstrates a basic Hardhat use case that forks to a mainnet and impersonates an account. Working with Uniswap to exchange tokens. It comes with test cases SimpleSwap.sol uses uniswap router to swap tokens PairsSwap.sol uses uniswap pair without the help of router

Installation:

Needs to have NodeJS installed:

Uses yarn rather than npx. yarn comes with Nodejs to enable:

Clone this depo and run yarn

yarn hardhat help
yarn hardhat test
yarn hardhat test --network localhost
REPORT_GAS=true yarn hardhat test
yarn hardhat node
yarn hardhat run scripts/deploy.js

Forking mainnet

To fork mainnet and create a localnode run

yarn fork_mainnet

About

some simple solidity contracts that uses uniswap v2 to exchange tokesn and eth

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •