/cairo-flash-loan

Flash loans in cairo based on EIP-7399

Primary LanguageCairo

Cairo FlashLoan Starknet

Flash loan which Implements EIP-7399 interface in which borrower smart contract borrow some amount from Lender smart contract with a condition such that amount is returned to lender contract with an additional fee charged by the lender contract

Table of Contents

📖 About

A flash loan is a smart contract transaction in which a lender smart contract lends assets to a borrower smart contract with the condition that the assets are returned, plus an optional fee, before the end of the transaction.

This repository use the 0.8.0 version of openzepplin docs and uses EIP-7399 standard which is wrapper for EIP-3156 Flash loan

🌅 Getting Started

Dependencies

Required

These are needed in order to compile and use the project.

Installing project dependencies

Cairo can be installed by simply downloading Scarb. Scarb bundles the Cairo compiler and the Cairo language server together in an easy-to-install package so that you can start writing Cairo code right away.

This will install the latest stable release of Scarb.

. curl --proto '=https' --tlsv1.2 -sSf https://docs.swmansion.com/scarb/install.sh | sh

We strongly recommend that you install Scarb via asdf, a CLI tool that can manage multiple language runtime versions on a per-project basis. This will ensure that the version of Scarb you use to work on a project always matches the one defined in the project settings, avoiding problems lead to version mismatch.

🚀 Usage

Running the project

You can add the following to your Sacrb project's Scarb.toml:

openzeppelin = { git = "https://github.com/aerius-labs/cairo-flash-loan/" }
starknet = "2.3.1"
[[target.starknet-contract]]
casm = true

This will add the openzepplin documnetation in our scarb Project and [[target.starknet-contract]] is used to target the starknet contract.

Running Scarb from CLI

To run Project from the command line, first compile the repository using Scarb:

scarb build

This will create a target/dev folder which later use for deployment of the contracts

Testing

📚 Documentation

⚖️ License