---
title: "Deploy a contract from a signer (contract creation tx)"
method: POST
path: "/contracts/v1/deploy"
tags: ["Contracts"]
---

# Deploy a contract from a signer (contract creation tx)

`POST /contracts/v1/deploy`

## Request

- Base URL: `https://api.run402.com`
- URL: `https://api.run402.com/contracts/v1/deploy`
- Auth: HTTP bearer

signs a contract-creation transaction (`to: null + data: bytecode`) and broadcasts it to the chain. Mirrors `POST /contracts/v1/call` (same auth, lifecycle gating, idempotency, billing) but instead of calling an existing contract, it creates a new one. The bytecode field is the full creation calldata — creation bytecode concatenated with ABI-encoded constructor args (the caller does the encoding using viem/ethers or equivalent; run402 does not compile Solidity). The deterministic CREATE address is computed from `(wallet.address, nonce)` and returned synchronously in the 202 response, so callers know where the new contract will live before the tx confirms. The reconciler verifies the receipt's `contractAddress` against the pre-stored predicted address on confirmation. Cost: chain gas at-cost (paid from wallet's native ETH) + $0.000005 signing fee per deploy (same as a regular contract call).

## Headers

- `Idempotency-Key` string

## Request body

- object
  - `signer_id` string, required: The cwlt_… ID of a signer owned by the calling project.
  - `chain` string, required: Must match the wallet's chain; mismatch returns 400 chain_mismatch.
  - `bytecode` string, required: Full creation calldata as 0x-prefixed hex (creation bytecode + ABI-encoded constructor args, concatenated client-side). Must be non-empty, even-length, and ≤ 128 KB (262144 hex chars).
  - `value` string: Optional native-token value in wei to attach to the deploy (rarely non-zero). Legacy alias for value_wei.
  - `value_wei` string: Optional native-token value in wei to attach to the deploy.

## Response `202`

Submitted; returns { call_id, tx_hash, status: 'pending', contract_address }. The contract_address is the deterministic CREATE address — known synchronously, before the tx confirms.

- object
  - `call_id` string, required
  - `tx_hash` string, required
  - `status` 'pending' | 'confirmed' | 'failed', required
  - `contract_address` string, required: Deterministic CREATE address derived from (wallet.address, nonce). Verified against the on-chain receipt on confirmation.

## Other responses

- `400`: invalid_request (missing signer_id/chain), invalid_bytecode (not hex / empty / odd-length / > 128 KB), invalid_value_wei, unsupported_chain, or chain_mismatch.
- `403`: Insufficient native balance, wallet suspended for unpaid rent, or project lifecycle blocked (past_due/frozen/dormant).
- `404`: Wallet not found (or belongs to a different project).
- `409`: Idempotency-Key was reused with a different request payload (the body carries the stored call's call_id, status, call_error, and tx_hash), or wallet has an inconsistent the platform's key custody-key state.
- `410`: Wallet deleted.
- `502`: RPC broadcast failure (network / chain unreachable). retryable: true when the failure happened before broadcast (a same-key retry re-executes); retryable: false plus a new_idempotency_key next-action when the send was ambiguous (broadcast-phase) or the stored failure predates failure-phase tracking.

---

[API](https://skmtc.dev/run402/apis/run402-api.md) · [All operations](https://skmtc.dev/run402/apis/run402-api/llms.txt) · [OpenAPI document](https://skmtc.dev/run402/apis/run402-api/revisions/893607557f50?raw)
