git clone https://github.com/BuildBearLabs/tutorial-aave-flash-loan-v2.git
cd tutorial-aave-flash-loan-v2
cp .env.example .env
npm i
npx hardhat
Before you run the scripts:
- Make sure you have enough Native tokens in your EOA to cover gas
- Fill the env variables with:
PRIVATE_KEY
: You can use your unlocked account mnemonic and receive a private-key for it using: -cast wallet private-key "MNEMONIC"
BUILDBEAR_SANDBOX_ID
: Fill in your Sandbox ID for etherscan verification on BuildBear after contracts deployment- Your RPC Endpoint should look something like
https://rpc.buildbear.io/BUILDBEAR_SANDBOX_ID
- Your RPC Endpoint should look something like
SANDBOX_CHAIN_ID
: Fill in the chain id for the sandbox created
- Make sure you have at least
1000000
or more of DAI and USDC
make deploy
make flashloan
make arbitrage