This project provides a simple, fast and free way to perform flash loans for any token available on the Uniswap V4 pool manager. Flash loans are a powerful tool in decentralized finance (DeFi), enabling users to borrow assets without collateral, provided the loan is repaid within the same transaction.
- Free Flash Loans: Borrow any token from Uniswap V4 pool manager without fees.
- Ease of Use: Simplified interface (ERC-3156) for developers and users to integrate flash loans into their applications.
- Flexibility: Supports all tokens available in the Uniswap V4 ecosystem.
- V4 Swaps Allowed: You can still perform V4 swaps within the flash loan callback.
src/V4FlashEntrypoint.sol: The main contract enabling flash loans.
test/V4FlashEntrypointFork.t.sol: Tests for the flash loan functionality (Base Fork).
Integrate the V4FlashEntrypoint contract into your project to perform flash loans. Refer to the MockFlashBorrower.sol for an example of how to interact with the contract.
The entrypoint is a standard ERC-3156 Flash Lender, allowing you to integrate flash loans into your applications seamlessly.
- Foundry installed for smart contract development.
- PNPM installed for managing JavaScript dependencies.
-
Clone the repository:
git clone https://github.com/akshatmittal/v4-flash-loan.git cd v4-flash-loan -
Install dependencies:
pnpm install
-
Build the project:
forge build
To run the tests, use the following command:
forge testContributions are welcome! Please fork the repository and submit a pull request with your changes.
This project is licensed under the MIT License.