Skip to content

rajat-sharma-Dev/RWA-lending-protocol

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

🏛️ Decentralized RWA Lending Protocol

RWA Lending Protocol is an innovative decentralized lending protocol that bridges the gap between traditional finance and decentralized finance (DeFi) by utilizing Real World Assets (RWAs) as collateral. This repository contains all components of the protocol: the Smart Contracts that power the core logic and the Frontend web application for user interaction.


📂 Repository Structure

The project is structured into two main directories:

Directory Contents Description
smart-contracts/ Solidity files, deployment scripts, and tests. The core, audited logic for the RWA-based lending platform.
frontend/website/ React/Next.js/Vue files, public assets, and styling. The user-facing web interface for interacting with the protocol.

✨ Features

  • RWA-Backed Loans: Secure loans using a diversified basket of tokenized real-world assets.
  • Transparent Oracles: Utilizes reliable, decentralized oracle networks (e.g., Chainlink) for accurate, real-time RWA valuation.
  • Intuitive UI: A user-friendly interface in frontend/website/ for easy lending, borrowing, and collateral management.

🚀 Getting Started (Overall)

This section details the prerequisites for setting up both the smart contracts and the frontend, and how to run the entire stack locally.

Prerequisites

Ensure you have the following installed:

  • Node.js: We recommend using the LTS version (Check Node.js website for the latest LTS).
  • Yarn or npm: A package manager (we'll use npm).
  • Git: For cloning the repository.
  • [Specific Prerequisite for Contracts, e.g., Foundry or Hardhat CLI]: Necessary for contract compilation/testing.

Installation

  1. Clone the Repository

    git clone [https://github.com/](https://github.com/)[Your-Username]/[Protocol-Name].git
    cd [Protocol-Name]
  2. Install Global Dependencies Since this is a monorepo, you may have some root dependencies, though the main installation steps are within the sub-directories.

    # Install any root-level dependencies if applicable
    npm install

⛓️ Smart Contracts (smart-contracts/)

This directory contains the Solidity smart contracts, deployment scripts, and testing suites.

Installation and Setup (Contracts)

  1. Navigate to the Contract Directory

    cd smart-contracts
  2. Install Dependencies (If separate)

    # If the contracts have their own package.json
    npm install
    # OR if using Foundry/non-Node environment, ensure dependencies are fetched
    # forge install
  3. Configure Environment Variables Create a .env file within the smart-contracts/ directory (or use a root .env if preferred) for deployment keys and network URLs.

    # Example for Hardhat/Foundry
    RPC_URL_TESTNET=[https://eth-sepolia.g.alchemy.com/v2/](https://eth-sepolia.g.alchemy.com/v2/)[YOUR_KEY]
    PRIVATE_KEY=0x...
    ETHERSCAN_API_KEY=[YOUR_ETHERSCAN_API_KEY]

Running the Contracts

  1. Compile Contracts
    # Example for Hardhat/Foundry
    npx hardhat compile
    # OR forge build
  2. Run Tests
    # Example for Hardhat/Foundry
    npx hardhat test
    # OR forge test
  3. Deploy to Testnet (e.g., Sepolia)
    npx hardhat run scripts/deploy.js --network sepolia

🌐 Frontend Application (frontend/website/)

This directory contains the web application used by users to interact with the deployed smart contracts.

Installation and Setup (Frontend)

  1. Navigate to the Frontend Directory

    cd ../frontend/website
  2. Install Dependencies

    npm install
    # OR yarn install
  3. Configure Environment Variables Create a .env file within the frontend/website/ directory. This configuration is for the web application's connection to the blockchain.

    # Example for React App
    REACT_APP_CONTRACT_ADDRESS=[DEPLOYED_CONTRACT_ADDRESS]
    REACT_APP_NETWORK_ID=[NETWORK_ID_OF_DEPLOYMENT]
    # Required for API calls (e.g., from an Infura/Alchemy node)
    REACT_APP_RPC_URL=[https://eth-sepolia.g.alchemy.com/v2/](https://eth-sepolia.g.alchemy.com/v2/)[YOUR_KEY]

Running the Frontend

  1. Start the Local Development Server This will typically start the application on http://localhost:3000.

    npm run dev
    # OR npm start
  2. View the Application Open your web browser and navigate to the displayed local address (usually http://localhost:3000).


🤝 Contributing

We welcome contributions! Please see our CONTRIBUTING.md file for guidelines on setting up your environment, submitting pull requests, and coding standards.


📜 License

This project is licensed under the [License Type, e.g., MIT License]. See the LICENSE file for details.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors