- Solidity (Writing Smart Contract)
- Javascript (Testing)
- Hardhat (Development Framework)
- Ethers (Blockchain Interactions)
- Alchemy (Forking Mainnet)
- Install NodeJS, recommended version is v16.13.2
$ npm install
Create a .env file, and fill in the following values (refer to the .env.example file):
- ALCHEMY_API_KEY="API_KEY"
- PRIVATE_KEY="YOUR_PRIVATE_KEY"
npx hardhat test
By default this will fork polygon mainnet and simulate the flashloan
npx hardhat run --network polygon ./scripts/1_deploy.js
Copy the deployed contract address logged to the console.
You'll want to paste in the address of the deployed contract on line 7
npx hardhat run --network polygon ./scripts/2_execute-flashloan.js