Thank you for your interest in contributing to Ancore! This document provides guidelines and instructions for contributing.
- Code of Conduct
- Getting Started
- Development Workflow
- Security Boundaries
- Contribution Guidelines
- Testing Requirements
- Code Review Process
We are committed to providing a welcoming and inclusive environment. Please:
- Be respectful and constructive
- Focus on what is best for the community
- Show empathy towards other community members
- Accept constructive criticism gracefully
- Node.js >= 20.0.0
- pnpm >= 9.0.0
- Rust toolchain (1.74.0+)
- wasm32-unknown-unknown target (
rustup target add wasm32-unknown-unknown) - Soroban CLI (
cargo install --locked soroban-cli)
- Fork the repository
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/ancore.git cd ancore - Add upstream remote:
git remote add upstream https://github.com/ancore-org/ancore.git
- Install dependencies:
pnpm install
- Build the project:
pnpm build
feat/description- New featuresfix/description- Bug fixesdocs/description- Documentation changesrefactor/description- Code refactoringtest/description- Test additions/improvements
-
Create a new branch:
git checkout -b feat/my-feature
-
Make your changes following our code style
-
Run tests:
pnpm test -
Run linting:
pnpm lint
-
Commit your changes:
git commit -m "feat: add awesome feature"Follow Conventional Commits
-
Push to your fork:
git push origin feat/my-feature
-
Open a Pull Request
Contributions are subject to different review processes based on the security level of the code:
These areas require core team approval and formal security review:
contracts/**- All smart contractspackages/crypto/**- Cryptographic primitivespackages/account-abstraction/**- Account abstraction core logic
If you want to contribute here:
- Open an issue first to discuss the change
- Expect rigorous review
- Sign our CLA
- Provide comprehensive tests
packages/core-sdk/**- Main SDKservices/**- Backend services
Requirements:
- Demonstrated understanding of the codebase
- Comprehensive test coverage
- Security considerations documented
Great areas for first-time contributors:
apps/**- Wallet applicationspackages/ui-kit/**- UI componentsdocs/**- Documentation- Tests for existing features
- Bug fixes
- Performance improvements
- Use TypeScript for all new code
- Follow the existing code style (enforced by Prettier)
- Use meaningful variable names
- Add JSDoc comments for public APIs
- Prefer functional programming patterns
Example:
/**
* Creates a new session key with the specified permissions.
*
* @param account - The account to create the session for
* @param permissions - Permissions for the session key
* @returns A promise resolving to the session key
*/
export async function createSessionKey(
account: Account,
permissions: SessionPermissions
): Promise<SessionKey> {
// Implementation
}- Follow Rust conventions and idioms
- Use snake_case for functions and variables
- Use PascalCase for types and traits
- Add comprehensive documentation comments
- Include security considerations in comments
- Write tests for all contract functions
Example:
/// Validates a transaction signature.
///
/// # Arguments
/// * `env` - The contract environment
/// * `tx_hash` - Hash of the transaction to validate
/// * `signature` - Signature to verify
///
/// # Security
/// Must verify the signer has appropriate permissions
pub fn validate_signature(
env: Env,
tx_hash: BytesN<32>,
signature: BytesN<64>
) -> bool {
// Implementation
}All contributions must include tests:
describe('SessionKey', () => {
it('should create a valid session key', async () => {
const account = await createTestAccount();
const sessionKey = await createSessionKey(account, defaultPermissions);
expect(sessionKey).toBeDefined();
expect(sessionKey.isValid()).toBe(true);
});
});#[cfg(test)]
mod test {
use super::*;
use soroban_sdk::{Env, testutils::Address as _};
#[test]
fn test_validate_signature() {
let env = Env::default();
// Test implementation
assert!(result);
}
}- Update relevant documentation in
docs/ - Add JSDoc/inline comments for public APIs
- Include examples for new features
- Update README.md if needed
- Initial review: 1-3 business days
- High-security code: 1-2 weeks (includes security review)
- Simple fixes: Often same-day
Reviewers will check:
- β Code quality and style
- β Test coverage
- β Documentation completeness
- β Security implications
- β Performance considerations
- β Breaking changes properly flagged
- Respond to all review comments
- Push additional commits to your branch
- Request re-review when ready
When opening a PR, please include:
## Description
Brief description of changes
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation update
## Testing
- [ ] Unit tests added/updated
- [ ] Integration tests added/updated
- [ ] Manual testing performed
## Security Considerations
Describe any security implications
## Checklist
- [ ] Code follows project style guidelines
- [ ] Self-review completed
- [ ] Comments added for complex logic
- [ ] Documentation updated
- [ ] Tests pass locally
- [ ] No new warnings introducedLook for issues labeled good-first-issue to get started.
Issues labeled help-wanted are priorities where we need community help.
Improving documentation is always appreciated:
- Fix typos
- Clarify confusing sections
- Add examples
- Translate to other languages
Major changes require an RFC:
- Copy
docs/rfcs/0000-template.mdtodocs/rfcs/XXXX-my-feature.md - Fill in the RFC template
- Open a PR with the RFC
- Discuss in the PR comments
- Once approved, implement the feature
- Telegram: Ancore
- Issues: Open a GitHub issue
Contributors are recognized in:
- Release notes
CONTRIBUTORS.md- Monthly community highlights
By contributing, you agree that your contributions will be licensed under:
- Apache 2.0 (for contracts and core SDK)
- MIT (for applications and UI)
Thank you for contributing to Ancore! π