{"id":15291919,"url":"https://github.com/cgrade/foundry-defi-stablecoin","last_synced_at":"2025-03-24T09:41:18.559Z","repository":{"id":257607776,"uuid":"850935454","full_name":"cgrade/foundry-defi-stablecoin","owner":"cgrade","description":"The Decentralized Stable Coin (DSC) project implements a decentralized stablecoin system that is algorithmically stabilized and pegged to the USD. The system is designed to maintain a 1:1 value with the USD while being overcollateralized with exogenous assets such as WETH and WBTC. This project includes the core smart contracts for the stablecoin, ","archived":false,"fork":false,"pushed_at":"2024-11-10T00:23:49.000Z","size":29,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-29T15:12:14.490Z","etag":null,"topics":["account","account-abstraction","foundry","openzeppelin-contracts","solidity","solidity-contracts","stablecoin","zksync-era"],"latest_commit_sha":null,"homepage":"","language":"Solidity","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cgrade.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-02T05:48:03.000Z","updated_at":"2024-11-10T00:25:44.000Z","dependencies_parsed_at":"2024-11-10T02:16:52.158Z","dependency_job_id":null,"html_url":"https://github.com/cgrade/foundry-defi-stablecoin","commit_stats":null,"previous_names":["cgrade/foundry-defi-stablecoin"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgrade%2Ffoundry-defi-stablecoin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgrade%2Ffoundry-defi-stablecoin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgrade%2Ffoundry-defi-stablecoin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgrade%2Ffoundry-defi-stablecoin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cgrade","download_url":"https://codeload.github.com/cgrade/foundry-defi-stablecoin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245247247,"owners_count":20584319,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["account","account-abstraction","foundry","openzeppelin-contracts","solidity","solidity-contracts","stablecoin","zksync-era"],"created_at":"2024-09-30T16:15:06.369Z","updated_at":"2025-03-24T09:41:18.532Z","avatar_url":"https://github.com/cgrade.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Decentralized Stable Coin (DSC) Project\n\n## Overview\n\nThe Decentralized Stable Coin (DSC) project implements a decentralized stablecoin system that is algorithmically stabilized and pegged to the USD. The system is designed to maintain a 1:1 value with the USD while being overcollateralized with exogenous assets such as WETH and WBTC. This project includes the core smart contracts for the stablecoin, its engine, and deployment scripts.\n\n## Core Components\n\n### 1. Smart Contracts\n\n- **DecentralizedStableCoin.sol**: Implements the ERC20 standard for the stablecoin, allowing minting and burning of tokens.\n- **DSCEngine.sol**: Manages the logic for minting and redeeming the stablecoin, as well as handling collateral deposits and withdrawals.\n- **HelperConfig.s.sol**: Provides configuration for deploying the DSC and DSCEngine contracts, including network-specific settings and mock price feeds for testing.\n\n### 2. Mock Contracts\n\n- **MockV3Aggregator.t.sol**: A mock implementation of a price aggregator for testing purposes, simulating the behavior of a price feed.\n\n### 3. Deployment Scripts\n\n- **DeployDSC.s.sol**: Script for deploying the Decentralized Stable Coin and its associated DSCEngine, setting up necessary configurations and addresses.\n\n### 4. Unit Tests\n\n- **DSCEngineTest.t.sol**: Contains unit tests for the DSCEngine contract, ensuring the functionality of collateral deposits, price feed retrieval, and error handling.\n\n## Project Structure\n\n```\nproject-root/\n│\n├── script/\n│   ├── DeployDSC.s.sol\n│   └── HelperConfig.s.sol\n│\n├── src/\n│   ├── DecentralizedStableCoin.sol\n│   └── DSCEngine.sol\n│\n├── test/\n│   ├── mocks/\n│   │   └── MockV3Aggregator.t.sol\n│   └── unit/\n│       └── DSCEngineTest.t.sol\n│\n└── README.md\n```\n\n## Installation\n\nTo get started with the project, follow these steps:\n\n1. **Clone the repository**:\n\n   ```bash\n   git clone \u003crepository-url\u003e\n   cd \u003crepository-directory\u003e\n   ```\n\n2. **Install dependencies**:\n   Ensure you have [Foundry](https://book.getfoundry.sh/) installed. Then run:\n\n   ```bash\n   forge install\n   ```\n\n3. **Compile the contracts**:\n\n   ```bash\n   forge build\n   ```\n\n4. **Run tests**:\n   ```bash\n   forge test\n   ```\n\n## Usage\n\n### Deploying the Contracts\n\nTo deploy the DSC and DSCEngine contracts, run the following command:\n\n```bash\nforge script script/DeployDSC.s.sol --broadcast\n```\n\n### Interacting with the Contracts\n\nOnce deployed, you can interact with the contracts using a web3 provider or through a frontend application. The `DSCEngine` contract provides functions for depositing collateral, minting DSC, and redeeming collateral.\n\n## Testing\n\nThe project includes unit tests for the `DSCEngine` contract. To run the tests, use the following command:\n\n```bash\nforge test\n```\n\n## Contributing\n\nContributions are welcome! If you have suggestions for improvements or find bugs, please open an issue or submit a pull request.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more details.\n\n## Acknowledgments\n\n- Special thanks to the OpenZeppelin team for their ERC20 implementation and security libraries.\n- Thanks to Chainlink for providing reliable price feeds.\n\n```\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcgrade%2Ffoundry-defi-stablecoin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcgrade%2Ffoundry-defi-stablecoin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcgrade%2Ffoundry-defi-stablecoin/lists"}