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/deploy-multi-chain.git
cd deploy-multi-chain
cargo install --path . # Install the CLI locally
deploy-multi-chain <chain_name> [OPTIONS]
--all
- deploy on all chains declared in thefoundry.toml
file--cp-bf
- copy the broadcasts generated by foundry from to thedeployments
directory--script
- the script to run for deployment--broadcast
- wether the deployment should be broadcasted or not--gas-price
- the gas price to use for the deployment in wei
deploy-multi-chain 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 -->