Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MyLending Protocol

A decentralized lending protocol built with Solidity and Foundry.

Users can deposit ETH as collateral, borrow USDC, repay loans, and withdraw collateral.

This project is created for learning and demonstrating DeFi lending mechanisms, smart contract security, and testing practices.


Features

Lending

  • Deposit ETH as collateral
  • Borrow USDC against collateral
  • Repay borrowed USDC
  • Withdraw collateral after repayment

Collateral Management

  • ETH price fetched through Chainlink Price Feed
  • Collateral ratio validation
  • Health factor calculation

Security

Implemented:

  • Reentrancy protection using OpenZeppelin ReentrancyGuard
  • Checks-Effects-Interactions pattern
  • Input validation
  • Oracle price validation

Tech Stack

  • Solidity ^0.8.x
  • Foundry
  • OpenZeppelin Contracts
  • Chainlink Price Feed
  • Ethereum Virtual Machine (EVM)

Contract Architecture

About

Simple lending contract with a collateral ratio of 150%, a liquidation threshold of 120%, and a liquidator reward of 5%.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages