{"id":18780529,"url":"https://github.com/barkprotocol/crowdfunding-program-test","last_synced_at":"2025-12-18T21:30:16.265Z","repository":{"id":255011789,"uuid":"848258736","full_name":"barkprotocol/crowdfunding-program-test","owner":"barkprotocol","description":"the BARK Protocol's Solana-based crowdfunding program, developed using Anchor. This program enables users to create and manage crowdfunding campaigns on the Solana blockchain. ","archived":false,"fork":false,"pushed_at":"2024-08-27T13:14:50.000Z","size":72,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-29T10:44:15.562Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/barkprotocol.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-08-27T12:39:32.000Z","updated_at":"2024-08-27T13:14:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"090ef27a-71b4-435f-b049-356630347598","html_url":"https://github.com/barkprotocol/crowdfunding-program-test","commit_stats":null,"previous_names":["barkprotocol/crowdfunding-program-test"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barkprotocol%2Fcrowdfunding-program-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barkprotocol%2Fcrowdfunding-program-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barkprotocol%2Fcrowdfunding-program-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barkprotocol%2Fcrowdfunding-program-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/barkprotocol","download_url":"https://codeload.github.com/barkprotocol/crowdfunding-program-test/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239696441,"owners_count":19682236,"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":"2024-11-07T20:26:56.215Z","updated_at":"2025-12-18T21:30:16.198Z","avatar_url":"https://github.com/barkprotocol.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Crowdfunding Program and Crowdfunding Platform Backend\n\n## Overview\n\nWelcome to the BARK Protocol's Solana-based crowdfunding program, developed using Anchor. This program enables users to create and manage crowdfunding campaigns on the Solana blockchain. It includes comprehensive features for campaign management, donation handling, updates, refunds, and more. \n\nAdditionally, the program provides a backend for integrating with various platform features, enhancing functionality, and managing campaign data efficiently.\n\n## Features\n\n- **Create Campaign**: Set up a new crowdfunding campaign with details such as title, description, goal, and timing constraints.\n- **Cancel Campaign**: Abort a campaign before it starts.\n- **Donate**: Contribute funds to an ongoing campaign.\n- **Cancel Donation**: Withdraw a donation and receive a refund if the campaign has not ended.\n- **Claim Donations**: Retrieve the total funds donated to a campaign upon its successful completion.\n- **Update Campaign Metadata**: Change details of an existing campaign.\n- **Refund Donations**: Return donations if the campaign fails to meet its goal or is unsuccessful.\n- **Extend Campaign**: Extend the end date of an active campaign.\n- **Close Campaign**: Close a campaign before its scheduled end date.\n\n## Getting Started\n\n### Prerequisites\n\nEnsure you have the following tools installed:\n\n- **Rust**: Install Rust using [rustup](https://rustup.rs/).\n- **Anchor**: Install the Anchor CLI by following [Anchor's installation guide](https://project-serum.github.io/anchor/getting-started/installation.html).\n- **Solana CLI**: Install Solana CLI tools from [Solana's installation guide](https://docs.solana.com/cli/install-solana-cli-tools).\n\n### Installation\n\n1. **Clone the repository:**\n\n    ```sh\n    git clone https://github.com/barkprotocol/crowdfunding-program.git\n    cd crowdfunding-program\n    ```\n\n2. **Build the program:**\n\n    ```sh\n    anchor build\n    ```\n\n3. **Set up your local environment:**\n\n    - Start a local Solana test validator:\n\n        ```sh\n        solana-test-validator\n        ```\n\n    - Configure your Solana CLI to use the local test validator:\n\n        ```sh\n        solana config set --url localhost\n        ```\n\n### Running Tests\n\n1. **Deploy the program to the local test validator:**\n\n    ```sh\n    anchor deploy\n    ```\n\n2. **Execute the test suite:**\n\n    ```sh\n    anchor test\n    ```\n\n## Usage\n\n### Creating a Campaign\n\nTo create a new campaign, use the `create_campaign` function with necessary details:\n\n```sh\nanchor run create_campaign --title \"Campaign Title\" --description \"Campaign Description\" --org_name \"Organization Name\" --project_link \"http://project.link\" --project_image \"http://image.link\" --goal 1000000 --start_at 1672531200 --end_at 1675123200\n```\n\n### Donating to a Campaign\n\nTo donate to a campaign, use the `donate` function:\n\n```sh\nanchor run donate --campaign \"CAMPAIGN_PUBLIC_KEY\" --amount 50000\n```\n\n### Canceling a Donation\n\nTo cancel a donation and receive a refund, use the `cancel_donation` function:\n\n```sh\nanchor run cancel_donation --campaign \"CAMPAIGN_PUBLIC_KEY\"\n```\n\n### Claiming Donations\n\nTo claim funds from a successfully completed campaign, use the `claim_donations` function:\n\n```sh\nanchor run claim_donations --campaign \"CAMPAIGN_PUBLIC_KEY\"\n```\n\n### Updating Campaign Metadata\n\nTo update metadata for an existing campaign, use the `update_campaign_metadata` function:\n\n```sh\nanchor run update_campaign_metadata --campaign \"CAMPAIGN_PUBLIC_KEY\" --title \"Updated Title\"\n```\n\n### Extending a Campaign\n\nTo extend the end date of a campaign, use the `extend_campaign` function:\n\n```sh\nanchor run extend_campaign --campaign \"CAMPAIGN_PUBLIC_KEY\" --new_end_at 1687238400\n```\n\n### Closing a Campaign\n\nTo close a campaign before its end date, use the `close_campaign` function:\n\n```sh\nanchor run close_campaign --campaign \"CAMPAIGN_PUBLIC_KEY\"\n```\n\n## Events\n\nThe program emits events to signal important actions:\n\n- `CampaignCreated`\n- `CampaignCancelled`\n- `DonationReceived`\n- `DonationCancelled`\n- `DonationsClaimed`\n- `CampaignMetadataUpdated`\n- `DonationRefunded`\n- `CampaignExtended`\n- `CampaignClosed`\n\nThese events can be used for real-time updates and integration with off-chain systems.\n\n## Contributing\n\nContributions are welcome! Please submit issues or pull requests for any improvements or bug fixes. Ensure that your contributions follow the code style guidelines and include relevant tests.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbarkprotocol%2Fcrowdfunding-program-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbarkprotocol%2Fcrowdfunding-program-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbarkprotocol%2Fcrowdfunding-program-test/lists"}