Skip to content
@trebuchet-org

Trebuchet

Launch your Solidity smart contracts with ease and precision

Developers deploying code with a trebuchet

Precision deployment tools for the modern smart contract developer


What is Trebuchet?

Trebuchet is a comprehensive deployment framework that brings deterministic, reproducible smart contract deployments to the Ethereum ecosystem. Our tools leverage CreateX factory contracts to ensure your contracts deploy to the same addresses across any EVM-compatible chain, while providing sophisticated orchestration for complex deployment workflows.

Why Trebuchet?

  • 🎯 Deterministic Deployments: Same addresses across all chains using CreateX
  • 🚀 Production-Ready: Battle-tested patterns with hardware wallet and Safe multisig support
  • 🔧 Developer-First: Seamless integration with existing Foundry workflows
  • 📚 Automatic Library Management: Smart dependency resolution and linking
  • 🛡️ Enterprise-Grade: Complete transaction coordination and audit trails

Core Projects

Go CLI orchestrator for Foundry script execution

The command-line interface that coordinates your deployment workflows. Built on the principle of "Go orchestrates, Solidity executes" - it handles configuration, planning, and registry management while all chain interactions happen through proven Foundry scripts.

Key Features:

  • 📋 Project initialization with deployment templates
  • 🎯 Address prediction before deployment
  • 📊 Comprehensive deployment registry with verification tracking
  • 🔗 Automatic library detection, deployment, and linking
  • ⚙️ Configuration management for multi-environment deployments
  • 🌐 Multi-chain orchestration with shared deterministic addresses

Installation:

# Easy installation with trebup (recommended)
curl -L https://raw.githubusercontent.com/trebuchet-org/treb-cli/main/trebup/install | bash
trebup

# Or build from source
git clone https://github.com/trebuchet-org/treb-cli
cd treb-cli && make install

Solidity deployment library with multi-sender coordination

A sophisticated Solidity framework for writing deployment scripts that can execute transactions through different wallet types while maintaining deterministic addresses. Provides a unified interface for EOA, hardware wallets, and Safe multisig deployments.

Key Features:

  • 🔄 Multi-sender coordination with automatic transaction batching
  • 🛡️ Hardware wallet and Safe multisig integration
  • 🧪 Secure proxy-based contract interaction through harness system
  • 📚 Registry integration for cross-contract address lookups
  • 🏗️ Flexible scripting framework for complex deployment logic

Installation:

forge install trebuchet-org/treb-sol

Quick Start

1. Initialize a Project

# Create a new Foundry project
forge init my-protocol && cd my-protocol

# Initialize treb
treb init my-protocol

# Install the deployment library
forge install trebuchet-org/treb-sol

2. Generate Deployment Script

# Auto-generate deployment script
treb gen deploy MyToken

# Creates script/deploy/DeployMyToken.s.sol with:
# - Automatic constructor detection
# - CreateX integration
# - Registry recording

3. Configure Environment

# Set up configuration
treb context set network sepolia
treb context set namespace staging

# Add environment variables
echo 'SEPOLIA_RPC_URL=https://sepolia.infura.io/v3/YOUR_KEY' >> .env
echo 'DEPLOYER_PRIVATE_KEY=0x...' >> .env
echo 'ETHERSCAN_API_KEY=...' >> .env

4. Deploy Contracts

# Predict address before deployment
treb run script/deploy/DeployMyToken.s.sol --dry-run

# Deploy to configured network
treb run script/deploy/DeployMyToken.s.sol

# Deploy with automatic verification
treb run script/deploy/DeployMyToken.s.sol --network mainnet
treb verify MyToken

Architecture

The "Go Orchestrates, Solidity Executes" Pattern

Trebuchet follows a clean separation of concerns:

  • Go CLI handles configuration, planning, registry management, and library resolution
  • Foundry scripts handle all chain interactions using proven, battle-tested patterns
  • CreateX provides deterministic address generation across chains
  • Registry system tracks deployments with comprehensive metadata

Deterministic Deployments

All deployments use CreateX with multi-component salt generation:

  • Contract name: Ensures different contracts get different addresses
  • Namespace: Separates environments (staging/production)
  • Label: Optional versioning (e.g., "v1.0", "beta")

Same salt = same address across all chains

Multi-Sender Architecture

treb-sol provides a unified interface for different transaction execution methods:

// Private key sender (development)
Senders.Sender storage deployer = sender("dev");

// Hardware wallet sender (production)  
Senders.Sender storage ledger = sender("ledger");

// Safe multisig sender (treasury operations)
Senders.Sender storage treasury = sender("treasury");

// All use the same deployment interface
address token = deployer.create3("Token").deploy();

Enterprise Features

Safe Multisig Integration

Complete support for Safe multisig deployments with transaction batching:

