> ## 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.

# GET /v1/contract/{id}

Get a contract project by ID

` GET /v1/contract/{id} `

Get a contract project by ID

## Parameters

### ` id ` (path, required)

Contract project ID

- ` value `: type ` string `

## Responses

### ` 200 ` — OK

Content type: ` application/json `

- ` value `: type ` object `

  - ` code `: type ` integer `

    - example: ` 200 `

  - ` data `: type ` object `

    - ` allDeployments `: type ` array `

      - ` array item `: type ` object `

        - ` address `: type ` string `

        - ` blockNumber `: type ` integer `

        - ` chainId `: type ` integer `

        - ` deployedAt `: type ` string `

        - ` deploymentMode `: type ` string ` — standard, create2, or create3

        - ` gasUsed `: type ` integer `

        - ` isDeterministic `: type ` boolean ` — Whether CREATE2/CREATE3 was used

        - ` networkType `: type ` string ` — mainnet or testnet

        - ` predictedAddress `: type ` string ` — Pre-computed address for deterministic deployments

        - ` salt `: type ` string ` — CREATE2/CREATE3 salt for deterministic address

        - ` txHash `: type ` string `

        - ` verificationStatus `: type ` string ` — Verification status

          - enum: ` ["pending","verified","failed"] `

        - ` verificationUrl `: type ` string ` — URL to view verified contract on block explorer

        - ` verified `: type ` boolean ` — Whether contract source is verified on block explorer

    - ` auditReport `: type ` object `

      - ` findings `: type ` array `

        - ` array item `: type ` object `

          - ` acknowledged `: type ` boolean `

          - ` category `: type ` string ` — reentrancy, access-control, etc.

          - ` codeSnippet `: type ` string `

          - ` description `: type ` string `

          - ` location `: type ` string `

          - ` recommendation `: type ` string `

          - ` severity `: type ` string ` — critical, high, medium, low, info

          - ` title `: type ` string `

      - ` passes `: type ` array `

        - ` array item `: type ` string `

      - ` summary `: type ` object `

        - ` critical `: type ` integer `

        - ` high `: type ` integer `

        - ` info `: type ` integer `

        - ` low `: type ` integer `

        - ` medium `: type ` integer `

        - ` overallRisk `: type ` string ` — low, medium, high, critical

        - ` recommendation `: type ` string ` — deployment recommendation

      - ` timestamp `: type ` string `

    - ` autoFixAttempts `: type ` integer `

    - ` compilationFixAttempts `: type ` integer `

    - ` createdAt `: type ` string `

    - ` currentStep `: type ` integer `

    - ` deployments `: type ` object ` — Deployments is populated from the contract_deployments table, NOT from a DB column. Kept for backward-compatible JSON serialization in API responses.

    - ` externalContractId `: type ` string `

    - ` id `: type ` string `

    - ` name `: type ` string `

    - ` organizationId `: type ` string `

    - ` planSummary `: type ` string `

    - ` sessionId `: type ` string `

    - ` source `: type ` object `

      - ` abi `: type ` string ` — Compiled artifacts (populated after compilation)

      - ` bytecode `: type ` string ` — Deployment bytecode

      - ` compilerOutput `: type ` string ` — Metadata

      - ` constructorAbi `: type ` string ` — Constructor info

      - ` contractCode `: type ` string ` — Main contract Solidity source (flattened or with imports)

      - ` contractName `: type ` string ` — Main contract (required)

      - ` dependencies `: type ` object ` — package → version (e.g., "@openzeppelin/contracts" → "v5.0.0")

      - ` deployedCode `: type ` string ` — Runtime bytecode

      - ` files `: type ` object ` — Multi-file project support Key: relative path (e.g., "src/interfaces/IERC20.sol") Value: file content

      - ` mainContract `: type ` string ` — Path to main contract file (e.g., "src/MyToken.sol")

      - ` solVersion `: type ` string ` — Solidity version (e.g., "0.8.20")

      - ` summary `: type ` string ` — Non-technical summary generated by AI

      - ` testCode `: type ` string ` — Foundry test file source

      - ` version `: type ` integer ` — Source version (increments on each edit)

    - ` status `: type ` string `

      - enum: ` ["planned","generating","code_generated","testing","tested","auditing","audited","deploying","testnet_deployed","mainnet_deployed","failed"] `

    - ` testResults `: type ` object `

      - ` autoFixed `: type ` boolean `

      - ` failed `: type ` integer `

      - ` failures `: type ` array `

        - ` array item `: type ` string `

      - ` fixAttempts `: type ` integer `

      - ` log `: type ` string `

      - ` passed `: type ` integer `

      - ` runAt `: type ` string `

      - ` total `: type ` integer `

    - ` updatedAt `: type ` string `

    - ` walletId `: type ` string `

  - ` message `: type ` string `

    - example: ` "success" `

  - ` requestId `: type ` string `

    - example: ` "abc-123" `

### ` 404 ` — Not Found

Content type: ` application/json `

- ` value `: type ` object `

  - ` code `: type ` integer `

  - ` details `: type ` array `

    - ` array item `: type ` unknown `

  - ` message `: type ` string `

  - ` requestId `: type ` string `

## Request examples

### cURL

```curl
curl -X GET 'https://api.example.com/v1/contract/string' \
  -H 'Authorization: Bearer YOUR_API_TOKEN'
```

### JavaScript

```javascript
const response = await fetch('https://api.example.com/v1/contract/string', {
  method: 'GET',
  headers: {
      "Authorization": "Bearer YOUR_API_TOKEN"
  }
});

const data = await response.json();
console.log(data);
```

### Python

```python
import requests

headers = {
    'Authorization': 'Bearer YOUR_API_TOKEN'
}

response = requests.get('https://api.example.com/v1/contract/string', headers=headers)
print(response.json())
```

### Go

```go
package main

import (
	"fmt"
	"io"
	"net/http"
)

func main() {
	req, _ := http.NewRequest("GET", "https://api.example.com/v1/contract/string", nil)
	req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN")

	resp, _ := http.DefaultClient.Do(req)
	defer resp.Body.Close()
	result, _ := io.ReadAll(resp.Body)
	fmt.Println(string(result))
}
```