Dobbie Template is the official boilerplate for creating smart contract repositories compatible with the Dobbie DevOps Platform. It provides a pre-configured environment for developing, testing, verifying, and versioning smart contracts in a collaborative team setting.
This template is designed to:
- Bootstrap new projects with a ready-to-go DevOps setup.
- Migrate existing projects by moving your contracts into this optimized environment.
- Hardhat 3 (Beta): Configured with
viemfor a modern, fast development experience. - Dobbie DevOps Integration: Includes a suite of scripts in
scripts/devopsto integrate seamlessly with the Dobbie platform for proposal discovery, package uploading, and integrity verification. - Automated Workflows: GitHub Actions for CI/CD, automatic proposal submission, and on-chain status monitoring.
- Hybrid Testing: Supports both Solidity (Foundry-style) and TypeScript (via
node:test) test suites. - Ignition Deployment: Ready-to-use deployment modules.
Use this repository as a GitHub template to start a fresh project. It comes with the directory structure, configuration, and scripts needed to connect to a Dobbie Governor immediately.
- Click Use this template.
- Clone your new repository.
- Follow the Installation steps.
If you have an existing Hardhat project, it is recommended to move your source code into this template rather than configuring your existing project from scratch:
- Clone this repository.
- Copy your smart contracts into
contracts/. - Migrate your tests to
test/. - Update
hardhat.config.tswith any specific compiler settings or plugins you require.
We provide three core GitHub Action workflows to automate the governance lifecycle:
Trigger: Open/Update Pull Request
- Compiles & Tests: Runs your test suite to ensure code quality.
- Packages: bundled artifacts and source code into an IPFS-ready package.
- Proposes: Automatically submits a proposal to the on-chain Governor.
- Comments: Posts the Proposal ID and IPFS CID back to the PR for stakeholders to review.
Trigger: Schedule (Every 15 mins)
- Tracks: Checks the on-chain state of all open proposals (Pending, Active, Defeated, Succeeded, Executed).
- Updates: posted PR status comments with the live vote status.
- Executes: If a proposal succeeds and is executed on-chain, this workflow automatically merges the PR into
main.
Trigger: Push to main
- Verifies: Ensures that the code on the
mainbranch exactly matches the bytecode deployed on-chain. - Alerts: Fails if there is a mismatch (detects "drift" or unauthorized changes).
- Node.js (v22 or later)
- pnpm
- Clone this repository.
- Install dependencies:
pnpm install
- Set up your environment variables:
cp .env.example .env # Edit .env with your configuration (RPC URLs, Private Keys, etc.)
pnpm compilepnpm testDeploy to the Sepolia testnet using Hardhat Ignition:
pnpm deploy:sepoliacontracts/: Smart contract source files (.sol).scripts/devops/: Dobbie integration scripts.discover-proposals.ts: Discovers and processes all on-chain proposals.package.ts: Packages artifacts for upload.upload.ts: Uploads packages to the Dobbie registry.verify-integrity.ts: Verifies the integrity of local files against the registry.
.github/workflows/: Automated CI/CD and Governance pipelines.test/: TypeScript tests usingviemandnode:test.ignition/: Deployment modules.hardhat.config.ts: Hardhat configuration file.
- Develop: Write your contracts in
contracts/. - Test: Ensure correctness with
pnpm test. - Deploy: Use the provided scripts to deploy your system.
- Integrate: Use the
scripts/devopstools to manage your contract versions and proposals within your team's Dobbie workflow.