Giter VIP home page Giter VIP logo

lending-borrowing-dapp's Introduction

Lending Borrowing Dapp

About The Project

This DApp allows one to borrow ETH against a NFT collateral as well as earn interest on lending ETH to the platform for a given duration in a transparent manner using blockchain and smart contracts.

Technology Stack & Tools

  • Solidity (Writing Smart Contracts & Tests)
  • Javascript (React & Testing)
  • Truffle (Development Framework)
  • Ethers.js (Blockchain Interaction)
  • React.js (Frontend Framework)
  • Chakra UI (React Component Library)
  • Wagmi (React Hooks for Ethereum)
  • RainbowKit (Wallet Connection)๐ŸŒˆ

Prerequisites

To engage with the Dapp you will need the following :

Setting Up

  • Clone/Download the repository
  • Install dependencies in truffle and client folder

    npm install

  • Truffle([https://www.trufflesuite.com/truffle] (https://www.trufflesuite.com/truffle))

    npm install truffle

  • Run tests

    $ truffle test

  • Start local Ganache Node

    In a separate terminal execute run the following command : Ganache

  • Deploy script locally
    • $ truffle console --network development
    • $ truffle compile
    • $ truffle migrate
  • Run react project

    In frontend folder run the following command $ npm start

Functionality

Get User Loan - Each loan that gets created is assigned a unique ID that increments sequentially, such that the first loan that gets created will have an ID of 1. With this ID we are then able to retrieve successfully created loans that point to that ID from the blockchain. An address can only have one active loan at a given time.

Get User Lending - Each lending that gets created is assigned a unique ID that increments sequentially, such that the first lending that gets created will have an ID of 1. With this ID we are then able to retrieve successfully created lending that point to that ID from the blockchain. An address can have multiple active lendings at a time.

Create Loan - Allows the user to create a loan by providing Duration, Loan Amount, NFT Contract Address, NFT Token Id, and lastly the NFT Floor Price which the dapp retrieves it via opensea nft api. The value of the loan must be greater than 0. The interest rate is decided based on the duration of loan. Once the loan is create, You can view the loan under current activity on account history page.

Pay Monthly Deposit - Allows the assigned borrower to pay the monthly deposit of the loan in which his/hers address was assigned to.

Pay Complete Loan - This allows the borrower to pay back the remaining amount of the loan. The borrower can obtain the required amount to be paid by looking up his loan using the ID. Once the borrower has paid this amount, the Loan Status will change to MATURED, indicating the maturity of the loan.

Create Lender - Allows user to create a lending by providing Lending Amount, Duration. The value of the lending must be greater than 0. The interest rate is decided based on the duration of lending. Once the lending is created, You can view the lending under current activity on account history page.

Redeem Lenders Interest - This allows the lender to redeem interest earned on their lending. Interest is decided based on the duration of lending.

Retrieve Lender Funds - This allows the lender to retrieve the lending amount when the Lender Status is updated to MATURED.

lending-borrowing-dapp's People

Contributors

muskansubnani avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.