deploy
Deploy a contract to a zkSync network using forge create. Get contract address, transaction hash, and deployer details.
Instructions
Deploy a contract to a zkSync network (forge create --zksync). Returns structured output with contract address, tx hash, and deployer.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectPath | Yes | Absolute path to the foundry project directory | |
| profile | No | Foundry profile to use (maps to FOUNDRY_PROFILE env var). Selects a [profile.<name>] section from foundry.toml, e.g. 'zksync', 'ci', 'production'. | |
| contractPath | Yes | Contract identifier in the form src/MyContract.sol:MyContract | |
| rpcUrl | Yes | RPC URL of the target zkSync network | |
| privateKey | No | Raw private key for signing. Only use for local development with well-known test keys (e.g. anvil-zksync accounts). For production, use 'account' (named keystore) or hardware wallets instead. | |
| account | No | Named keystore account from ~/.foundry/keystores (recommended for production). Create one with: cast wallet import <name> --interactive | |
| keystore | No | Path to an encrypted keystore JSON file | |
| passwordFile | No | Path to a file containing the keystore password | |
| keystorePassword | No | Keystore password (prefer passwordFile to keep it out of process args) | |
| unlocked | No | Use eth_sendTransaction with --from address (no local signing). For nodes that manage keys natively. | |
| from | No | Sender address, used with --unlocked or hardware wallets. Maps to --from for cast/deploy, --sender for forge script. | |
| ledger | No | Sign with a Ledger hardware wallet | |
| trezor | No | Sign with a Trezor hardware wallet | |
| aws | No | Sign with AWS KMS (requires AWS_KMS_KEY_ID env var) | |
| gcp | No | Sign with Google Cloud KMS (requires GCP_PROJECT_ID, GCP_LOCATION, GCP_KEY_RING, GCP_KEY_NAME, GCP_KEY_VERSION env vars) | |
| broadcast | No | If true, actually broadcast the deployment transaction on-chain. Without this, forge create runs in dry-run mode. | |
| constructorArgs | No | Constructor arguments, each as a separate string. Solidity types are ABI-encoded by forge, e.g. ['0xaddr', '100', 'hello'] | |
| verify | No | If true, verify the contract on a block explorer after deployment | |
| verifierUrl | No | Block explorer verification API URL (e.g. https://api-era.zksync.network/api) | |
| extraArgs | No | Additional CLI flags, each as a separate array element |