Smart Contract Projects
Repository Structure
main-project/ (Node/TypeScript/Hardhat)
βββ contracts/<contract-repo>/ (Git submodule - Solidity contracts)
βββ diamonds/<DiamondContractName>/ (Git submodule - Deployment records & config)
βββ scripts/
βββ tests/
βββ package.json
βββ tsconfig.json
βββ hardhat.config.tsBranch Strategy
Main Repositories (Parent + Both Submodules)
Core Branches
main- Production-ready code, always deployablestaging- Pre-release testing and validation (deployed to testnets)develop- Integration branch for ongoing development
Supporting Branches
feature/CONTRACT-123-add-staking- New featureshotfix/fix-critical-vulnerability- Critical production fixesrelease/v1.2.0- Release preparation
Naming Conventions
Branch Names
Commit Messages
Tags
Workflow Process
1. Feature Development
2. Pull Request Requirements
PR Title Format
Required PR Checks
PR Template
3. Submodule Management
Updating Submodules in Parent
Submodule Workflow Rules
Contracts submodule: Always merge to develop first, then update parent
Deployments submodule: Updated immediately after successful deployments
Atomic updates: Submodule updates should be separate commits with clear messages
4. Release Process
Creating a Release
GitHub Integration
Branch Protection Rules
Main Branch
Require pull request reviews (min 1 reviewer)
Require status checks to pass
Require branches to be up to date
Require conversation resolution
Restrict pushes to admins only
Develop Branch
Require pull request reviews (min 1 reviewer)
Require status checks to pass
Allow force pushes for admins
GitHub Actions Workflow
Issue and Project Integration
Issue Labels
Last updated