Skip to content

suisuisui0722/v4-flash-loan

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Uniswap V4 Flash Loan

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.

Features

  • 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.

Project Structure

  • src/
    • V4FlashEntrypoint.sol: The main contract enabling flash loans.
  • test/
    • V4FlashEntrypointFork.t.sol: Tests for the flash loan functionality (Base Fork).

Usage

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.

Getting Started

Prerequisites

  • Foundry installed for smart contract development.
  • PNPM installed for managing JavaScript dependencies.

Installation

  1. Clone the repository:

    git clone https://github.com/akshatmittal/v4-flash-loan.git
    cd v4-flash-loan
  2. Install dependencies:

    pnpm install
  3. Build the project:

    forge build

Running Tests

To run the tests, use the following command:

forge test

Contributing

Contributions are welcome! Please fork the repository and submit a pull request with your changes.

License

This project is licensed under the MIT License.

About

Uniswap V4 Flash Loans

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Solidity 100.0%