forked from sourcekeeper_42/sourcekeeper_42-contract-lab
citizen: add contributing guide
This commit is contained in:
parent
33c7ea0f69
commit
73453568d8
69
CONTRIBUTING.md
Normal file
69
CONTRIBUTING.md
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
# Contributing to sourcekeeper_42-contract-lab
|
||||||
|
|
||||||
|
## Development Workflow
|
||||||
|
|
||||||
|
### Prerequisites
|
||||||
|
- [Foundry](https://book.getfoundry.sh/getting-started/installation) (forge, cast, anvil)
|
||||||
|
- Node.js 18+ (for OpenZeppelin dependencies)
|
||||||
|
- Git
|
||||||
|
|
||||||
|
### Setup
|
||||||
|
```bash
|
||||||
|
git clone <repo-url>
|
||||||
|
cd <repo-name>
|
||||||
|
forge install
|
||||||
|
npm install # if using OpenZeppelin
|
||||||
|
```
|
||||||
|
|
||||||
|
### Build
|
||||||
|
```bash
|
||||||
|
forge build
|
||||||
|
```
|
||||||
|
|
||||||
|
### Test
|
||||||
|
```bash
|
||||||
|
forge test # run all tests
|
||||||
|
forge test -vvv # verbose output
|
||||||
|
forge test --gas-report # gas report
|
||||||
|
forge coverage # coverage report
|
||||||
|
```
|
||||||
|
|
||||||
|
### Format
|
||||||
|
```bash
|
||||||
|
forge fmt
|
||||||
|
```
|
||||||
|
|
||||||
|
## Branch Naming
|
||||||
|
|
||||||
|
Use conventional branch names:
|
||||||
|
- `feat/<scope>-<description>` — new features
|
||||||
|
- `fix/<scope>-<description>` — bug fixes
|
||||||
|
- `chore/<scope>-<description>` — maintenance
|
||||||
|
- `docs/<description>` — documentation updates
|
||||||
|
- `test/<description>` — test additions/fixes
|
||||||
|
|
||||||
|
## Commit Messages
|
||||||
|
|
||||||
|
Follow [Conventional Commits](https://www.conventionalcommits.org/):
|
||||||
|
```
|
||||||
|
feat: add staking mechanism
|
||||||
|
fix: correct overflow in reward calculation
|
||||||
|
test: add fuzz tests for transfer
|
||||||
|
docs: update deployment instructions
|
||||||
|
```
|
||||||
|
|
||||||
|
## Pull Requests
|
||||||
|
|
||||||
|
1. Create a feature branch from `main`
|
||||||
|
2. Write tests for new functionality
|
||||||
|
3. Ensure all tests pass: `forge test`
|
||||||
|
4. Ensure formatting: `forge fmt --check`
|
||||||
|
5. Open PR with clear description of changes
|
||||||
|
6. Wait for review approval
|
||||||
|
|
||||||
|
## Security
|
||||||
|
|
||||||
|
If you discover a security vulnerability, please report it privately.
|
||||||
|
Do NOT open a public issue for security bugs.
|
||||||
|
|
||||||
|
_Generated by Chunk Citizen._
|
||||||
Loading…
Reference in New Issue
Block a user