The DSC Protocol is a decentralized finance (DeFi) protocol designed to create a decentralized stablecoin (DSC) that is algorithmically pegged to the US Dollar (USD). Users can mint DSC by storing collateral and burn it to release the collateral. The protocol supports exogenous collateral types, specifically Ethereum (ETH) and Bitcoin (BTC).
- Decentralized Stablecoin: The DSC is algorithmically pegged to the USD.
- Collateralized Minting: Users can mint DSC by depositing collateral (ETH or BTC) and burn DSC to release their collateral.
- Chainlink Price Feeds: Reliable and tamper-proof price feeds are used to determine the value of collateral assets.
- OpenZeppelin: Secure and audited smart contract libraries are used for contract and token creation.
- DSC: The ERC20 token representing the stablecoin.
- DSCEngine: The core engine that handles minting and burning of DSC by managing collateral.
The protocol accepts the following types of collateral:
- Ethereum (ETH)
- Bitcoin (BTC)
The protocol relies on Chainlink price feeds to fetch the current market prices of ETH and BTC.
- Foundry
- Chainlink
- OpenZeppelin
-
Clone the repository:
git clone https://github.com/fraolb/Defi_protocol.git cd Defi_protocol -
Install dependencies:
forge install ...
-
Compile the contracts:
forge build
To deploy the DSC protocol to a local blockchain, run:
forge script/DeployDSC.s.solTo run tests, use:
forge testTo mint DSC, users need to deposit collateral (ETH or BTC) to the DSCEngine contract. The amount of DSC minted will be determined by the value of the collateral deposited.
To burn DSC and release the collateral, users need to send DSC to the DSCEngine contract. The collateral will be released back to the user in proportion to the amount of DSC burned.
The DSC protocol uses OpenZeppelin libraries to ensure the security and reliability of smart contracts. Chainlink price feeds provide secure and accurate market data for collateral valuation.
This project is licensed under the MIT License. See the LICENSE file for details.
For any questions or inquiries, please contact us at fraolbereket@gmail.com.