Skip to content

topcook/flashloan-uniswap-sushiswap

Repository files navigation

Simple Flashloan Contract

This is only for test, not for production.

Main Task

Arbitrager.sol
test:

Additional Challenges

  1. Modify the contract to support arbitrary token pairs.

    ✅smart contrats: AdvancedArbitrager.sol->arbitrage()
    ✅unit tests: test.js

  2. Modify the contract to support multiple exchange interfaces (e.g. Uniswap V3, Balancer, 1Inch, etc.)

    Support of UniswapV3
    ✅smart contracts: AdvancedArbitrager.sol->normalArbitrageUniswapV2ToUniswapV3()
    ✅unit tests: test.js

  3. Make the contract ownable and then have the contract use it's own funds for trading. Provide profit-sharing incentives to users who call the arbitrage() function.

    ✅smart contrats: AdvancedArbitrager.sol -> prfits, owner
    ✅unit tests: test.js

  4. Add support for gas station network and use profits to pay for the gas costs.

    ✅smart contrats TokenPaymaster.sol, AdvancedArbitrager.sol
    ✅uint tests: install GSN env and test the integration in test-gsn.js

  5. Integrate flash loans to maximize profit.

    Integrate flash swap
    ✅smart contracts: AdvancedArbitrager.sol->uniswapV2Call
    ✅unit tests: test.js

How to test

Install

yarn

Install modules

yarn install

Test without gsn

yarn test

Test with gsn

yarn hardhat-node

open anthother terminal

yarn test-gsn

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published