contract SafeDeployment is TrebScript {
    function run() public broadcast {
        Senders.Sender storage safe = sender("treasury");
        
        // All transactions are automatically batched
        address token = safe.create3("Token").deploy();
        address vault = safe.create3("Vault").deploy(abi.encode(token));
        
        // Configuration calls are also batched
        Token(safe.harness(token)).grantRole(MINTER_ROLE, vault);
        
        // Single Safe transaction executes entire deployment
    }
}

Hardware Wallet Support

Native integration with Ledger and Trezor devices:

# Configure hardware wallet deployment
treb context set deployer.type ledger
treb context set deployer.derivation_path "m/44'/60'/0'/0/0"

# Deploy using hardware wallet
treb run script/deploy/DeployMyToken.s.sol

Registry & Verification Management

Comprehensive tracking of all deployments with automatic verification:

# List all deployments
treb list

# Show detailed deployment information
treb show MyToken --namespace production

# Verify pending contracts
treb verify --pending

# Cross-environment lookups
treb show MyToken --namespace staging --network sepolia

Library Management

Automatic dependency detection and deployment:

// Your contract uses a library
import {StringUtils} from "./libraries/StringUtils.sol";

contract MyContract {
    using StringUtils for string;
    
    function process(string memory input) public pure returns (string memory) {
        return input.toUpperCase();  // Uses StringUtils library
    }
}

When deploying MyContract, treb automatically:

  1. Detects the StringUtils dependency
  2. Checks if it's already deployed on the target chain
  3. Deploys it if missing (or reuses existing deployment)
  4. Links it during MyContract deployment

Multi-Chain Orchestration

Deploy to multiple chains with guaranteed address consistency:

# Deploy to multiple chains with same addresses
treb run script/deploy/DeployMyToken.s.sol \
  --network mainnet,polygon,arbitrum \
  --namespace production

# Addresses are identical across all chains

Cross-chain contract references:

contract CrossChainSetup is TrebScript {
    function run() public broadcast {
        // Reference mainnet deployment while on L2
        address mainnetBridge = lookup("Bridge", "production", "1");
        
        // Deploy L2 side with mainnet reference
        address l2Bridge = sender("default")
            .create3("L2Bridge")
            .deploy(abi.encode(mainnetBridge));
    }
}

Use Cases

DeFi Protocol Deployment

  • Deploy core contracts (token, pools, governance) with deterministic addresses
  • Coordinate multi-step initialization through Safe multisig
  • Automatic library management for complex dependencies
  • Cross-chain deployment with shared addresses

NFT Collection Launch

  • Deterministic collection addresses for cross-chain compatibility
  • Hardware wallet deployment for security
  • Automatic marketplace contract verification
  • Metadata contract linkage

Infrastructure Deployment

  • Bridge contracts with cross-chain address coordination
  • Oracle networks with deterministic node addresses
  • Governance systems with hardware wallet security

Upgrade Workflows

  • Predictable proxy implementation addresses
  • Safe multisig coordination for upgrade proposals
  • Verification of new implementations before deployment

Getting Help

  • Documentation: trebuchet-org.github.io (coming soon)
  • CLI Help: treb help or treb [command] --help
  • Issues: Report bugs and feature requests in the respective repositories
  • Discussions: Community discussions in treb-cli discussions

Contributing

We welcome contributions to the Trebuchet ecosystem! Each repository has its own contribution guidelines:

Development Setup

# Set up treb-cli development
git clone https://github.com/trebuchet-org/treb-cli
cd treb-cli
make dev-setup
make test

# Set up treb-sol development  
git clone https://github.com/trebuchet-org/treb-sol
cd treb-sol
forge build
forge test

Status

🚀 Active Development - Core features are production-ready and in use by teams deploying to mainnet. New features and improvements are continuously being added.

Recent milestones:

  • ✅ CreateX integration with deterministic deployments
  • ✅ Multi-sender coordination with Safe multisig support
  • ✅ Automatic library detection and deployment
  • ✅ Comprehensive registry and verification system
  • 🔄 Cross-chain orchestration improvements
  • 🔄 Enhanced developer experience features

License

All projects in the Trebuchet organization are licensed under the MIT License.


"Because sometimes you need perfect ballistics for your contract launches" 🏰⚡

Popular repositories Loading

  1. treb-sol treb-sol Public

    Solidity Libraries used in conjunction with `treb-cli` to deploy Solidity contracts with CreateX, Foundry an Gnosis Safe

    Solidity 3 2

  2. treb-cli treb-cli Public

    CLI tool for managing deterministic solidity deployments with CreateX and Foundry

    Go 2 1

  3. safe-utils safe-utils Public

    Forked from Recon-Fuzz/safe-utils

    Interact with the Safe API from Foundry scripts

    Solidity

  4. treb.to treb.to Public

    https://treb.to

    CSS

  5. .github .github Public

Repositories

Showing 5 of 5 repositories

People

This organization has no public members. You must be a member to see who’s a part of this organization.

Top languages

Loading…

Most used topics

Loading…