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:
- Simple Contract - Basic single-contract verification
- Workspace Project - Multi-package Scarb workspace
- Dojo Project - Dojo project verification
- Multi-Contract Batch - Batch verification for multiple contracts
- 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:
- Start with Simple Contract to understand the basics
- Progress to Workspace Project for multi-package setups
- Try Dojo Project if you’re using the Dojo framework
- Learn Multi-Contract Batch for efficient bulk verification
- Implement CI/CD Pipeline to automate your workflow
For Reference
If you’re looking for a specific use case:
- “How do I verify my first contract?” → Simple Contract
- “My project has multiple packages” → Workspace Project
- “I’m building with Dojo” → Dojo Project
- “I need to verify many contracts” → Multi-Contract Batch
- “I want to automate verification” → CI/CD Pipeline
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
- Command Reference - Complete command documentation
- Configuration Guide - Configuration options
- Troubleshooting - Error resolution
- Best Practices - Recommended workflows
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:
- Check the Troubleshooting section in each example
- Review the Troubleshooting Guide
- Use
--verboseflag to see detailed error messages - Try
--dry-runto preview what will be submitted - 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 →