A powerful, gas-efficient, and modular decentralized finance (DeFi) protocol enabling users to borrow against collateral and repay loans seamlessly using multiple supported tokens on Core Testnet.
🧠 GitHub Repository: https://github.com/coredao-org/dapp-tutorial
- 🏦 Lend & Borrow: Supply collateral and borrow from a selection of supported tokens.
- 🔄 Repay System: Easily repay borrowed tokens with calculated interest.
- 🔍 Loan Viewer: See real-time loan data per token pair.
- 🧠 ERC-20 Support: Currently supports USDT, USDC, and DAI.
- ⚙️ Smart Contract Factory Pattern: Optimized to manage lending pools and loan data per user.
git clone https://github.com/coredao-org/dapp-tutorial.git
cd dapp-tutorial/14-CoreLendCreate a .env file in the root directory and add your private key:
PRIVATE_KEY=your_private_key_herenpm installYou can deploy the lending contract to Core Testnet using Hardhat.
npx hardhat compileUpdate your hardhat.config.ts with Core Testnet RPC and run:
npx hardhat run scripts/deploy.ts --network coreTestnetMake sure your
.envcontains a funded private key for the Core Testnet.
To interact with the protocol using tUSDT, tDAI, or tUSDC test tokens, visit:
🧴 Token Faucet: https://token-faucet-sandy.vercel.app
You’ll receive tokens compatible with CoreLend’s supported assets.
Navigate into the frontend directory and run:
cd frontend
npm install
npm run devThe dApp will be live at
http://localhost:3000
├── contracts/ # Lending smart contracts (CoreLend.sol)
├── frontend/ # Frontend application (Next.js + Ethers.js)
├── scripts/ # Hardhat deployment scripts
│ └── deploy.js # Deploys the CoreLend contract
├── hardhat.config.js # Network configuration
├── .env # Private key for deployment
└── README.md
- Solidity – Smart contract language
- Hardhat – Smart contract dev environment
- Next.js – React-based frontend framework
- Tailwind CSS – Styling
- Ethers.js – Web3 provider
- Core Blockchain – Testnet deployment
Got an idea to improve the protocol? Feel free to:
- Fork the repo
- Submit issues
- Propose pull requests
We welcome community contributions!