{"id":24418734,"url":"https://github.com/ronfflex/fundraising","last_synced_at":"2025-03-13T13:21:37.117Z","repository":{"id":263514950,"uuid":"890648667","full_name":"Ronfflex/Fundraising","owner":"Ronfflex","description":"A small complete Solidity fundraising project","archived":false,"fork":false,"pushed_at":"2024-11-19T00:01:52.000Z","size":46,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-20T09:13:14.079Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/Ronfflex.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-11-18T23:58:36.000Z","updated_at":"2024-11-19T00:01:56.000Z","dependencies_parsed_at":"2024-11-19T01:17:48.167Z","dependency_job_id":"2beaa5fd-8b47-4e67-8323-e89cb8b6837c","html_url":"https://github.com/Ronfflex/Fundraising","commit_stats":null,"previous_names":["ronfflex/fundraising"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ronfflex%2FFundraising","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ronfflex%2FFundraising/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ronfflex%2FFundraising/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ronfflex%2FFundraising/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ronfflex","download_url":"https://codeload.github.com/Ronfflex/Fundraising/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243410569,"owners_count":20286433,"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":[],"created_at":"2025-01-20T09:13:16.105Z","updated_at":"2025-03-13T13:21:37.086Z","avatar_url":"https://github.com/Ronfflex.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fundraising Smart Contract System\n\nA decentralized fundraising platform allowing users to create and manage fundraising campaigns with ERC20 token contributions.\n\n## Architecture\n\n```\nfundraising/\n├── src/\n│   ├── interface/\n│   │   ├── IFundraisingCampaign.sol     # Campaign interface\n│   │   └── IFundraisingFactory.sol      # Factory interface\n│   ├── FundraisingFactory.sol           # Main factory contract\n│   ├── FundraisingCampaign.sol          # Individual campaign contract\n├── test/\n│   ├─ mock/\n│   │   └── MockERC20.sol                # Mock ERC20 for testing\n│   ├── FundraisingFactory.t.sol         # Factory tests\n│   └── FundraisingCampaign.t.sol        # Campaign tests\n├── script/\n│   ├── Deploy.s.sol                     # Deployment scripts\n│   └── Interactions.s.sol               # Interaction scripts\n└── lib/\n    └── openzeppelin-contracts/          # Dependencies\n```\n\n## Features\n\n### Factory Contract\n- Campaign request submission\n- Owner approval/rejection system\n- Campaign deployment management\n- Request status tracking\n- Campaign registry\n\n### Campaign Contract\n- Multi-token contribution support\n- Min/Max amount enforcement\n- Timeline management\n- Claim/Refund system\n- Campaign status tracking\n\n## Technical Stack\n\n- Solidity 0.8.28\n- Foundry Framework\n- OpenZeppelin 5.x.x\n  - Ownable\n  - SafeERC20\n  - ReentrancyGuard\n\n## Test Coverage\n\n```bash\n| File                        | % Lines         | % Statements    | % Branches      | % Funcs        |\n|-----------------------------|-----------------|-----------------|-----------------|----------------|\n| src/FundraisingCampaign.sol | 100.00% (38/38) | 100.00% (42/42) | 100.00% (32/32) | 100.00% (5/5)  |\n| src/FundraisingFactory.sol  | 100.00% (24/24) | 100.00% (24/24) | 100.00% (16/16) | 100.00% (5/5)  |\n```\n\n## Installation\n\n1. Clone the repository\n```bash\ngit clone https://github.com/Ronfflex/Fundraising.git\ncd fundraising\n```\n\n2. Install dependencies\n```bash\nforge install\n```\n\n3. Build the project\n```bash\nforge build\n```\n\n## Testing\n\nRun the complete test suite:\n```bash\nforge test\n```\n\nRun with verbosity:\n```bash\nforge test -vvv\n```\n\nGenerate coverage report:\n```bash\nforge coverage --report lcov\n```\n\n## Deployment\n\n1. Set up your environment variables in `.env`:\n```env\nPRIVATE_KEY=your_private_key\nRPC_URL=your_rpc_url\nETHERSCAN_API_KEY=your_etherscan_api_key\n```\n\n2. Deploy the contracts:\n```bash\nforge script script/Deploy.s.sol --rpc-url $RPC_URL --broadcast --verify\n```\n\n## Contract Interactions\n\nThe project includes scripts for common interactions:\n\n1. Create a new campaign:\n```bash\nforge script script/Interactions.s.sol:InteractionsScript --sig \"createCampaign()\" --rpc-url $RPC_URL --broadcast\n```\n\n2. Review a campaign:\n```bash\nforge script script/Interactions.s.sol:InteractionsScript --sig \"reviewCampaign(uint256,bool)\" \u003crequest_id\u003e true --rpc-url $RPC_URL --broadcast\n```\n\n3. Contribute to a campaign:\n```bash\nforge script script/Interactions.s.sol:InteractionsScript --sig \"contributeToCampaign(address,uint256,address)\" \u003ccampaign_address\u003e \u003camount\u003e \u003ctoken_address\u003e --rpc-url $RPC_URL --broadcast\n```\n\n## Smart Contract Architecture\n\n### Factory Pattern\n```mermaid\ngraph TD\n    A[FundraisingFactory] --\u003e|deploys| B[FundraisingCampaign]\n    A --\u003e|manages| C[Campaign Requests]\n    B --\u003e|accepts| D[ERC20 Contributions]\n    B --\u003e|manages| E[Fund Distribution]\n```\n\n### State Flow\n```mermaid\nstateDiagram-v2\n    [*] --\u003e Pending: Request Submitted\n    Pending --\u003e Accepted: Owner Approves\n    Pending --\u003e Rejected: Owner Rejects\n    Accepted --\u003e Active: Campaign Started\n    Active --\u003e Successful: Target Reached\n    Active --\u003e Failed: Target Not Reached\n    Successful --\u003e [*]: Funds Claimed\n    Failed --\u003e [*]: Funds Refunded\n```\n\n## Security Features\n\n1. **Access Control**\n   - Ownable pattern for factory management\n   - Creator-only access for campaign management\n\n2. **Safety Measures**\n   - ReentrancyGuard for all fund operations\n   - SafeERC20 for token transfers\n   - Checks-Effects-Interactions pattern\n\n3. **Timeline Enforcement**\n   - Start/End date validation\n   - Status-based operation control\n\n4. **Amount Controls**\n   - Minimum/Maximum target validation\n   - Contribution limit checks\n\n## License\n\nMIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fronfflex%2Ffundraising","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fronfflex%2Ffundraising","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fronfflex%2Ffundraising/lists"}