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
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
To fork mainnet and create a localnode run
yarn fork_mainnet