Skip to Content
Contract CI/CD

Contract CI/CD

Stagenets provide a CI/CD pipeline for smart contracts. They:

  • Connect to GitHub repositories containing Hardhat or Foundry projects
  • Continuously import and compile their smart contracts
  • Automatically create Workspaces for those contracts when they are deployed to your Stagenet

When developing smart contracts, you should connect your repository to your Stagenet to enable automatic Workspace creation for your Stagenet deployments.

With this connection established, simply point your existing deploy scripts at your Stagenet to deploy into a true-to-mainnet environment and automatically get rich, contract-scoped analytics and tooling.

Import contracts from GitHub

To import smart contracts from GitHub to your Stagenet, go to your project’s CI/CD page and do the following:

  1. Install the contract.dev GitHub App into your GitHub account or organisation, granting access to the repository containing your contracts.
  2. When redirected back, select the repository you want to import.
  3. If needed, set a Build Configuration for the repository, which defines how its contracts are compiled. Standard Hardhat and Foundry projects work out of the box.

After submitting a Build Configuration, you’ll be taken to the repository’s dashboard, where you’ll see its initial compilation running. Once complete, its contracts will be synced to your Stagenet, enabling automatic Workspace creation for their Stagenet deployments.

When new or updated contracts are pushed to a connected repository, the Stagenet automatically imports and compiles them, creating new versions whenever contract bytecode changes.

To see a step-by-step guide for importing contracts and setting up Workspaces for them, check out the Quickstart.

Last updated on