A Rust-based utility script for deploying Sablier contracts on multiple chains via a single CLI, meant to be used by the Sablier team.
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.
- Rust and Cargo installed on your machine. See the installation guide here.
- Foundry toolchain installed on your machine. See the installation guide here.
git clone https://github.com/sablier-labs/multichain-deployer.git
cd multichain-deployer
cargo install --path . # Install the CLI locally
multichain-deployer <chain_name> [OPTIONS]
--all
- deploy on all chains declared in thefoundry.toml
file--broadcast
- wether the deployment should be broadcasted or not--cp-bf
- copy the broadcasts generated by foundry from to thedeployments
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 atdeployments.md
--script
- the script to run for deployment--verify
- Verify deployment on the respective chain explorer
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
- 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
- e.g. 1. mainnet -->