This project demonstrates a basic Hardhat project interacting with an external contract.
Its abilities are demonstrated in the test/sample-test.js file:
- You can grab information from an external contract (e.g. WETH address).
- You can mint yourself USDC tokens for testing.
- You can make a swap on UniswapV2 on behalf of the user.
Try running the test (it is pinned to a block number and therefore should be deterministic):
yarn testCreate a .env file at the project root with the following:
RPC_URL=https://eth-mainnet.alchemyapi.io/v2/<alchemy_api_key>