Skip to content

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

Dobbie Template

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:

  1. Bootstrap new projects with a ready-to-go DevOps setup.
  2. Migrate existing projects by moving your contracts into this optimized environment.

Features

  • Hardhat 3 (Beta): Configured with viem for a modern, fast development experience.
  • Dobbie DevOps Integration: Includes a suite of scripts in scripts/devops to 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.

Usage Scenarios

1. Bootstrap a New Project

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.

  1. Click Use this template.
  2. Clone your new repository.
  3. Follow the Installation steps.

2. Migrate an Existing Project

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:

  1. Clone this repository.
  2. Copy your smart contracts into contracts/.
  3. Migrate your tests to test/.
  4. Update hardhat.config.ts with any specific compiler settings or plugins you require.

Workflows

We provide three core GitHub Action workflows to automate the governance lifecycle:

1. Validate & Propose (propose-on-pr.yml)

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.

2. Monitor On-Chain Status (monitor-proposal.yml)

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.

3. System Integrity Check (integrity-check.yml)

Trigger: Push to main

  • Verifies: Ensures that the code on the main branch exactly matches the bytecode deployed on-chain.
  • Alerts: Fails if there is a mismatch (detects "drift" or unauthorized changes).

Getting Started

Prerequisites

  • Node.js (v22 or later)
  • pnpm

Installation

  1. Clone this repository.
  2. Install dependencies:
    pnpm install
  3. Set up your environment variables:
    cp .env.example .env
    # Edit .env with your configuration (RPC URLs, Private Keys, etc.)

Usage

Compile Contracts

pnpm compile

Run Tests

pnpm test

Deployment

Deploy to the Sepolia testnet using Hardhat Ignition:

pnpm deploy:sepolia

Project Structure

  • contracts/: 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 using viem and node:test.
  • ignition/: Deployment modules.
  • hardhat.config.ts: Hardhat configuration file.

Dobbie Workflow

  1. Develop: Write your contracts in contracts/.
  2. Test: Ensure correctness with pnpm test.
  3. Deploy: Use the provided scripts to deploy your system.
  4. Integrate: Use the scripts/devops tools to manage your contract versions and proposals within your team's Dobbie workflow.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages