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.ts

Branch Strategy

Main Repositories (Parent + Both Submodules)

Core Branches

  • main - Production-ready code, always deployable

  • staging - Pre-release testing and validation (deployed to testnets)

  • develop - Integration branch for ongoing development

Supporting Branches

  • feature/CONTRACT-123-add-staking - New features

  • hotfix/fix-critical-vulnerability - Critical production fixes

  • release/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

  1. Contracts submodule: Always merge to develop first, then update parent

  2. Deployments submodule: Updated immediately after successful deployments

  3. 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