The propose
command proposes a deployment to the Sphinx DevOps Platform.
The following steps occur when this command is run:
- Simulation: Sphinx simulates the deployment by invoking the Forge script on a fork of each network. If a transaction reverts during the simulation, Sphinx will throw an error.
- Preview: Sphinx displays the broadcasted transactions in a preview, which the user will be prompted to confirm.
- Relay: Sphinx submits the deployment to the Sphinx UI, where the user will approve it.
Note: The
propose
command is only available on networks supported by Sphinx's DevOps Platform. See the list of supported networks in the main README.
Using npx
:
npx sphinx propose <SCRIPT_PATH> --networks <NETWORK_NAMES...|testnets|mainnets> [options]
Using pnpm
:
pnpm sphinx propose <SCRIPT_PATH> --networks <NETWORK_NAMES...|testnets|mainnets> [options]
<SCRIPT_PATH>
: Required. The path to the Forge script file to propose.
--networks <NETWORK_NAMES...|testnets|mainnets>
: Required. The network(s) to propose on. Options include:- Arbitrary network names (e.g.,
ethereum optimism arbitrum
): Propose on one or more networks, which must match the network names in therpc_endpoints
section of yourfoundry.toml
. testnets
: Propose on the test networks in yoursphinxConfig.testnets
array. Provides a convenient way to propose on many networks without specifying them on the command line. Requires additional configuration; see the Configuration Options section forsphinxConfig.testnets
.mainnets
: Propose on the production networks in yoursphinxConfig.mainnets
array. Provides a convenient way to propose on many networks without specifying them on the command line. Requires additional configuration; see the Configuration Options section forsphinxConfig.mainnets
.
- Arbitrary network names (e.g.,
--sig <SIGNATURE [PARAMETERS...] | CALLDATA>
(Alias:-s
): Optional. The signature of the function to call in the script, or raw calldata. Matches the interface of Forge Script's--sig
parameter.- Default:
run()
- Default:
--confirm
: Optional. Confirm the proposal without previewing it. Useful for automating proposals.--dry-run
: Optional. Perform a trial run without sending data to Sphinx's backend. Useful for testing and validation.--silent
: Optional. Suppress output to display only error messages. Must be combined with--confirm
to confirm the proposal without previewing it.--target-contract <TARGET_CONTRACT>
(Alias:--tc
): Optional. Specify a contract in multi-contract scripts.
-
Propose a script located at
./path/to/script.s.sol
on Sepolia:npx sphinx propose ./path/to/script.s.sol --networks sepolia
-
Propose a script located at
./path/to/script.s.sol
on a few production networks:npx sphinx propose ./path/to/script.s.sol --networks ethereum optimism arbitrum
-
Propose a script located at
./path/to/script.s.sol
on Ethereum by calling the script'sdeploy(uint256)
function with the argument1234
:npx sphinx propose ./path/to/script.s.sol --networks ethereum --sig 'deploy(uint256)' 1234
-
Propose a script located at
./path/to/script.s.sol
on all networks insphinxConfig.testnets
, skipping the deployment preview:npx sphinx propose ./path/to/script.s.sol --networks testnets --confirm
-
Dry run a proposal on all networks in
sphinxConfig.mainnets
using a script located at./path/to/script.s.sol
:npx sphinx propose ./path/to/script.s.sol --networks mainnets --dry-run