Thank you for your interest in contributing to the Custos-Starknet project! This repository contains the smart contracts for Custos, written in Cairo using Scarb. We appreciate contributions of all types, whether it’s a bug fix, new feature, or improvement to our documentation. Please follow the guidelines below to ensure a smooth contribution process.
- Code of Conduct
- How to Contribute
- Development Environment Setup
- Project Setup
- Testing Guidelines
- Branching and Commit Guidelines
- Pull Requests
- Workflow Examples
- Coding Standards
- Issue Reporting
- Resources
- License
Please adhere to our Code of Conduct. We expect all contributors to maintain professionalism and respect when engaging with the community.
There are several ways to contribute to Custos-Starknet:
- Report Bugs: Open an issue to report bugs.
- Suggest Features: Open an issue to suggest new features.
- Fix Bugs or Implement Features: Check open issues and submit a pull request with your contributions.
- Improve Documentation: Enhancing documentation is always welcome.
i. Rust Installation(required for Scarb)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env
-
For macOS/Linux:
curl --proto '=https' --tlsv1.2 -sSf https://docs.swmansion.com/scarb/install.sh | sh
-
For Windows:
- Download the installer from Scarb releases
- Add Scarb to your system PATH
- VS Code Extensions(recommended)
- Cairo Language Support
- Scarb Build Tools
- Better TOML
To contribute, you need to set up the project locally:
- Fork the repository.
- Clone your fork:
git clone https://github.com/your-username/custos-starknet.git
- Navigate to the project directory:
cd custos-starknet
- Install Scarb if you haven't already: Scarb Installation Guide.
- Install Project Dependencies:
scarb build
- Run tests:
scarb test
- Make sure everything works before making changes.
scarb test
#[test]
fn test_something() {
// Arrange
// Act
// Assert
}
- Use descriptive names.
- Example:
test_deposit_with_valid_amount_succeeds
-
Branch Naming:
feature/your-feature-name
for new features.bugfix/issue-number-description
for bug fixes.
-
Commit Messages:
- Use clear, concise messages that describe what the commit does.
- Example:
feat: add new collateralization feature for loan contracts
- Ensure your branch is up to date with the main branch.
- Push your changes and open a PR against
master
. - Provide a detailed description of your changes.
- Link any relevant issues.
-
Create feature branch:
git checkout -b feature/<new-feature-name>
-
Implement feature and tests:
# Write your code # Add tests scarb test
-
Submit PR:
git add . git commit -m "feat: add new feature description" git push origin feature/<new-feature-name>
- Create bug fix branch:
git checkout -b bugfix/issue-number-description
- Fix and Verify:
# Fix the bug # Add/modify test scarb test
- Submit PR:
git add . git commit -m "fix: resolve issue description" git push origin bugfix/issue-number-description
- Cairo Code: Follow the Cairo documentation and best practices.
- Testing: Write tests for your code and ensure all tests pass before submitting a PR.
When reporting issues:
- Use descriptive titles.
- Provide as much detail as possible.
- Include relevant environment information.