https://github.com/ehsan-the-coder/stablecoin
This project is meant to be a stablecoin where users can deposit any token (but must be listed on chainlink pricefeed) in exchange for a token that will be pegged to the USD.
https://github.com/ehsan-the-coder/stablecoin
Last synced: 3 months ago
JSON representation
This project is meant to be a stablecoin where users can deposit any token (but must be listed on chainlink pricefeed) in exchange for a token that will be pegged to the USD.
- Host: GitHub
- URL: https://github.com/ehsan-the-coder/stablecoin
- Owner: Ehsan-The-Coder
- Created: 2024-02-12T06:48:33.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-04-25T00:15:16.000Z (about 1 year ago)
- Last Synced: 2025-01-08T22:46:16.917Z (4 months ago)
- Language: Solidity
- Size: 70.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Decentralized Stablecoin
This project is a DeFi application that enables users to mint, burn, and manage a stablecoin (SC) backed by real-world assets and pegged to the US dollar. The system leverages Chainlink oracles for real-time price feeds and OpenZeppelin for secure smart contract development.
## Features
- Exogenously Collateralized: Uses external assets as collateral to ensure SC value stability.
- Dollar Pegged: Maintains a 2:1 value with the US dollar, offering a stable and predictable currency.
- Algorithmically Stable: Uses sophisticated algorithms to manage supply and demand in volatile markets.
- Overcollateralization: Requires overcollateralization to ensure system security and stability.## Technologies Used
- Solidity: The programming language used to write smart contracts for the Ethereum blockchain.
- Chainlink: Provides real-time price feeds to smart contracts, ensuring accurate valuation of collateral.
- Foundry: A development environment for Ethereum that allows for compiling, testing, and deploying smart contracts.
- OpenZeppelin: Library for secure smart contract development.## Project Structure
- src: Contains the smart contracts (SCEngine.sol, StableCoin.sol), library contracts (ChainlinkManager.sol, Utilis.sol), and test files for the smart contracts.
- script: Contains deployment scripts for the smart contracts & mocks contracts for testing purpose.
- test: Contains unit and fuzz tests for the project.
├── lib
├── script>
│ └── deploy
│ ├── DeploySCEngine.s.sol
│ ├── HelperConfig.s.sol
│ └── mocks
│ └── all mock contracts & deployments
├── src
│ ├── SCEngine.sol
│ ├── StableCoin.sol
│ └── Libraries
│ ├── ChainlinkManager.sol
│ └── Utilis.sol
├── test
│ └── fuzz
│ └── unit
├── README.md
├── foundry.toml
## Getting Started
To get started with this project, clone the repository and install the dependencies:
## Prerequisites
- Bash
- Foundry
- Ethereum wallet### Quickstart
Clone the repository and navigate to the newly created folder:
```bash
git clone https://github.com/Ehsan-The-Coder/StableCoin.git
cd StableCoin
forge install
```### Build
```bash
forge build
```### Testing
```bash
forge test
``````bash
forge test --match-test your-test-name
```### Test Coverage
```bash
forge coverage
```and for coverage based testing:
```bash
forge coverage --report debug
```### Usage with a local node
```bash
anvil
```
## License
This project is licensed under the MIT License.
## Acknowledgments
- [Solidity](https://soliditylang.org/)
- [Foundry](https://https://book.getfoundry.sh/)
- [Chainlink](https://docs.chain.link/data-feeds/price-feeds/)
- [OpenZeppelin](https://openzeppelin.com/)
- [PatrickCollins](https://github.com/PatrickAlphaC)## Connect with me
- [Linkedin](https://www.linkedin.com/in/ehsanthecoder/)
- [X/Twitter](https://twitter.com/ehsanthecoder)
- [Github](https://github.com/Ehsan-The-Coder)
- [Gmail] [email protected]