Flash Swap Practice
This is a UniswapV2 flash swap practice, our goal is to pass the test.
Liquidator.sol
Practice 1: liquidate()
will call FakeLendingProtocol.liquidatePosition()
to liquidate the position of the user.
Follow the instructions in contracts/Liquidator.sol
to complete the practice.
(Do not change any other files)
Arbitrage.sol
Practice 2: arbitrage()
will do the arbitrage between the given two pools (must be the same pair).
Follow the instructions in contracts/Arbitrage.sol
to complete the practice.
For convenience, we will only practice method 1, and fix the borrowed amount to 5 WETH
If you are interested in the flash swap arbitrage, you can read more in this repository
Local Development
Clone this repository, install Node.js dependencies, and build the source code:
git clone https://github.com/Rita94105/FlashSwapPractice.git
cd FlashSwapPractice
npm install
forge install
forge build
forge test