First off, thank you for considering contributing to FlashStack! It's people like you that make FlashStack the first and best flash loan protocol on Bitcoin Layer 2.
- 🐛 Report bugs
- 💡 Suggest new features or improvements
- 📖 Improve documentation
- 🔧 Submit bug fixes
- ✨ Add new receiver contract examples
- 🧪 Write additional tests
- 🎨 Improve UI/UX (when frontend launches)
- Clarinet 2.0 or later
- Node.js 16 or later
- Git
- Basic understanding of Clarity smart contracts
-
Fork the repository
# Click "Fork" on GitHub, then clone your fork git clone https://github.com/YOUR_USERNAME/flashstack.git cd flashstack
-
Install dependencies
npm install
-
Verify everything works
clarinet check
-
Create a branch
git checkout -b feature/your-feature-name # or git checkout -b fix/bug-description
-
Write your code
- Follow existing code style
- Add comments for complex logic
- Keep functions focused and small
-
Test your changes
# Check syntax clarinet check # Run in console to test clarinet console
-
Update documentation
- Update README.md if you added features
- Add code comments
- Update relevant docs in /docs folder
-
Commit your changes
git add . git commit -m "feat: add arbitrage calculator function"
Use conventional commit messages:
feat:- New featuresfix:- Bug fixesdocs:- Documentation onlytest:- Adding testsrefactor:- Code refactoringstyle:- Formatting changeschore:- Maintenance tasks
-
Push to your fork
git push origin feature/your-feature-name
-
Open a Pull Request
- Go to the original FlashStack repository
- Click "New Pull Request"
- Select your fork and branch
- Fill out the PR template
- Submit!
- Follow SIP-010 standards for token contracts
- Use descriptive variable names (
flash-mint-amountnotamt) - Add input validation for all public functions
- Include error handling with descriptive error codes
- Comment complex logic with clear explanations
- Keep functions under 50 lines when possible
Example:
;; Good ✅
(define-public (flash-mint (amount uint) (receiver <flash-receiver>))
(begin
;; Validate amount
(asserts! (> amount u0) err-invalid-amount)
;; Validate not paused
(asserts! (not (var-get paused)) err-protocol-paused)
;; Execute flash mint
...
)
)
;; Bad ❌
(define-public (fm (a uint) (r <flash-receiver>))
;; No validation, unclear names
...
)- Write tests for new features
- Test edge cases (zero amounts, max values, etc.)
- Test error conditions
- Include integration tests for receiver contracts
- Update README.md for significant features
- Add inline comments for complex code
- Create examples for new receiver types
- Update API docs in /docs folder
- Check existing issues - Your bug may already be reported
- Use latest version - Update to latest main branch
- Minimal reproduction - Can you reproduce it consistently?
Use the bug report template and include:
- Clear title - Describe the issue
- Steps to reproduce - Detailed steps
- Expected behavior - What should happen
- Actual behavior - What actually happens
- Environment - Clarinet version, OS, etc.
- Code snippets - Relevant contract code
- Error messages - Full error output
Example:
Title: flash-mint fails with err-insufficient-collateral on valid STX amount
Steps to reproduce:
1. Deploy contracts to devnet
2. Lock 100,000 STX via PoX
3. Call flash-mint with 10 sBTC
4. Transaction fails
Expected: flash-mint succeeds
Actual: Returns (err u104)
Environment:
- Clarinet 2.3.0
- Windows 11
- Node 18.0.0
We love new ideas! Before suggesting:
- Check existing issues - Someone may have suggested it
- Consider scope - Does it fit FlashStack's mission?
- Think through implementation - How would it work?
Use the feature request template and include:
- Clear description - What's the feature?
- Use case - Why is it needed?
- Examples - How would it be used?
- Alternatives - What other solutions exist?
When you submit a PR:
- Automated checks run - Clarinet check, tests
- Maintainer reviews - Usually within 48 hours
- Feedback addressed - Make requested changes
- Approval & merge - Once approved, we merge!
- ✅ Code works and tests pass
- ✅ Follows coding standards
- ✅ Well documented
- ✅ No breaking changes (or clearly noted)
- ✅ Minimal scope (focused changes)
Contributors are recognized in:
- README.md contributors section
- CHANGELOG.md for each release
- Special shoutouts on Twitter
- Potential core team invitation for consistent contributors
- README.md - Project overview
- QUICKSTART.md - Getting started
- /docs - Complete documentation
- Twitter - Follow for updates
- GitHub Discussions - Ask questions
- Stacks Discord - Chat with community
- Project Lead: Matt Glory (@FlashStackBTC)
- GitHub: mattglory
By contributing, you agree that your contributions will be licensed under the MIT License.
Thank you for contributing to FlashStack! Together we're building the future of Bitcoin DeFi. ⚡