Thank you for your interest in contributing to x402-exec! We welcome contributions from the community.
- Foundry for Solidity development
- Node.js 18+ for the showcase application
- Git for version control
# Clone the repository
git clone https://github.com/nuwa-protocol/x402-exec.git
cd x402-exec
# Install Foundry dependencies and build contracts
cd contracts
forge install
forge build
# Run tests to verify setup
forge test- Use GitHub Issues to report bugs or suggest features
- Search existing issues before creating a new one
- Provide clear reproduction steps for bugs
- Include relevant contract addresses, transaction hashes, or error messages
-
Fork the repository and create a new branch from
maingit checkout -b feature/your-feature-name
-
Make your changes
- Write clean, well-documented code
- Follow the existing code style
- Add tests for new features
- Update documentation as needed
-
Test your changes
# Run all tests forge test # Check gas usage forge test --gas-report # Check test coverage forge coverage
-
Commit your changes
git add . git commit -m "feat: add new feature"
Use conventional commit messages:
feat:for new featuresfix:for bug fixesdocs:for documentation changestest:for test additions/changesrefactor:for code refactoring
-
Push and create a Pull Request
git push origin feature/your-feature-name
Then open a Pull Request on GitHub with:
- Clear description of changes
- Reference to related issues (if any)
- Screenshots or examples (if applicable)
- Follow Solidity Style Guide
- Use OpenZeppelin contracts for standard functionality
- Write comprehensive NatSpec comments
- Follow CEI (Checks-Effects-Interactions) pattern
- Add reentrancy guards where appropriate
- Ensure all functions have appropriate visibility modifiers
- Write unit tests for all new functions
- Include edge case testing
- Test for expected reverts
- Aim for high test coverage (>90%)
- Update README.md if adding new features
- Add NatSpec comments to all public/external functions
- Include usage examples for new Hooks
- Keep documentation in sync with code changes
SettlementRouter.sol- Core settlement logicISettlementHook.sol- Hook interface
- Add new Hook examples in
contracts/examples/ - Each Hook should have:
- Well-documented contract code
- Comprehensive tests
- Usage examples
- API documentation
- Integration guides
- Architecture explanations
We especially welcome contributions in:
- 🧪 Testing: Increasing test coverage, adding edge cases
- 📚 Documentation: Improving guides, adding examples
- 🔌 Hook Examples: New creative use cases for Hooks
- ⚡ Gas Optimization: Making contracts more efficient
- 🔒 Security: Identifying and fixing vulnerabilities
- Be respectful and inclusive
- Welcome newcomers and help them learn
- Focus on constructive feedback
- Assume good intentions
By contributing, you agree that your contributions will be licensed under the Apache-2.0 License.
- Open a GitHub Discussion
- File an Issue for bug reports or feature requests
Thank you for contributing to x402-exec! 🚀