> ## Documentation Index
> Fetch the complete documentation index at: https://docs.b3os.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Deploy Contract

Deploy a compiled EVM smart contract to any supported chain. Supports standard CREATE, CREATE2, and CREATE3 (via CreateX) for deterministic addresses. Can deploy from custom bytecode or fetch from contract projects. Signs and broadcasts the deployment transaction via Turnkey wallet. Returns the deployed contract address, transaction hash, and gas details. Ideal for: deploying new contracts, cross-chain deployments at same address, factory patterns, automated protocol deployments.

![Deploy Contract logo](https://ai-icon.b3.fun/logo/ethereum)
Catalog action EVM Onchain wallet Gas

Deploy a compiled EVM smart contract to any supported chain. Supports standard CREATE, CREATE2, and CREATE3 (via CreateX) for deterministic addresses. Can deploy from custom bytecode or fetch from contract projects. Signs and broadcasts the deployment transaction via Turnkey wallet. Returns the deployed contract address, transaction hash, and gas details. Ideal for: deploying new contracts, cross-chain deployments at same address, factory patterns, automated protocol deployments.

**Review wallet and value movement**

This action can require a wallet connector, gas, token movement, or an external side effect. Test with simulation or a controlled amount before using it in a live workflow.

## At a Glance

| Field | Value |
| --- | --- |
| Action ID | `deploy-contract` |
| Category | EVM Onchain |
| Connector | `wallet` |
| Requires gas | Yes |
| Funds movement | None declared |
| Tags | `blockchain`, `evm`, `deploy`, `contract`, `smart-contract`, `bytecode`, `create`, `create2`, `create3`, `createx`, `deterministic` |

## Payload Schema

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `contractProjectId` | `string` | No | Select a compiled contract project or choose 'Custom bytecode' to enter bytecode manually. |
| `bytecode` | `string` | No | Compiled contract bytecode as a hex string \(0x-prefixed\). Required if contractSource is 'custom' or not specified. This is the deployment bytecode \(creation code\), not the runtime bytecode. |
| `abi` | `string` | No | Contract ABI as a JSON string array. Required if constructorArgs are provided. Must include the constructor definition. |
| `constructorArgs` | `string` | No | Constructor arguments as a JSON string array \(e.g., '\["arg1", "1000"\]'\). Requires abi to be provided. |
| `chainId` | `number` | Yes | Chain ID \(1=Ethereum, 137=Polygon, 56=BSC, 8453=Base, etc.\) |
| `value` | `string` | No | Amount of native token \(ETH, etc.\) to send with deployment in Wei. For payable constructors. Defaults to '0'. |
| `gasLimit` | `string` | No | Optional gas limit for the deployment transaction. If not provided, will be estimated. Contract deployments typically require more gas than regular transactions. |
| `maxFeePerGas` | `string` | No | Optional max fee per gas in Wei \(EIP-1559\). If not provided, will be estimated. |
| `maxPriorityFeePerGas` | `string` | No | Optional max priority fee per gas in Wei \(EIP-1559\). If not provided, will be estimated. |
| `waitForConfirmation` | `boolean` | No | Whether to wait for transaction confirmation. Defaults to true. Must be true to obtain contractAddress. |
| `confirmations` | `number` | No | Number of confirmations to wait for. Defaults to 1. |
| `deploymentMode` | `string` | No | Deployment method: 'standard' \(default\) uses CREATE opcode, 'create2' and 'create3' use CreateX factory for deterministic addresses across chains. |
| `salt` | `string` | No | 32-byte salt for CREATE2/CREATE3 deterministic deployment \(hex string, 0x-prefixed, 64 hex chars\). If not provided for create2/create3 modes, a random salt will be generated. |

## Result Schema

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `status` | `string` | Yes | - |
| `contractAddress` | `string` | Yes | The deployed contract address |
| `transactionHash` | `string` | Yes | The deployment transaction hash |
| `from` | `string` | No | The deployer address \(Turnkey wallet\) |
| `blockNumber` | `number` | No | The block number where the deployment was mined |
| `gasUsed` | `string` | No | Gas consumed by the deployment |
| `effectiveGasPrice` | `string` | No | The effective gas price paid |
| `deploymentMode` | `string` | No | Deployment method used |
| `salt` | `string` | No | Salt used for CREATE2/CREATE3 deployment \(if deterministic\) |
| `isDeterministic` | `boolean` | No | Whether CREATE2/CREATE3 was used for deterministic address |
| `predictedAddress` | `string` | No | Pre-computed contract address \(for CREATE2/CREATE3, should match contractAddress\) |
| `contractName` | `string` | No | Contract name from the project \(if deployed from a contract project\) |

## Examples

**Workflow node**

```json
{
  "type": "deploy-contract",
  "payload": {
    "chainId": 8453
  },
  "children": [],
  "connector": {
    "type": "wallet",
    "id": "conn_wallet"
  }
}
```
  **Test with API**

```bash
curl -X POST "https://api.b3os.org/v1/actions/deploy-contract/test" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "inputs": {
    "chainId": 8453
  }
}'
```

**Use expressions for dynamic values**

Payload fields can use workflow expressions such as `{{$trigger.body.amount}}`, `{{$nodes.fetch.result.price}}`, and `{{$props.asset}}` when the value should come from a trigger, prior node, or reusable workflow prop.