Skip to content

AlbertKacirek/DecentralizedStableCoin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Decentralized Stablecoin (DSC)

This project implements a decentralized, algorithmic stablecoin system on Ethereum. Users can deposit WETH and WBTC as collateral to mint DSC, a token pegged to USD.

Features

  • Pegged to USD: DSC maintains a 1:1 peg to the US Dollar.
  • Exogenous Collateral: Only WETH and WBTC are accepted as collateral.
  • Algorithmic Stability: No governance or fees; stability is enforced by smart contract logic.
  • Overcollateralization: The system ensures all DSC is backed by more collateral than its value.

Contracts

  • DSCEngine: Core logic for minting, redeeming, collateral management, and liquidation.
  • DecentralizedStableCoin: ERC20 implementation of DSC, with mint/burn restricted to DSCEngine.
  • HelperConfig: Network configuration and mock deployment for local testing.
  • OracleLib: Chainlink price feed safety checks.
  • MockV3Aggregator: Chainlink price feed mock for tests.

Getting Started

Prerequisites

  • Foundry
  • Node.js (for some scripts)
  • Git (with submodules)

Installation

git clone --recurse-submodules <repo-url>
cd stablecoin
forge install

Compile

forge build

Test

forge test --coverage

Usage

Deploy contracts using the provided scripts:

forge script script/DeployDSC.s.sol --rpc-url <your_rpc_url> --broadcast

Testing

  • Unit tests: test/unit/
  • Fuzz/invariant tests: test/fuzz/
  • Coverage report: coverage.txt

Project Structure

  • src/: Main contracts
  • script/: Deployment and config scripts
  • test/: Unit and fuzz tests
  • lib/: External dependencies (OpenZeppelin, Chainlink, Forge Std)

Contributing

Pull requests and issues are welcome! Please:

  • Write clear commit messages
  • Add/modify tests for new features
  • Follow Solidity best practices

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors