Precision deployment tools for the modern smart contract developer
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.
- 🎯 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
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 installSolidity 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# 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# Auto-generate deployment script
treb gen deploy MyToken
# Creates script/deploy/DeployMyToken.s.sol with:
# - Automatic constructor detection
# - CreateX integration
# - Registry recording# 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# 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 MyTokenTrebuchet 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
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
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();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
}
}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.solComprehensive 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 sepoliaAutomatic 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:
- Detects the
StringUtilsdependency - Checks if it's already deployed on the target chain
- Deploys it if missing (or reuses existing deployment)
- Links it during
MyContractdeployment
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 chainsCross-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));
}
}- 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
- Deterministic collection addresses for cross-chain compatibility
- Hardware wallet deployment for security
- Automatic marketplace contract verification
- Metadata contract linkage
- Bridge contracts with cross-chain address coordination
- Oracle networks with deterministic node addresses
- Governance systems with hardware wallet security
- Predictable proxy implementation addresses
- Safe multisig coordination for upgrade proposals
- Verification of new implementations before deployment
- Documentation: trebuchet-org.github.io (coming soon)
- CLI Help:
treb helportreb [command] --help - Issues: Report bugs and feature requests in the respective repositories
- Discussions: Community discussions in treb-cli discussions
We welcome contributions to the Trebuchet ecosystem! Each repository has its own contribution guidelines:
# 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🚀 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
All projects in the Trebuchet organization are licensed under the MIT License.
"Because sometimes you need perfect ballistics for your contract launches" 🏰⚡
