- Notifications
You must be signed in to change notification settings - Fork175
yuichiroaoki/poly-flash
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
An open source flashloan smart contract on polygon network
Run the following command.
git clone https://github.com/yuichiroaoki/poly-flash.gitcd poly-flash
You'll need anALCHEMY_POLYGON_RPC_URL
environment variable. You can get one fromAlchemy 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 yourPRIVATE_KEY
environment variable,with a private key from your wallet.
PRIVATE_KEY='your-PRIVATE_KEY'
*Note: If using metamask, you'll have to add a0x
to the start of your private key)
Run the following command.
yarn install
Run the following command.
yarn compile
Run the following command.
yarntest test/polygon/dodoflash.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 polygon
It costs about 0.2 MATIC to deployFlashloan
contract.
https://polygonscan.com/address/0xb6c4448386c4ecf4e5eab057351f8a6a8a465a0d
Deploy on the polygon mainnnet fork with the following command:
yarn liquidations
Deploy on the polygon mainnnet with the following command:
yarn liquidations --network polygon
About
Flashloan on Polygon