Skip to content

sablier-labs/multichain-deployer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Multichain Deployer

A Rust-based utility script for deploying Sablier contracts on multiple chains via a single CLI, meant to be used by the Sablier team.

About

This script offers a CLI tool designed to enhance the experience of deploying Solidity smart contracts across multiple chains. It streamlines the deployment of Sablier contracts by automating the forge script command with the appropriate flags for targeting specific chains.

Installation

Prerequisites

  • Rust and Cargo installed on your machine. See the installation guide here.
  • Foundry toolchain installed on your machine. See the installation guide here.

Steps

git clone https://github.com/sablier-labs/multichain-deployer.git
cd multichain-deployer
cargo install --path . # Install the CLI locally

Usage

multichain-deployer <chain_name> [OPTIONS]

Flags:

  • --all - deploy on all chains declared in the foundry.toml file
  • --broadcast - wether the deployment should be broadcasted or not
  • --cp-bf - copy the broadcasts generated by foundry from to the deployments directory
  • --gas-price - the gas price to use for the deployment in wei
  • --help Prints a help message
  • --log - Creates a Markdown file with the deployed contracts at deployments.md
  • --script - the script to run for deployment
  • --verify - Verify deployment on the respective chain explorer

Example:

multichain-deployer sepolia --script DeployFlow.s.sol

Output:

Deploying to the chains: sepolia
Running the deployment command: FOUNDRY_PROFILE=optimized forge script script/DeployFlow.s.sol --rpc-url sepolia

Assumptions:

  • The script is run within a Foundry project, with a script directory declared at the root of the project.
  • Chain names match the ones declared in the foundry.toml file
  • If the --cp-bf flag is used, the deployments directory is expected to exist at ../deployments
  • If the --verify flag is used, Etherscan API keys must be set in the .env file in the format: <chain_name_from_foundry_toml>_API_KEY.
    • e.g. 1. mainnet --> MAINNET_API_KEY 2. avalanche --> AVALANCHE_API_KEY

About

⚡ Rapid Multichain Deployer

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages