{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://alxprotocol.com/schemas/alx-deployment-manifest.schema.json",
  "title": "ALX Reference Contract Deployment Manifest",
  "description": "Evidence required to identify a published deployment of an ALX reference contract.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "manifestVersion",
    "protocolVersion",
    "contractVersion",
    "network",
    "chainId",
    "contractName",
    "address",
    "deploymentTransaction",
    "deployer",
    "compiler",
    "sourceCommit",
    "sourceSha256",
    "abiSha256",
    "deployedBytecodeSha256",
    "explorerVerification",
    "auditReference",
    "activationStatus"
  ],
  "properties": {
    "manifestVersion": {"const": "1"},
    "protocolVersion": {
      "type": "string",
      "const": "1",
      "description": "ALX protocol algorithm version the deployment is intended to support."
    },
    "contractVersion": {
      "type": "string",
      "minLength": 1,
      "description": "Version label for the deployed contract source release."
    },
    "network": {"type": "string", "minLength": 1},
    "chainId": {"type": "integer", "minimum": 1},
    "contractName": {"const": "ALXAnchor"},
    "address": {"type": "string", "pattern": "^0x[a-fA-F0-9]{40}$"},
    "deploymentTransaction": {"type": "string", "pattern": "^0x[a-fA-F0-9]{64}$"},
    "deployer": {"type": "string", "pattern": "^0x[a-fA-F0-9]{40}$"},
    "compiler": {
      "type": "object",
      "additionalProperties": false,
      "required": ["version", "optimizerEnabled", "optimizerRuns", "evmVersion"],
      "properties": {
        "version": {"type": "string", "minLength": 1},
        "optimizerEnabled": {"type": "boolean"},
        "optimizerRuns": {"type": "integer", "minimum": 0},
        "evmVersion": {"type": "string", "minLength": 1}
      }
    },
    "sourceCommit": {"type": "string", "pattern": "^[a-fA-F0-9]{40}$"},
    "sourceSha256": {"type": "string", "pattern": "^[a-f0-9]{64}$"},
    "abiSha256": {"type": "string", "pattern": "^[a-f0-9]{64}$"},
    "deployedBytecodeSha256": {"type": "string", "pattern": "^[a-f0-9]{64}$"},
    "explorerVerification": {
      "type": "object",
      "additionalProperties": false,
      "required": ["verified", "url", "verifiedAt"],
      "properties": {
        "verified": {"const": true},
        "url": {"type": "string", "format": "uri"},
        "verifiedAt": {"type": "string", "format": "date-time"}
      }
    },
    "auditReference": {"type": "string", "format": "uri"},
    "activationStatus": {
      "enum": ["inactive", "active", "deprecated"],
      "description": "Publication lifecycle. Only active is a supported integration target. Incomplete drafts are not representable; omit the public record until evidence is complete."
    }
  }
}
