logo

Defi Stablecoin

Users can deposit WETH and WBTC in exchange for a token that will be pegged to the USD.

Contract (Sepolia)
  • Users can deposit WETH & WBTC for a USD-pegged token.
  • Implemented minting, burning, transfers, and liquidations.
  • Utilized extensive unit and fuzz testing to ensure security.

Description

This DeFi stablecoin offers a user-friendly and secure way to access a USD-pegged token. Users can deposit popular crypto assets like Wrapped Ether (WETH) or Wrapped Bitcoin (WBTC) as collateral. These deposited assets back the value of the stablecoin, ensuring it remains consistently tied to the US dollar. A secure Chainlink oracle feed acts as a reliable source of real-time USD price data. This data is constantly integrated into the system, automatically adjusting the protocol to maintain a one-to-one peg between the stablecoin and the US dollar.

Users enjoy complete control over their holdings. They can burn their stablecoins at any time to redeem their original WETH or WBTC collateral. The system constantly monitors the collateralization ratio (the value of deposited assets compared to outstanding stablecoins). If a user's collateral falls below a minimum threshold (under-collateralized), any other user can initiate a liquidation process. This process incentivizes other users, known as liquidators, to remove the under-collateralized debt from the system. Liquidators receive rewards for their participation, ensuring the protocol remains solvent and maintains its overall stability.

Security is a top priority for this DeFi stablecoin. The underlying smart contracts are rigorously tested using Foundry's comprehensive unit and fuzz testing tools. Unit testing verifies the individual functionalities of the smart contracts, while fuzz testing bombards the system with unexpected inputs to uncover potential vulnerabilities. This multi-layered testing approach helps identify and eliminate potential security risks before they can impact users or the stability of the protocol. By prioritizing security, this DeFi stablecoin provides a safe and reliable platform for users to access a USD-pegged token within the decentralized finance ecosystem.