Thank you for your interest in contributing to the ClipCash NFT smart contract! This document will help you set up your development environment and submit pull requests.
Before you begin, ensure you have the following installed:
- Rust (1.70 or later) - Install Rust
- wasm32-unknown-unknown target - Run:
rustup target add wasm32-unknown-unknown - stellar-cli (optional, for deployment) - Run:
cargo install stellar-cli
git clone https://github.com/your-repo/clips-contract.git
cd clips-contractcd contracts
make install-depsOr manually:
rustup target add wasm32-unknown-unknownBuild the contract to ensure everything works:
make buildRun tests:
make test- Use
cargo fmtto format your code before committing - Follow the existing code patterns
- Add comments for complex logic
Always test your changes:
# Run all tests
make test
# Run with verbose output
make test-verboseBuild the WASM contract:
make buildThe output will be at: contracts/target/wasm32-unknown-unknown/release/clips_nft.wasm
git checkout -b feature/your-feature-name
# or
git checkout -b fix/bug-description- Make your code changes
- Add or update tests
- Run
make testto ensure everything passes - Run
make formatto format code - Run
make checkto verify no compilation errors
Write clear commit messages:
git add .
git commit -m "feat: add royalty calculation for NFT transfers"git push origin feature/your-feature-nameThen create a pull request through GitHub.
| Command | Description |
|---|---|
make build |
Build WASM contract |
make test |
Run tests |
make check |
Check code |
make format |
Format code |
make clean |
Clean build artifacts |
contracts/
├── clips_nft/ # Smart contract source
│ ├── src/
│ │ └── lib.rs # Main contract code
│ └── Cargo.toml # Dependencies
├── Makefile # Build commands
└── CONTRIBUTING.md # This file
- Open an issue for bugs or feature requests
- Check existing issues and PRs before creating new ones
By contributing, you agree that your contributions will be licensed under the project's license.