Flash loan arbitrage contract
- Install Brownie
python3 -m pip install --user pipx python3 -m pipx ensurepath # restart your terminal pipx install eth-brownie - Install requirements
pip install -r requirements.txt
- Install
ganache-cli- using npm:
npm install -g ganache-cli
- or, if you are using Yarn:
yarn global add ganache-cli
- Create
.envfile with the following values:PRIVATE_KEY- Private key of the wallet accountWEB3_INFURA_PROJECT_ID- Project ID of the Infura projectPOLYGONSCAN_TOKEN- API key for the polygonscan account
Deploy the contract to a local development network:
brownie deploy scripts/deploy.py --network developmentThis will initialize a local ganache environment, which will be cleaned when the script finishes.
Deploy the contract to the Mumbai testnet:
brownie deploy scripts/deploy.py --network polygon-testThe contract can be seen at https://mumbai.polygonscan.com/address/<contract_address>
Deploy the contract to the polygon mainnet:
brownie deploy scripts/deploy.py --network polygon-mainNote: This will remove real money from the account (gas fees)
For running tests, run the following command:
brownie test -sNote:
- For running on a different network from what's configured as default,
the
--networkflag can be passed. - The
-sflag allow us to get the output printed while running the tests.