An open source flashloan smart contract on polygon network
You'll need an ALCHEMY_POLYGON_RPC_URL
environment variable. You can get one from Alchemy website for free.
Then, you can create a .env file with the following.
ALCHEMY_POLYGON_RPC_URL='<your-own-alchemy-polygon-mainnet-rpc-url>'
If you want to execute flashloan on the polygon mainnet, you need to add your PRIVATE_KEY
environment variable, with a private key from your wallet.
PRIVATE_KEY='your-PRIVATE_KEY'
*Note: If using metamask, you'll have to add a 0x
to the start of your private key)
Run the following command.
yarn install
Run the following command.
yarn compile
Run the following command.
yarn test test/balancerflashloan.test.ts
Once you have successfully done the above quickstart and added your private key to .env file, you can deploy your smart contract with the following command:
yarn deploy --network <network-name>