---
title: "POST /v1/contract/{id}/deploy/approve"
method: POST
path: "/v1/contract/{id}/deploy/approve"
---

# POST /v1/contract/{id}/deploy/approve

`POST /v1/contract/{id}/deploy/approve`

Approve and initiate contract deployment to testnet or mainnet

## Path parameters

- `id` string, required

## Request body

- union
  - object
  - ApproveContractDeployParams
    - `chainId` integer, required
    - `constructorArgs` unknown[]
      - unknown
    - `deploymentMode` 'standard' | 'create2' | 'create3'
    - `salt` string — Custom salt for deterministic deployment
    - `target` 'testnet' | 'mainnet', required
    - `walletId` string, required

## Response `200`

OK

- ApproveContractDeploySuccessResponse
  - `code` integer
  - `data` ContractDeployApproval
    - `estimate` GithubComB3FunB3MonoServicesB3osWorkflowInternalPkgEntityDeploymentEstimate
      - `costUsd` string
      - `estimatedCost` string
      - `gasLimit` integer
      - `gasPrice` string
      - `maxFeePerGas` string
      - `warning` string
    - `project` GithubComB3FunB3MonoServicesB3osWorkflowInternalPkgEntityContractProject
      - `allDeployments` GithubComB3FunB3MonoServicesB3osWorkflowInternalPkgEntityDeployResult[]
        - `address` string
        - `blockNumber` integer
        - `chainId` integer
        - `deployedAt` string
        - `deploymentMode` string — standard, create2, or create3
        - `gasUsed` integer
        - `isDeterministic` boolean — Whether CREATE2/CREATE3 was used
        - `networkType` string — mainnet or testnet
        - `predictedAddress` string — Pre-computed address for deterministic deployments
        - `salt` string — CREATE2/CREATE3 salt for deterministic address
        - `txHash` string
        - `verificationStatus` 'pending' | 'verified' | 'failed' — Verification status
        - `verificationUrl` string — URL to view verified contract on block explorer
        - `verified` boolean — Whether contract source is verified on block explorer
      - `auditReport` GithubComB3FunB3MonoServicesB3osWorkflowInternalPkgEntityAuditReport
        - `findings` GithubComB3FunB3MonoServicesB3osWorkflowInternalPkgEntityAuditFinding[]
          - `acknowledged` boolean
          - `category` string — reentrancy, access-control, etc.
          - `codeSnippet` string
          - `description` string
          - `location` string
          - `recommendation` string
          - `severity` string — critical, high, medium, low, info
          - `title` string
        - `passes` string[]
        - `summary` GithubComB3FunB3MonoServicesB3osWorkflowInternalPkgEntityAuditSummary
          - `critical` integer
          - `high` integer
          - `info` integer
          - `low` integer
          - `medium` integer
          - `overallRisk` string — low, medium, high, critical
          - `recommendation` string — deployment recommendation
        - `timestamp` string
      - `autoFixAttempts` integer
      - `compilationFixAttempts` integer
      - `createdAt` string
      - `currentStep` integer
      - `deployments` GithubComB3FunB3MonoServicesB3osWorkflowInternalPkgEntityDeployments — Deployments is populated from the contract_deployments table, NOT from a DB column. Kept for backward-compatible JSON serialization in API responses.
      - `externalContractId` string
      - `id` string
      - `name` string
      - `organizationId` string
      - `planSummary` string
      - `sessionId` string
      - `source` GithubComB3FunB3MonoServicesB3osWorkflowInternalPkgEntityContractSource
        - `abi` string — Compiled artifacts (populated after compilation)
        - `bytecode` string — Deployment bytecode
        - `compilerOutput` string — Metadata
        - `constructorAbi` string — Constructor info
        - `contractCode` string — Main contract Solidity source (flattened or with imports)
        - `contractName` string — Main contract (required)
        - `dependencies` object — package → version (e.g., "@openzeppelin/contracts" → "v5.0.0")
        - `deployedCode` string — Runtime bytecode
        - `files` object — Multi-file project support Key: relative path (e.g., "src/interfaces/IERC20.sol") Value: file content
        - `mainContract` string — Path to main contract file (e.g., "src/MyToken.sol")
        - `solVersion` string — Solidity version (e.g., "0.8.20")
        - `summary` string — Non-technical summary generated by AI
        - `testCode` string — Foundry test file source
        - `version` integer — Source version (increments on each edit)
      - `status` 'planned' | 'generating' | 'code_generated' | 'testing' | 'tested' | 'auditing' | 'audited' | 'deploying' | 'testnet_deployed' | 'mainnet_deployed' | 'failed'
      - `testResults` GithubComB3FunB3MonoServicesB3osWorkflowInternalPkgEntityTestResults
        - `autoFixed` boolean
        - `failed` integer
        - `failures` string[]
        - `fixAttempts` integer
        - `log` string
        - `passed` integer
        - `runAt` string
        - `total` integer
      - `updatedAt` string
      - `walletId` string
    - `taskId` string
  - `message` string
  - `requestId` string

## Other responses

- `400` — Bad Request
- `404` — Not Found

---

[API](https://skmtc.net/b3-fun/apis/b3os-workflow-api.md) · [All operations](https://skmtc.net/b3-fun/apis/b3os-workflow-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/b3-fun/b3os-workflow-api/versions/5a750a5a9596/schema)
