Skip to content

Latest commit

 

History

History
74 lines (56 loc) · 2.83 KB

File metadata and controls

74 lines (56 loc) · 2.83 KB

nostalgia

Decentralized lending protocol inspired by Compound v2. It allows users to supply and borrow assets through smart contracts, earning interest algorithmically based on market dynamics. Motivation for this: "I Don't Understand Anything I Can't Build".

art

🧱 Overview

  • NostalgicController.sol – Core risk management and market control logic.
  • NostalgicFactory.sol – Responsible for deploying and managing new pool instances.
  • NostalgicJumpRateModel.sol – Implements an interest rate model with a jump multiplier, adjusting rates dynamically based on utilization.
  • NostalgicPool.sol – Core pool contract for supplying and borrowing assets.

🧪 Testing

The project uses Foundry for testing and development. Tests are located under the test/ directory, with mocks and unit tests for each module.

╭--------------------------------+-------------------+-------------------+-----------------+-----------------╮
| File                           | % Lines           | % Statements      | % Branches      | % Funcs         |
+============================================================================================================+
| src/NostalgicController.sol    | 100.00% (80/80)   | 100.00% (86/86)   | 100.00% (30/30) | 100.00% (16/16) |
|--------------------------------+-------------------+-------------------+-----------------+-----------------|
| src/NostalgicFactory.sol       | 100.00% (23/23)   | 100.00% (21/21)   | 100.00% (2/2)   | 100.00% (5/5)   |
|--------------------------------+-------------------+-------------------+-----------------+-----------------|
| src/NostalgicJumpRateModel.sol | 100.00% (12/12)   | 100.00% (13/13)   | 100.00% (2/2)   | 100.00% (2/2)   |
|--------------------------------+-------------------+-------------------+-----------------+-----------------|
| src/NostalgicPool.sol          | 100.00% (145/145) | 100.00% (145/145) | 100.00% (33/33) | 100.00% (28/28) |
|--------------------------------+-------------------+-------------------+-----------------+-----------------|
| Total                          | 100.00% (260/260) | 100.00% (265/265) | 100.00% (67/67) | 100.00% (51/51) |
╰--------------------------------+-------------------+-------------------+-----------------+-----------------╯

Run the full test suite:

forge test

For more detailed output:

forge test -vvv

🧰 Project Structure

src/
 ├─ interfaces/
 │   ├─ NostalgicController.sol
 │   ├─ NostalgicFactory.sol
 │   ├─ NostalgicJumpRateModel.sol
 └─  └─ NostalgicPool.sol

⚙️ Setup

Clone the repository and install dependencies:

git clone https://github.com/typicalHuman/nostalgia.git
cd nostalgia
forge install

Build the contracts:

forge build