Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Examples

This section provides practical, end-to-end examples demonstrating how to use voyager-verifier in real-world scenarios. Each example walks through a complete verification workflow, from project setup to successful verification.

Overview

The examples are organized from simple to complex:

  1. Simple Contract - Basic single-contract verification
  2. Workspace Project - Multi-package Scarb workspace
  3. Dojo Project - Dojo project verification
  4. Multi-Contract Batch - Batch verification for multiple contracts
  5. CI/CD Pipeline - Automated verification in CI/CD

What You’ll Learn

Each example includes:

  • Project Setup - Complete Scarb.toml configuration
  • Contract Code - Sample contract implementation
  • Verification Steps - Detailed command-line instructions
  • Expected Output - What you should see at each step
  • Troubleshooting - Common issues and solutions
  • Best Practices - Recommended approaches

Prerequisites

Before working through these examples, ensure you have:

  • Scarb installed (version 2.x+)
  • voyager-verifier installed (see Installation)
  • Basic understanding of Cairo and Starknet development
  • A Starknet contract class hash (for verification examples)

For Dojo examples, you’ll also need:

  • Dojo installed (version 1.x+)

Example Projects

All examples use realistic project structures:

Simple Contract

A basic Starknet contract demonstrating core verification features:

  • Single contract file
  • Standard Scarb project structure
  • Basic storage and external functions

Workspace Project

A multi-package workspace showing:

  • Multiple Cairo packages in one repository
  • Shared dependencies
  • Package selection during verification

Dojo Project

A Dojo world with models and systems:

  • Dojo-specific dependencies
  • Multiple contracts and components
  • Dojo version detection

Batch Verification

Verifying multiple contracts at once:

  • Configuration file setup
  • Batch submission workflow
  • Progress monitoring

CI/CD Integration

Automated verification in continuous integration:

  • GitHub Actions workflow
  • GitLab CI pipeline
  • Environment configuration

Using These Examples

For Learning

If you’re new to voyager-verifier, we recommend following the examples in order:

  1. Start with Simple Contract to understand the basics
  2. Progress to Workspace Project for multi-package setups
  3. Try Dojo Project if you’re using the Dojo framework
  4. Learn Multi-Contract Batch for efficient bulk verification
  5. Implement CI/CD Pipeline to automate your workflow

For Reference

If you’re looking for a specific use case:

For Copy-Paste

Each example includes complete, working code that you can:

  • Copy directly into your project
  • Modify to fit your needs
  • Use as a template for similar scenarios

Example Structure

Each example follows a consistent format:

## Overview
Brief description of what you'll build

## Project Structure
Directory layout and file organization

## Setup
Step-by-step project setup instructions

## Contract Code
Complete contract implementation

## Configuration
Scarb.toml and .voyager.toml setup

## Verification
Detailed verification workflow

## Expected Output
What success looks like

## Troubleshooting
Common issues and solutions

## Next Steps
Where to go from here

Additional Resources

Interactive Learning

For an interactive verification experience, try the wizard mode:

voyager verify --wizard

The wizard guides you through the verification process step-by-step, making it perfect for learning and experimentation.

Getting Help

If you get stuck while working through an example:

  1. Check the Troubleshooting section in each example
  2. Review the Troubleshooting Guide
  3. Use --verbose flag to see detailed error messages
  4. Try --dry-run to preview what will be submitted
  5. Reach out to @StarknetVoyager on Telegram

Contributing Examples

Have a useful verification scenario that’s not covered here? Contributions are welcome! See Contributing to Documentation for guidelines.


Ready to start? Begin with the Simple Contract Example