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.
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. |
- 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.
This section details the prerequisites for setting up both the smart contracts and the frontend, and how to run the entire stack locally.
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.
-
Clone the Repository
git clone [https://github.com/](https://github.com/)[Your-Username]/[Protocol-Name].git cd [Protocol-Name] -
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
This directory contains the Solidity smart contracts, deployment scripts, and testing suites.
-
Navigate to the Contract Directory
cd smart-contracts -
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
-
Configure Environment Variables Create a
.envfile within thesmart-contracts/directory (or use a root.envif 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]
- Compile Contracts
# Example for Hardhat/Foundry npx hardhat compile # OR forge build
- Run Tests
# Example for Hardhat/Foundry npx hardhat test # OR forge test
- Deploy to Testnet (e.g., Sepolia)
npx hardhat run scripts/deploy.js --network sepolia
This directory contains the web application used by users to interact with the deployed smart contracts.
-
Navigate to the Frontend Directory
cd ../frontend/website -
Install Dependencies
npm install # OR yarn install -
Configure Environment Variables Create a
.envfile within thefrontend/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]
-
Start the Local Development Server This will typically start the application on
http://localhost:3000.npm run dev # OR npm start -
View the Application Open your web browser and navigate to the displayed local address (usually
http://localhost:3000).
We welcome contributions! Please see our CONTRIBUTING.md file for guidelines on setting up your environment, submitting pull requests, and coding standards.
This project is licensed under the [License Type, e.g., MIT License]. See the LICENSE file for details.