How muhammadjehanzaib/defi-stablecoin works
Project type and purpose
• This is a Foundry-based Solidity project implementing an algorithmic, exogenously-collateralized stablecoin pegged to $1. It uses Chainlink Price Feeds for on-chain oracle data, allows users to exchange ETH and BTC for the stablecoin, and features decentralized minting and burning mechanisms.
File structure
• Top-level files:
• foundry.toml – Foundry config (compiler, paths, network settings)
• .gitmodules – Git submodule links to external smart-contract libraries
• README.md – Project goals and mechanisms
• Directories:
• src/ – Core Solidity contracts
– Libraries/ – Helper contracts and shared logic modules
• lib/ – Submodules with external dependencies
– openzeppelin-contracts/
– chainlink-brownie-contracts/
– forge-std/
• script/ – Deployment and management scripts (Forge scripts)
• test/ – Unit tests, fuzz tests, mock contracts
README for additional insights
• Peg mechanism: anchored to $1 via Chainlink price feeds
• Exchange function: swap ETH & BTC for stablecoin at real‐time price
• Minting: algorithmic, decentralized stability mechanism
• Collateral: exogenous crypto (users deposit ETH/BTC)