TrustCircle is an advanced EVM-compatible decentralized lending protocol that combines on-chain reputation NFTs, social trust circles, dynamic interest rates, hybrid collateral lending, credit delegation, flash loans, and decentralized governance to create the most flexible peer-to-peer lending platform in DeFi. Built to win hackathons with cutting-edge features.
- Soulbound NFTs that represent user creditworthiness
- Evolving metadata with on-chain SVG generation
- 5 reputation tiers: Bronze โ Silver โ Gold โ Platinum โ Diamond
- Scores from 0-1000 points based on lending behavior
- Create or join small communities (3-15 members)
- Member vouching system increases borrowing capacity
- Collective responsibility with slashing mechanisms
- Trust score calculation across all circles
- Borrow based on reputation and social proof, not collateral
- Dynamic interest rates (3%-30%) based on reputation tier
- Flexible loan terms (7-365 days)
- Early repayment bonuses boost reputation
- Achievement NFTs with 9 different badges
- Reputation bonuses for unlocking achievements
- Progress tracking and milestone rewards
- Invite friends and earn reputation bonuses
- 30 points for referrer, 20 for new user
- Milestone bonuses every 5 referrals (+50 points)
- Timelock mechanism (7-day waiting period)
- Safer emergency fund access
- Reputation penalty for emergency use
- Complete Borrow Interface - Loan amount, duration, interest preview
- Complete Lend Interface - Deposit/withdraw with pool statistics
- Trust Circles Interface - Create circles, set requirements
- Loan Management - View all loans, repay directly
- Transaction Tracking - Real-time tx notifications with Etherscan links
- Analytics Dashboard - Protocol and user performance metrics โญ
- Leaderboard - Competitive rankings for borrowers, lenders, and circles โญ
- Enhanced Hero - Feature showcase for new users
- Extend loan duration up to 2 times per loan โญ
- Small 0.5% extension fee instead of default penalties
- Flexible 7-90 day extensions
- Reputation bonus for proactive management
- Borrow with partial collateral (50-150%) โญ
- 2-5x borrowing limit boost with collateral
- Up to 3% interest rate discount
- Liquidation protection mechanism
- Collateral returned on successful repayment
- High-reputation users share borrowing capacity โญ
- Set delegation limits and expiration
- Revoke anytime with full control
- Expand access to underserved users
- ERC20 governance token (TCG) โญ
- Stake for enhanced voting power (1.2x)
- Create and vote on protocol proposals
- Earn rewards for lending/borrowing
- 100 tokens per reputation tier milestone
- Zero-collateral instant loans โญ
- 0.09% flash loan fee
- No reputation requirement
- Perfect for arbitrage and liquidations
- Fees distributed to liquidity providers
Core Contracts:
- ReputationNFT.sol - Soulbound NFT with dynamic metadata and reputation scoring
- TrustCircle.sol - Circle creation, member management, and vouching system
- LendingPool.sol - Core lending/borrowing with dynamic rates
- AchievementBadges.sol - Gamification with achievement NFTs
- ReferralSystem.sol - User growth incentives with reputation bonuses
- EmergencyWithdraw.sol - Timelock mechanism for safer emergency withdrawals
- LoanExtension.sol - Request loan extensions with 5% fee
- GovernanceToken.sol - DAO-style voting on protocol parameters
- Leaderboard.sol - Track and rank top performers
New Advanced Features: โญ
- LoanExtension.sol - Loan refinancing and extension mechanism
- HybridLending.sol - Collateral-backed loans with boosted limits
- CreditDelegation.sol - Delegate borrowing power to trusted users
- GovernanceToken.sol - ERC20 token for protocol governance and rewards
- FlashLoan.sol - Flash loan implementation with 0.09% fee
- React + Vite - Modern, fast development experience
- Ethers.js - Web3 integration for wallet connection
- Premium UI/UX - Glassmorphism effects, gradient animations, responsive design
- Analytics Dashboard - Real-time protocol and user metrics โญ
- Leaderboard System - Gamified rankings with competitive elements โญ
- Node.js v18+
- MetaMask or compatible Web3 wallet
- Test ETH (Sepolia or Alfajores testnet)
# Clone the repository
git clone https://github.com/Gbangbolaoluwagbemiga/chinchin
cd chinchin
# Install dependencies
npm install
# Compile contracts
npx hardhat compile
# Run tests
npx hardhat test
# Deploy to local network
npx hardhat node
npx hardhat run scripts/deploy.js --network localhostcd frontend
npm install
npm run devUpdate contract addresses in frontend/src/App.jsx after deployment.
All 15 integration tests passing:
npx hardhat testTests cover:
- โ Reputation NFT minting and soulbound mechanics
- โ Reputation score updates and tier calculation
- โ Trust circle creation and member management
- โ Vouching system and trust score calculation
- โ Lending pool deposits and withdrawals
- โ Dynamic interest rate calculation
- โ Loan borrowing and repayment
- โ Achievement unlocking and reputation bonuses
- โ Full user journey from mint to repayment
chinchin/
โโโ contracts/ # Smart contracts
โ โโโ ReputationNFT.sol
โ โโโ TrustCircle.sol
โ โโโ LendingPool.sol
โ โโโ AchievementBadges.sol
โโโ scripts/ # Deployment scripts
โ โโโ deploy.js
โโโ test/ # Integration tests
โ โโโ Integration.test.js
โโโ frontend/ # React frontend
โ โโโ src/
โ โ โโโ App.jsx
โ โ โโโ App.css
โ โ โโโ index.css
โ โโโ package.json
โโโ hardhat.config.js
โโโ package.json
- Novel Problem: Addresses real financial inclusion challenges
- Technical Innovation: Combines DeFi + social proof in a unique way
- On-Chain Everything: All reputation and trust data verifiable on-chain
- Complete Solution: Smart contracts + tests + beautiful UI
- Demonstrable: Can show actual lending cycles in live demo
- Gamification: Achievement system increases engagement
- Real Impact: Enables lending for the unbanked/underbanked
- User mints Reputation NFT - Starting with 100 points (Bronze tier)
- Joins/creates Trust Circles - Connects with trusted community
- Receives vouches - Circle members vouch to boost trust score
- Borrows funds - Dynamic rate based on reputation (e.g., Diamond = 3%)
- Repays loan - On-time payment boosts reputation, unlocks achievements
- Reputation grows - Higher tier = better rates + higher limits
- Soulbound NFTs prevent reputation trading
- Access control for reputation updates
- Reentrancy guards on all financial functions
- Grace period before loan defaults
- Circle slashing for defaulters affects vouchers
Perfect for hackathon demos:
- New User Journey - Mint โ Circle โ Borrow โ Repay
- Reputation Growth - Show tier progression from Bronze to Diamond
- Trust Circle Impact - Demonstrate how vouches reduce interest rates
- Achievement Unlocks - Showcase gamification mechanics
- Solidity 0.8.24 - Smart contract language
- Hardhat - Development environment
- OpenZeppelin - Battle-tested contract libraries
- Ethers.js - Web3 integration
- React - Frontend framework
- Vite - Build tool
MIT
Built with inspiration from winning hackathon projects in DeFi, social lending, and on-chain reputation systems.
Ready to revolutionize peer-to-peer lending? Deploy TrustCircle and win your hackathon! ๐