Thank you for your interest in contributing to the Creative Crowdfunding Protocol! This document provides detailed guidelines to help you contribute effectively.
- Code of Conduct
- Getting Started
- Development Workflow
- Smart Contract Development Guidelines
- Pull Request Process
- Community
Please read our Code of Conduct to understand the behavior we expect from all contributors.
If you want to add or modify the content of this project:
- Search if an issue already exists
- If a related issue doesn't exist, create a new issue using the appropriate template
- Discuss the proposed changes with the community before starting work
- Wait for issue assignment or approval before submitting a PR
Scan through our existing issues to find one that interests you. You can use labels to filter issues:
good first issue: Suitable for newcomersbug: Issues with the existing codeenhancement: New features or improvementsdocumentation: Documentation improvementshelp wanted: Issues where help is particularly needed
- Fork the repository
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/ccprotocol-contracts.git cd ccprotocol-contracts - Add the original repository as upstream:
git remote add upstream https://github.com/ccprotocol/ccprotocol-contracts.git
- Install development dependencies:
forge install
- Copy and configure environment variables:
cp .env.example .env # Edit .env with your settings
main: Production-ready codedevelop: Integration branch for features- Feature branches: Named as
feature/your-feature-name - Bug fix branches: Named as
fix/bug-name
Always create your working branch from develop:
git checkout develop
git pull upstream develop
git checkout -b feature/your-feature-name- Ensure your changes address a specific issue
- Make commits with clear, descriptive messages
- Keep changes focused and atomic
- Rebase your branch regularly to incorporate upstream changes:
git fetch upstream git rebase upstream/develop
All code changes must include appropriate tests:
- Write unit tests for new functionality
- Run the test suite to ensure all tests pass:
forge test - For more detailed test output:
forge test -vvv - Run gas reports to ensure efficiency:
forge test --gas-report
- Update or add NatSpec comments for all public functions:
/** * @notice Brief explanation of the function * @param paramName Description of the parameter * @return Description of the return value */ function exampleFunction(uint256 paramName) public returns (bool) { // Function implementation }
- Update relevant documentation in the
docs/directory - Include a summary of documentation changes in your PR
- Follow established security patterns
- Use OpenZeppelin contracts where appropriate
- Be aware of common vulnerabilities (reentrancy, frontrunning, etc.)
- Avoid complex control flows that are difficult to audit
- Consider formal verification for critical functions
- Be mindful of storage vs. memory usage
- Batch operations when possible
- Use appropriate data types (uint256 is often most gas-efficient)
- Consider gas costs in loops and data structures
- Include gas reports in PRs for significant changes
- Follow Solidity style guides
- Use meaningful variable and function names
- Format your code using the prettier
- Keep functions small and focused
- Use appropriate visibility modifiers (public, external, internal, private)
- Update the README or documentation if needed
- Ensure all CI checks pass
- Create a pull request to the
developbranch - Fill in the PR template with all required information
- Request review from relevant team members
- PR title should be descriptive and reference the issue (e.g., "Fix #123: Add timestamp validation")
- All tests must pass
- Code must be properly formatted
- New code should be covered by tests
- Changes should be well-documented
- Commit history should be clean and logical
- At least one core contributor must review and approve the changes
- Address all review comments promptly
- CI checks must pass
- Changes may require revision based on feedback
- Once approved, a maintainer will merge the PR
- GitHub Issues: For bugs and feature requests
- Discord: For quick questions and community discussions
- Pull Requests: For code review discussions
Join our community on Discord.
By contributing to CC Protocol, you agree that your contributions will be licensed under the project's MIT License.