
Security News
Meet Socket at Black Hat Europe and BSides London 2025
Socket is heading to London! Stop by our booth or schedule a meeting to see what we've been working on.
@openzeppelin/defender-deploy-client-cli
Advanced tools
CLI for deployments using OpenZeppelin Defender SDK
CLI for deployments using OpenZeppelin Defender SDK.
Warning This repository contains experimental code. It is available as a technology preview and its functionality is incomplete and subject to change. Breaking changes may be introduced at any point while it is in preview.
DEFENDER_KEY=<Your API key>
DEFENDER_SECRET<Your API secret>
The network that is used with OpenZeppelin Defender is determined by the chainId parameter in the below commands.
If you want to ensure that a specific network is used with Defender, set the DEFENDER_NETWORK environment variable, for example:
DEFENDER_NETWORK=my-mainnet-fork
If set, this must be the name of a public, private or forked network in Defender. If the chainId parameter corresponds to a different network while this is set, the deployment will not occur and will throw an error instead.
Note This is required if you have multiple forked networks in Defender with the same chainId, in which case the one with name matching the
DEFENDER_NETWORKenvironment variable will be used.
npx @openzeppelin/defender-deploy-client-cli <COMMAND> <OPTIONS>
Performs actions using OpenZeppelin Defender.
Available commands:
deploy Deploys a contract.
proposeUpgrade Proposes an upgrade.
getDeployApprovalProcess Gets the deploy approval process configured for a network.
getUpgradeApprovalProcess Gets the upgrade approval process configured for a network.
Run 'npx @openzeppelin/defender-deploy-client-cli <COMMAND> --help' for more information on a command.
npx @openzeppelin/defender-deploy-client-cli deploy --contractName <CONTRACT_NAME> --contractPath <CONTRACT_PATH> --chainId <CHAIN_ID> --buildInfoFile <BUILD_INFO_FILE_PATH> [--constructorBytecode <CONSTRUCTOR_ARGS>] [--licenseType '<LICENSE>'] [--verifySourceCode <true|false>] [--relayerId <RELAYER_ID>] [--salt <SALT>] [--createFactoryAddress <CREATE_FACTORY_ADDRESS>] [--gasLimit <GAS_LIMIT>] [--gasPrice <GAS_PRICE>] [--maxFeePerGas <MAX_FEE_PER_GAS>] [--maxPriorityFeePerGas <MAX_PRIORITY_FEE_PER_GAS>] [--metadata '<METADATA>'] [--origin '<ORIGIN>']
Deploys a contract using OpenZeppelin Defender.
Required options:
--contractName <CONTRACT_NAME> Name of the contract to deploy.
--contractPath <CONTRACT_PATH> Path to the contract file.
--chainId <CHAIN_ID> Chain ID of the network to deploy to.
--buildInfoFile <BUILD_INFO_FILE_PATH> Path to the build info file containing Solidity compiler input and output for the contract.
Additional options:
--constructorBytecode <CONSTRUCTOR_BYTECODE> 0x-prefixed ABI encoded byte string representing the constructor arguments. Required if the constructor has arguments.
--licenseType '<LICENSE>' License type to display on block explorers for verified source code. See https://etherscan.io/contract-license-types for supported values and use the string found in brackets, e.g. 'MIT'
--verifySourceCode <true|false> Whether to verify source code on block explorers. Defaults to true.
--relayerId <RELAYER_ID> Relayer ID to use for deployment. Defaults to the relayer configured for your deployment environment on Defender.
--salt <SALT> Salt to use for CREATE2 deployment. Defaults to a random salt.
--createFactoryAddress <CREATE_FACTORY_ADDRESS> Address of the CREATE2 factory to use for deployment. Defaults to the factory provided by Defender.
--gasLimit <GAS_LIMIT> Maximum amount of gas to allow the deployment transaction to use.
--gasPrice <GAS_PRICE> Gas price for legacy transactions, in wei.
--maxFeePerGas <MAX_FEE_PER_GAS> Maximum total fee per gas, in wei.
--maxPriorityFeePerGas <MAX_PRIORITY_FEE_PER_GAS> Maximum priority fee per gas, in wei.
--metadata '<METADATA>' Use this to identify, tag, or classify deployments. See https://docs.openzeppelin.com/defender/module/deploy#metadata. Must be a JSON string, for example: --metadata '{ "commitHash": "4ae3e0d", "tag": "v1.0.0", "anyOtherField": "anyValue" }'
--origin <ORIGIN> The client that made the deployment. For internal use only. Only 'Foundry' or 'SDK' are supported. Defaults to 'SDK'.
npx @openzeppelin/defender-deploy-client-cli proposeUpgrade --proxyAddress <PROXY_ADDRESS> --newImplementationAddress <NEW_IMPLEMENTATION_ADDRESS> --chainId <CHAIN_ID> [--proxyAdminAddress <PROXY_ADMIN_ADDRESS>] [--contractArtifactFile <CONTRACT_ARTIFACT_FILE_PATH>] [--approvalProcessId <UPGRADE_APPROVAL_PROCESS_ID>]
Proposes an upgrade using OpenZeppelin Defender.
Required options:
--proxyAddress <PROXY_ADDRESS> Address of the proxy to upgrade.
--newImplementationAddress <NEW_IMPLEMENTATION_ADDRESS> Address of the new implementation contract.
--chainId <CHAIN_ID> Chain ID of the network to use.
Additional options:
--proxyAdminAddress <PROXY_ADMIN_ADDRESS> Address of the proxy's admin. Required if the proxy is a transparent proxy.
--contractArtifactFile <CONTRACT_ARTIFACT_FILE_PATH> Path to a JSON file that contains an "abi" entry, where its value will be used as the new implementation ABI.
--approvalProcessId <UPGRADE_APPROVAL_PROCESS_ID> The ID of the upgrade approval process. Defaults to the upgrade approval process configured for your deployment environment on Defender.
0.0.1-alpha.10 (2025-01-13)
origin option for Defender deployments.FAQs
CLI for deployments using OpenZeppelin Defender SDK
The npm package @openzeppelin/defender-deploy-client-cli receives a total of 1,017 weekly downloads. As such, @openzeppelin/defender-deploy-client-cli popularity was classified as popular.
We found that @openzeppelin/defender-deploy-client-cli demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket is heading to London! Stop by our booth or schedule a meeting to see what we've been working on.

Security News
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.